[cmake-developers] Using reflinks during install phase

Brad King brad.king at kitware.com
Wed May 28 16:17:39 EDT 2014


On 05/28/2014 01:20 PM, Alessandro Di Federico wrote:
> Hi, I'm working on a quite big project, namely LLVM. As you can
> imagine, launching a `make install` it's quite time consuming, in
> particular in Debug builds. However I'm using a smart file system
> (BTRFS on Linux) which supports "reflinks", which basically means
> that it's possible to create copy-on-write duplicate of a file, without
> having to write the file contents again. This can be easily done using
> `cp` (from the GNU Coreutils) with the --reflink parameter.

Neat.  How is it known when a reflink is safe (e.g. on the same
filesystem)?  Does it just fall back to a normal copy otherwise?

This would likely go in the implementation of the file(INSTALL)
command used internally by the installation infrastructure.
See SystemTools::CopyFileAlways in Source/kwsys/SystemTools.cxx.
That method could probably be optimized anyway.

Thanks,
-Brad




More information about the cmake-developers mailing list