Skip to content
Snippets Groups Projects
  1. Jan 16, 2025
  2. Jan 15, 2025
    • Nick Begg's avatar
      SystemTools: Fix CloneFileContent copy-on-write on macOS / APFS · 2926bae9
      Nick Begg authored and Brad King's avatar Brad King committed
      `SystemTools::CloneFileContent()` attempts to clone a file using the
      underlying filesystem’s copy-on-write features. The call to macOS’s
      copyfile() was changed to not use COPYFILE_CLONE some time back due to
      it following symlinks - which was not desired. Unfortunately (and the
      manpage for copyfile() really doesn’t make this clear) this disables
      cloning all together.
      
      Go back to using `COPYFILE_CLONE`, but explicitly check for symlinks.
      
      Additionally, add the `COPYFILE_UNLINK` flag. This fixes a second bug
      in the existing implementation - existing files were not overwritten on
      macOS which is inconsistent with the Linux implementation which
      explicitly removes them, as well as calling `open()` with `O_CREAT`.
      In effect this meant that progressively, previously cloned files become
      de-cloned from their source as the built-in blockwise copy gets used
      instead.
      
      Rewrite the method comments which don't seem to have been updated since
      the macOS implementation was added.  The function itself is not
      especially well named anymore.
      
      Verified cloning works using this tool:
      
      * https://github.com/dyorgio/apfs-clone-checker
      
      See also:
      
      * https://wadetregaskis.com/copy-on-write-on-apfs/
      2926bae9
  3. Dec 12, 2024
  4. Nov 30, 2024
  5. Nov 28, 2024
  6. Nov 23, 2024
  7. Nov 22, 2024
  8. Nov 06, 2024
  9. Nov 05, 2024
  10. Nov 04, 2024
  11. Nov 03, 2024
    • Brad King's avatar
      SystemTools: Remove path translation map · 47dce1a3
      Brad King authored
      CMake used this to preserve symlinks through realpath operations, but
      its presence caused some undesired side effects.  Those realpath
      operations are being replaced with a hand-written alternative that
      explicitly preserves symlinks when possible and does not have the side
      effects.  Therefore we no longer need the path translation map.
      
      Issue: cmake/cmake#16228
      47dce1a3
  12. Nov 01, 2024
  13. Oct 31, 2024
  14. Oct 28, 2024
  15. Oct 25, 2024
  16. Oct 24, 2024
  17. Oct 23, 2024
  18. Sep 19, 2024
  19. Sep 18, 2024
  20. Sep 10, 2024
  21. Sep 09, 2024
  22. Sep 03, 2024
  23. Aug 28, 2024
  24. May 30, 2024
  25. May 29, 2024
    • Jochem van Boxtel's avatar
      SystemTools: Add FileId class and GetFileId function · 510b13b4
      Jochem van Boxtel authored and Brad King's avatar Brad King committed
      Add a FileId class, which encapsulates the identifier internally used
      by the existing SystemTools::SameFile function. The GetFileId function
      retrieves a FileId object for the given file or directory. This makes the
      file identifier cacheable to the calling code, so that checking whether
      one file is the same as many other candidates can be done faster.
      510b13b4
  26. May 28, 2024
  27. May 27, 2024
    • Brad King's avatar
      ConsoleBuf: Fix test case when running under Windows Terminal · beaf1ca1
      Brad King authored
      Since commit 4967ccc0 (ConsoleBuf: Fix output for strings that contain
      null byte, 2016-11-09) our test case writes a NUL byte to the console.
      The behavior of Windows Terminal differs from Windows Console Host
      (conhost.exe).  Detect which of these is in use at runtime and adjust
      our expected result accordingly.
      beaf1ca1
  28. May 06, 2024
  29. May 02, 2024
Loading