You need to enable JavaScript to run this app.
最新活动
大模型
产品
解决方案
定价
生态与合作
支持与服务
开发者
了解我们

Scons缓存是否支持硬链接?含--cache=nolinked参数使用场景

Let's break down your questions clearly, as someone who's worked with SCons caching quite a bit:

Absolutely! Hardlinks are actually the default behavior for SCons caching when you don't explicitly disable them. When a build artifact exists in the cache, SCons will create a hardlink from the cache directory to your build directory by default—this is faster than copying and saves disk space since hardlinks point to the same underlying file data.

Hold on, let's clarify what that --cache=nolinked flag does first: this option explicitly tells SCons not to use hardlinks (or symlinks) and instead copy files from the cache. So if you're passing that flag, you're overriding the default hardlink behavior you want.

If your goal is to get hardlinks from cache to build directory, you should drop the --cache=nolinked flag. Instead, use a command like this:

scons --cache=yes --cache-dir=/path/to/your/cache

Or if you want to force using the cache even if the build environment has changed (use cautiously):

scons --cache=force --cache-dir=/path/to/your/cache

One quick caveat: Hardlinks only work if your cache directory and build directory are on the same filesystem. If they're on different filesystems, SCons will automatically fall back to copying files, since hardlinks can't cross filesystem boundaries.


内容的提问来源于stack exchange,提问作者igor.sol

火山引擎 最新活动