diff options
author | anatoly techtonik <techtonik@gmail.com> | 2014-03-04 14:33:55 (GMT) |
---|---|---|
committer | anatoly techtonik <techtonik@gmail.com> | 2014-03-04 14:33:55 (GMT) |
commit | be3bb54fe4ee5faf1ca944da7d8f06e922005145 (patch) | |
tree | 08c0e079696a4d8f0f8c7ff159292f52a27d81be | |
parent | dafea3d33fc1fbbedcf6ea1f6fe92e58061d57da (diff) | |
parent | 42aba42f5f013bf3fd119c76e97c6bbdcb41b893 (diff) | |
download | SCons-be3bb54fe4ee5faf1ca944da7d8f06e922005145.zip SCons-be3bb54fe4ee5faf1ca944da7d8f06e922005145.tar.gz SCons-be3bb54fe4ee5faf1ca944da7d8f06e922005145.tar.bz2 |
Merge fixes to run from source
-rw-r--r-- | src/CHANGES.txt | 14 | ||||
-rw-r--r-- | src/script/scons.py | 18 |
2 files changed, 21 insertions, 11 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 52d8604..baeda64 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -57,10 +57,16 @@ RELEASE 2.3.1.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE - Test harness: fail_test() can now print a message to help debugging. From Anatoly Techtonik: - - Require rpmbuild when building SCons package. - - Print full stack on certain errors, for debugging. - - Improve documentation for Textfile builder. - + - Several improvements for running scons.py from source: + * engine files form source directory take priority over all other + importable versions + * message about scons.py running from source is removed to fix tests + that were failing because of this extra line in the output + * error message when SCons import fails now lists lookup paths + - Fixed rpmbuild requirement for building SCons .rpm package. + - Improved Debug tools to return full caller stack (PR#66). + - Improved documentation for Textfile builder. + From William Deegan: - VS2012 & VS2010 Resolve initialization issues by adding path to reg.exe in shell used to run batch files. diff --git a/src/script/scons.py b/src/script/scons.py index 46e6d2b..2c17cd8 100644 --- a/src/script/scons.py +++ b/src/script/scons.py @@ -85,6 +85,11 @@ scons_version = 'scons-%s' % __version__ # preferred order of scons lookup paths prefs = [] +# - running from source takes priority (since 2.3.1) +script_path = os.path.abspath(os.path.dirname(__file__)) +source_path = os.path.join(script_path, '..', 'engine') + +# - running from egg check try: import pkg_resources except ImportError: @@ -171,7 +176,7 @@ else: libs.extend([os.path.join(x, scons_version) for x in prefs]) libs.extend([os.path.join(x, 'scons') for x in prefs]) -sys.path = libs + sys.path +sys.path = [source_path] + libs + sys.path ############################################################################## # END STANDARD SCons SCRIPT HEADER @@ -181,12 +186,11 @@ if __name__ == "__main__": try: import SCons.Script except: - ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'engine') - if os.path.exists(ROOT): - sys.path += [ROOT] - print("SCons import failed. Trying to run from source directory") - import SCons.Script - + print("Import failed. Unable to find SCons files in:") + for path in [source_path] + libs: + print " %s" % path + raise + # this does all the work, and calls sys.exit # with the proper exit status when done. SCons.Script.main() |