diff options
author | Mats Wichmann <mats@linux.com> | 2019-03-28 11:17:52 (GMT) |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2019-04-13 17:43:49 (GMT) |
commit | fd4a8f7c9383095a0e508bac937b6122dd5317d6 (patch) | |
tree | cfabafa7df9fc28b1d7bee08c6350834702f9499 /src/engine/SCons/Tool/swig.py | |
parent | dd1f5a85f85098b6fdfb12e6585f466ad599b48c (diff) | |
download | SCons-fd4a8f7c9383095a0e508bac937b6122dd5317d6.zip SCons-fd4a8f7c9383095a0e508bac937b6122dd5317d6.tar.gz SCons-fd4a8f7c9383095a0e508bac937b6122dd5317d6.tar.bz2 |
[#3336] do not add not-found tool paths
When tool modules initialize, they check paths to decide if
the underlying tool is actually present. The current checker adds
any "default paths" the caller may have supplied (locations like
mingw, cygwin, chocolatey install locations, etc.); if there is
match from this list, any previous default paths are also kept.
To avoid keeping these non-matching paths, restore the original PATH;
the caller is responsible for adding to PATH if necessary.
Docstring now says so.
Note lex and yacc tool modules seem to expect the path-modifying
behavior that's being gotten rid of - so they preseve the path
first and restore it after. The change here won't break those,
but makes the extra behavior unneeded - could remove it.
Signed-off-by: Mats Wichmann <mats@linux.com>
Diffstat (limited to 'src/engine/SCons/Tool/swig.py')
-rw-r--r-- | src/engine/SCons/Tool/swig.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/engine/SCons/Tool/swig.py b/src/engine/SCons/Tool/swig.py index c6abefb..6ed9d82 100644 --- a/src/engine/SCons/Tool/swig.py +++ b/src/engine/SCons/Tool/swig.py @@ -184,9 +184,10 @@ def generate(env): from SCons.Platform.mingw import MINGW_DEFAULT_PATHS from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS + from SCons.Platform.win32 import CHOCO_DEFAULT_PATH if sys.platform == 'win32': - swig = SCons.Tool.find_program_path(env, 'swig', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS + [r'C:\ProgramData\chocolatey\bin'] ) + swig = SCons.Tool.find_program_path(env, 'swig', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS + CHOCO_DEFAULT_PATH) if swig: swig_bin_dir = os.path.dirname(swig) env.AppendENVPath('PATH', swig_bin_dir) |