-
-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug when combining CacheDir and MSVC_BATCH #4361
Comments
To add what I said in the referenced email thread: can reproduce this, and believe, though don't have definitive proof, that the presence of two variantdirs is also a necessary part of the triggering - however, I've not added the variantdir label onto this issue (yet). |
OK, I've monkey patched
In other words, it is the try:
cached_targets = []
for t in self.targets:
if not t.retrieve_from_cache():
break
cached_targets.append(t)
if len(cached_targets) < len(self.targets):
# Remove targets before building. It's possible that we
# partially retrieved targets from the cache, leaving
# them in read-only mode. That might cause the command
# to fail.
#
for t in cached_targets:
try:
t.fs.unlink(t.get_internal_path())
except (IOError, OSError) as e:
SCons.Warnings.warn(SCons.Warnings.CacheCleanupErrorWarning,
"Failed copying all target files from cache, Error while attempting to remove file %s retrieved from cache: %s" % (t.get_internal_path(), e))
self.targets[0].build()
else:
for t in cached_targets:
t.cached = 1
except SystemExit: Dumping out the values of cached_targets = ['build2\\main.obj']
self.targets = ['build2\\main.obj', 'build2\\foo.obj'] I'm guessing that this intends to rebuild I hope that this is of some help... |
I'm not sure batching can be compatible with cachedir.. </before coffee thoughts> |
Hi @bdbaddog, Doing a clean build of one of our build products as an example:
We could certainly disable MSVC_BATCH when building with a cache but we would need to analyse the results to be sure that the cache provides more speed up than the removal of batching causes slow down. Would it be possible to implement the following logic for each batch:
While it is sub-optimal, I suspect that it would give a lot of the performance benefit of each mechanism while simplifying the work that needs to be done... P.S. For reference, I used the non-MSVC_BATCH build to |
Describe the bug
We have recently switched on CacheDir in our CI machine and, while this has largely been a positive experience, we have seen the odd link failure that we could not explain. I was eventually able to reproduce the issue and produce a minimal SConstruct that illustrates the problem. It is an interaction between the MSVS batching and the cache.
Required information
To reproduce the problem, I have created two C files and a SConstruct:
src/main.c
src/foo.c
SConstruct
The steps to reproduce the issue are:
scons
) to populate the cachebuild1/main.obj
Running
scons
, I would expectbuild1/main.obj
to be retrieved from the cache,foo.c
to be builts to producebuild1/foo.obj
andbuild2/foo.obj
before the two Programs are linked. What I actually get is a build failure:At this point
build2/main.obj
has been removed (hence the link failure) but running scons again succeeds:The text was updated successfully, but these errors were encountered: