Skip to content

env.CacheDir fails to apply the cache path to only build targets found in that environment #1639

Closed

Description

@bdbaddog

This issue was originally created at: 2007-04-17 16:41:57.
This issue was reported by: osb1842.
osb1842 said at 2007-04-17 16:41:57

Consider this small SConstruct:

"default.cpp" and "env.cpp" are identical files with an empty main.

#########################
Program('default.cpp')

env = Environment()
env.CacheDir('CacheDir')
env.Program('env.cpp')
#########################

Incorrect Behavior:

  1. Run scons.
  2. Observe both default.exe and env.exe being built.
  3. Delete default.exe, env.exe, and all object files.
  4. Run scons again.
  5. Observe env.exe, default.exe, and all object files retrieved from cache.

Expected Behavior:

  1. Run scons.
  2. Observe both default.exe and env.exe being built.
  3. Delete default.exe, env.exe, and all object files.
  4. Run scons again.
  5. Observe env.exe and env.obj retrieved from cache. default.exe and default.obj
    are rebuilt from scratch.

osb1842 said at 2007-04-17 16:42:49

Created an attachment (id=177)
Test environment for this bug/feature

djvm said at 2007-08-02 16:46:44

This would allow precompiled headers to be used on win32 along with CacheDir().

That won't work right now, because (apparently) the absolute path of file(s) is
stored in the .pch file (the output of the precompilation process). This is a
problem if different users of the CacheDir() feature have their files located in
a different absolute path from each other (which is typical around here).

Currently, I can only use CacheDir() if I completely disable precompiled
headers, which is a huge performance hit on some of our code.

stevenknight said at 2007-08-15 12:56:58

*** Issue 1011 has been marked as a duplicate of this issue. ***

stevenknight said at 2007-08-15 13:24:13

Fix has been checked in for next release:

http://scons.tigris.org/servlets/ReadMsg?list=dev&msgNo=4100
http://scons.tigris.org/servlets/ReadMsg?list=commits&msgNo=853

(Actually, that was just the last checkin after a series of refactorings that
laid the groundwork for this.)

Thanks,

Votes for this issue: 15.

osb1842 attached envCacheDir-test.zip at 2007-04-17 16:42:49.

Test environment for this bug/feature

stevenknight said this issue blocks #1664 at 2007-08-15 13:24:13.

stevenknight said this issue is duplicated by #1011 at 2007-08-15 12:56:59.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions