From 697e33ed224b539a42ff68121f7497f5bbf941b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 14 Jul 2019 08:35:24 +0200 Subject: New upstream version 3.0.5 --- src/Announce.txt | 60 +- src/CHANGES.txt | 337 ++++++- src/LICENSE.txt | 2 +- src/README.txt | 21 +- src/RELEASE.txt | 72 +- src/engine/MANIFEST-xml.in | 8 - src/engine/MANIFEST.in | 6 +- src/engine/SCons/Action.py | 27 +- src/engine/SCons/Action.xml | 2 +- src/engine/SCons/ActionTests.py | 572 +++++++----- src/engine/SCons/Builder.py | 18 +- src/engine/SCons/BuilderTests.py | 20 +- src/engine/SCons/CacheDir.py | 17 +- src/engine/SCons/CacheDirTests.py | 16 +- src/engine/SCons/Conftest.py | 20 +- src/engine/SCons/Debug.py | 4 +- src/engine/SCons/Defaults.py | 14 +- src/engine/SCons/Defaults.xml | 32 +- src/engine/SCons/DefaultsTests.py | 13 +- src/engine/SCons/Environment.py | 15 +- src/engine/SCons/Environment.xml | 4 +- src/engine/SCons/EnvironmentTests.py | 24 +- src/engine/SCons/EnvironmentValues.py | 1 + src/engine/SCons/Errors.py | 25 +- src/engine/SCons/ErrorsTests.py | 34 +- src/engine/SCons/Executor.py | 6 +- src/engine/SCons/ExecutorTests.py | 13 +- src/engine/SCons/Job.py | 6 +- src/engine/SCons/JobTests.py | 130 ++- src/engine/SCons/Memoize.py | 4 +- src/engine/SCons/MemoizeTests.py | 16 +- src/engine/SCons/Node/Alias.py | 4 +- src/engine/SCons/Node/AliasTests.py | 17 +- src/engine/SCons/Node/FS.py | 325 ++++++- src/engine/SCons/Node/FSTests.py | 185 +++- src/engine/SCons/Node/NodeTests.py | 21 +- src/engine/SCons/Node/Python.py | 17 +- src/engine/SCons/Node/PythonTests.py | 23 +- src/engine/SCons/Node/__init__.py | 81 +- src/engine/SCons/Options/BoolOption.py | 50 -- src/engine/SCons/Options/EnumOption.py | 50 -- src/engine/SCons/Options/ListOption.py | 50 -- src/engine/SCons/Options/PackageOption.py | 50 -- src/engine/SCons/Options/PathOption.py | 76 -- src/engine/SCons/Options/__init__.py | 67 -- src/engine/SCons/PathList.py | 4 +- src/engine/SCons/PathListTests.py | 4 +- src/engine/SCons/Platform/PlatformTests.py | 25 +- src/engine/SCons/Platform/__init__.py | 64 +- src/engine/SCons/Platform/__init__.xml | 26 +- src/engine/SCons/Platform/aix.py | 4 +- src/engine/SCons/Platform/cygwin.py | 13 +- src/engine/SCons/Platform/darwin.py | 4 +- src/engine/SCons/Platform/hpux.py | 4 +- src/engine/SCons/Platform/irix.py | 4 +- src/engine/SCons/Platform/mingw.py | 39 + src/engine/SCons/Platform/os2.py | 4 +- src/engine/SCons/Platform/posix.py | 11 +- src/engine/SCons/Platform/posix.xml | 6 +- src/engine/SCons/Platform/sunos.py | 4 +- src/engine/SCons/Platform/sunos.xml | 2 +- src/engine/SCons/Platform/virtualenv.py | 120 +++ src/engine/SCons/Platform/virtualenvTests.py | 243 ++++++ src/engine/SCons/Platform/win32.py | 35 +- src/engine/SCons/Platform/win32.xml | 2 +- src/engine/SCons/SConf.py | 84 +- src/engine/SCons/SConfTests.py | 34 +- src/engine/SCons/SConsign.py | 7 +- src/engine/SCons/SConsignTests.py | 4 +- src/engine/SCons/Scanner/C.py | 4 +- src/engine/SCons/Scanner/CTests.py | 20 +- src/engine/SCons/Scanner/D.py | 4 +- src/engine/SCons/Scanner/DTests.py | 16 +- src/engine/SCons/Scanner/Dir.py | 4 +- src/engine/SCons/Scanner/DirTests.py | 13 +- src/engine/SCons/Scanner/Fortran.py | 6 +- src/engine/SCons/Scanner/FortranTests.py | 6 +- src/engine/SCons/Scanner/IDL.py | 4 +- src/engine/SCons/Scanner/IDLTests.py | 12 +- src/engine/SCons/Scanner/LaTeX.py | 20 +- src/engine/SCons/Scanner/LaTeXTests.py | 23 +- src/engine/SCons/Scanner/Prog.py | 4 +- src/engine/SCons/Scanner/ProgTests.py | 7 +- src/engine/SCons/Scanner/RC.py | 4 +- src/engine/SCons/Scanner/RCTests.py | 9 +- src/engine/SCons/Scanner/SWIG.py | 4 +- src/engine/SCons/Scanner/ScannerTests.py | 62 +- src/engine/SCons/Scanner/__init__.py | 4 +- src/engine/SCons/Scanner/__init__.xml | 2 +- src/engine/SCons/Script/Interactive.py | 4 +- src/engine/SCons/Script/Main.py | 25 +- src/engine/SCons/Script/Main.xml | 2 +- src/engine/SCons/Script/MainTests.py | 13 +- src/engine/SCons/Script/SConsOptions.py | 18 +- src/engine/SCons/Script/SConscript.py | 83 +- src/engine/SCons/Script/SConscript.xml | 25 +- src/engine/SCons/Script/SConscriptTests.py | 4 +- src/engine/SCons/Script/__init__.py | 27 +- src/engine/SCons/Subst.py | 24 +- src/engine/SCons/Subst.xml | 2 +- src/engine/SCons/SubstTests.py | 26 +- src/engine/SCons/Taskmaster.py | 13 +- src/engine/SCons/TaskmasterTests.py | 9 +- src/engine/SCons/Tool/386asm.py | 4 +- src/engine/SCons/Tool/386asm.xml | 2 +- src/engine/SCons/Tool/DCommon.py | 4 +- src/engine/SCons/Tool/DCommon.xml | 2 +- src/engine/SCons/Tool/FortranCommon.py | 4 +- src/engine/SCons/Tool/GettextCommon.py | 12 +- src/engine/SCons/Tool/JavaCommon.py | 192 +++- src/engine/SCons/Tool/JavaCommonTests.py | 56 +- src/engine/SCons/Tool/MSCommon/__init__.py | 4 +- src/engine/SCons/Tool/MSCommon/arch.py | 12 +- src/engine/SCons/Tool/MSCommon/common.py | 14 +- src/engine/SCons/Tool/MSCommon/netframework.py | 4 +- src/engine/SCons/Tool/MSCommon/sdk.py | 14 +- src/engine/SCons/Tool/MSCommon/vc.py | 328 +++++-- src/engine/SCons/Tool/MSCommon/vs.py | 19 +- src/engine/SCons/Tool/PharLapCommon.py | 4 +- src/engine/SCons/Tool/ToolTests.py | 4 +- src/engine/SCons/Tool/__init__.py | 535 +++++++----- src/engine/SCons/Tool/__init__.xml | 2 +- src/engine/SCons/Tool/aixc++.py | 4 +- src/engine/SCons/Tool/aixc++.xml | 2 +- src/engine/SCons/Tool/aixcc.py | 4 +- src/engine/SCons/Tool/aixcc.xml | 2 +- src/engine/SCons/Tool/aixcxx.py | 4 +- src/engine/SCons/Tool/aixf77.py | 4 +- src/engine/SCons/Tool/aixf77.xml | 2 +- src/engine/SCons/Tool/aixlink.py | 4 +- src/engine/SCons/Tool/aixlink.xml | 2 +- src/engine/SCons/Tool/applelink.py | 155 +++- src/engine/SCons/Tool/applelink.xml | 379 +++++--- src/engine/SCons/Tool/ar.py | 4 +- src/engine/SCons/Tool/ar.xml | 2 +- src/engine/SCons/Tool/as.py | 4 +- src/engine/SCons/Tool/as.xml | 2 +- src/engine/SCons/Tool/bcc32.py | 4 +- src/engine/SCons/Tool/bcc32.xml | 2 +- src/engine/SCons/Tool/c++.py | 4 +- src/engine/SCons/Tool/c++.xml | 2 +- src/engine/SCons/Tool/cc.py | 4 +- src/engine/SCons/Tool/cc.xml | 2 +- src/engine/SCons/Tool/clang.py | 15 +- src/engine/SCons/Tool/clang.xml | 2 +- src/engine/SCons/Tool/clangCommon/__init__.py | 17 + src/engine/SCons/Tool/clangxx.py | 17 +- src/engine/SCons/Tool/clangxx.xml | 2 +- src/engine/SCons/Tool/cvf.py | 4 +- src/engine/SCons/Tool/cvf.xml | 2 +- src/engine/SCons/Tool/cxx.py | 4 +- src/engine/SCons/Tool/cyglink.xml | 2 +- src/engine/SCons/Tool/default.py | 4 +- src/engine/SCons/Tool/default.xml | 2 +- src/engine/SCons/Tool/dmd.py | 4 +- src/engine/SCons/Tool/dmd.xml | 2 +- src/engine/SCons/Tool/docbook/__init__.py | 4 +- src/engine/SCons/Tool/docbook/__init__.xml | 2 +- src/engine/SCons/Tool/docbook/docs/manual.xml | 2 +- src/engine/SCons/Tool/dvi.py | 4 +- src/engine/SCons/Tool/dvi.xml | 2 +- src/engine/SCons/Tool/dvipdf.py | 4 +- src/engine/SCons/Tool/dvipdf.xml | 2 +- src/engine/SCons/Tool/dvips.py | 4 +- src/engine/SCons/Tool/dvips.xml | 2 +- src/engine/SCons/Tool/f03.py | 4 +- src/engine/SCons/Tool/f03.xml | 2 +- src/engine/SCons/Tool/f08.py | 4 +- src/engine/SCons/Tool/f08.xml | 2 +- src/engine/SCons/Tool/f77.py | 4 +- src/engine/SCons/Tool/f77.xml | 2 +- src/engine/SCons/Tool/f90.py | 4 +- src/engine/SCons/Tool/f90.xml | 2 +- src/engine/SCons/Tool/f95.py | 4 +- src/engine/SCons/Tool/f95.xml | 2 +- src/engine/SCons/Tool/filesystem.py | 4 +- src/engine/SCons/Tool/fortran.py | 4 +- src/engine/SCons/Tool/fortran.xml | 15 +- src/engine/SCons/Tool/g++.py | 4 +- src/engine/SCons/Tool/g++.xml | 2 +- src/engine/SCons/Tool/g77.py | 4 +- src/engine/SCons/Tool/g77.xml | 2 +- src/engine/SCons/Tool/gas.py | 4 +- src/engine/SCons/Tool/gas.xml | 2 +- src/engine/SCons/Tool/gcc.py | 51 +- src/engine/SCons/Tool/gcc.xml | 2 +- src/engine/SCons/Tool/gdc.py | 4 +- src/engine/SCons/Tool/gdc.xml | 2 +- src/engine/SCons/Tool/gettext.xml | 2 +- src/engine/SCons/Tool/gettext_tool.py | 16 +- src/engine/SCons/Tool/gfortran.py | 6 +- src/engine/SCons/Tool/gfortran.xml | 2 +- src/engine/SCons/Tool/gnulink.py | 4 +- src/engine/SCons/Tool/gnulink.xml | 2 +- src/engine/SCons/Tool/gs.py | 4 +- src/engine/SCons/Tool/gs.xml | 2 +- src/engine/SCons/Tool/gxx.py | 8 +- src/engine/SCons/Tool/hpc++.py | 4 +- src/engine/SCons/Tool/hpc++.xml | 2 +- src/engine/SCons/Tool/hpcc.py | 4 +- src/engine/SCons/Tool/hpcc.xml | 2 +- src/engine/SCons/Tool/hpcxx.py | 4 +- src/engine/SCons/Tool/hplink.py | 4 +- src/engine/SCons/Tool/hplink.xml | 2 +- src/engine/SCons/Tool/icc.py | 4 +- src/engine/SCons/Tool/icc.xml | 2 +- src/engine/SCons/Tool/icl.py | 4 +- src/engine/SCons/Tool/icl.xml | 2 +- src/engine/SCons/Tool/ifl.py | 4 +- src/engine/SCons/Tool/ifl.xml | 2 +- src/engine/SCons/Tool/ifort.py | 4 +- src/engine/SCons/Tool/ifort.xml | 2 +- src/engine/SCons/Tool/ilink.py | 4 +- src/engine/SCons/Tool/ilink.xml | 2 +- src/engine/SCons/Tool/ilink32.py | 4 +- src/engine/SCons/Tool/ilink32.xml | 2 +- src/engine/SCons/Tool/install.py | 4 +- src/engine/SCons/Tool/install.xml | 2 +- src/engine/SCons/Tool/intelc.py | 6 +- src/engine/SCons/Tool/intelc.xml | 2 +- src/engine/SCons/Tool/ipkg.py | 4 +- src/engine/SCons/Tool/jar.py | 135 ++- src/engine/SCons/Tool/jar.xml | 2 +- src/engine/SCons/Tool/javac.py | 24 +- src/engine/SCons/Tool/javac.xml | 515 +++++------ src/engine/SCons/Tool/javacTests.py | 11 +- src/engine/SCons/Tool/javah.py | 14 +- src/engine/SCons/Tool/javah.xml | 2 +- src/engine/SCons/Tool/latex.py | 4 +- src/engine/SCons/Tool/latex.xml | 2 +- src/engine/SCons/Tool/ldc.py | 4 +- src/engine/SCons/Tool/ldc.xml | 2 +- src/engine/SCons/Tool/lex.py | 48 +- src/engine/SCons/Tool/lex.xml | 11 +- src/engine/SCons/Tool/link.py | 185 ++-- src/engine/SCons/Tool/link.xml | 2 +- src/engine/SCons/Tool/linkloc.py | 4 +- src/engine/SCons/Tool/linkloc.xml | 2 +- src/engine/SCons/Tool/m4.py | 4 +- src/engine/SCons/Tool/m4.xml | 2 +- src/engine/SCons/Tool/masm.py | 4 +- src/engine/SCons/Tool/masm.xml | 2 +- src/engine/SCons/Tool/midl.py | 6 +- src/engine/SCons/Tool/midl.xml | 2 +- src/engine/SCons/Tool/mingw.py | 132 +-- src/engine/SCons/Tool/mingw.xml | 2 +- src/engine/SCons/Tool/msgfmt.py | 18 +- src/engine/SCons/Tool/msgfmt.xml | 2 +- src/engine/SCons/Tool/msginit.py | 18 +- src/engine/SCons/Tool/msginit.xml | 2 +- src/engine/SCons/Tool/msgmerge.py | 19 +- src/engine/SCons/Tool/msgmerge.xml | 2 +- src/engine/SCons/Tool/mslib.py | 6 +- src/engine/SCons/Tool/mslib.xml | 2 +- src/engine/SCons/Tool/mslink.py | 6 +- src/engine/SCons/Tool/mslink.xml | 2 +- src/engine/SCons/Tool/mssdk.py | 4 +- src/engine/SCons/Tool/mssdk.xml | 2 +- src/engine/SCons/Tool/msvc.py | 19 +- src/engine/SCons/Tool/msvc.xml | 14 +- src/engine/SCons/Tool/msvs.py | 40 +- src/engine/SCons/Tool/msvs.xml | 968 ++++++++++++--------- src/engine/SCons/Tool/msvsTests.py | 13 +- src/engine/SCons/Tool/mwcc.py | 4 +- src/engine/SCons/Tool/mwcc.xml | 2 +- src/engine/SCons/Tool/mwld.py | 4 +- src/engine/SCons/Tool/mwld.xml | 2 +- src/engine/SCons/Tool/nasm.py | 4 +- src/engine/SCons/Tool/nasm.xml | 2 +- src/engine/SCons/Tool/packaging.xml | 2 +- src/engine/SCons/Tool/packaging/__init__.py | 41 +- src/engine/SCons/Tool/packaging/__init__.xml | 61 +- src/engine/SCons/Tool/packaging/ipk.py | 12 +- src/engine/SCons/Tool/packaging/msi.py | 15 +- src/engine/SCons/Tool/packaging/rpm.py | 57 +- src/engine/SCons/Tool/packaging/src_tarbz2.py | 6 +- src/engine/SCons/Tool/packaging/src_targz.py | 6 +- src/engine/SCons/Tool/packaging/src_tarxz.py | 43 + src/engine/SCons/Tool/packaging/src_zip.py | 4 +- src/engine/SCons/Tool/packaging/tarbz2.py | 8 +- src/engine/SCons/Tool/packaging/targz.py | 6 +- src/engine/SCons/Tool/packaging/tarxz.py | 44 + src/engine/SCons/Tool/packaging/zip.py | 4 +- src/engine/SCons/Tool/pdf.py | 4 +- src/engine/SCons/Tool/pdf.xml | 2 +- src/engine/SCons/Tool/pdflatex.py | 4 +- src/engine/SCons/Tool/pdflatex.xml | 2 +- src/engine/SCons/Tool/pdftex.py | 4 +- src/engine/SCons/Tool/pdftex.xml | 2 +- src/engine/SCons/Tool/qt.py | 43 +- src/engine/SCons/Tool/qt.xml | 2 +- src/engine/SCons/Tool/rmic.py | 19 +- src/engine/SCons/Tool/rmic.xml | 2 +- src/engine/SCons/Tool/rpcgen.py | 6 +- src/engine/SCons/Tool/rpcgen.xml | 2 +- src/engine/SCons/Tool/rpm.py | 4 +- src/engine/SCons/Tool/rpmutils.py | 4 +- src/engine/SCons/Tool/sgiar.py | 4 +- src/engine/SCons/Tool/sgiar.xml | 2 +- src/engine/SCons/Tool/sgic++.py | 4 +- src/engine/SCons/Tool/sgic++.xml | 2 +- src/engine/SCons/Tool/sgicc.py | 4 +- src/engine/SCons/Tool/sgicc.xml | 2 +- src/engine/SCons/Tool/sgicxx.py | 4 +- src/engine/SCons/Tool/sgilink.py | 4 +- src/engine/SCons/Tool/sgilink.xml | 2 +- src/engine/SCons/Tool/sunar.py | 4 +- src/engine/SCons/Tool/sunar.xml | 2 +- src/engine/SCons/Tool/sunc++.py | 4 +- src/engine/SCons/Tool/sunc++.xml | 2 +- src/engine/SCons/Tool/suncc.py | 4 +- src/engine/SCons/Tool/suncc.xml | 2 +- src/engine/SCons/Tool/suncxx.py | 4 +- src/engine/SCons/Tool/sunf77.py | 4 +- src/engine/SCons/Tool/sunf77.xml | 2 +- src/engine/SCons/Tool/sunf90.py | 4 +- src/engine/SCons/Tool/sunf90.xml | 2 +- src/engine/SCons/Tool/sunf95.py | 4 +- src/engine/SCons/Tool/sunf95.xml | 2 +- src/engine/SCons/Tool/sunlink.py | 4 +- src/engine/SCons/Tool/sunlink.xml | 2 +- src/engine/SCons/Tool/swig.py | 42 +- src/engine/SCons/Tool/swig.xml | 9 +- src/engine/SCons/Tool/tar.py | 4 +- src/engine/SCons/Tool/tar.xml | 2 +- src/engine/SCons/Tool/tex.py | 32 +- src/engine/SCons/Tool/tex.xml | 2 +- src/engine/SCons/Tool/textfile.py | 4 +- src/engine/SCons/Tool/textfile.xml | 6 +- src/engine/SCons/Tool/tlib.py | 4 +- src/engine/SCons/Tool/tlib.xml | 2 +- src/engine/SCons/Tool/wix.py | 4 +- src/engine/SCons/Tool/wixTests.py | 8 +- src/engine/SCons/Tool/xgettext.py | 18 +- src/engine/SCons/Tool/xgettext.xml | 2 +- src/engine/SCons/Tool/yacc.py | 45 +- src/engine/SCons/Tool/yacc.xml | 2 +- src/engine/SCons/Tool/zip.py | 4 +- src/engine/SCons/Tool/zip.xml | 2 +- src/engine/SCons/Util.py | 170 ++-- src/engine/SCons/UtilTests.py | 321 +++++-- src/engine/SCons/Variables/BoolVariable.py | 4 +- src/engine/SCons/Variables/BoolVariableTests.py | 9 +- src/engine/SCons/Variables/EnumVariable.py | 4 +- src/engine/SCons/Variables/EnumVariableTests.py | 9 +- src/engine/SCons/Variables/ListVariable.py | 4 +- src/engine/SCons/Variables/ListVariableTests.py | 9 +- src/engine/SCons/Variables/PackageVariable.py | 4 +- src/engine/SCons/Variables/PackageVariableTests.py | 9 +- src/engine/SCons/Variables/PathVariable.py | 4 +- src/engine/SCons/Variables/PathVariableTests.py | 9 +- src/engine/SCons/Variables/VariablesTests.py | 44 +- src/engine/SCons/Variables/__init__.py | 11 +- src/engine/SCons/Warnings.py | 17 +- src/engine/SCons/WarningsTests.py | 9 +- src/engine/SCons/__init__.py | 12 +- src/engine/SCons/compat/__init__.py | 6 +- src/engine/SCons/compat/_scons_dbm.py | 4 +- src/engine/SCons/cpp.py | 41 +- src/engine/SCons/cppTests.py | 145 ++- src/engine/SCons/dblite.py | 16 +- src/engine/SCons/exitfuncs.py | 4 +- src/script/scons-configure-cache.py | 141 +-- src/script/scons-time.py | 26 +- src/script/scons.bat | 12 +- src/script/scons.py | 113 +-- src/script/sconsign.py | 227 +++-- src/setup.py | 61 +- src/test_files.py | 4 +- src/test_interrupts.py | 4 +- src/test_pychecker.py | 4 +- src/test_setup.py | 4 +- src/test_strings.py | 18 +- 373 files changed, 6780 insertions(+), 3618 deletions(-) mode change 100644 => 100755 src/Announce.txt mode change 100644 => 100755 src/CHANGES.txt mode change 100644 => 100755 src/RELEASE.txt delete mode 100644 src/engine/MANIFEST-xml.in delete mode 100644 src/engine/SCons/Options/BoolOption.py delete mode 100644 src/engine/SCons/Options/EnumOption.py delete mode 100644 src/engine/SCons/Options/ListOption.py delete mode 100644 src/engine/SCons/Options/PackageOption.py delete mode 100644 src/engine/SCons/Options/PathOption.py delete mode 100644 src/engine/SCons/Options/__init__.py create mode 100644 src/engine/SCons/Platform/mingw.py create mode 100644 src/engine/SCons/Platform/virtualenv.py create mode 100644 src/engine/SCons/Platform/virtualenvTests.py create mode 100644 src/engine/SCons/Tool/clangCommon/__init__.py create mode 100644 src/engine/SCons/Tool/packaging/src_tarxz.py create mode 100644 src/engine/SCons/Tool/packaging/tarxz.py mode change 100644 => 100755 src/script/scons.py mode change 100644 => 100755 src/setup.py (limited to 'src') diff --git a/src/Announce.txt b/src/Announce.txt old mode 100644 new mode 100755 index ebda22e..324b9fc --- a/src/Announce.txt +++ b/src/Announce.txt @@ -18,24 +18,73 @@ So that everyone using SCons can help each other learn how to use it more effectively, please go to http://scons.org/lists.html#users to sign up for the scons-users mailing list. -RELEASE 3.0.0 - Mon, 18 Sep 2017 08:32:04 -0700 +RELEASE 3.0.5 - Mon, 26 Mar 2019 15:04:42 -0700 Please consult the RELEASE.txt file for a summary of changes since the last release and consult the CHANGES.txt file for complete a list of changes since last release. This announcement highlights only the important changes. + Please note the following important changes since release 3.0.4: + - Change the default for AppendENVPath to delete_existing=0, so path + order will not be changed, unless explicitly set (Issue #3276) + - Add lex construction variable LEXUNISTD for turning off unix headers on windows + - Update lex tool to use win_flex on windows if available + - Add the textfile tool to the default tool list + - The mingw tool now respects SHCCCOMSTR, SHLINKCOMSTR and LDMODULECOMSTR + - Add support for finding vswhere under 32 bit Windows installs + + + Please note the following important changes since release 3.0.3: + - Added TEMPFILESUFFIX to allow user to specify suffix for tempfiles used for long command lines + - Initial support for ARM architectures with Microsoft Visual Studio 2017. You must set TARGET_ARCH + to arm or arm64 to enable. + - Fixed issue detecting installs of Microsoft Visual Studio 2017 as well as Microsoft build tools 2017. + Please note the following important changes since release 2.5.1: - *IT IS NOT READY FOR PRODUCTION USE* This is the initial release supporting both python 3.5+ and 2.7.x and pypy There are some important changes: - - Any print statements must now use python 3 syntax of "print()" + - Properly support versioned shared libraries for MacOS. We've also introduced two + new env variables APPLELINK_CURRENT_VERSION and APPLELINK_COMPATIBILITY_VERSION which will specify + what is passed to the linkers -current_version and -compatibility_version flags. If not specified + they will be derived from SHLIBVERSION as such: + - APPLELINK_CURRENT_VERSION = SHLIBVERSION + - APPLELINK_COMPATIBILITY_VERSION = all but the last digit in SHLIBVERSION with .0 appended. + Note that the values of the above will be validated. Valid format for either APPLELINK variable is + X[.Y[.Z]] where 0 <= X <= 65535, 0 <= Y <= 255, 0 <= Z <= 255. + - Fix issue #2980 with credit to Piotr Bartosik (and William Blevins). This is an issue where using + TimeStamp-MD5 Decider and CacheDir can yield incorrect md5's being written into the .sconsign. + The difference between Piotr Bartosik's patch and the current code is that the more complicated + creation of file to csig map is only done when the count of children for the current node doesn't + match the previous count which is loaded from the sconsign. + - Add flag must_exist to SConscript() call to fail on missing script. + Not failing on missing script is now considered deprecated, and the first instance will print a + deprecation message. + - Add xz compression format to packaging choices. + - Add Textfile/Substfile to default environment. (issue #3147) + - Remove long deprecated SCons.Options which have been replaced by *Variable() + many years ago. + - Updated logic for mingw and clang on win32 to search default tool install paths if not + found in normal SCons PATH. If the user specifies PATH or tool specific paths they + will be used and the default paths below will be ignored. + - Default path for clang/clangxx : C:\Program Files\LLVM\bin + - Default path for mingw : C:\MinGW\bin and/or C:\mingw-w64\*\mingw64\bin + - Key program to locate mingw : mingw32-make (as the gcc with mingw prefix has no fixed name) + - Added virtualenv support. A new function Virtualenv() determines whether + SCons runs in a virtualenv. The search PATH may also be extended to + prefer executables from the current virtualenv over the ones provided by + base environment. New option --enable-virtualenv provided to import some + virtualenv-related variables to SCons and extend every env['ENV']['PATH'] + automatically. New option --ignore-virtualenv disables this. Two + environment variables, SCONS_ENABLE_VIRTUALENV and + SCONS_IGNORE_VIRTUALENV are supported for the same purpose. + - Recognize new java 9, 10, 11 (as 9.0 and 10.0, 11.0) - All node content should be in bytes. This is the default in python 2.7.x, in Python 3 all strings are by default unicode. byte and/or bytearray should be used if you construct content for return by a custom node type's get_content() method. - - This is some (as yet unresolved issue) using Literal()'s in some context with + - There are some (as yet unresolved issue) using Literal()'s in some context with Python 3 - pypy should be supported, please report any issues to the user's mailing list. - Currently if you switch back and forth between python 2.7.x and 3.5+ you will @@ -1266,6 +1315,3 @@ improve SCons for your needs. -- The SCons Development Team Gary Oberbrunner and Bill Deegan, maintainers Thanks to all the contributors for all your help! - -Copyright (c) 2001 - 2017 The SCons Foundation -src/Announce.txt rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog diff --git a/src/CHANGES.txt b/src/CHANGES.txt old mode 100644 new mode 100755 index ff28506..c46a804 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -5,6 +5,335 @@ Change Log +RELEASE 3.0.5 - Mon, 26 Mar 2019 15:04:42 -0700 + + From William Deegan: + + - Fix Issue #3283 - Handle using --config=force in combination with Decider('MD5-timestamp'). + 3.0.2 in fix for issue #2980 added that deciders can throw DeciderNeedsNode exception. + The Configure logic directly calls the decider when using --config=force but wasn't handling + that exception. This would yield minimally configure tests using TryLink() not running and + leaving TypeError Nonetype exception in config.log + - Fix Issue #3303 - Handle --config=force overwriting the Environment passed into Configure()'s + Decider and not clearing it when the configure context is completed. + - Add default paths for yacc tool on windows to include cygwin, mingw, and chocolatey + - Fix issue #2799 - Fix mingw tool to respect SHCCCOMSTR, SHLINKCOMSTR and LDMODULECOMSTR + - Fix Issue #3329 - Add support for MS SDK V10.0A (which is commonly installed with VS2017) + - Fix Issue #3333 - Add support for finding vswhere under 32 bit windows installs. + + From Maciej Kumorek: + - Update the MSVC tool to include the nologo flag by default in RCFLAGS + + From Daniel Moody: + - Change the default for AppendENVPath to delete_existing=0, so path + order will not be changed, unless explicitly set (Issue #3276) + - Fixed bug which threw error when running SCons on windows system with no MSVC installed. + - Update link tool to convert target to node before accessing node member + - Update mingw tool to remove MSVC like nologo CCFLAG + - Add default paths for lex tool on windows to include cygwin, mingw, and chocolatey + - Add lex construction variable LEXUNISTD for turning off unix headers on windows + - Update lex tool to use win_flex on windows if available + + From Mats Wichmann: + - Quiet open file ResourceWarnings on Python >= 3.6 caused by + not using a context manager around Popen.stdout + - Add the textfile tool to the default tool list + - Fix syntax on is/is not clauses: should not use with a literal + - Properly retrieve exit code when catching SystemExit + - scons-time now uses context managers around file opens + - Fix regex patterns that were not specified as raw strings + + From Bernhard M. Wiedemann: + - Do not store build host+user name if reproducible builds are wanted + + +RELEASE 3.0.4 - Mon, 20 Jan 2019 22:49:27 +0000 + + From Mats Wichmann: + - Improve finding of Microsoft compiler: add a 'products' wildcard + in case 2017 Build Tools only is installed as it is considered a separate + product from the default Visual Studio + - Add TEMPFILESUFFIX to allow a customizable filename extension, as + described in the patch attached to issue #2431. + - scons.py and sconsign.py stopped working if script called as a symlink + to location in scons-local location. + - Fix issue running scons using a symlink to scons.py in an scons-local dir + - Doc updates around Default(), and the various *TARGETS variables. + + From Daniel Moody: + - Improved support for VC14.1 and Visual Studio 2017, as well as arm and arm64 targets. + Issues #3268 & Issue #3222 + - Initial support for ARM targets with Visual Studio 2017 - Issue #3182 (You must set TARGET_ARCH for this to work) + - Update TempFileMunge class to use PRINT_CMD_LINE_FUNC + + From Tobias Herzog + - Enhance cpp scanner regex logic to detect if/elif expressions without whitespaces but + parenthesis like "#if(defined FOO)" or "#elif!(BAR)" correctly. + + +RELEASE 3.0.3 - Mon, 07 Jan 2019 20:05:22 -0400 + NOTE: 3.0.2 release was dropped because there was a packaging bug. Please consider all 3.0.2 + content. + + From William Deegan: + - Fixes to packaging logic. Ensuring the SCons.Tool.clangCommon module is added + to the release packages. + - Modify scons.bat script to check for scons python script without .py extension if no file + scons.py exists. This enables an all platform wheel to work. + + From Mats Wichmann: + - Update doc examples to work with Python 3.5+: map() now returns an iterable instead of a list. + + +RELEASE 3.0.2 - Mon, 31 Dec 2018 16:00:12 -0700 + + From Bernard Blackham: + - Fixed handling of side-effects in task master (fixes #3013). + + From William Deegan: + - Remove long deprecated SCons.Options code and tests. This removes BoolOption,EnumOption, + ListOption,PackageOption, and PathOption which have been replaced by *Variable() many years ago. + - Re-Enable parallel SCons (-j) when running via Pypy + - Move SCons test framework files to testing/framework and remove all references to QMtest. + QMTest has not been used by SCons for some time now. + - Updated logic for mingw and clang on win32 to search default tool install paths if not + found in normal SCons PATH. If the user specifies PATH or tool specific paths they + will be used and the default paths below will be ignored. + - Default path for clang/clangxx : C:\Program Files\LLVM\bin + - Default path for mingw : C:\MinGW\bin and/or C:\mingw-w64\*\mingw64\bin + - Key program to locate mingw : mingw32-make (as the gcc with mingw prefix has no fixed name) + - Fixed issue causing stack trace when python Action function contains a unicode string when being + run with Python 2.7 + - Add alternate path to QT install for Centos in qt tool: /usr/lib64/qt-3.3/bin + - Fix Java tools to search reasonable default paths for Win32, Linux, macOS. Add required paths + for swig and java native interface to JAVAINCLUDES. You should add these to your CPPPATH if you need + to compile with them. This handles spaces in paths in default Java paths on windows. + - Added more java paths to match install for Centos 7 of openjdk + - Fix new logic which populates JAVAINCLUDES to handle the case where javac is not found. + - Fix GH Issue #2580 - # in FRAMEWORKPATH doesn't get properly expanded. The # is left in the + command line. + - Fix issue #2980 with credit to Piotr Bartosik (and William Blevins). This is an issue where using + TimeStamp-MD5 Decider and CacheDir can yield incorrect md5's being written into the .sconsign. + The difference between Piotr Bartosik's patch and the current code is that the more complicated + creation of file to csig map is only done when the count of children for the current node doesn't + match the previous count which is loaded from the sconsign. + - Fix issue # 3106 MSVC if using MSVC_BATCH and target dir had a space would fail due to quirk in + MSVC's handling of escaped targetdirs when batch compiling. + - Fix GH Issue #3141 unicode string in a TryAction() with python 2.7 crashes. + - Fix GH Issue #3212 - Use of Py3 and CacheDir + Configure's TryCompile (or likely and Python Value Nodes) + yielded trying to combine strings and bytes which threw exception. + - Fix GH Issue #3225 SCons.Util.Flatten() doesn't handle MappingView's produced by dictionary as return + values from dict().{items(), keys(), values()}. + - Fix GH Issue #3241 - Properly support versioned shared libraries for MacOS. We've also introduced two + new env variables APPLELINK_CURRENT_VERSION and APPLELINK_COMPATIBILITY_VERSION which will specify + what is passed to the linkers -current_version and -compatibility_version flags. If not specified + they will be derived from SHLIBVERSION as such: + - APPLELINK_CURRENT_VERSION = SHLIBVERSION + - APPLELINK_COMPATIBILITY_VERSION = all but the last digit in SHLIBVERSION with .0 appended. + Note that the values of the above will be validated. Valid format for either APPLELINK variable is + X[.Y[.Z]] where 0 <= X <= 65535, 0 <= Y <= 255, 0 <= Z <= 255. + The new variables have been added to the documents and should show up in user guide and manpage. + - Fix GH Issue #3136 no longer wrap io.{BufferedReader,BufferedWriter,BufferedRWPair,BufferedRandom,TextIOWrapper + with logic to set HANDLE_FLAG_INHERIT flag on the file handle. Python 3.4+ automatically sets this according + to Python docs: https://docs.python.org/3/library/os.html#fd-inheritance + + From Ray Donnelly: + - Fix the PATH created by scons.bat (and other .bat files) to provide a normalized + PATH. Some pythons in the 3.6 series are no longer able to handle paths which + have ".." in them and end up crashing. This is done by cd'ing into the directory + we want to add to the path and then using %CD% to give us the normalized directory + See bug filed under Python 3.6: https://bugs.python.org/issue32457. + Note: On Win32 PATH's which have not been normalized may cause undefined behavior + by other executables being run by SCons (or any subprocesses of executables being run by SCons). + Resolving this issue should eliminate that possibility going forward. + + From Andrew Featherstone + - Removed unused --warn options from the man page and source code. + + From Arda Fu + - Fix cpp scanner regex logic to treat ifndef for py3.5+. Previously it was + not properly differentiating between if, ifdef, and ifndef. + + From Philipp Maierhöfer + - Added a __hash__ method to the class Scons.Subst.Literal. Required when substituting Literal + objects when SCons runs with Python 3. + - Added missing FORTRANMODDIRPREFIX to the gfortran tool. + + From Matthew Marinets: + - Fixed an issue that caused the Java emitter to incorrectly parse arguments to constructors that + implemented a class. + + From Fredrik Medley: + - Fix exception when printing of EnviromentError messages. + Specifically, this fixes error reporting of the race condition when + initializing the cache which error previously was hidden. + + From Daniel Moody: + - Updated Jar builder to handle nodes and directories better + - Updated Jar builder to flatten source list which could contain embedded lists + - Removed some magic numbers from jar.py on behalf of Mats Wichmann (mats@linux.com) + - Set the pickling protocal back to highest which was causing issues + with variant dir tests. This will cause issues if reading sconsigns + pickled with the previous lower protocal. + - Updated swig to setup default paths for windows + - Updated gettext tools to setup default paths for windows with Cygwin/MinGW setups + - Add common location for default paths for cygwin and mingw in Platform modules + - Updated YACC tool to work on windows with Cygwin/MinGW setups + - Set the pickling protocal back to highest which was causing issues + with variant dir tests. This will cause issues if reading sconsigns + pickled with the previous lower protocal. + - Updated FS.py to handle removal of splitunc function from python 3.7 + - Updated the vc.py to ignore MSVS versions where not compiler could be found + + From Gary Oberbrunner: + - Fix bug when Installing multiple subdirs outside the source tree + - fix to_str to handle None without raising exception + - Fix -jN for python 3.7 + + From Jonathon Reinhart: + - Replace all instances of `int main()` in C code with `int main(void)`. + Specifically, this fixes the test cases use by Configure.CheckCC() which + would fail when using -Wstrict-prototypes. + + From Zachary Tessler: + - Fix calculation of signatures for FunctionActions that contain list (or set,...) + comprehensions whose expressions involve constant literals. Those constants had + been ignored in signatures, so changing them did not cause targets to be rebuilt. + + From Paweł Tomulik: + - In the testing framework, module TestCommon, fixed must_contain(), + must_not_contain(), and related methods of TestCommon class to work with + substrings located at zero offset. + - Added virtualenv support. A new function Virtualenv() determines whether + SCons runs in a virtualenv. The search PATH may also be extended to + prefer executables from the current virtualenv over the ones provided by + base environment. New option --enable-virtualenv provided to import some + virtualenv-related variables to SCons and extend every env['ENV']['PATH'] + automatically. New option --ignore-virtualenv disables this. Two + environment variables, SCONS_ENABLE_VIRTUALENV and + SCONS_IGNORE_VIRTUALENV are supported for the same purpose. + + From Richard West: + - Add SConstruct.py, Sconstruct.py, sconstruct.py to the search path for the root SConstruct file. + Allows easier debugging within Visual Studio + - Change setup.py to change the install directory (via pip, or setup.py install) from scons-#.#.# + to scons (Yielding /lib/scons/SCons/ instead of /lib/scons/SCons-#.#.#/). + This changes SCons to better comply with normal Python installation practices. + + From Mats Wichmann: + - Recognize new java 9, 10, 11 (as 9.0 and 10.0, 11.0) + - Updated manpage scons.xml to fix a nested list problem + - Updated doc terminiology: use prepend instead of append as appropriate + - XML validity fixes from SConstruct.py change + - Update wiki links to new github location + - Update bug links to new github location + - Make it easier for SConscript() call to fail on missing script. + It was possible to call SCons.Warnings.warningAsException + (not documented as a user API) to make all warnings fail. Now + SConscript can take an optional must_exist flag which if true fails + if the script does not exist. Not failing on missing script is + now considered deprecated, and the first instance will print a + deprecation message. It is now also possible to flip the scons + behavior (which still defaults to warn, not fail) by calling + SCons.Script.set_missing_sconscript_error, which is also not a + documented interface at the moment. + - Convert TestCmd.read to use with statement on open (quiets 17 py3 warnings) + - Quiet py3 warning in UtilTests.py + - Fix tests specifying octal constants for py3 + - Fix must_contain tests for py3 + - RPM package generation: + - Fix supplying a build architecture + - Disable auto debug package generation on certain rpmbuild versions + - Adjust some tests to only supply build-id file on certain rpmbuild versions + - Tests now use a file fixture for the repeated (trivial) main.c program. + - Document and comment cleanup. + - Added new Environment Value X_RPM_EXTRADEFS to supply custom settings + to the specfile without adding specific logic for each one to scons. + - The test for Python.h needed by swig tests is moved to get_python_platform + so it does not have to be repeated in every test; picks up one failure + which did not make the (previously needed) check. Windows version + of get_python_platform needed some rework in case running in virtualenv. + - If test opens os.devnull, register with atexit so file opens do not leak. + - Fix bugs in Win32 process spawn logic to handle OSError exception correctly. + - Use time.perf_counter instead of time.clock if it exists. + time.clock deprecated since py3.3, due to remove in 3.8. deprecation + warnings from py3.7 were failing a bunch of tests on Windows since they + mess up expected stderr. + - Prefer Py3's inspect.getfullargspec over deprecated inspect.getargspec. + Switched to "new" (standard in Py2.7) usage of receiving a namedtuple - + we were unpacking to a four-tuple, two of the items of which were unused; + getfullargspec returns a named tuple with seven elements so it is a + cleaner drop-in replacement using the namedtuple. + - Updated the test-framework.rst documentation. + - Remove obsoleted internal implementaiton of OrderedDict. + - Test for tar packaging fixups + - Stop using deprecated unittest asserts + - messages in strip-install-dir test now os-neutral + - Add xz compression format to packaging choices. + - Syntax cleanups - trailing blanks, use "is" to compare with None, etc. + Three uses of variables not defined are changed. + - Some script changes in trying to find scons engine + - Update (pep8) configure-cache script, add a --show option. + - Fix for a couple of "what if tool not found" exceptions in framework. + - Add Textfile/Substfile to default environment. (issue #3147) + - sconsign: a couple of python3 fixes; be more tolerant of implicit + entries which have no signatures; minor PEP8 changes. + - Fix a couple of type mistakes (list-> string, filter type -> list) + - Fix a couple of type mistakes in packaging tools: list-> string in msi, + filter type -> list in ipk + + From Bernhard M. Wiedemann: + - Update SCons' internal scons build logic to allow overriding build date + with SOURCE_DATE_EPOCH for SCons itself. + - Change the datestamps in SCons' docs and embedded in code use ISO 8601 format and UTC + + From Hao Wu + - Typo in customized decider example in user guide + - Replace usage of unittest.TestSuite with unittest.main() (fix #3113) + +RELEASE 3.0.1 - Mon, 12 Nov 2017 15:31:33 -0700 + + From Daniel Moody: + - Jar can take multiple targets, and will make a duplicate jar from the sources for each target + - Added some warnings in case the Jar builder makes an implicit target + - Added Jar method and changed jar build to be more specific. Jar method will take in + directories or classes as source. Added more tests to JAR to ensure the jar was + packaged with the correct compiled class files. + - Added a No result test case to handle bug which seems unrelated to java in the + swig-dependencies.py test, more info here: http://scons.tigris.org/issues/show_bug.cgi?id=2907 + - Added a travis script to test on ubuntu trusty now that the project is on github + so that Continuus Integration tests can be run automatically. It tests most case and considers + no result a pass as well. Improving this script can install more dependincies allowing for more + tests to be run. + + From Daniel Moody: + - Updated the Jar Builder tool in Tool/__init__.py so that is doesn't force class files as + sources, allowing directories to be passed, which was causing test/Java/JAR.py to fail. + + From William Deegan: + - Fix issue where code in utility routine to_String_for_subst() had code whose result was never + properly returned. + (Found by: James Rinkevich https://pairlist4.pair.net/pipermail/scons-users/2017-October/006358.html ) + - Fixed Variables.GenerateHelpText() to now use the sort parameter. Due to incorrect 2to3 fixer changes + 8 years ago it was being used as a boolean parameter. Now you can specify sort to be a callable, or boolean + value. (True = normal sort). Manpage also updated. + - Fixed Tool loading logic from exploding sys.path with many site_scons/site_tools prepended on py3. + - Added additional output with time to process each SConscript file when using --debug=time. + + From Thomas Berg: + - Fixed a regression in scons-3.0.0 where "from __future__ import print_function" was imposed + on the scope where SConstruct is executed, breaking existing builds using PY 2.7. + + From William Deegan: + - Fix broken subst logic where a string with "$$(abc)" was being treated as "$(abc) and the + logic for removing the signature escapes was then failing because there was no closing "$)". + This was introduced by a pull request to allow recursive variable evaluations to yield a string + such as "$( $( some stuff $) $)". + + From Zachary Tessler: + - Fix incorrect warning for repeated identical builder calls that use overrides + + RELEASE 3.0.0 - Mon, 18 Sep 2017 08:32:04 -0700 NOTE: This is a major release. You should expect that some targets may rebuild when upgrading. @@ -77,9 +406,9 @@ will cause rebuilds. - Add support for Visual Studio 2017. This support requires vswhere.exe a helper tool installed with newer installs of 2017. SCons expects it to be located at "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" - It can be downloaded separately at + It can be downloaded separately at https://github.com/Microsoft/vswhere - + From Tom Tanner: - Allow nested $( ... $) sections @@ -6135,7 +6464,3 @@ A brief overview of important functionality available in release 0.01: - Windows installer available. - - -Copyright (c) 2001 - 2017 The SCons Foundation -src/CHANGES.txt rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog diff --git a/src/LICENSE.txt b/src/LICENSE.txt index ff04f2e..6b6cd6c 100644 --- a/src/LICENSE.txt +++ b/src/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2001 - 2017 The SCons Foundation +Copyright (c) 2001 - 2019 The SCons Foundation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/src/README.txt b/src/README.txt index ffba407..40d7217 100644 --- a/src/README.txt +++ b/src/README.txt @@ -2,7 +2,7 @@ SCons - a software construction tool - Version 3.0.0 + Version 3.0.3 This is SCons, a tool for building software (and other files). SCons is @@ -28,8 +28,7 @@ the latest version by checking the SCons download page at: EXECUTION REQUIREMENTS ====================== -Running SCons requires Python version 2.7.*. Currently it does not -run on the Python 3.x release. There should be +Running SCons requires Python version 2.7.* or 3.5.* and above. There should be no other dependencies or requirements to run SCons. (There is, however, an additional requirement to *install* SCons from this particular package; see the next section.) @@ -57,7 +56,7 @@ provided Python-standard setup script as follows: By default, the above command will do the following: - -- Install the version-numbered "scons-3.0.0" and "sconsign-3.0.0" + -- Install the version-numbered "scons-3.0.3" and "sconsign-3.0.3" scripts in the default system script directory (/usr/bin or C:\Python*\Scripts, for example). This can be disabled by specifying the "--no-version-script" option on the command @@ -71,17 +70,17 @@ By default, the above command will do the following: making it the default on your system. On UNIX or Linux systems, you can have the "scons" and "sconsign" - scripts be hard links or symbolic links to the "scons-3.0.0" and - "sconsign-3.0.0" scripts by specifying the "--hardlink-scons" + scripts be hard links or symbolic links to the "scons-3.0.3" and + "sconsign-3.0.3" scripts by specifying the "--hardlink-scons" or "--symlink-scons" options on the command line. - -- Install "scons-3.0.0.bat" and "scons.bat" wrapper scripts in the + -- Install "scons-3.0.3.bat" and "scons.bat" wrapper scripts in the Python prefix directory on Windows (C:\Python*, for example). This can be disabled by specifying the "--no-install-bat" option on the command line. On UNIX or Linux systems, the "--install-bat" option may be - specified to have "scons-3.0.0.bat" and "scons.bat" files + specified to have "scons-3.0.3.bat" and "scons.bat" files installed in the default system script directory, which is useful if you want to install SCons in a shared file system directory that can be used to execute SCons from both UNIX/Linux and @@ -89,7 +88,7 @@ By default, the above command will do the following: -- Install the SCons build engine (a Python module) in an appropriate version-numbered SCons library directory - (/usr/lib/scons-3.0.0 or C:\Python*\scons-3.0.0, for example). + (/usr/lib/scons-3.0.3 or C:\Python*\scons-3.0.3, for example). See below for more options related to installing the build engine library. @@ -146,7 +145,7 @@ of small examples for getting started using SCons. Additional documentation for SCons is available at: - http://www.scons.org/doc.html + https://scons.org/documentation.html LICENSING @@ -247,4 +246,4 @@ many contributors, including but not at all limited to: \... and many others. -Copyright (c) 2001 - 2015 The SCons Foundation +Copyright (c) 2001 - 2019 The SCons Foundation diff --git a/src/RELEASE.txt b/src/RELEASE.txt old mode 100644 new mode 100755 index 82a0c5a..90cc745 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -1,51 +1,43 @@ - A new SCons checkpoint release, 3.0.0, is now available - on the SCons download page: +A new SCons release, 3.0.5, is now available on the SCons download page: - http://www.scons.org/download.php + https://scons.org/pages/download.html - Here is a summary of the changes since 2.5.1: +Here is a summary of the changes since 3.0.4: - NEW FUNCTIONALITY +CHANGED/ENHANCED EXISTING FUNCTIONALITY - - Initial support for Python 3.5+ - - I + - Change the default for AppendENVPath to delete_existing=0, so path + order will not be changed, unless explicitly set (Issue #3276) + - Add lex construction variable LEXUNISTD for turning off unix headers on windows + - Update lex tool to use win_flex on windows if available + - Add the textfile tool to the default tool list - DEPRECATED FUNCTIONALITY +FIXES - - List anything that's been deprecated since the last release + - Fix Issue #3283 - Handle using --config=force in combination with Decider('MD5-timestamp'). + 3.0.2 in fix for issue #2980 added that deciders can throw DeciderNeedsNode exception. + The Configure logic directly calls the decider when using --config=force but wasn't handling + that exception. This would yield minimally configure tests using TryLink() not running and + leaving TypeError Nonetype exception in config.log + - Fix Issue #3303 - Handle --config=force overwriting the Environment passed into Configure()'s + Decider and not clearing it when the configure context is completed. + - Add default paths for yacc tool on windows to include cygwin, mingw, and chocolatey + - Fix issue #2799 - Fix mingw tool to respect SHCCCOMSTR, SHLINKCOMSTR and LDMODULECOMSTR + - Fix Issue #3329 - Add support for MS SDK V10.0A (which is commonly installed with VS2017) + - Fix Issue #3333 - Add support for finding vswhere under 32 bit windows installs. + - Update the MSVC tool to include the nologo flag by default in RCFLAGS + - Fixed bug which threw error when running SCons on windows system with no MSVC installed. - CHANGED/ENHANCED EXISTING FUNCTIONALITY - - List modifications to existing features, where the previous behavior - wouldn't actually be considered a bug +IMPROVEMENTS + - Do not store build host+user name if reproducible builds are wanted - FIXES - - List fixes of outright bugs - - IMPROVEMENTS - - - List improvements that wouldn't be visible to the user in the - documentation: performance improvements (describe the circumstances - under which they would be observed), or major code cleanups - - PACKAGING - - - List changes in the way SCons is packaged and/or released - - DOCUMENTATION - - - List any significant changes to the documentation (not individual - typo fixes, even if they're mentioned in src/CHANGES.txt to give - the contributor credit) - - DEVELOPMENT - - - List visible changes in the way SCons is developed - - Thanks to CURLY, LARRY, and MOE for their contributions to this release. - Contributors are listed alphabetically by their last name. - -Copyright (c) 2001 - 2017 The SCons Foundation -src/RELEASE.txt rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog +git shortlog --no-merges -ns 3.0.4..HEAD + 34 William Deegan + 33 Mats Wichmann + 18 Daniel + 4 Daniel Moody + 3 Bernhard M. Wiedemann + 2 Maciej Kumorek diff --git a/src/engine/MANIFEST-xml.in b/src/engine/MANIFEST-xml.in deleted file mode 100644 index cfbfd3a..0000000 --- a/src/engine/MANIFEST-xml.in +++ /dev/null @@ -1,8 +0,0 @@ -SCons/*.xml -SCons/Platform/*.xml -SCons/Scanner/__init__.xml -SCons/Script/*.xml -SCons/Tool/*.xml -SCons/Tool/docbook/__init__.xml -SCons/Tool/docbook/utils/xmldepend.xsl -SCons/Tool/packaging/__init__.xml diff --git a/src/engine/MANIFEST.in b/src/engine/MANIFEST.in index 2df278e..39aba6c 100644 --- a/src/engine/MANIFEST.in +++ b/src/engine/MANIFEST.in @@ -18,7 +18,6 @@ SCons/Node/__init__.py SCons/Node/Alias.py SCons/Node/FS.py SCons/Node/Python.py -SCons/Options/*.py SCons/PathList.py SCons/Platform/__init__.py SCons/Platform/aix.py @@ -27,9 +26,11 @@ SCons/Platform/darwin.py SCons/Platform/hpux.py SCons/Platform/irix.py SCons/Platform/os2.py +SCons/Platform/mingw.py SCons/Platform/posix.py SCons/Platform/sunos.py SCons/Platform/win32.py +SCons/Platform/virtualenv.py SCons/Scanner/__init__.py SCons/Scanner/C.py SCons/Scanner/D.py @@ -64,6 +65,7 @@ SCons/Tool/c++.py SCons/Tool/cxx.py SCons/Tool/cc.py SCons/Tool/cyglink.py +SCons/Tool/clangCommon/__init__.py SCons/Tool/clang.py SCons/Tool/clangxx.py SCons/Tool/cvf.py @@ -177,3 +179,5 @@ SCons/Tool/msgfmt.py SCons/Tool/msginit.py SCons/Tool/msgmerge.py SCons/Tool/xgettext.py +#SCons/Tool/docbook/docbook-xsl-1.76.1/** +#SCons/Tool/docbook/utils/** diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index 97040a4..f1ca2cf 100644 --- a/src/engine/SCons/Action.py +++ b/src/engine/SCons/Action.py @@ -77,7 +77,7 @@ way for wrapping up the functions. """ -# Copyright (c) 2001 - 2017 The SCons Foundation +# Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -98,7 +98,7 @@ way for wrapping up the functions. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "src/engine/SCons/Action.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" +__revision__ = "src/engine/SCons/Action.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog" import os import pickle @@ -107,6 +107,7 @@ import sys import subprocess import itertools import inspect +from collections import OrderedDict import SCons.Debug from SCons.Debug import logInstanceCreation @@ -115,8 +116,7 @@ import SCons.Util import SCons.Subst # we use these a lot, so try to optimize them -is_String = SCons.Util.is_String -is_List = SCons.Util.is_List +from SCons.Util import is_String, is_List class _null(object): pass @@ -258,8 +258,7 @@ def _code_contents(code, docstring=None): # function. Note that we have to call _object_contents on each # constants because the code object of nested functions can # show-up among the constants. - - z = [_object_contents(cc) for cc in code.co_consts[1:]] + z = [_object_contents(cc) for cc in code.co_consts if cc != docstring] contents.extend(b',(') contents.extend(bytearray(',', 'utf-8').join(z)) contents.extend(b')') @@ -803,7 +802,7 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw): kw['env'] = new_env try: - return subprocess.Popen(cmd, **kw) + pobj = subprocess.Popen(cmd, **kw) except EnvironmentError as e: if error == 'raise': raise # return a dummy Popen instance that only returns error @@ -817,7 +816,13 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw): def readline(self): return '' def __iter__(self): return iter(()) stdout = stderr = f() - return dummyPopen(e) + pobj = dummyPopen(e) + finally: + # clean up open file handles stored in parent's kw + for k, v in kw.items(): + if hasattr(v, 'close'): + v.close() + return pobj class CommandAction(_ActionAction): @@ -837,8 +842,8 @@ class CommandAction(_ActionAction): _ActionAction.__init__(self, **kw) if is_List(cmd): if [c for c in cmd if is_List(c)]: - raise TypeError("CommandAction should be given only " \ - "a single command") + raise TypeError("CommandAction should be given only " + "a single command") self.cmd_list = cmd def __str__(self): @@ -1289,7 +1294,7 @@ class ListAction(ActionBase): return result def get_varlist(self, target, source, env, executor=None): - result = SCons.Util.OrderedDict() + result = OrderedDict() for act in self.list: for var in act.get_varlist(target, source, env, executor): result[var] = True diff --git a/src/engine/SCons/Action.xml b/src/engine/SCons/Action.xml index 99f4e86..9cb186c 100644 --- a/src/engine/SCons/Action.xml +++ b/src/engine/SCons/Action.xml @@ -1,6 +1,6 @@ %s"%df) + if df: + return df + + if not df: + try: + # this should yield a path which matches what's in the sconsign + c_str = self.get_path() + df = dmap.get(c_str, None) + if MD5_TIMESTAMP_DEBUG: print("-->%s"%df) + if df: + return df + + if os.altsep: + c_str = c_str.replace(os.sep, os.altsep) + df = dmap.get(c_str, None) + if MD5_TIMESTAMP_DEBUG: print("-->%s"%df) + if df: + return df + + except AttributeError as e: + raise FileBuildInfoFileToCsigMappingError("No mapping from file name to content signature for :%s"%c_str) + + return df + + def changed_timestamp_then_content(self, target, prev_ni, node=None): + """ + Used when decider for file is Timestamp-MD5 + + NOTE: If the timestamp hasn't changed this will skip md5'ing the + file and just copy the prev_ni provided. If the prev_ni + is wrong. It will propagate it. + See: https://github.com/SCons/scons/issues/2980 + + Args: + self - dependency + target - target + prev_ni - The NodeInfo object loaded from previous builds .sconsign + node - Node instance. This is the only changed* function which requires + node to function. So if we detect that it's not passed. + we throw DeciderNeedsNode, and caller should handle this and pass node. + + Returns: + Boolean - Indicates if node(File) has changed. + """ + if node is None: + # We need required node argument to get BuildInfo to function + raise DeciderNeedsNode(self.changed_timestamp_then_content) + + # Now get sconsign name -> csig map and then get proper prev_ni if possible + bi = node.get_stored_info().binfo + rebuilt = False + try: + dependency_map = bi.dependency_map + except AttributeError as e: + dependency_map = self._build_dependency_map(bi) + rebuilt = True + + if len(dependency_map) == 0: + # If there's no dependency map, there's no need to find the + # prev_ni as there aren't any + # shortcut the rest of the logic + if MD5_TIMESTAMP_DEBUG: print("Skipping checks len(dmap)=0") + + # We still need to get the current file's csig + # This should be slightly faster than calling self.changed_content(target, new_prev_ni) + self.get_csig() + return True + + new_prev_ni = self._get_previous_signatures(dependency_map) + new = self.changed_timestamp_match(target, new_prev_ni) + + if MD5_TIMESTAMP_DEBUG: + old = self.changed_timestamp_match(target, prev_ni) + + if old != new: + print("Mismatch self.changed_timestamp_match(%s, prev_ni) old:%s new:%s"%(str(target), old, new)) + new_prev_ni = self._get_previous_signatures(dependency_map) + + + if not new: try: - self.get_ninfo().csig = prev_ni.csig + # NOTE: We're modifying the current node's csig in a query. + self.get_ninfo().csig = new_prev_ni.csig except AttributeError: pass return False - return self.changed_content(target, prev_ni) + return self.changed_content(target, new_prev_ni) def changed_timestamp_newer(self, target, prev_ni): try: @@ -3251,6 +3450,12 @@ class File(Base): return 1 def changed_timestamp_match(self, target, prev_ni): + """ + Return True if the timestamps don't match or if there is no previous timestamp + :param target: + :param prev_ni: Information about the node from the previous build + :return: + """ try: return self.get_timestamp() != prev_ni.timestamp except AttributeError: @@ -3272,7 +3477,9 @@ class File(Base): # ...and they'd like a local copy. e = LocalCopy(self, r, None) if isinstance(e, SCons.Errors.BuildError): - raise + # Likely this should be re-raising exception e + # (which would be BuildError) + raise e SCons.Node.store_info_map[self.store_info](self) if T: Trace(' 1\n') return 1 @@ -3293,11 +3500,14 @@ class File(Base): result = self if not self.exists(): norm_name = _my_normcase(self.name) - for dir in self.dir.get_all_rdirs(): - try: node = dir.entries[norm_name] - except KeyError: node = dir.file_on_disk(self.name) + for repo_dir in self.dir.get_all_rdirs(): + try: + node = repo_dir.entries[norm_name] + except KeyError: + node = repo_dir.file_on_disk(self.name) + if node and node.exists() and \ - (isinstance(node, File) or isinstance(node, Entry) \ + (isinstance(node, File) or isinstance(node, Entry) or not node.is_derived()): result = node # Copy over our local attributes to the repository @@ -3317,6 +3527,28 @@ class File(Base): self._memo['rfile'] = result return result + def find_repo_file(self): + """ + For this node, find if there exists a corresponding file in one or more repositories + :return: list of corresponding files in repositories + """ + retvals = [] + + norm_name = _my_normcase(self.name) + for repo_dir in self.dir.get_all_rdirs(): + try: + node = repo_dir.entries[norm_name] + except KeyError: + node = repo_dir.file_on_disk(self.name) + + if node and node.exists() and \ + (isinstance(node, File) or isinstance(node, Entry) \ + or not node.is_derived()): + retvals.append(node) + + return retvals + + def rstr(self): return str(self.rfile()) @@ -3374,6 +3606,8 @@ class File(Base): because multiple targets built by the same action will all have the same build signature, and we have to differentiate them somehow. + + Signature should normally be string of hex digits. """ try: return self.cachesig @@ -3383,10 +3617,13 @@ class File(Base): # Collect signatures for all children children = self.children() sigs = [n.get_cachedir_csig() for n in children] + # Append this node's signature... sigs.append(self.get_contents_sig()) + # ...and it's path sigs.append(self.get_internal_path()) + # Merge this all into a single signature result = self.cachesig = SCons.Util.MD5collect(sigs) return result diff --git a/src/engine/SCons/Node/FSTests.py b/src/engine/SCons/Node/FSTests.py index 3a36894..021d433 100644 --- a/src/engine/SCons/Node/FSTests.py +++ b/src/engine/SCons/Node/FSTests.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2001 - 2017 The SCons Foundation +# Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -22,7 +22,7 @@ # from __future__ import division, print_function -__revision__ = "src/engine/SCons/Node/FSTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" +__revision__ = "src/engine/SCons/Node/FSTests.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog" import SCons.compat @@ -41,6 +41,7 @@ import SCons.Errors import SCons.Node.FS import SCons.Util import SCons.Warnings +import SCons.Environment built_it = None @@ -605,7 +606,7 @@ class VariantDirTestCase(unittest.TestCase): print("File `%s' alter_targets() `%s' != expected `%s'" % (f, tp, expect)) errors = errors + 1 - self.failIf(errors) + self.assertFalse(errors) class BaseTestCase(_tempdirTestCase): def test_stat(self): @@ -1133,7 +1134,10 @@ class FSTestCase(_tempdirTestCase): e1 = fs.Entry(p) e2 = fs.Entry(path) assert e1 is e2, (e1, e2) - assert str(e1) is str(e2), (str(e1), str(e2)) + a=str(e1) + b=str(e2) + assert a == b, ("Strings should match for same file/node\n%s\n%s"%(a,b)) + # Test for a bug in 0.04 that did not like looking up # dirs with a trailing slash on Windows. @@ -1657,7 +1661,12 @@ class FSTestCase(_tempdirTestCase): import ntpath x = test.workpath(*dirs) drive, path = ntpath.splitdrive(x) - unc, path = ntpath.splitunc(path) + try: + unc, path = ntpath.splitunc(path) + except AttributeError: + # could be python 3.7 or newer, make sure splitdrive can do UNC + assert ntpath.splitdrive(r'\\split\drive\test')[0] == r'\\split\drive' + pass path = strip_slash(path) return '//' + path[1:] @@ -2455,6 +2464,139 @@ class FileTestCase(_tempdirTestCase): assert not build_f1.exists(), "%s did not realize that %s disappeared" % (build_f1, src_f1) assert not os.path.exists(build_f1.get_abspath()), "%s did not get removed after %s was removed" % (build_f1, src_f1) + def test_changed(self): + """ + Verify that changes between BuildInfo's list of souces, depends, and implicit + dependencies do not corrupt content signature values written to .SConsign + when using CacheDir and Timestamp-MD5 decider. + This is for issue #2980 + """ + # node should have + # 1 source (for example main.cpp) + # 0 depends + # N implicits (for example ['alpha.h', 'beta.h', 'gamma.h', '/usr/bin/g++']) + + class ChangedNode(SCons.Node.FS.File): + def __init__(self, name, directory=None, fs=None): + SCons.Node.FS.File.__init__(self, name, directory, fs) + self.name = name + self.Tag('found_includes', []) + self.stored_info = None + self.build_env = None + self.changed_since_last_build = 4 + self.timestamp = 1 + + def get_stored_info(self): + return self.stored_info + + def get_build_env(self): + return self.build_env + + def get_timestamp(self): + """ Fake timestamp so they always match""" + return self.timestamp + + def get_contents(self): + return self.name + + def get_ninfo(self): + """ mocked to ensure csig will equal the filename""" + try: + return self.ninfo + except AttributeError: + self.ninfo = FakeNodeInfo(self.name, self.timestamp) + return self.ninfo + + def get_csig(self): + ninfo = self.get_ninfo() + try: + return ninfo.csig + except AttributeError: + pass + + return "Should Never Happen" + + class ChangedEnvironment(SCons.Environment.Base): + + def __init__(self): + SCons.Environment.Base.__init__(self) + self.decide_source = self._changed_timestamp_then_content + + class FakeNodeInfo(object): + def __init__(self, csig, timestamp): + self.csig = csig + self.timestamp = timestamp + + #Create nodes + fs = SCons.Node.FS.FS() + d = self.fs.Dir('.') + + node = ChangedNode('main.o',d,fs) # main.o + s1 = ChangedNode('main.cpp',d,fs) # main.cpp + s1.timestamp = 2 # this changed + i1 = ChangedNode('alpha.h',d,fs) # alpha.h - The bug is caused because the second build adds this file + i1.timestamp = 2 # This is the new file. + i2 = ChangedNode('beta.h',d,fs) # beta.h + i3 = ChangedNode('gamma.h',d,fs) # gamma.h - In the bug beta.h's csig from binfo overwrites this ones + i4 = ChangedNode('/usr/bin/g++',d,fs) # /usr/bin/g++ + + node.add_source([s1]) + node.add_dependency([]) + node.implicit = [i1, i2, i3, i4] + node.implicit_set = set() + # node._add_child(node.implicit, node.implicit_set, [n7, n8, n9]) + # node._add_child(node.implicit, node.implicit_set, [n10, n11, n12]) + + # Mock out node's scan method + # node.scan = lambda *args: None + + # Mock out nodes' children() ? + # Should return Node's. + # All those nodes should have changed_since_last_build set to match Timestamp-MD5's + # decider method... + + # Generate sconsign entry needed + sconsign_entry = SCons.SConsign.SConsignEntry() + sconsign_entry.binfo = node.new_binfo() + sconsign_entry.ninfo = node.new_ninfo() + + # mock out loading info from sconsign + # This will cause node.get_stored_info() to return our freshly created sconsign_entry + node.stored_info = sconsign_entry + + # binfo = information from previous build (from sconsign) + # We'll set the following attributes (which are lists): "bsources", "bsourcesigs", + # "bdepends","bdependsigs", "bimplicit", "bimplicitsigs" + bi = sconsign_entry.binfo + bi.bsources = ['main.cpp'] + bi.bsourcesigs=[FakeNodeInfo('main.cpp',1),] + + bi.bdepends = [] + bi.bdependsigs = [] + + bi.bimplicit = ['beta.h','gamma.h'] + bi.bimplicitsigs = [FakeNodeInfo('beta.h',1), FakeNodeInfo('gamma.h',1)] + + ni = sconsign_entry.ninfo + # We'll set the following attributes (which are lists): sources, depends, implicit lists + + #Set timestamp-md5 + #Call changed + #Check results + node.build_env = ChangedEnvironment() + + changed = node.changed() + + # change to true to debug + if False: + print("Changed:%s"%changed) + print("%15s -> csig:%s"%(s1.name, s1.ninfo.csig)) + print("%15s -> csig:%s"%(i1.name, i1.ninfo.csig)) + print("%15s -> csig:%s"%(i2.name, i2.ninfo.csig)) + print("%15s -> csig:%s"%(i3.name, i3.ninfo.csig)) + print("%15s -> csig:%s"%(i4.name, i4.ninfo.csig)) + + self.assertEqual(i2.name,i2.ninfo.csig, "gamma.h's fake csig should equal gamma.h but equals:%s"%i2.ninfo.csig) class GlobTestCase(_tempdirTestCase): @@ -3747,38 +3889,7 @@ class AbsolutePathTestCase(unittest.TestCase): if __name__ == "__main__": - suite = unittest.TestSuite() - suite.addTest(VariantDirTestCase()) - suite.addTest(find_fileTestCase()) - suite.addTest(StringDirTestCase()) - suite.addTest(stored_infoTestCase()) - suite.addTest(has_src_builderTestCase()) - suite.addTest(prepareTestCase()) - suite.addTest(SConstruct_dirTestCase()) - suite.addTest(clearTestCase()) - suite.addTest(disambiguateTestCase()) - suite.addTest(postprocessTestCase()) - suite.addTest(SpecialAttrTestCase()) - suite.addTest(SaveStringsTestCase()) - tclasses = [ - AbsolutePathTestCase, - BaseTestCase, - CacheDirTestCase, - DirTestCase, - DirBuildInfoTestCase, - DirNodeInfoTestCase, - EntryTestCase, - FileTestCase, - FileBuildInfoTestCase, - FileNodeInfoTestCase, - FSTestCase, - GlobTestCase, - RepositoryTestCase, - ] - for tclass in tclasses: - names = unittest.getTestCaseNames(tclass, 'test_') - suite.addTests(list(map(tclass, names))) - TestUnit.run(suite) + unittest.main() # Local Variables: # tab-width:4 diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py index e50616a..39b928b 100644 --- a/src/engine/SCons/Node/NodeTests.py +++ b/src/engine/SCons/Node/NodeTests.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2001 - 2017 The SCons Foundation +# Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -20,7 +20,7 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "src/engine/SCons/Node/NodeTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" +__revision__ = "src/engine/SCons/Node/NodeTests.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog" import SCons.compat @@ -30,8 +30,6 @@ import re import sys import unittest -import TestUnit - import SCons.Errors import SCons.Node import SCons.Util @@ -1337,9 +1335,9 @@ class NodeListTestCase(unittest.TestCase): assert s == "['n3', 'n2', 'n1']", s r = repr(nl) - r = re.sub('at (0[xX])?[0-9a-fA-F]+', 'at 0x', r) + r = re.sub(r'at (0[xX])?[0-9a-fA-F]+', 'at 0x', r) # Don't care about ancestry: just leaf value of MyNode - r = re.sub('<.*?\.MyNode', ' +(scripts, [exports, variant_dir, duplicate, must_exist]) + -(dirs=subdirs, [name=script, exports, variant_dir, duplicate]) - +(dirs=subdirs, [name=script, exports, variant_dir, duplicate, must_exist]) + @@ -563,6 +567,17 @@ TODO??? SConscript('build/SConscript', src_dir='src') --> + +The optional +must_exist +argument, if true, causes an exception to be raised if a requested +&SConscript; file is not found. The current default is false, +causing only a warning to be omitted, but this behavior is deprecated. +For scripts which truly intend to be optional, transition to +explicty supplying +must_exist=False to the call. + + Here are some composite examples: diff --git a/src/engine/SCons/Script/SConscriptTests.py b/src/engine/SCons/Script/SConscriptTests.py index 2b10446..fb06ac4 100644 --- a/src/engine/SCons/Script/SConscriptTests.py +++ b/src/engine/SCons/Script/SConscriptTests.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2001 - 2017 The SCons Foundation +# Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Script/SConscriptTests.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" +__revision__ = "src/engine/SCons/Script/SConscriptTests.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog" import SCons.Script.SConscript diff --git a/src/engine/SCons/Script/__init__.py b/src/engine/SCons/Script/__init__.py index ffafadf..834c70d 100644 --- a/src/engine/SCons/Script/__init__.py +++ b/src/engine/SCons/Script/__init__.py @@ -12,7 +12,7 @@ it goes here. """ # -# Copyright (c) 2001 - 2017 The SCons Foundation +# Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -34,7 +34,7 @@ it goes here. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Script/__init__.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" +__revision__ = "src/engine/SCons/Script/__init__.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog" import time start_time = time.time() @@ -81,8 +81,8 @@ import SCons.Action import SCons.Builder import SCons.Environment import SCons.Node.FS -import SCons.Options import SCons.Platform +import SCons.Platform.virtualenv import SCons.Scanner import SCons.SConf import SCons.Subst @@ -150,6 +150,7 @@ Environment = SCons.Environment.Environment #OptParser = SCons.SConsOptions.OptParser FindPathDirs = SCons.Scanner.FindPathDirs Platform = SCons.Platform.Platform +Virtualenv = SCons.Platform.virtualenv.Virtualenv Return = _SConscript.Return Scanner = SCons.Scanner.Base Tool = SCons.Tool.Tool @@ -162,12 +163,6 @@ ListVariable = SCons.Variables.ListVariable PackageVariable = SCons.Variables.PackageVariable PathVariable = SCons.Variables.PathVariable -# Deprecated names that will go away some day. -BoolOption = SCons.Options.BoolOption -EnumOption = SCons.Options.EnumOption -ListOption = SCons.Options.ListOption -PackageOption = SCons.Options.PackageOption -PathOption = SCons.Options.PathOption # Action factories. Chmod = SCons.Defaults.Chmod @@ -283,12 +278,20 @@ def HelpFunction(text, append=False): # Will be non-zero if we are reading an SConscript file. sconscript_reading = 0 +_no_missing_sconscript = False +_warn_missing_sconscript_deprecated = True + +def set_missing_sconscript_error(flag=1): + """Set behavior on missing file in SConscript() call. Returns previous value""" + global _no_missing_sconscript + old = _no_missing_sconscript + _no_missing_sconscript = flag + return old + # def Variables(files=[], args=ARGUMENTS): return SCons.Variables.Variables(files, args) -def Options(files=[], args=ARGUMENTS): - return SCons.Options.Options(files, args) # The list of global functions to add to the SConscript name space # that end up calling corresponding methods or Builders in the @@ -374,7 +377,9 @@ GlobalDefaultBuilders = [ 'SharedObject', 'StaticLibrary', 'StaticObject', + 'Substfile', 'Tar', + 'Textfile', 'TypeLibrary', 'Zip', 'Package', diff --git a/src/engine/SCons/Subst.py b/src/engine/SCons/Subst.py index 90c12a0..4fc8461 100644 --- a/src/engine/SCons/Subst.py +++ b/src/engine/SCons/Subst.py @@ -5,7 +5,7 @@ SCons string substitution. """ # -# Copyright (c) 2001 - 2017 The SCons Foundation +# Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -26,7 +26,7 @@ SCons string substitution. # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "src/engine/SCons/Subst.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" +__revision__ = "src/engine/SCons/Subst.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog" import collections import re @@ -86,6 +86,9 @@ class Literal(object): def __neq__(self, other): return not self.__eq__(other) + def __hash__(self): + return hash(self.lstr) + class SpecialAttrWrapper(object): """This is a wrapper for what we call a 'Node special attribute.' This is any of the attributes of a Node that we can reference from @@ -338,7 +341,10 @@ SUBST_RAW = 1 SUBST_SIG = 2 _rm = re.compile(r'\$[()]') -_rm_split = re.compile(r'(\$[()])') + +# Note the pattern below only matches $( or $) when there is no +# preceeding $. (Thus the (? -%scons; - -%builders-mod; - -%functions-mod; - -%tools-mod; - -%variables-mod; -]> + + %scons; + + %builders-mod; + + %functions-mod; + + %tools-mod; + + %variables-mod; + ]> - - - -Sets construction variables for the Apple linker -(similar to the GNU linker). - - - -FRAMEWORKPATHPREFIX -_FRAMEWORKPATH -_FRAMEWORKS -LINKCOM -SHLINKFLAGS -SHLINKCOM -LDMODULEPREFIX -LDMODULESUFFIX -LDMODULEFLAGS -LDMODULECOM - - -FRAMEWORKSFLAGS - - - -"> - - -On Mac OS X with gcc, -general user-supplied frameworks options to be added at -the end of a command -line building a loadable module. -(This has been largely superseded by -the &cv-link-FRAMEWORKPATH;, &cv-link-FRAMEWORKPATHPREFIX;, -&cv-link-FRAMEWORKPREFIX; and &cv-link-FRAMEWORKS; variables -described above.) - - - - - - - -On Mac OS X with gcc, a list of the framework names to be linked into a -program or shared library or bundle. -The default value is the empty list. -For example: - - - - env.AppendUnique(FRAMEWORKS=Split('System Cocoa SystemConfiguration')) - - - - - - - - -On Mac OS X with gcc, -the prefix to be used for linking in frameworks -(see &cv-link-FRAMEWORKS;). -The default value is -. - - - - - - - -On Mac OS X with gcc, -an automatically-generated construction variable -containing the linker command-line options -for linking with FRAMEWORKS. - - - - - - - -On Mac OS X with gcc, -a list containing the paths to search for frameworks. -Used by the compiler to find framework-style includes like -#include <Fmwk/Header.h>. -Used by the linker to find user-specified frameworks when linking (see -&cv-link-FRAMEWORKS;). -For example: - - - - env.AppendUnique(FRAMEWORKPATH='#myframeworkdir') - - - -will add - - - - ... -Fmyframeworkdir - - - -to the compiler and linker command lines. - - - - - - - -On Mac OS X with gcc, the prefix to be used for the FRAMEWORKPATH entries. -(see &cv-link-FRAMEWORKPATH;). -The default value is -. - - - - - - - -On Mac OS X with gcc, an automatically-generated construction variable -containing the linker command-line options corresponding to -&cv-link-FRAMEWORKPATH;. - - - + + + + Sets construction variables for the Apple linker + (similar to the GNU linker). + + + + FRAMEWORKPATHPREFIX + _FRAMEWORKPATH + _FRAMEWORKS + LINKCOM + SHLINKFLAGS + SHLINKCOM + LDMODULEPREFIX + LDMODULESUFFIX + LDMODULEFLAGS + LDMODULECOM + APPLELINK_CURRENT_VERSION + APPLELINK_COMPATIBILITY_VERSION + APPLELINK_NO_CURRENT_VERSION + APPLELINK_NO_COMPATIBILITY_VERSION + _APPLELINK_CURRENT_VERSION + _APPLELINK_COMPATIBILITY_VERSION + + + FRAMEWORKSFLAGS + + + + + + + + On Mac OS X this is used to set the linker flag: + + -compatibility_version + + + The value is specified as X[.Y[.Z]] where X is between 1 and 65535, Y can be omitted or between 1 and + 255, Z can be omitted or between 1 and 255. This value will be derived from &cv-link-SHLIBVERSION; if + not + specified. The lowest digit will be dropped and replaced by a 0. + + + If the &cv-link-APPLELINK_NO_COMPATIBILITY_VERSION; is set then no -compatibility_version will be + output. + + See MacOS's ld manpage for more details + + + + + + + Set this to any True (1|True|non-empty string) value to disable adding -compatibility_version flag when + generating versioned shared libraries. + + + This overrides &cv-link-APPLELINK_COMPATIBILITY_VERSION;. + + + + + + + + + A macro (by default a generator function) used to create the linker flags to specify + apple's linker's -compatibility_version flag. + The default generator uses &cv-link-APPLELINK_COMPATIBILITY_VERSION; + and &cv-link-APPLELINK_NO_COMPATIBILITY_VERSION; and &cv-link-SHLIBVERSION; + to determine the correct flag. + + + + + + + + + On Mac OS X this is used to set the linker flag: + + -current_version + + + The value is specified as X[.Y[.Z]] where X is between 1 and 65535, Y can be omitted or between 1 and + 255, Z can be omitted or between 1 and 255. This value will be set to &cv-link-SHLIBVERSION; if not + specified. + + + If the &cv-link-APPLELINK_NO_CURRENT_VERSION; is set then no -current_version will be + output. + + See MacOS's ld manpage for more details + + + + + + + + + Set this to any True (1|True|non-empty string) value to disable adding -current_version flag when + generating versioned shared libraries. + + + This overrides &cv-link-APPLELINK_CURRENT_VERSION;. + + + + + + + + A macro (by default a generator function) used to create the linker flags to specify apple's linker's + -current_version flag. The default generator uses &cv-link-APPLELINK_CURRENT_VERSION; and + &cv-link-APPLELINK_NO_CURRENT_VERSION; and &cv-link-SHLIBVERSION; to determine the correct flag. + + + + + + "> + + + On Mac OS X with gcc, + general user-supplied frameworks options to be added at + the end of a command + line building a loadable module. + (This has been largely superseded by + the &cv-link-FRAMEWORKPATH;, &cv-link-FRAMEWORKPATHPREFIX;, + &cv-link-FRAMEWORKPREFIX; and &cv-link-FRAMEWORKS; variables + described above.) + + + + + + + + On Mac OS X with gcc, a list of the framework names to be linked into a + program or shared library or bundle. + The default value is the empty list. + For example: + + + + env.AppendUnique(FRAMEWORKS=Split('System Cocoa SystemConfiguration')) + + + + + + + + + On Mac OS X with gcc, + the prefix to be used for linking in frameworks + (see &cv-link-FRAMEWORKS;). + The default value is + . + + + + + + + + On Mac OS X with gcc, + an automatically-generated construction variable + containing the linker command-line options + for linking with FRAMEWORKS. + + + + + + + + On Mac OS X with gcc, + a list containing the paths to search for frameworks. + Used by the compiler to find framework-style includes like + #include <Fmwk/Header.h>. + Used by the linker to find user-specified frameworks when linking (see + &cv-link-FRAMEWORKS;). + For example: + + + + env.AppendUnique(FRAMEWORKPATH='#myframeworkdir') + + + + will add + + + + ... -Fmyframeworkdir + + + + to the compiler and linker command lines. + + + + + + + + On Mac OS X with gcc, the prefix to be used for the FRAMEWORKPATH entries. + (see &cv-link-FRAMEWORKPATH;). + The default value is + . + + + + + + + + On Mac OS X with gcc, an automatically-generated construction variable + containing the linker command-line options corresponding to + &cv-link-FRAMEWORKPATH;. + + + diff --git a/src/engine/SCons/Tool/ar.py b/src/engine/SCons/Tool/ar.py index 4d2a005..bef719f 100644 --- a/src/engine/SCons/Tool/ar.py +++ b/src/engine/SCons/Tool/ar.py @@ -9,7 +9,7 @@ selection method. """ # -# Copyright (c) 2001 - 2017 The SCons Foundation +# Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ar.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" +__revision__ = "src/engine/SCons/Tool/ar.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog" import SCons.Defaults import SCons.Tool diff --git a/src/engine/SCons/Tool/ar.xml b/src/engine/SCons/Tool/ar.xml index 9b9e0a0..573c80b 100644 --- a/src/engine/SCons/Tool/ar.xml +++ b/src/engine/SCons/Tool/ar.xml @@ -1,6 +1,6 @@ -%scons; - -%builders-mod; - -%functions-mod; - -%tools-mod; - -%variables-mod; -]> + + %scons; + + %builders-mod; + + %functions-mod; + + %tools-mod; + + %variables-mod; + ]> - - - -Sets construction variables for the &javac; compiler. - - - -JAVAC -JAVACFLAGS -JAVACCOM -JAVACLASSSUFFIX -JAVASUFFIX -JAVABOOTCLASSPATH -JAVACLASSPATH -JAVASOURCEPATH - - -JAVACCOMSTR - - + + + + Sets construction variables for the &javac; compiler. + + + + JAVAC + JAVACFLAGS + JAVACCOM + JAVACLASSSUFFIX + JAVAINCLUDES + JAVASUFFIX + JAVABOOTCLASSPATH + JAVACLASSPATH + JAVASOURCEPATH + + + JAVACCOMSTR + + - - - -Builds one or more Java class files. -The sources may be any combination of explicit -.java files, -or directory trees which will be scanned -for .java files. - + + + + Builds one or more Java class files. + The sources may be any combination of explicit + .java + files, + or directory trees which will be scanned + for .java files. + - -SCons will parse each source .java file -to find the classes -(including inner classes) -defined within that file, -and from that figure out the -target .class files that will be created. -The class files will be placed underneath -the specified target directory. - + + SCons will parse each source .java file + to find the classes + (including inner classes) + defined within that file, + and from that figure out the + target .class files that will be created. + The class files will be placed underneath + the specified target directory. + - -SCons will also search each Java file -for the Java package name, -which it assumes can be found on a line -beginning with the string -package -in the first column; -the resulting .class files -will be placed in a directory reflecting -the specified package name. -For example, -the file -Foo.java -defining a single public -Foo -class and -containing a package name of -sub.dir -will generate a corresponding -sub/dir/Foo.class -class file. - + + SCons will also search each Java file + for the Java package name, + which it assumes can be found on a line + beginning with the string + package + in the first column; + the resulting .class files + will be placed in a directory reflecting + the specified package name. + For example, + the file + Foo.java + defining a single public + Foo + class and + containing a package name of + sub.dir + will generate a corresponding + sub/dir/Foo.class + class file. + - -Examples: - + + Examples: + - -env.Java(target = 'classes', source = 'src') -env.Java(target = 'classes', source = ['src1', 'src2']) -env.Java(target = 'classes', source = ['File1.java', 'File2.java']) - + + env.Java(target = 'classes', source = 'src') + env.Java(target = 'classes', source = ['src1', 'src2']) + env.Java(target = 'classes', source = ['File1.java', 'File2.java']) + - -Java source files can use the native encoding for the underlying OS. -Since SCons compiles in simple ASCII mode by default, -the compiler will generate warnings about unmappable characters, -which may lead to errors as the file is processed further. -In this case, the user must specify the LANG -environment variable to tell the compiler what encoding is used. -For portibility, it's best if the encoding is hard-coded -so that the compile will work if it is done on a system -with a different encoding. - + + Java source files can use the native encoding for the underlying OS. + Since SCons compiles in simple ASCII mode by default, + the compiler will generate warnings about unmappable characters, + which may lead to errors as the file is processed further. + In this case, the user must specify the + LANG + environment variable to tell the compiler what encoding is used. + For portibility, it's best if the encoding is hard-coded + so that the compile will work if it is done on a system + with a different encoding. + - -env = Environment() -env['ENV']['LANG'] = 'en_GB.UTF-8' - - - + + env = Environment() + env['ENV']['LANG'] = 'en_GB.UTF-8' + + + - - - -Specifies the list of directories that -will be added to the -&javac; command line -via the option. -The individual directory names will be -separated by the operating system's path separate character -(: on UNIX/Linux/POSIX, -; on Windows). - - - + + + + Specifies the list of directories that + will be added to the + &javac; command line + via the option. + The individual directory names will be + separated by the operating system's path separate character + (: on UNIX/Linux/POSIX, + ; + on Windows). + + + - - - -The Java compiler. - - - + + + + Include path for Java header files (such as jni.h) + + + - - - -The command line used to compile a directory tree containing -Java source files to -corresponding Java class files. -Any options specified in the &cv-link-JAVACFLAGS; construction variable -are included on this command line. - - - + + + + The Java compiler. + + + - - - -The string displayed when compiling -a directory tree of Java source files to -corresponding Java class files. -If this is not set, then &cv-link-JAVACCOM; (the command line) is displayed. - + + + + The command line used to compile a directory tree containing + Java source files to + corresponding Java class files. + Any options specified in the &cv-link-JAVACFLAGS; construction variable + are included on this command line. + + + - -env = Environment(JAVACCOMSTR = "Compiling class files $TARGETS from $SOURCES") - - - + + + + The string displayed when compiling + a directory tree of Java source files to + corresponding Java class files. + If this is not set, then &cv-link-JAVACCOM; (the command line) is displayed. + - - - -General options that are passed to the Java compiler. - - - + + env = Environment(JAVACCOMSTR = "Compiling class files $TARGETS from $SOURCES") + + + - - - -The directory in which Java class files may be found. -This is stripped from the beginning of any Java .class -file names supplied to the -JavaH -builder. - - - + + + + General options that are passed to the Java compiler. + + + - - - -Specifies the list of directories that -will be searched for Java -.class file. -The directories in this list will be added to the -&javac; and &javah; command lines -via the option. -The individual directory names will be -separated by the operating system's path separate character -(: on UNIX/Linux/POSIX, -; on Windows). - + + + + The directory in which Java class files may be found. + This is stripped from the beginning of any Java .class + file names supplied to the + JavaH + builder. + + + - -Note that this currently just adds the specified -directory via the option. -&SCons; does not currently search the -&cv-JAVACLASSPATH; directories for dependency -.class files. - - - + + + + Specifies the list of directories that + will be searched for Java + .class + file. + The directories in this list will be added to the + &javac; and &javah; command lines + via the option. + The individual directory names will be + separated by the operating system's path separate character + (: on UNIX/Linux/POSIX, + ; + on Windows). + - - - -The suffix for Java class files; -.class -by default. - - - + + Note that this currently just adds the specified + directory via the option. + &SCons; does not currently search the + &cv-JAVACLASSPATH; directories for dependency + .class + files. + + + - - - -Specifies the list of directories that -will be searched for input -.java file. -The directories in this list will be added to the -&javac; command line -via the option. -The individual directory names will be -separated by the operating system's path separate character -(: on UNIX/Linux/POSIX, -; on Windows). - + + + + The suffix for Java class files; + .class + by default. + + + - -Note that this currently just adds the specified -directory via the option. -&SCons; does not currently search the -&cv-JAVASOURCEPATH; directories for dependency -.java files. - - - + + + + Specifies the list of directories that + will be searched for input + .java + file. + The directories in this list will be added to the + &javac; command line + via the option. + The individual directory names will be + separated by the operating system's path separate character + (: on UNIX/Linux/POSIX, + ; + on Windows). + - - - -The suffix for Java files; -.java -by default. - - - + + Note that this currently just adds the specified + directory via the option. + &SCons; does not currently search the + &cv-JAVASOURCEPATH; directories for dependency + .java + files. + + + - - - -Specifies the Java version being used by the &b-Java; builder. -This is not currently used to select one -version of the Java compiler vs. another. -Instead, you should set this to specify the version of Java -supported by your &javac; compiler. -The default is 1.4. - + + + + The suffix for Java files; + .java + by default. + + + - -This is sometimes necessary because -Java 1.5 changed the file names that are created -for nested anonymous inner classes, -which can cause a mismatch with the files -that &SCons; expects will be generated by the &javac; compiler. -Setting &cv-JAVAVERSION; to 1.5 -(or 1.6, as appropriate) -can make &SCons; realize that a Java 1.5 or 1.6 -build is actually up to date. - - - + + + + Specifies the Java version being used by the &b-Java; builder. + This is not currently used to select one + version of the Java compiler vs. another. + Instead, you should set this to specify the version of Java + supported by your &javac; compiler. + The default is 1.4. + + + + This is sometimes necessary because + Java 1.5 changed the file names that are created + for nested anonymous inner classes, + which can cause a mismatch with the files + that &SCons; expects will be generated by the &javac; compiler. + Setting &cv-JAVAVERSION; to + 1.5 + (or 1.6, as appropriate) + can make &SCons; realize that a Java 1.5 or 1.6 + build is actually up to date. + + + diff --git a/src/engine/SCons/Tool/javacTests.py b/src/engine/SCons/Tool/javacTests.py index 0debbb6..067ff3e 100644 --- a/src/engine/SCons/Tool/javacTests.py +++ b/src/engine/SCons/Tool/javacTests.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2001 - 2017 The SCons Foundation +# Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -24,8 +24,6 @@ import os import unittest -import TestUnit - import SCons.Tool.javac class DummyNode(object): @@ -40,14 +38,14 @@ class pathoptTestCase(unittest.TestCase): popt = SCons.Tool.javac.pathopt('-foopath', 'FOOPATH') env = {'FOOPATH': path} actual = popt(None, None, env, None) - self.assertEquals(expect, actual) + self.assertEqual(expect, actual) def assert_pathopt_default(self, expect, path, default): popt = SCons.Tool.javac.pathopt('-foopath', 'FOOPATH', default='DPATH') env = {'FOOPATH': path, 'DPATH': default} actual = popt(None, None, env, None) - self.assertEquals(expect, actual) + self.assertEqual(expect, actual) def test_unset(self): self.assert_pathopt([], None) @@ -101,5 +99,4 @@ class pathoptTestCase(unittest.TestCase): '') if __name__ == "__main__": - suite = unittest.makeSuite(pathoptTestCase, 'test_') - TestUnit.run(suite) + unittest.main() diff --git a/src/engine/SCons/Tool/javah.py b/src/engine/SCons/Tool/javah.py index 0e1885c..84183cb 100644 --- a/src/engine/SCons/Tool/javah.py +++ b/src/engine/SCons/Tool/javah.py @@ -9,7 +9,7 @@ selection method. """ # -# Copyright (c) 2001 - 2017 The SCons Foundation +# Copyright (c) 2001 - 2019 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/javah.py rel_3.0.0:4395:8972f6a2f699 2017/09/18 12:59:24 bdbaddog" +__revision__ = "src/engine/SCons/Tool/javah.py 103260fce95bf5db1c35fb2371983087d85dd611 2019-07-13 18:25:30 bdbaddog" import os.path @@ -40,6 +40,8 @@ import SCons.Builder import SCons.Node.FS import SCons.Tool.javac import SCons.Util +from SCons.Tool.JavaCommon import get_java_install_dirs + def emit_java_headers(target, source, env): """Create and return lists of Java stub header files that will @@ -120,6 +122,14 @@ def generate(env): java_javah = SCons.Tool.CreateJavaHBuilder(env) java_javah.emitter = emit_java_headers + if env['PLATFORM'] == 'win32': + # Ensure that we have a proper path for clang + javah = SCons.Tool.find_program_path(env, 'javah', + default_paths=get_java_install_dirs(env['PLATFORM'])) + if javah: + javah_bin_dir = os.path.dirname(javah) + env.AppendENVPath('PATH', javah_bin_dir) + env['_JAVAHOUTFLAG'] = JavaHOutFlagGenerator env['JAVAH'] = 'javah' env['JAVAHFLAGS'] = SCons.Util.CLVar('') diff --git a/src/engine/SCons/Tool/javah.xml b/src/engine/SCons/Tool/javah.xml index f362e3e..f72a6cd 100644 --- a/src/engine/SCons/Tool/javah.xml +++ b/src/engine/SCons/Tool/javah.xml @@ -1,6 +1,6 @@