Skip to content
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

MSVC_BATCH retrieves unnecessary files from CacheDir() #2503

Open
bdbaddog opened this issue Jan 2, 2018 · 0 comments
Open

MSVC_BATCH retrieves unnecessary files from CacheDir() #2503

bdbaddog opened this issue Jan 2, 2018 · 0 comments

Comments

@bdbaddog
Copy link
Contributor

bdbaddog commented Jan 2, 2018

This issue was originally created at: 2009-10-19 14:04:27.
This issue was reported by: djvanmaren.

djvanmaren said at 2009-10-19 14:04:27

  1. When MSVC_BATCH is set to 1 (True), scons causes all files in batch to be compiled, even when only one needs to be. Escaping the $CHANGED_SOURCES with $( and $) in $CXXCOM & friends seems to fix this problem, so that only the changed file (or the file with the missing .obj) gets compiled.
  2. The workaround above seems to fix the behavior in the normal case, but if CacheDir is in use, all the .obj files will be retrieved from the cache (when only one should need to be).

The (soon to be) attached zip of source files and an SConstruct file can reproduce these problems:

  1. unpack .zip file
  2. cd scons-test-case
  3. scons . should build testlib.lib, a.obj, and b.obj
  4. delete a.obj.
  5. scons . should build only a.obj and be done, but it builds both a.obj and b.obj.

Then, to reproduce problem 2:

  1. uncomment second line: env.CacheDir(cache)
  2. scons . --cache-force should copy *.obj, testlib.lib to cache subdirectory.
  3. delete a.obj
  4. scons . should retrieve only a.obj from cache, but it retrieves b.obj as well.

djvanmaren said at 2009-10-19 14:06:27

Created an attachment (id=638)
Sample test case to reproduce problem

djvanmaren said at 2009-10-19 21:47:05

Created an attachment (id=639)
Patch apparently addressing first problem

djvanmaren said at 2009-10-19 21:51:48

Created an attachment (id=640)
Patch that seems to fix first part of issue.

djvanmaren said at 2009-10-19 21:54:53

Use later version of scons-batch-patch.diff, as it fixed a small typo. Sorry for confusion.

djvanmaren said at 2009-10-20 09:59:39

See discussion for more details:

http://scons.tigris.org/ds/viewMessage.do?dsForumId=1272&dsMessageId=2408284 (dead link)

stevenknight said at 2009-12-15 17:35:56

SK to research, then 2.1 p3 if fix needs work

stevenknight said at 2009-12-15 18:11:34

actually assign to SK

stevenknight said at 2010-01-05 13:27:53

I can not reproduce problem #1 with either the current trunk (r4591) or with 1.2.0.d20090905 (r4346):

C:\Users\sgk\SCons\Work\2503>python bootstrap.py -C scons-test-case
C:\Python26\python.exe C:\Users\sgk\SCons\Work\2503\src\script\scons.py
 
C:\Users\sgk\SCons\Work\2503>
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cl /Fo.\ /c a.cpp b.cpp /TP /nologo
a.cpp
b.cpp
Generating Code...
lib /nologo /OUT:testlib.lib a.obj b.obj
scons: done building targets.
 
C:\Users\sgk\SCons\Work\2503>
del scons-test-case\a.obj
 
C:\Users\sgk\SCons\Work\2503>python bootstrap.py -C scons-test-case
C:\Python26\python.exe C:\Users\sgk\SCons\Work\2503\src\script\scons.py
 
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cl /Fo.\ /c a.cpp /TP /nologo
a.cpp
lib /nologo /OUT:testlib.lib a.obj b.obj
scons: done building targets.
 
C:\Users\sgk\SCons\Work\2503>

Putting $( $) around $CHANGED_SOURCES should not have any effect on what $CHANGED_SOURCES expands to, so there must be something else going on there.

The second problem (pulling too much from cache) is easily reproducible and needs a little more investigation. Changing the Summary to reflect that problem and setting priority and milestone per bug triage.

Should this be returned to issues@scons so someone else can possibly have a crack at it?

garyo said at 2012-09-01 10:01:49

Bumping all old issues targeted for past releases to 2.x.

djvanmaren attached scons-test-case.zip at 2009-10-19 14:06:27.

Sample test case to reproduce problem

djvanmaren attached scons-batch-patch.diff at 2009-10-19 21:47:05.

Patch apparently addressing first problem

djvanmaren attached scons-batch-patch.diff at 2009-10-19 21:51:48.

Patch that seems to fix first part of issue.

@bdbaddog bdbaddog added this to the 2.x milestone Jan 2, 2018
@mwichmann mwichmann added the has patch Issue has attached Patch label Jan 9, 2021
@mwichmann mwichmann modified the milestones: 2.x, anytime Mar 27, 2021
@mwichmann mwichmann added cachedir and removed P3 labels Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants