From e627d1d01f36a1c4935978861db6e46b77167f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Oct 2018 20:06:47 +0200 Subject: Refresh d/p/0110-remove_stale_files.patch for python 3 compatibility --- debian/changelog | 7 +++++++ debian/files | 1 - debian/patches/0110-remove_stale_files.patch | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) delete mode 100644 debian/files diff --git a/debian/changelog b/debian/changelog index 0d0c874..be64e6c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +scons (3.0.1-2) UNRELEASED; urgency=medium + + * Refresh debian/patches/0110-remove_stale_files.patch to + make fix python 3 compatibility (Closes: #893740). + + -- Jörg Frings-Fürst Fri, 12 Oct 2018 19:47:43 +0200 + scons (3.0.1-1) unstable; urgency=medium * New upstream release: diff --git a/debian/files b/debian/files deleted file mode 100644 index 59a90df..0000000 --- a/debian/files +++ /dev/null @@ -1 +0,0 @@ -scons_3.0.1-1_source.buildinfo devel optional diff --git a/debian/patches/0110-remove_stale_files.patch b/debian/patches/0110-remove_stale_files.patch index b3a94d2..298d47c 100644 --- a/debian/patches/0110-remove_stale_files.patch +++ b/debian/patches/0110-remove_stale_files.patch @@ -13,7 +13,7 @@ Index: trunk/engine/SCons/Script/Main.py + # Remove temporary files left by SCons + if options.clean: -+ if os.environ.has_key('DH_INTERNAL_OPTIONS'): ++ if 'DH_INTERNAL_OPTIONS' in os.environ: + import shutil + for path in ('.sconsign.dblite', '.sconf_temp'): + try: -- cgit v1.2.3 From be5e7d919ba5e4d228828bcd8f0313bb5b243081 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Oct 2018 20:07:50 +0200 Subject: typo --- debian/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index be64e6c..8f9fddf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,7 +1,8 @@ scons (3.0.1-2) UNRELEASED; urgency=medium - * Refresh debian/patches/0110-remove_stale_files.patch to - make fix python 3 compatibility (Closes: #893740). + * Refresh debian/patches/0110-remove_stale_files.patch for python 3 + compatibility (Closes: #893740). + Thanks to Bernd Zeimetz . -- Jörg Frings-Fürst Fri, 12 Oct 2018 19:47:43 +0200 -- cgit v1.2.3 From 3f7051cae2371516cfd44d25fef33216b7508095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Oct 2018 20:10:03 +0200 Subject: Migrate to debhelper 11 --- debian/changelog | 3 +++ debian/compat | 2 +- debian/control | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8f9fddf..c7df472 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,9 @@ scons (3.0.1-2) UNRELEASED; urgency=medium * Refresh debian/patches/0110-remove_stale_files.patch for python 3 compatibility (Closes: #893740). Thanks to Bernd Zeimetz . + * Migrate to debhelper 11: + - Change debian/compat to 11. + - Bump minimum debhelper version in debian/control to >= 11. -- Jörg Frings-Fürst Fri, 12 Oct 2018 19:47:43 +0200 diff --git a/debian/compat b/debian/compat index f599e28..b4de394 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -10 +11 diff --git a/debian/control b/debian/control index 8703627..b914de5 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Jörg Frings-Fürst Uploaders: Laszlo Boszormenyi (GCS) Build-Depends: - debhelper (>= 10), + debhelper (>= 11), dh-python, python (>= 2.7~) Standards-Version: 4.1.2.0 -- cgit v1.2.3 From e1c176198761e894da362cbdedd810e0938c0e3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Oct 2018 20:11:18 +0200 Subject: Declare compliance with Debian Policy 4.2.1 --- debian/changelog | 1 + debian/control | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index c7df472..18bbac5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,7 @@ scons (3.0.1-2) UNRELEASED; urgency=medium * Migrate to debhelper 11: - Change debian/compat to 11. - Bump minimum debhelper version in debian/control to >= 11. + * Declare compliance with Debian Policy 4.2.1 (No changes needed). -- Jörg Frings-Fürst Fri, 12 Oct 2018 19:47:43 +0200 diff --git a/debian/control b/debian/control index b914de5..61060aa 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Build-Depends: debhelper (>= 11), dh-python, python (>= 2.7~) -Standards-Version: 4.1.2.0 +Standards-Version: 4.2.1 X-Python-Version: >= 2.7 Homepage: http://www.scons.org/ Vcs-Git: https://anonscm.debian.org/cgit/collab-maint/scons.git -- cgit v1.2.3 From 659f5379b685d75a6de6bc42e8f70bf9ff695342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Oct 2018 20:24:44 +0200 Subject: d/rules, d/control: Remove trailing whitespaces --- debian/changelog | 4 ++++ debian/control | 1 - debian/rules | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 18bbac5..a09076f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,10 @@ scons (3.0.1-2) UNRELEASED; urgency=medium - Change debian/compat to 11. - Bump minimum debhelper version in debian/control to >= 11. * Declare compliance with Debian Policy 4.2.1 (No changes needed). + * debian/control: + - Remove trailing whitespaces. + * debian/rules: + - Remove trailing whitespaces. -- Jörg Frings-Fürst Fri, 12 Oct 2018 19:47:43 +0200 diff --git a/debian/control b/debian/control index 61060aa..6c5d7ba 100644 --- a/debian/control +++ b/debian/control @@ -22,4 +22,3 @@ Description: replacement for make support. SCons rule sets are Python scripts so as well as the features it provides itself SCons allows you to use the full power of Python to control compilation. - diff --git a/debian/rules b/debian/rules index 60e93ec..3df1e98 100755 --- a/debian/rules +++ b/debian/rules @@ -9,4 +9,3 @@ clean: override_dh_auto_install: dh_auto_install -- --no-version-script --standalone-lib --no-install-man - -- cgit v1.2.3 From 279d864b80870c0e7cb3e0a3dc37e338d15f4be8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Oct 2018 21:18:07 +0200 Subject: d/rules, d/control: add python3 support --- debian/changelog | 2 ++ debian/control | 4 ++-- debian/rules | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index a09076f..9d6e38c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,8 +9,10 @@ scons (3.0.1-2) UNRELEASED; urgency=medium * Declare compliance with Debian Policy 4.2.1 (No changes needed). * debian/control: - Remove trailing whitespaces. + - Add python3 support. * debian/rules: - Remove trailing whitespaces. + - Add python3 support. -- Jörg Frings-Fürst Fri, 12 Oct 2018 19:47:43 +0200 diff --git a/debian/control b/debian/control index 6c5d7ba..10eced4 100644 --- a/debian/control +++ b/debian/control @@ -6,9 +6,9 @@ Uploaders: Laszlo Boszormenyi (GCS) Build-Depends: debhelper (>= 11), dh-python, - python (>= 2.7~) + python-all, + python3-all Standards-Version: 4.2.1 -X-Python-Version: >= 2.7 Homepage: http://www.scons.org/ Vcs-Git: https://anonscm.debian.org/cgit/collab-maint/scons.git Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/scons.git diff --git a/debian/rules b/debian/rules index 3df1e98..9f5141f 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f %: - dh $@ --with python2 + dh $@ --with python2, python3 clean: rm -fr build -- cgit v1.2.3 From 66487b24e13ab807e9b581977f10dfcce7b20ed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Oct 2018 23:50:01 +0200 Subject: d/control: Change VCS-* to point to the new repository --- debian/changelog | 1 + debian/control | 4 ++-- debian/rules | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9d6e38c..457f04c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ scons (3.0.1-2) UNRELEASED; urgency=medium * debian/control: - Remove trailing whitespaces. - Add python3 support. + - Change VCS-* to point to the new repository. * debian/rules: - Remove trailing whitespaces. - Add python3 support. diff --git a/debian/control b/debian/control index 10eced4..c2bf9b1 100644 --- a/debian/control +++ b/debian/control @@ -10,8 +10,8 @@ Build-Depends: python3-all Standards-Version: 4.2.1 Homepage: http://www.scons.org/ -Vcs-Git: https://anonscm.debian.org/cgit/collab-maint/scons.git -Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/scons.git +Vcs-Git: git://jff.email/opt/git/scons.git +Vcs-Browser: https://jff.email/cgit/scons.git Package: scons Architecture: all diff --git a/debian/rules b/debian/rules index 9f5141f..d375e94 100755 --- a/debian/rules +++ b/debian/rules @@ -1,7 +1,7 @@ #!/usr/bin/make -f %: - dh $@ --with python2, python3 + dh $@ --with python2,python3 clean: rm -fr build -- cgit v1.2.3 From 2fb368b8751637ffa010e5e4f79e2dda6adc6038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Jul 2019 17:46:22 +0200 Subject: Add Depends --- debian/control | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/control b/debian/control index c2bf9b1..462778b 100644 --- a/debian/control +++ b/debian/control @@ -15,7 +15,10 @@ Vcs-Browser: https://jff.email/cgit/scons.git Package: scons Architecture: all -Depends: ${python:Depends}, ${misc:Depends} +Depends: + ${python:Depends}, + ${python3:Depends}, + ${misc:Depends} Description: replacement for make SCons is a make replacement providing a range of enhanced features such as automated dependency generation and built in compilation cache -- cgit v1.2.3 From 19712e5025e3cf6a33fccd0738f04e018d55025f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Jul 2019 17:48:12 +0200 Subject: New upstream version 3.0.5 --- CHANGES.txt | 339 +++++++++++++++++-- LICENSE.txt | 2 +- MANIFEST | 11 +- PKG-INFO | 6 +- README.txt | 21 +- RELEASE.txt | 94 ++---- engine/SCons/Action.py | 27 +- engine/SCons/Builder.py | 4 +- engine/SCons/CacheDir.py | 17 +- engine/SCons/Conftest.py | 20 +- engine/SCons/Debug.py | 4 +- engine/SCons/Defaults.py | 14 +- engine/SCons/Environment.py | 15 +- engine/SCons/Errors.py | 25 +- engine/SCons/Executor.py | 6 +- engine/SCons/Job.py | 6 +- engine/SCons/Memoize.py | 4 +- engine/SCons/Node/Alias.py | 4 +- engine/SCons/Node/FS.py | 325 +++++++++++++++--- engine/SCons/Node/Python.py | 17 +- engine/SCons/Node/__init__.py | 81 +++-- engine/SCons/Options/BoolOption.py | 50 --- engine/SCons/Options/EnumOption.py | 50 --- engine/SCons/Options/ListOption.py | 50 --- engine/SCons/Options/PackageOption.py | 50 --- engine/SCons/Options/PathOption.py | 76 ----- engine/SCons/Options/__init__.py | 67 ---- engine/SCons/PathList.py | 4 +- engine/SCons/Platform/__init__.py | 64 +++- engine/SCons/Platform/aix.py | 4 +- engine/SCons/Platform/cygwin.py | 13 +- engine/SCons/Platform/darwin.py | 4 +- engine/SCons/Platform/hpux.py | 4 +- engine/SCons/Platform/irix.py | 4 +- engine/SCons/Platform/mingw.py | 39 +++ engine/SCons/Platform/os2.py | 4 +- engine/SCons/Platform/posix.py | 11 +- engine/SCons/Platform/sunos.py | 4 +- engine/SCons/Platform/virtualenv.py | 120 +++++++ engine/SCons/Platform/win32.py | 35 +- engine/SCons/SConf.py | 84 +++-- engine/SCons/SConsign.py | 7 +- engine/SCons/Scanner/C.py | 4 +- engine/SCons/Scanner/D.py | 4 +- engine/SCons/Scanner/Dir.py | 4 +- engine/SCons/Scanner/Fortran.py | 6 +- engine/SCons/Scanner/IDL.py | 4 +- engine/SCons/Scanner/LaTeX.py | 20 +- engine/SCons/Scanner/Prog.py | 4 +- engine/SCons/Scanner/RC.py | 4 +- engine/SCons/Scanner/SWIG.py | 4 +- engine/SCons/Scanner/__init__.py | 4 +- engine/SCons/Script/Interactive.py | 4 +- engine/SCons/Script/Main.py | 25 +- engine/SCons/Script/SConsOptions.py | 18 +- engine/SCons/Script/SConscript.py | 72 +++- engine/SCons/Script/__init__.py | 27 +- engine/SCons/Subst.py | 7 +- engine/SCons/Taskmaster.py | 13 +- engine/SCons/Tool/386asm.py | 4 +- engine/SCons/Tool/DCommon.py | 4 +- engine/SCons/Tool/FortranCommon.py | 4 +- engine/SCons/Tool/GettextCommon.py | 12 +- engine/SCons/Tool/JavaCommon.py | 192 +++++++++-- engine/SCons/Tool/MSCommon/__init__.py | 4 +- engine/SCons/Tool/MSCommon/arch.py | 12 +- engine/SCons/Tool/MSCommon/common.py | 14 +- engine/SCons/Tool/MSCommon/netframework.py | 4 +- engine/SCons/Tool/MSCommon/sdk.py | 14 +- engine/SCons/Tool/MSCommon/vc.py | 328 ++++++++++++++---- engine/SCons/Tool/MSCommon/vs.py | 19 +- engine/SCons/Tool/PharLapCommon.py | 4 +- engine/SCons/Tool/__init__.py | 517 +++++++++++++++++------------ engine/SCons/Tool/aixc++.py | 4 +- engine/SCons/Tool/aixcc.py | 4 +- engine/SCons/Tool/aixcxx.py | 4 +- engine/SCons/Tool/aixf77.py | 4 +- engine/SCons/Tool/aixlink.py | 4 +- engine/SCons/Tool/applelink.py | 155 ++++++++- engine/SCons/Tool/ar.py | 4 +- engine/SCons/Tool/as.py | 4 +- engine/SCons/Tool/bcc32.py | 4 +- engine/SCons/Tool/c++.py | 4 +- engine/SCons/Tool/cc.py | 4 +- engine/SCons/Tool/clang.py | 15 +- engine/SCons/Tool/clangCommon/__init__.py | 17 + engine/SCons/Tool/clangxx.py | 17 +- engine/SCons/Tool/cvf.py | 4 +- engine/SCons/Tool/cxx.py | 4 +- engine/SCons/Tool/default.py | 4 +- engine/SCons/Tool/dmd.py | 4 +- engine/SCons/Tool/docbook/__init__.py | 4 +- engine/SCons/Tool/dvi.py | 4 +- engine/SCons/Tool/dvipdf.py | 4 +- engine/SCons/Tool/dvips.py | 4 +- engine/SCons/Tool/f03.py | 4 +- engine/SCons/Tool/f08.py | 4 +- engine/SCons/Tool/f77.py | 4 +- engine/SCons/Tool/f90.py | 4 +- engine/SCons/Tool/f95.py | 4 +- engine/SCons/Tool/filesystem.py | 4 +- engine/SCons/Tool/fortran.py | 4 +- engine/SCons/Tool/g++.py | 4 +- engine/SCons/Tool/g77.py | 4 +- engine/SCons/Tool/gas.py | 4 +- engine/SCons/Tool/gcc.py | 51 +-- engine/SCons/Tool/gdc.py | 4 +- engine/SCons/Tool/gettext_tool.py | 16 +- engine/SCons/Tool/gfortran.py | 6 +- engine/SCons/Tool/gnulink.py | 4 +- engine/SCons/Tool/gs.py | 4 +- engine/SCons/Tool/gxx.py | 8 +- engine/SCons/Tool/hpc++.py | 4 +- engine/SCons/Tool/hpcc.py | 4 +- engine/SCons/Tool/hpcxx.py | 4 +- engine/SCons/Tool/hplink.py | 4 +- engine/SCons/Tool/icc.py | 4 +- engine/SCons/Tool/icl.py | 4 +- engine/SCons/Tool/ifl.py | 4 +- engine/SCons/Tool/ifort.py | 4 +- engine/SCons/Tool/ilink.py | 4 +- engine/SCons/Tool/ilink32.py | 4 +- engine/SCons/Tool/install.py | 4 +- engine/SCons/Tool/intelc.py | 6 +- engine/SCons/Tool/ipkg.py | 4 +- engine/SCons/Tool/jar.py | 104 +++--- engine/SCons/Tool/javac.py | 24 +- engine/SCons/Tool/javah.py | 14 +- engine/SCons/Tool/latex.py | 4 +- engine/SCons/Tool/ldc.py | 4 +- engine/SCons/Tool/lex.py | 48 ++- engine/SCons/Tool/link.py | 185 ++++++----- engine/SCons/Tool/linkloc.py | 4 +- engine/SCons/Tool/m4.py | 4 +- engine/SCons/Tool/masm.py | 4 +- engine/SCons/Tool/midl.py | 6 +- engine/SCons/Tool/mingw.py | 132 +++++--- engine/SCons/Tool/msgfmt.py | 18 +- engine/SCons/Tool/msginit.py | 18 +- engine/SCons/Tool/msgmerge.py | 19 +- engine/SCons/Tool/mslib.py | 6 +- engine/SCons/Tool/mslink.py | 6 +- engine/SCons/Tool/mssdk.py | 4 +- engine/SCons/Tool/msvc.py | 19 +- engine/SCons/Tool/msvs.py | 40 ++- engine/SCons/Tool/mwcc.py | 4 +- engine/SCons/Tool/mwld.py | 4 +- engine/SCons/Tool/nasm.py | 4 +- engine/SCons/Tool/packaging/__init__.py | 41 ++- engine/SCons/Tool/packaging/ipk.py | 12 +- engine/SCons/Tool/packaging/msi.py | 15 +- engine/SCons/Tool/packaging/rpm.py | 57 ++-- engine/SCons/Tool/packaging/src_tarbz2.py | 6 +- engine/SCons/Tool/packaging/src_targz.py | 6 +- engine/SCons/Tool/packaging/src_tarxz.py | 43 +++ engine/SCons/Tool/packaging/src_zip.py | 4 +- engine/SCons/Tool/packaging/tarbz2.py | 8 +- engine/SCons/Tool/packaging/targz.py | 6 +- engine/SCons/Tool/packaging/tarxz.py | 44 +++ engine/SCons/Tool/packaging/zip.py | 4 +- engine/SCons/Tool/pdf.py | 4 +- engine/SCons/Tool/pdflatex.py | 4 +- engine/SCons/Tool/pdftex.py | 4 +- engine/SCons/Tool/qt.py | 43 ++- engine/SCons/Tool/rmic.py | 19 +- engine/SCons/Tool/rpcgen.py | 6 +- engine/SCons/Tool/rpm.py | 4 +- engine/SCons/Tool/rpmutils.py | 4 +- engine/SCons/Tool/sgiar.py | 4 +- engine/SCons/Tool/sgic++.py | 4 +- engine/SCons/Tool/sgicc.py | 4 +- engine/SCons/Tool/sgicxx.py | 4 +- engine/SCons/Tool/sgilink.py | 4 +- engine/SCons/Tool/sunar.py | 4 +- engine/SCons/Tool/sunc++.py | 4 +- engine/SCons/Tool/suncc.py | 4 +- engine/SCons/Tool/suncxx.py | 4 +- engine/SCons/Tool/sunf77.py | 4 +- engine/SCons/Tool/sunf90.py | 4 +- engine/SCons/Tool/sunf95.py | 4 +- engine/SCons/Tool/sunlink.py | 4 +- engine/SCons/Tool/swig.py | 42 ++- engine/SCons/Tool/tar.py | 4 +- engine/SCons/Tool/tex.py | 32 +- engine/SCons/Tool/textfile.py | 4 +- engine/SCons/Tool/tlib.py | 4 +- engine/SCons/Tool/wix.py | 4 +- engine/SCons/Tool/xgettext.py | 18 +- engine/SCons/Tool/yacc.py | 45 ++- engine/SCons/Tool/zip.py | 4 +- engine/SCons/Util.py | 158 +++++---- engine/SCons/Variables/BoolVariable.py | 4 +- engine/SCons/Variables/EnumVariable.py | 4 +- engine/SCons/Variables/ListVariable.py | 4 +- engine/SCons/Variables/PackageVariable.py | 4 +- engine/SCons/Variables/PathVariable.py | 4 +- engine/SCons/Variables/__init__.py | 4 +- engine/SCons/Warnings.py | 17 +- engine/SCons/__init__.py | 14 +- engine/SCons/compat/__init__.py | 6 +- engine/SCons/compat/_scons_dbm.py | 4 +- engine/SCons/cpp.py | 41 +-- engine/SCons/dblite.py | 16 +- engine/SCons/exitfuncs.py | 4 +- scons-time.1 | 8 +- scons.1 | 426 +++++++++++++++++------- sconsign.1 | 18 +- script/scons | 113 ++++--- script/scons-configure-cache | 143 +++++--- script/scons-time | 26 +- script/scons.bat | 12 +- script/sconsign | 227 +++++++++---- setup.py | 51 +-- 213 files changed, 4044 insertions(+), 2087 deletions(-) mode change 100644 => 100755 CHANGES.txt mode change 100644 => 100755 RELEASE.txt delete mode 100644 engine/SCons/Options/BoolOption.py delete mode 100644 engine/SCons/Options/EnumOption.py delete mode 100644 engine/SCons/Options/ListOption.py delete mode 100644 engine/SCons/Options/PackageOption.py delete mode 100644 engine/SCons/Options/PathOption.py delete mode 100644 engine/SCons/Options/__init__.py create mode 100644 engine/SCons/Platform/mingw.py create mode 100644 engine/SCons/Platform/virtualenv.py create mode 100644 engine/SCons/Tool/clangCommon/__init__.py create mode 100644 engine/SCons/Tool/packaging/src_tarxz.py create mode 100644 engine/SCons/Tool/packaging/tarxz.py mode change 100644 => 100755 script/scons mode change 100644 => 100755 setup.py diff --git a/CHANGES.txt b/CHANGES.txt old mode 100644 new mode 100755 index abcced8..c46a804 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -5,44 +5,335 @@ Change Log -RELEASE 3.0.1 - Mon, 14 Nov 2017 08:28:09 -0700 +RELEASE 3.0.5 - Mon, 26 Mar 2019 15:04:42 -0700 - 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 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: - - 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. - - 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 $) $)". + - 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 + 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 + - 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 + 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. @@ -115,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 @@ -6173,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 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog diff --git a/LICENSE.txt b/LICENSE.txt index ff04f2e..6b6cd6c 100644 --- a/LICENSE.txt +++ b/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/MANIFEST b/MANIFEST index 1802d18..879d8d9 100644 --- a/MANIFEST +++ b/MANIFEST @@ -18,12 +18,6 @@ engine/SCons/Node/Alias.py engine/SCons/Node/FS.py engine/SCons/Node/Python.py engine/SCons/Node/__init__.py -engine/SCons/Options/BoolOption.py -engine/SCons/Options/EnumOption.py -engine/SCons/Options/ListOption.py -engine/SCons/Options/PackageOption.py -engine/SCons/Options/PathOption.py -engine/SCons/Options/__init__.py engine/SCons/PathList.py engine/SCons/Platform/__init__.py engine/SCons/Platform/aix.py @@ -31,9 +25,11 @@ engine/SCons/Platform/cygwin.py engine/SCons/Platform/darwin.py engine/SCons/Platform/hpux.py engine/SCons/Platform/irix.py +engine/SCons/Platform/mingw.py engine/SCons/Platform/os2.py engine/SCons/Platform/posix.py engine/SCons/Platform/sunos.py +engine/SCons/Platform/virtualenv.py engine/SCons/Platform/win32.py engine/SCons/SConf.py engine/SCons/SConsign.py @@ -80,6 +76,7 @@ engine/SCons/Tool/bcc32.py engine/SCons/Tool/c++.py engine/SCons/Tool/cc.py engine/SCons/Tool/clang.py +engine/SCons/Tool/clangCommon/__init__.py engine/SCons/Tool/clangxx.py engine/SCons/Tool/cvf.py engine/SCons/Tool/cxx.py @@ -149,9 +146,11 @@ engine/SCons/Tool/packaging/msi.py engine/SCons/Tool/packaging/rpm.py engine/SCons/Tool/packaging/src_tarbz2.py engine/SCons/Tool/packaging/src_targz.py +engine/SCons/Tool/packaging/src_tarxz.py engine/SCons/Tool/packaging/src_zip.py engine/SCons/Tool/packaging/tarbz2.py engine/SCons/Tool/packaging/targz.py +engine/SCons/Tool/packaging/tarxz.py engine/SCons/Tool/packaging/zip.py engine/SCons/Tool/pdf.py engine/SCons/Tool/pdflatex.py diff --git a/PKG-INFO b/PKG-INFO index 31af5ef..7909b30 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,10 +1,10 @@ Metadata-Version: 1.0 Name: scons -Version: 3.0.1 +Version: 3.0.5 Summary: Open Source next-generation build tool. Home-page: http://www.scons.org/ -Author: Steven Knight -Author-email: knight@baldmt.com +Author: William Deegan +Author-email: bill@baddogconsulting.com License: UNKNOWN Description: Open Source next-generation build tool. Improved, cross-platform substitute for the classic Make diff --git a/README.txt b/README.txt index 1239d25..40d7217 100644 --- a/README.txt +++ b/README.txt @@ -2,7 +2,7 @@ SCons - a software construction tool - Version 3.0.1 + 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.1" and "sconsign-3.0.1" + -- 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.1" and - "sconsign-3.0.1" 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.1.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.1.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.1 or C:\Python*\scons-3.0.1, 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/RELEASE.txt b/RELEASE.txt old mode 100644 new mode 100755 index 695e2c6..90cc745 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -1,73 +1,43 @@ - A new SCons checkpoint release, 3.0.1, 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 - XXX The primary purpose of this release ... XXX - A SCons "checkpoint release" is intended to provide early access to - new features so they can be tested in the field before being released - for adoption by other software distributions. +Here is a summary of the changes since 3.0.4: - Note that a checkpoint release is developed using the same test-driven - development methodology as all SCons releases. Existing SCons - functionality should all work as it does in previous releases (except - for any changes identified in the release notes) and early adopters - should be able to use a checkpoint release safely for production work - with existing SConscript files. If not, it represents not only a bug - in SCons but also a hole in the regression test suite, and we want to - hear about it. +CHANGED/ENHANCED EXISTING FUNCTIONALITY - New features may be more lightly tested than in past releases, - especially as concerns their interaction with all of the other - functionality in SCons. We are especially interested in hearing bug - reports about new functionality. + - 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 - We do not recommend that downstream distributions (Debian, Fedora, - etc.) package a checkpoint release, mainly to avoid confusing the - "public" release numbering with the long checkpoint release names. +FIXES - Here is a summary of the changes since 1.3.0: + - 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. - NEW FUNCTIONALITY - - List new features (presumably why a checkpoint is being released) +IMPROVEMENTS + - Do not store build host+user name if reproducible builds are wanted - DEPRECATED FUNCTIONALITY - - List anything that's been deprecated since the last release - - CHANGED/ENHANCED EXISTING FUNCTIONALITY - - - List modifications to existing features, where the previous behavior - wouldn't actually be considered a bug - - 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 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 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/engine/SCons/Action.py b/engine/SCons/Action.py index ce5471d..861db48 100644 --- a/engine/SCons/Action.py +++ b/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 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Action.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" 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/engine/SCons/Builder.py b/engine/SCons/Builder.py index cf7010d..2d337c9 100644 --- a/engine/SCons/Builder.py +++ b/engine/SCons/Builder.py @@ -77,7 +77,7 @@ There are the following methods for internal use within this module: """ # -# 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 @@ There are the following methods for internal use within this module: # 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/Builder.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Builder.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import collections diff --git a/engine/SCons/CacheDir.py b/engine/SCons/CacheDir.py index b15d715..81c74f0 100644 --- a/engine/SCons/CacheDir.py +++ b/engine/SCons/CacheDir.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,12 +21,13 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/CacheDir.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/CacheDir.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __doc__ = """ CacheDir support """ +import hashlib import json import os import stat @@ -55,6 +56,10 @@ def CacheRetrieveFunc(target, source, env): fs.symlink(fs.readlink(cachefile), t.get_internal_path()) else: env.copy_from_cache(cachefile, t.get_internal_path()) + try: + os.utime(cachefile, None) + except OSError: + pass st = fs.stat(cachefile) fs.chmod(t.get_internal_path(), stat.S_IMODE(st[stat.ST_MODE]) | stat.S_IWRITE) return 0 @@ -134,12 +139,6 @@ warned = dict() class CacheDir(object): def __init__(self, path): - try: - import hashlib - except ImportError: - msg = "No hashlib or MD5 module available, CacheDir() not supported" - SCons.Warnings.warn(SCons.Warnings.NoMD5ModuleWarning, msg) - path = None self.path = path self.current_cache_debug = None self.debugFP = None @@ -222,7 +221,9 @@ class CacheDir(object): return None, None sig = node.get_cachedir_bsig() + subdir = sig[:self.config['prefix_len']].upper() + dir = os.path.join(self.path, subdir) return dir, os.path.join(dir, sig) diff --git a/engine/SCons/Conftest.py b/engine/SCons/Conftest.py index abaf00d..84aa992 100644 --- a/engine/SCons/Conftest.py +++ b/engine/SCons/Conftest.py @@ -136,7 +136,7 @@ def CheckBuilder(context, text = None, language = None): if not text: text = """ -int main() { +int main(void) { return 0; } """ @@ -157,7 +157,7 @@ def CheckCC(context): """ context.Display("Checking whether the C compiler works... ") text = """ -int main() +int main(void) { return 0; } @@ -177,7 +177,7 @@ def CheckSHCC(context): """ context.Display("Checking whether the (shared) C compiler works... ") text = """ -int foo() +int foo(void) { return 0; } @@ -197,7 +197,7 @@ def CheckCXX(context): """ context.Display("Checking whether the C++ compiler works... ") text = """ -int main() +int main(void) { return 0; } @@ -217,7 +217,7 @@ def CheckSHCXX(context): """ context.Display("Checking whether the (shared) C++ compiler works... ") text = """ -int main() +int main(void) { return 0; } @@ -290,7 +290,7 @@ char %s();""" % function_name #include %(hdr)s -int main() { +int main(void) { #if defined (__stub_%(name)s) || defined (__stub___%(name)s) fail fail fail #else @@ -400,7 +400,7 @@ def CheckType(context, type_name, fallback = None, %(include)s %(header)s -int main() { +int main(void) { if ((%(name)s *) 0) return 0; if (sizeof (%(name)s)) @@ -465,7 +465,7 @@ def CheckTypeSize(context, type_name, header = None, language = None, expect = N src = src + r""" typedef %s scons_check_type; -int main() +int main(void) { static int test_array[1 - 2 * !(((long int) (sizeof(scons_check_type))) == %d)]; test_array[0] = 0; @@ -498,7 +498,7 @@ int main() src = src + """ #include #include -int main() { +int main(void) { printf("%d", (int)sizeof(""" + type_name + """)); return 0; } @@ -560,7 +560,7 @@ def CheckDeclaration(context, symbol, includes = None, language = None): context.Display('Checking whether %s is declared... ' % symbol) src = src + r""" -int main() +int main(void) { #ifndef %s (void) %s; diff --git a/engine/SCons/Debug.py b/engine/SCons/Debug.py index b79ad65..be19a01 100644 --- a/engine/SCons/Debug.py +++ b/engine/SCons/Debug.py @@ -9,7 +9,7 @@ caller_trace() """ # -# 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 @@ caller_trace() # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Debug.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Debug.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import sys diff --git a/engine/SCons/Defaults.py b/engine/SCons/Defaults.py index 9d135ed..15ad91e 100644 --- a/engine/SCons/Defaults.py +++ b/engine/SCons/Defaults.py @@ -10,7 +10,7 @@ from distutils.msvccompiler. """ # -# 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 @@ -33,7 +33,7 @@ from distutils.msvccompiler. # from __future__ import division -__revision__ = "src/engine/SCons/Defaults.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Defaults.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os @@ -210,7 +210,7 @@ def chmod_func(dest, mode): else: raise SyntaxError("Could not find +, - or =") operation_list = operation.split(operator) - if len(operation_list) is not 2: + if len(operation_list) != 2: raise SyntaxError("More than one operator found") user = operation_list[0].strip().replace("a", "ugo") permission = operation_list[1].strip() @@ -333,8 +333,8 @@ def touch_func(dest): if os.path.exists(file): atime = os.path.getatime(file) else: - open(file, 'w') - atime = mtime + with open(file, 'w'): + atime = mtime os.utime(file, (atime, mtime)) Touch = ActionFactory(touch_func, @@ -342,6 +342,7 @@ Touch = ActionFactory(touch_func, # Internal utility functions + def _concat(prefix, list, suffix, env, f=lambda x: x, target=None, source=None): """ Creates a new list from 'list' by first interpolating each element @@ -358,6 +359,7 @@ def _concat(prefix, list, suffix, env, f=lambda x: x, target=None, source=None): return _concat_ixes(prefix, list, suffix, env) + def _concat_ixes(prefix, list, suffix, env): """ Creates a new list from 'list' by concatenating the 'prefix' and @@ -395,6 +397,7 @@ def _concat_ixes(prefix, list, suffix, env): return result + def _stripixes(prefix, itms, suffix, stripprefixes, stripsuffixes, env, c=None): """ This is a wrapper around _concat()/_concat_ixes() that checks for @@ -565,7 +568,6 @@ ConstructionEnvironment = { 'DSUFFIXES' : SCons.Tool.DSuffixes, 'ENV' : {}, 'IDLSUFFIXES' : SCons.Tool.IDLSuffixes, -# 'LATEXSUFFIXES' : SCons.Tool.LaTeXSuffixes, # moved to the TeX tools generate functions '_concat' : _concat, '_defines' : _defines, '_stripixes' : _stripixes, diff --git a/engine/SCons/Environment.py b/engine/SCons/Environment.py index 0ff6c79..0fcd617 100644 --- a/engine/SCons/Environment.py +++ b/engine/SCons/Environment.py @@ -10,7 +10,7 @@ Environment """ # -# 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 @@ Environment # 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/Environment.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Environment.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import copy @@ -150,7 +150,7 @@ def _set_BUILDERS(env, key, value): for k in list(bd.keys()): del bd[k] except KeyError: - bd = BuilderDict(kwbd, env) + bd = BuilderDict(bd, env) env._dict[key] = bd for k, v in value.items(): if not SCons.Builder.is_a_Builder(v): @@ -1217,7 +1217,7 @@ class Base(SubstitutionEnvironment): return path def AppendENVPath(self, name, newpath, envname = 'ENV', - sep = os.pathsep, delete_existing=1): + sep = os.pathsep, delete_existing=0): """Append path elements to the path 'name' in the 'ENV' dictionary for this environment. Will only add any particular path once, and will normpath and normcase all paths to help @@ -1568,12 +1568,12 @@ class Base(SubstitutionEnvironment): """ filename = self.subst(filename) try: - fp = open(filename, 'r') + with open(filename, 'r') as fp: + lines = SCons.Util.LogicalLines(fp).readlines() except IOError: if must_exist: raise return - lines = SCons.Util.LogicalLines(fp).readlines() lines = [l for l in lines if l[0] != '#'] tdlist = [] for line in lines: @@ -2258,7 +2258,7 @@ class Base(SubstitutionEnvironment): while (node != node.srcnode()): node = node.srcnode() return node - sources = list(map( final_source, sources )); + sources = list(map(final_source, sources)) # remove duplicates return list(set(sources)) @@ -2372,6 +2372,7 @@ class OverrideEnvironment(Base): kw = copy_non_reserved_keywords(kw) self.__dict__['overrides'].update(semi_deepcopy(kw)) + # The entry point that will be used by the external world # to refer to a construction environment. This allows the wrapper # interface to extend a construction environment for its own purposes diff --git a/engine/SCons/Errors.py b/engine/SCons/Errors.py index 88904de..4f1403d 100644 --- a/engine/SCons/Errors.py +++ b/engine/SCons/Errors.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 @@ -28,7 +28,7 @@ and user errors in SCons. """ -__revision__ = "src/engine/SCons/Errors.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Errors.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import shutil import SCons.Util @@ -95,7 +95,7 @@ class BuildError(Exception): # py3: errstr should be string and not bytes. - self.errstr = SCons.Util.to_str(errstr) + self.errstr = SCons.Util.to_String(errstr) self.status = status self.exitstatus = exitstatus self.filename = filename @@ -176,8 +176,8 @@ def convert_to_BuildError(status, exc_info=None): filename = status.filename except AttributeError: filename = None - - buildError = BuildError( + + buildError = BuildError( errstr=status.args[0], status=status.errno, exitstatus=2, @@ -190,14 +190,13 @@ def convert_to_BuildError(status, exc_info=None): # error, which might be different from the target being built # (for example, failure to create the directory in which the # target file will appear). - try: - filename = status.filename - except AttributeError: - filename = None + filename = getattr(status, 'filename', None) + strerror = getattr(status, 'strerror', str(status)) + errno = getattr(status, 'errno', 2) - buildError = BuildError( - errstr=status.strerror, - status=status.errno, + buildError = BuildError( + errstr=strerror, + status=errno, exitstatus=2, filename=filename, exc_info=exc_info) @@ -217,7 +216,7 @@ def convert_to_BuildError(status, exc_info=None): errstr="Error %s" % status, status=status, exitstatus=2) - + #import sys #sys.stderr.write("convert_to_BuildError: status %s => (errstr %s, status %s)\n"%(status,buildError.errstr, buildError.status)) return buildError diff --git a/engine/SCons/Executor.py b/engine/SCons/Executor.py index 12a68d8..cc3813c 100644 --- a/engine/SCons/Executor.py +++ b/engine/SCons/Executor.py @@ -6,7 +6,7 @@ Nodes. """ # -# 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 @@ -28,7 +28,7 @@ Nodes. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function -__revision__ = "src/engine/SCons/Executor.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Executor.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import collections @@ -450,6 +450,8 @@ class Executor(object, with_metaclass(NoSlotsPyPy)): """Fetch the signature contents. This is the main reason this class exists, so we can compute this once and cache it regardless of how many target or source Nodes there are. + + Returns bytes """ try: return self._memo['get_contents'] diff --git a/engine/SCons/Job.py b/engine/SCons/Job.py index ed8a5e6..e049142 100644 --- a/engine/SCons/Job.py +++ b/engine/SCons/Job.py @@ -7,7 +7,7 @@ stop, and wait on jobs. """ # -# 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 @@ -29,7 +29,7 @@ stop, and wait on jobs. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Job.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Job.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.compat @@ -199,7 +199,7 @@ class Serial(object): task.prepare() if task.needs_execute(): task.execute() - except: + except Exception as e: if self.interrupted(): try: raise SCons.Errors.BuildError( diff --git a/engine/SCons/Memoize.py b/engine/SCons/Memoize.py index c30f371..12fe043 100644 --- a/engine/SCons/Memoize.py +++ b/engine/SCons/Memoize.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 print_function -__revision__ = "src/engine/SCons/Memoize.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Memoize.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __doc__ = """Memoizer diff --git a/engine/SCons/Node/Alias.py b/engine/SCons/Node/Alias.py index 78923b4..8fbeef7 100644 --- a/engine/SCons/Node/Alias.py +++ b/engine/SCons/Node/Alias.py @@ -8,7 +8,7 @@ This creates a hash of global Aliases (dummy targets). """ # -# 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 @@ -30,7 +30,7 @@ This creates a hash of global Aliases (dummy targets). # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Node/Alias.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Node/Alias.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import collections diff --git a/engine/SCons/Node/FS.py b/engine/SCons/Node/FS.py index ecde942..be9f7fd 100644 --- a/engine/SCons/Node/FS.py +++ b/engine/SCons/Node/FS.py @@ -11,7 +11,7 @@ that can be used by scripts or modules looking for the canonical default. """ # -# 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 @@ -33,7 +33,7 @@ that can be used by scripts or modules looking for the canonical default. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function -__revision__ = "src/engine/SCons/Node/FS.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Node/FS.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import fnmatch import os @@ -43,6 +43,7 @@ import stat import sys import time import codecs +from itertools import chain import SCons.Action import SCons.Debug @@ -56,9 +57,12 @@ import SCons.Util import SCons.Warnings from SCons.Debug import Trace +from . import DeciderNeedsNode print_duplicate = 0 +MD5_TIMESTAMP_DEBUG = False + def sconsign_none(node): raise NotImplementedError @@ -74,6 +78,9 @@ def sconsign_dir(node): _sconsign_map = {0 : sconsign_none, 1 : sconsign_dir} +class FileBuildInfoFileToCsigMappingError(Exception): + pass + class EntryProxyAttributeError(AttributeError): """ An AttributeError subclass for recording and displaying the name @@ -132,7 +139,10 @@ def initialize_do_splitdrive(): global do_splitdrive global has_unc drive, path = os.path.splitdrive('X:/foo') - has_unc = hasattr(os.path, 'splitunc') + # splitunc is removed from python 3.7 and newer + # so we can also just test if splitdrive works with UNC + has_unc = (hasattr(os.path, 'splitunc') + or os.path.splitdrive(r'\\split\drive\test')[0] == r'\\split\drive') do_splitdrive = not not drive or has_unc @@ -282,11 +292,13 @@ def set_duplicate(duplicate): Link_Funcs.append(link_dict[func]) def LinkFunc(target, source, env): - # Relative paths cause problems with symbolic links, so - # we use absolute paths, which may be a problem for people - # who want to move their soft-linked src-trees around. Those - # people should use the 'hard-copy' mode, softlinks cannot be - # used for that; at least I have no idea how ... + """ + Relative paths cause problems with symbolic links, so + we use absolute paths, which may be a problem for people + who want to move their soft-linked src-trees around. Those + people should use the 'hard-copy' mode, softlinks cannot be + used for that; at least I have no idea how ... + """ src = source[0].get_abspath() dest = target[0].get_abspath() dir, file = os.path.split(dest) @@ -328,7 +340,12 @@ Unlink = SCons.Action.Action(UnlinkFunc, None) def MkdirFunc(target, source, env): t = target[0] - if not t.exists(): + # This os.path.exists test looks redundant, but it's possible + # when using Install() to install multiple dirs outside the + # source tree to get a case where t.exists() is true but + # the path does already exist, so this prevents spurious + # build failures in that case. See test/Install/multi-dir. + if not t.exists() and not os.path.exists(t.get_abspath()): t.fs.mkdir(t.get_abspath()) return 0 @@ -682,10 +699,15 @@ class Base(SCons.Node.Node): @SCons.Memoize.CountMethodCall def stat(self): - try: return self._memo['stat'] - except KeyError: pass - try: result = self.fs.stat(self.get_abspath()) - except os.error: result = None + try: + return self._memo['stat'] + except KeyError: + pass + try: + result = self.fs.stat(self.get_abspath()) + except os.error: + result = None + self._memo['stat'] = result return result @@ -697,13 +719,17 @@ class Base(SCons.Node.Node): def getmtime(self): st = self.stat() - if st: return st[stat.ST_MTIME] - else: return None + if st: + return st[stat.ST_MTIME] + else: + return None def getsize(self): st = self.stat() - if st: return st[stat.ST_SIZE] - else: return None + if st: + return st[stat.ST_SIZE] + else: + return None def isdir(self): st = self.stat() @@ -1048,21 +1074,22 @@ _classEntry = Entry class LocalFS(object): - - # This class implements an abstraction layer for operations involving - # a local file system. Essentially, this wraps any function in - # the os, os.path or shutil modules that we use to actually go do - # anything with or to the local file system. - # - # Note that there's a very good chance we'll refactor this part of - # the architecture in some way as we really implement the interface(s) - # for remote file system Nodes. For example, the right architecture - # might be to have this be a subclass instead of a base class. - # Nevertheless, we're using this as a first step in that direction. - # - # We're not using chdir() yet because the calling subclass method - # needs to use os.chdir() directly to avoid recursion. Will we - # really need this one? + """ + This class implements an abstraction layer for operations involving + a local file system. Essentially, this wraps any function in + the os, os.path or shutil modules that we use to actually go do + anything with or to the local file system. + + Note that there's a very good chance we'll refactor this part of + the architecture in some way as we really implement the interface(s) + for remote file system Nodes. For example, the right architecture + might be to have this be a subclass instead of a base class. + Nevertheless, we're using this as a first step in that direction. + + We're not using chdir() yet because the calling subclass method + needs to use os.chdir() directly to avoid recursion. Will we + really need this one? + """ #def chdir(self, path): # return os.chdir(path) def chmod(self, path, mode): @@ -1389,10 +1416,10 @@ class FS(LocalFS): if not isinstance(d, SCons.Node.Node): d = self.Dir(d) self.Top.addRepository(d) - + def PyPackageDir(self, modulename): """Locate the directory of a given python module name - + For example scons might resolve to Windows: C:\Python27\Lib\site-packages\scons-2.5.1 Linux: /usr/lib/scons @@ -2462,11 +2489,42 @@ class FileNodeInfo(SCons.Node.NodeInfoBase): if key not in ('__weakref__',): setattr(self, key, value) + def __eq__(self, other): + return self.csig == other.csig and self.timestamp == other.timestamp and self.size == other.size + + def __ne__(self, other): + return not self.__eq__(other) + class FileBuildInfo(SCons.Node.BuildInfoBase): - __slots__ = () + """ + This is info loaded from sconsign. + + Attributes unique to FileBuildInfo: + dependency_map : Caches file->csig mapping + for all dependencies. Currently this is only used when using + MD5-timestamp decider. + It's used to ensure that we copy the correct + csig from previous build to be written to .sconsign when current build + is done. Previously the matching of csig to file was strictly by order + they appeared in bdepends, bsources, or bimplicit, and so a change in order + or count of any of these could yield writing wrong csig, and then false positive + rebuilds + """ + __slots__ = ('dependency_map') current_version_id = 2 + def __setattr__(self, key, value): + + # If any attributes are changed in FileBuildInfo, we need to + # invalidate the cached map of file name to content signature + # heald in dependency_map. Currently only used with + # MD5-timestamp decider + if key != 'dependency_map' and hasattr(self, 'dependency_map'): + del self.dependency_map + + return super(FileBuildInfo, self).__setattr__(key, value) + def convert_to_sconsign(self): """ Converts this FileBuildInfo object for writing to a .sconsign file @@ -3235,14 +3293,155 @@ class File(Base): def changed_state(self, target, prev_ni): return self.state != SCons.Node.up_to_date - def changed_timestamp_then_content(self, target, prev_ni): - if not self.changed_timestamp_match(target, prev_ni): + + # Caching node -> string mapping for the below method + __dmap_cache = {} + __dmap_sig_cache = {} + + + def _build_dependency_map(self, binfo): + """ + Build mapping from file -> signature + + Args: + self - self + binfo - buildinfo from node being considered + + Returns: + dictionary of file->signature mappings + """ + + # For an "empty" binfo properties like bsources + # do not exist: check this to avoid exception. + if (len(binfo.bsourcesigs) + len(binfo.bdependsigs) + \ + len(binfo.bimplicitsigs)) == 0: + return {} + + + # store this info so we can avoid regenerating it. + binfo.dependency_map = { str(child):signature for child, signature in zip(chain(binfo.bsources, binfo.bdepends, binfo.bimplicit), + chain(binfo.bsourcesigs, binfo.bdependsigs, binfo.bimplicitsigs))} + + return binfo.dependency_map + + def _get_previous_signatures(self, dmap): + """ + Return a list of corresponding csigs from previous + build in order of the node/files in children. + + Args: + self - self + dmap - Dictionary of file -> csig + + Returns: + List of csigs for provided list of children + """ + prev = [] + # MD5_TIMESTAMP_DEBUG = False + + if len(dmap) == 0: + if MD5_TIMESTAMP_DEBUG: print("Nothing dmap shortcutting") + return None + + if MD5_TIMESTAMP_DEBUG: print("len(dmap):%d"%len(dmap)) + # First try the simple name for node + c_str = str(self) + if MD5_TIMESTAMP_DEBUG: print("Checking :%s"%c_str) + df = dmap.get(c_str, None) + 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 + + 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/engine/SCons/Node/Python.py b/engine/SCons/Node/Python.py index f12e6ef..d235de8 100644 --- a/engine/SCons/Node/Python.py +++ b/engine/SCons/Node/Python.py @@ -5,7 +5,7 @@ Python nodes. """ # -# 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 @@ -27,7 +27,7 @@ Python nodes. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Node/Python.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Node/Python.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Node @@ -137,6 +137,10 @@ class Value(SCons.Node.Node): return contents def get_contents(self): + """ + Get contents for signature calculations. + :return: bytes + """ text_contents = self.get_text_contents() try: return text_contents.encode() @@ -155,12 +159,17 @@ class Value(SCons.Node.Node): def get_csig(self, calc=None): """Because we're a Python value node and don't have a real timestamp, we get to ignore the calculator and just use the - value contents.""" + value contents. + + Returns string. Ideally string of hex digits. (Not bytes) + """ try: return self.ninfo.csig except AttributeError: pass - contents = self.get_contents() + + contents = self.get_text_contents() + self.get_ninfo().csig = contents return contents diff --git a/engine/SCons/Node/__init__.py b/engine/SCons/Node/__init__.py index 299673f..889e7a4 100644 --- a/engine/SCons/Node/__init__.py +++ b/engine/SCons/Node/__init__.py @@ -22,7 +22,7 @@ be able to depend on any other type of "thing." from __future__ import print_function # -# 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 @@ -43,8 +43,9 @@ from __future__ import print_function # 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/__init__.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Node/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +import os import collections import copy from itertools import chain @@ -139,6 +140,7 @@ def exists_entry(node): node.disambiguate() return _exists_map[node._func_exists](node) + def exists_file(node): # Duplicate from source path if we are set up to do this. if node.duplicate and not node.is_derived() and not node.linked: @@ -155,7 +157,7 @@ def exists_file(node): # The source file does not exist. Make sure no old # copy remains in the variant directory. if print_duplicate: - print("dup: no src for %s, unlinking old variant copy"%self) + print("dup: no src for %s, unlinking old variant copy" % node) if exists_base(node) or node.islink(): node.fs.unlink(node.get_internal_path()) # Return None explicitly because the Base.exists() call @@ -246,6 +248,21 @@ _target_from_source_map = {0 : target_from_source_none, # used by it. # + +class DeciderNeedsNode(Exception): + """ + Indicate that the decider needs the node as well as the target and the dependency. + Normally the node and the target are the same, but in the case of repository + They may be different. Also the NodeInfo is retrieved from the node + """ + def __init__(self, call_this_decider): + """ + :param call_this_decider: to return the decider to call directly since deciders + are called through several levels of indirection + """ + self.decider = call_this_decider + + # # First, the single decider functions # @@ -269,6 +286,7 @@ def changed_since_last_build_node(node, target, prev_ni): """ raise NotImplementedError + def changed_since_last_build_alias(node, target, prev_ni): cur_csig = node.get_csig() try: @@ -276,19 +294,24 @@ def changed_since_last_build_alias(node, target, prev_ni): except AttributeError: return 1 + def changed_since_last_build_entry(node, target, prev_ni): node.disambiguate() return _decider_map[node.changed_since_last_build](node, target, prev_ni) + def changed_since_last_build_state_changed(node, target, prev_ni): - return (node.state != SCons.Node.up_to_date) + return node.state != SCons.Node.up_to_date + def decide_source(node, target, prev_ni): return target.get_build_env().decide_source(node, target, prev_ni) + def decide_target(node, target, prev_ni): return target.get_build_env().decide_target(node, target, prev_ni) + def changed_since_last_build_python(node, target, prev_ni): cur_csig = node.get_csig() try: @@ -380,6 +403,7 @@ class NodeInfoBase(object): """ state = other.__getstate__() self.__setstate__(state) + def format(self, field_list=None, names=0): if field_list is None: try: @@ -665,7 +689,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): executor.cleanup() def reset_executor(self): - "Remove cached executor; forces recompute when needed." + """Remove cached executor; forces recompute when needed.""" try: delattr(self, 'executor') except AttributeError: @@ -1136,7 +1160,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): binfo.bactsig = SCons.Util.MD5signature(executor.get_contents()) if self._specific_sources: - sources = [ s for s in self.sources if not s in ignore_set] + sources = [s for s in self.sources if not s in ignore_set] else: sources = executor.get_unignored_sources(self, self.ignore) @@ -1145,13 +1169,17 @@ class Node(object, with_metaclass(NoSlotsPyPy)): binfo.bsources = [s for s in sources if s not in seen and not seen.add(s)] binfo.bsourcesigs = [s.get_ninfo() for s in binfo.bsources] + binfo.bdepends = [d for d in self.depends if d not in ignore_set] + binfo.bdependsigs = [d.get_ninfo() for d in self.depends] - binfo.bdepends = self.depends - binfo.bdependsigs = [d.get_ninfo() for d in self.depends if d not in ignore_set] - - binfo.bimplicit = self.implicit or [] - binfo.bimplicitsigs = [i.get_ninfo() for i in binfo.bimplicit if i not in ignore_set] - + # Because self.implicit is initialized to None (and not empty list []) + # we have to handle this case + if not self.implicit: + binfo.bimplicit = [] + binfo.bimplicitsigs = [] + else: + binfo.bimplicit = [i for i in self.implicit if i not in ignore_set] + binfo.bimplicitsigs = [i.get_ninfo() for i in binfo.bimplicit] return binfo @@ -1213,7 +1241,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): return _exists_map[self._func_exists](self) def rexists(self): - """Does this node exist locally or in a repositiory?""" + """Does this node exist locally or in a repository?""" # There are no repositories by default: return _rexists_map[self._func_rexists](self) @@ -1452,13 +1480,18 @@ class Node(object, with_metaclass(NoSlotsPyPy)): result = True for child, prev_ni in zip(children, then): - if _decider_map[child.changed_since_last_build](child, self, prev_ni): - if t: Trace(': %s changed' % child) - result = True + try: + if _decider_map[child.changed_since_last_build](child, self, prev_ni): + if t: Trace(': %s changed' % child) + result = True + except DeciderNeedsNode as e: + if e.decider(self, prev_ni, node=node): + if t: Trace(': %s changed' % child) + result = True - contents = self.get_executor().get_contents() if self.has_builder(): import SCons.Util + contents = self.get_executor().get_contents() newsig = SCons.Util.MD5signature(contents) if bi.bactsig != newsig: if t: Trace(': bactsig %s != newsig %s' % (bi.bactsig, newsig)) @@ -1607,7 +1640,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): # so we only print them after running them through this lambda # to turn them into the right relative Node and then return # its string. - def stringify( s, E=self.dir.Entry ) : + def stringify( s, E=self.dir.Entry): if hasattr( s, 'dir' ) : return str(E(s)) return str(s) @@ -1616,15 +1649,21 @@ class Node(object, with_metaclass(NoSlotsPyPy)): removed = [x for x in old_bkids if not x in new_bkids] if removed: - removed = list(map(stringify, removed)) + removed = [stringify(r) for r in removed] fmt = "`%s' is no longer a dependency\n" lines.extend([fmt % s for s in removed]) for k in new_bkids: if not k in old_bkids: lines.append("`%s' is a new dependency\n" % stringify(k)) - elif _decider_map[k.changed_since_last_build](k, self, osig[k]): - lines.append("`%s' changed\n" % stringify(k)) + else: + try: + changed = _decider_map[k.changed_since_last_build](k, self, osig[k]) + except DeciderNeedsNode as e: + changed = e.decider(self, osig[k], node=self) + + if changed: + lines.append("`%s' changed\n" % stringify(k)) if len(lines) == 0 and old_bkids != new_bkids: lines.append("the dependency order changed:\n" + diff --git a/engine/SCons/Options/BoolOption.py b/engine/SCons/Options/BoolOption.py deleted file mode 100644 index 5f007cd..0000000 --- a/engine/SCons/Options/BoolOption.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright (c) 2001 - 2017 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# 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/Options/BoolOption.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" - -__doc__ = """Place-holder for the old SCons.Options module hierarchy - -This is for backwards compatibility. The new equivalent is the Variables/ -class hierarchy. These will have deprecation warnings added (some day), -and will then be removed entirely (some day). -""" - -import SCons.Variables -import SCons.Warnings - -warned = False - -def BoolOption(*args, **kw): - global warned - if not warned: - msg = "The BoolOption() function is deprecated; use the BoolVariable() function instead." - SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) - warned = True - return SCons.Variables.BoolVariable(*args, **kw) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/engine/SCons/Options/EnumOption.py b/engine/SCons/Options/EnumOption.py deleted file mode 100644 index b5bcb37..0000000 --- a/engine/SCons/Options/EnumOption.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright (c) 2001 - 2017 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# 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/Options/EnumOption.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" - -__doc__ = """Place-holder for the old SCons.Options module hierarchy - -This is for backwards compatibility. The new equivalent is the Variables/ -class hierarchy. These will have deprecation warnings added (some day), -and will then be removed entirely (some day). -""" - -import SCons.Variables -import SCons.Warnings - -warned = False - -def EnumOption(*args, **kw): - global warned - if not warned: - msg = "The EnumOption() function is deprecated; use the EnumVariable() function instead." - SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) - warned = True - return SCons.Variables.EnumVariable(*args, **kw) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/engine/SCons/Options/ListOption.py b/engine/SCons/Options/ListOption.py deleted file mode 100644 index 3f9d39d..0000000 --- a/engine/SCons/Options/ListOption.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright (c) 2001 - 2017 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# 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/Options/ListOption.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" - -__doc__ = """Place-holder for the old SCons.Options module hierarchy - -This is for backwards compatibility. The new equivalent is the Variables/ -class hierarchy. These will have deprecation warnings added (some day), -and will then be removed entirely (some day). -""" - -import SCons.Variables -import SCons.Warnings - -warned = False - -def ListOption(*args, **kw): - global warned - if not warned: - msg = "The ListOption() function is deprecated; use the ListVariable() function instead." - SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) - warned = True - return SCons.Variables.ListVariable(*args, **kw) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/engine/SCons/Options/PackageOption.py b/engine/SCons/Options/PackageOption.py deleted file mode 100644 index 074c0af..0000000 --- a/engine/SCons/Options/PackageOption.py +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright (c) 2001 - 2017 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# 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/Options/PackageOption.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" - -__doc__ = """Place-holder for the old SCons.Options module hierarchy - -This is for backwards compatibility. The new equivalent is the Variables/ -class hierarchy. These will have deprecation warnings added (some day), -and will then be removed entirely (some day). -""" - -import SCons.Variables -import SCons.Warnings - -warned = False - -def PackageOption(*args, **kw): - global warned - if not warned: - msg = "The PackageOption() function is deprecated; use the PackageVariable() function instead." - SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) - warned = True - return SCons.Variables.PackageVariable(*args, **kw) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/engine/SCons/Options/PathOption.py b/engine/SCons/Options/PathOption.py deleted file mode 100644 index 84751f9..0000000 --- a/engine/SCons/Options/PathOption.py +++ /dev/null @@ -1,76 +0,0 @@ -# -# Copyright (c) 2001 - 2017 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# 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/Options/PathOption.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" - -__doc__ = """Place-holder for the old SCons.Options module hierarchy - -This is for backwards compatibility. The new equivalent is the Variables/ -class hierarchy. These will have deprecation warnings added (some day), -and will then be removed entirely (some day). -""" - -import SCons.Variables -import SCons.Warnings - -warned = False - -class _PathOptionClass(object): - def warn(self): - global warned - if not warned: - msg = "The PathOption() function is deprecated; use the PathVariable() function instead." - SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) - warned = True - - def __call__(self, *args, **kw): - self.warn() - return SCons.Variables.PathVariable(*args, **kw) - - def PathAccept(self, *args, **kw): - self.warn() - return SCons.Variables.PathVariable.PathAccept(*args, **kw) - - def PathIsDir(self, *args, **kw): - self.warn() - return SCons.Variables.PathVariable.PathIsDir(*args, **kw) - - def PathIsDirCreate(self, *args, **kw): - self.warn() - return SCons.Variables.PathVariable.PathIsDirCreate(*args, **kw) - - def PathIsFile(self, *args, **kw): - self.warn() - return SCons.Variables.PathVariable.PathIsFile(*args, **kw) - - def PathExists(self, *args, **kw): - self.warn() - return SCons.Variables.PathVariable.PathExists(*args, **kw) - -PathOption = _PathOptionClass() - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/engine/SCons/Options/__init__.py b/engine/SCons/Options/__init__.py deleted file mode 100644 index 7a924f9..0000000 --- a/engine/SCons/Options/__init__.py +++ /dev/null @@ -1,67 +0,0 @@ -# -# Copyright (c) 2001 - 2017 The SCons Foundation -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# 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/Options/__init__.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" - -__doc__ = """Place-holder for the old SCons.Options module hierarchy - -This is for backwards compatibility. The new equivalent is the Variables/ -class hierarchy. These will have deprecation warnings added (some day), -and will then be removed entirely (some day). -""" - -import SCons.Variables -import SCons.Warnings - -from .BoolOption import BoolOption # okay -from .EnumOption import EnumOption # okay -from .ListOption import ListOption # naja -from .PackageOption import PackageOption # naja -from .PathOption import PathOption # okay - -warned = False - -class Options(SCons.Variables.Variables): - def __init__(self, *args, **kw): - global warned - if not warned: - msg = "The Options class is deprecated; use the Variables class instead." - SCons.Warnings.warn(SCons.Warnings.DeprecatedOptionsWarning, msg) - warned = True - SCons.Variables.Variables.__init__(self, *args, **kw) - - def AddOptions(self, *args, **kw): - return SCons.Variables.Variables.AddVariables(self, *args, **kw) - - def UnknownOptions(self, *args, **kw): - return SCons.Variables.Variables.UnknownVariables(self, *args, **kw) - - def FormatOptionHelpText(self, *args, **kw): - return SCons.Variables.Variables.FormatVariableHelpText(self, *args, - **kw) - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/engine/SCons/PathList.py b/engine/SCons/PathList.py index cce60e6..fa73a9d 100644 --- a/engine/SCons/PathList.py +++ b/engine/SCons/PathList.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/PathList.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/PathList.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __doc__ = """SCons.PathList diff --git a/engine/SCons/Platform/__init__.py b/engine/SCons/Platform/__init__.py index 83c68ee..e1cc941 100644 --- a/engine/SCons/Platform/__init__.py +++ b/engine/SCons/Platform/__init__.py @@ -20,7 +20,7 @@ their own platform definition. """ # -# 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 @@ -43,7 +43,7 @@ their own platform definition. # from __future__ import print_function -__revision__ = "src/engine/SCons/Platform/__init__.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Platform/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.compat @@ -87,6 +87,7 @@ def platform_default(): else: return sys.platform + def platform_module(name = platform_default()): """Return the imported module for the platform. @@ -117,11 +118,13 @@ def platform_module(name = platform_default()): setattr(SCons.Platform, name, mod) return sys.modules[full_name] + def DefaultToolList(platform, env): """Select a default tool list for the specified platform. """ return SCons.Tool.tool_list(platform, env) + class PlatformSpec(object): def __init__(self, name, generate): self.name = name @@ -133,6 +136,7 @@ class PlatformSpec(object): def __str__(self): return self.name + class TempFileMunge(object): """A callable class. You can set an Environment variable to this, then call it with a string argument, then it will perform temporary @@ -140,15 +144,20 @@ class TempFileMunge(object): line limitation. Example usage: - env["TEMPFILE"] = TempFileMunge - env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}" + env["TEMPFILE"] = TempFileMunge + env["LINKCOM"] = "${TEMPFILE('$LINK $TARGET $SOURCES','$LINKCOMSTR')}" By default, the name of the temporary file used begins with a - prefix of '@'. This may be configred for other tool chains by - setting '$TEMPFILEPREFIX'. - - env["TEMPFILEPREFIX"] = '-@' # diab compiler - env["TEMPFILEPREFIX"] = '-via' # arm tool chain + prefix of '@'. This may be configured for other tool chains by + setting '$TEMPFILEPREFIX': + env["TEMPFILEPREFIX"] = '-@' # diab compiler + env["TEMPFILEPREFIX"] = '-via' # arm tool chain + env["TEMPFILEPREFIX"] = '' # (the empty string) PC Lint + + You can configure the extension of the temporary file through the + TEMPFILESUFFIX variable, which defaults to '.lnk' (see comments + in the code below): + env["TEMPFILESUFFIX"] = '.lnt' # PC Lint """ def __init__(self, cmd, cmdstr = None): self.cmd = cmd @@ -185,21 +194,26 @@ class TempFileMunge(object): node = target[0] if SCons.Util.is_List(target) else target cmdlist = getattr(node.attributes, 'tempfile_cmdlist', None) \ if node is not None else None - if cmdlist is not None : + if cmdlist is not None: return cmdlist # We do a normpath because mktemp() has what appears to be # a bug in Windows that will use a forward slash as a path - # delimiter. Windows's link mistakes that for a command line + # delimiter. Windows' link mistakes that for a command line # switch and barfs. # - # We use the .lnk suffix for the benefit of the Phar Lap + # Default to the .lnk suffix for the benefit of the Phar Lap # linkloc linker, which likes to append an .lnk suffix if # none is given. - (fd, tmp) = tempfile.mkstemp('.lnk', text=True) + if env.has_key('TEMPFILESUFFIX'): + suffix = env.subst('$TEMPFILESUFFIX') + else: + suffix = '.lnk' + + fd, tmp = tempfile.mkstemp(suffix, text=True) native_tmp = SCons.Util.get_native_path(os.path.normpath(tmp)) - if env.get('SHELL',None) == 'sh': + if env.get('SHELL', None) == 'sh': # The sh shell will try to escape the backslashes in the # path, so unescape them. native_tmp = native_tmp.replace('\\', r'\\\\') @@ -239,8 +253,9 @@ class TempFileMunge(object): source) if self.cmdstr is not None else '' # Print our message only if XXXCOMSTR returns an empty string if len(cmdstr) == 0 : - print("Using tempfile "+native_tmp+" for command line:\n"+ - str(cmd[0]) + " " + " ".join(args)) + cmdstr = ("Using tempfile "+native_tmp+" for command line:\n"+ + str(cmd[0]) + " " + " ".join(args)) + self._print_cmd_str(target, source, env, cmdstr) # Store the temporary file command list into the target Node.attributes # to avoid creating two temporary files one for print and one for execute. @@ -252,6 +267,23 @@ class TempFileMunge(object): pass return cmdlist + def _print_cmd_str(self, target, source, env, cmdstr): + # check if the user has specified a cmd line print function + print_func = None + try: + get = env.get + except AttributeError: + pass + else: + print_func = get('PRINT_CMD_LINE_FUNC') + + # use the default action cmd line print if user did not supply one + if not print_func: + action = SCons.Action._ActionAction() + action.print_cmd_line(cmdstr, target, source, env) + else: + print_func(cmdstr, target, source, env) + def Platform(name = platform_default()): """Select a canned Platform specification. diff --git a/engine/SCons/Platform/aix.py b/engine/SCons/Platform/aix.py index 97ccbc1..7faddd9 100644 --- a/engine/SCons/Platform/aix.py +++ b/engine/SCons/Platform/aix.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/aix.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Platform/aix.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import subprocess diff --git a/engine/SCons/Platform/cygwin.py b/engine/SCons/Platform/cygwin.py index de22d4b..434d125 100644 --- a/engine/SCons/Platform/cygwin.py +++ b/engine/SCons/Platform/cygwin.py @@ -8,7 +8,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 @@ -30,11 +30,20 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/cygwin.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Platform/cygwin.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" + +import sys from . import posix from SCons.Platform import TempFileMunge +CYGWIN_DEFAULT_PATHS = [] +if sys.platform == 'win32': + CYGWIN_DEFAULT_PATHS = [ + r'C:\cygwin64\bin', + r'C:\cygwin\bin' + ] + def generate(env): posix.generate(env) diff --git a/engine/SCons/Platform/darwin.py b/engine/SCons/Platform/darwin.py index d9fa930..7f4b468 100644 --- a/engine/SCons/Platform/darwin.py +++ b/engine/SCons/Platform/darwin.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/darwin.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Platform/darwin.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from . import posix import os diff --git a/engine/SCons/Platform/hpux.py b/engine/SCons/Platform/hpux.py index 28a3cd2..cc97d39 100644 --- a/engine/SCons/Platform/hpux.py +++ b/engine/SCons/Platform/hpux.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/hpux.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Platform/hpux.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from . import posix diff --git a/engine/SCons/Platform/irix.py b/engine/SCons/Platform/irix.py index 8682c01..5df080a 100644 --- a/engine/SCons/Platform/irix.py +++ b/engine/SCons/Platform/irix.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/irix.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Platform/irix.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from . import posix diff --git a/engine/SCons/Platform/mingw.py b/engine/SCons/Platform/mingw.py new file mode 100644 index 0000000..f3f7e44 --- /dev/null +++ b/engine/SCons/Platform/mingw.py @@ -0,0 +1,39 @@ +"""SCons.Platform.mingw + +Platform-specific initialization for the MinGW system. + +""" + +# +# 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 +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# 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/Platform/mingw.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" + +import sys + +MINGW_DEFAULT_PATHS = [] +if sys.platform == 'win32': + MINGW_DEFAULT_PATHS = [ + r'C:\msys64', + r'C:\msys' + ] \ No newline at end of file diff --git a/engine/SCons/Platform/os2.py b/engine/SCons/Platform/os2.py index 68fbc3a..a680f94 100644 --- a/engine/SCons/Platform/os2.py +++ b/engine/SCons/Platform/os2.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/os2.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Platform/os2.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from . import win32 def generate(env): diff --git a/engine/SCons/Platform/posix.py b/engine/SCons/Platform/posix.py index e76e564..aa43f51 100644 --- a/engine/SCons/Platform/posix.py +++ b/engine/SCons/Platform/posix.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/posix.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Platform/posix.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import errno import os @@ -41,6 +41,8 @@ import select import SCons.Util from SCons.Platform import TempFileMunge +from SCons.Platform.virtualenv import ImportVirtualenv +from SCons.Platform.virtualenv import ignore_virtualenv, enable_virtualenv exitvalmap = { 2 : 127, @@ -48,7 +50,7 @@ exitvalmap = { } def escape(arg): - "escape shell special characters" + """escape shell special characters""" slash = '\\' special = '"$' @@ -119,6 +121,9 @@ def generate(env): # Must be able to have GCC and DMD work in the same build, so: env['__DRPATH'] = '$_DRPATH' + if enable_virtualenv and not ignore_virtualenv: + ImportVirtualenv(env) + # Local Variables: # tab-width:4 # indent-tabs-mode:nil diff --git a/engine/SCons/Platform/sunos.py b/engine/SCons/Platform/sunos.py index 9e12503..2ec4c99 100644 --- a/engine/SCons/Platform/sunos.py +++ b/engine/SCons/Platform/sunos.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/sunos.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Platform/sunos.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from . import posix diff --git a/engine/SCons/Platform/virtualenv.py b/engine/SCons/Platform/virtualenv.py new file mode 100644 index 0000000..4cfb6e1 --- /dev/null +++ b/engine/SCons/Platform/virtualenv.py @@ -0,0 +1,120 @@ +"""SCons.Platform.virtualenv + +Support for virtualenv. +""" + +# +# 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 +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# 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/Platform/virtualenv.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" + +import os +import sys +import SCons.Util + + +virtualenv_enabled_by_default = False + + +def _enable_virtualenv_default(): + return SCons.Util.get_os_env_bool('SCONS_ENABLE_VIRTUALENV', virtualenv_enabled_by_default) + + +def _ignore_virtualenv_default(): + return SCons.Util.get_os_env_bool('SCONS_IGNORE_VIRTUALENV', False) + + +enable_virtualenv = _enable_virtualenv_default() +ignore_virtualenv = _ignore_virtualenv_default() +virtualenv_variables = ['VIRTUAL_ENV', 'PIPENV_ACTIVE'] + + +def _running_in_virtualenv(): + """Returns True, if scons is executed within a virtualenv""" + # see https://stackoverflow.com/a/42580137 + return (hasattr(sys, 'real_prefix') or + (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix)) + + +def _is_path_in(path, base): + """Returns true, if **path** is located under the **base** directory.""" + if not path or not base: # empty path may happen, base too + return False + rp = os.path.relpath(path, base) + return ((not rp.startswith(os.path.pardir)) and (not rp == os.path.curdir)) + + +def _inject_venv_variables(env): + if 'ENV' not in env: + env['ENV'] = {} + ENV = env['ENV'] + for name in virtualenv_variables: + try: + ENV[name] = os.environ[name] + except KeyError: + pass + +def _inject_venv_path(env, path_list=None): + """Modify environment such that SCons will take into account its virtualenv + when running external tools.""" + if path_list is None: + path_list = os.getenv('PATH') + env.PrependENVPath('PATH', select_paths_in_venv(path_list)) + + +def select_paths_in_venv(path_list): + """Returns a list of paths from **path_list** which are under virtualenv's + home directory.""" + if SCons.Util.is_String(path_list): + path_list = path_list.split(os.path.pathsep) + # Find in path_list the paths under the virtualenv's home + return [path for path in path_list if IsInVirtualenv(path)] + + +def ImportVirtualenv(env): + """Copies virtualenv-related environment variables from OS environment + to ``env['ENV']`` and prepends virtualenv's PATH to ``env['ENV']['PATH']``. + """ + _inject_venv_variables(env) + _inject_venv_path(env) + + +def Virtualenv(): + """Returns path to the virtualenv home if scons is executing within a + virtualenv or None, if not.""" + if _running_in_virtualenv(): + return sys.prefix + return None + + +def IsInVirtualenv(path): + """Returns True, if **path** is under virtualenv's home directory. If not, + or if we don't use virtualenv, returns False.""" + return _is_path_in(path, Virtualenv()) + + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/engine/SCons/Platform/win32.py b/engine/SCons/Platform/win32.py index 60935ca..756f6d6 100644 --- a/engine/SCons/Platform/win32.py +++ b/engine/SCons/Platform/win32.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/win32.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Platform/win32.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import os.path @@ -39,8 +39,14 @@ import tempfile from SCons.Platform.posix import exitvalmap from SCons.Platform import TempFileMunge +from SCons.Platform.virtualenv import ImportVirtualenv +from SCons.Platform.virtualenv import ignore_virtualenv, enable_virtualenv import SCons.Util +CHOCO_DEFAULT_PATH = [ + r'C:\ProgramData\chocolatey\bin' +] + try: import msvcrt import win32api @@ -80,16 +86,8 @@ else: win32con.HANDLE_FLAG_INHERIT, 0) file = _scons_file else: - import io - for io_class in ['BufferedReader', 'BufferedWriter', 'BufferedRWPair', - 'BufferedRandom', 'TextIOWrapper']: - _builtin_file = getattr(io, io_class) - class _scons_file(_builtin_file): - def __init__(self, *args, **kw): - _builtin_file.__init__(self, *args, **kw) - win32api.SetHandleInformation(msvcrt.get_osfhandle(self.fileno()), - win32con.HANDLE_FLAG_INHERIT, 0) - setattr(io, io_class, _scons_file) + # No longer needed for python 3.4 and above. Files are opened non sharable + pass @@ -132,7 +130,7 @@ try: # Without this, python can randomly crash while using -jN. # See the python bug at http://bugs.python.org/issue6476 # and SCons issue at - # http://scons.tigris.org/issues/show_bug.cgi?id=2449 + # https://github.com/SCons/scons/issues/2449 def spawnve(mode, file, args, env): spawn_lock.acquire() try: @@ -200,11 +198,11 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr): except OSError as e: # catch any error try: - ret = exitvalmap[e[0]] + ret = exitvalmap[e.errno] except KeyError: - sys.stderr.write("scons: unknown OSError exception code %d - %s: %s\n" % (e[0], cmd, e[1])) + sys.stderr.write("scons: unknown OSError exception code %d - %s: %s\n" % (e.errno, cmd, e.strerror)) if stderr is not None: - stderr.write("scons: %s: %s\n" % (cmd, e[1])) + stderr.write("scons: %s: %s\n" % (cmd, e.strerror)) # copy child output from tempfiles to our streams # and do clean up stuff if stdout is not None and stdoutRedirected == 0: @@ -436,7 +434,7 @@ def generate(env): if v: env['ENV']['COMSPEC'] = v - env.AppendENVPath('PATH', get_system_root() + '\System32') + env.AppendENVPath('PATH', get_system_root() + '\\System32') env['ENV']['PATHEXT'] = '.COM;.EXE;.BAT;.CMD' env['OBJPREFIX'] = '' @@ -462,6 +460,9 @@ def generate(env): env['HOST_OS'] = 'win32' env['HOST_ARCH'] = get_architecture().arch + if enable_virtualenv and not ignore_virtualenv: + ImportVirtualenv(env) + # Local Variables: # tab-width:4 diff --git a/engine/SCons/SConf.py b/engine/SCons/SConf.py index 0c4b402..66592d4 100644 --- a/engine/SCons/SConf.py +++ b/engine/SCons/SConf.py @@ -12,7 +12,7 @@ libraries are installed, if some command line options are supported etc. """ # -# 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 @@ -35,7 +35,7 @@ libraries are installed, if some command line options are supported etc. # from __future__ import print_function -__revision__ = "src/engine/SCons/SConf.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/SConf.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.compat @@ -56,6 +56,7 @@ import SCons.Warnings import SCons.Conftest from SCons.Debug import Trace +from SCons.Node import DeciderNeedsNode # Turn off the Conftest error logging SCons.Conftest.LogInputFiles = 0 @@ -323,18 +324,6 @@ class SConfBuildTask(SCons.Taskmaster.AlwaysTask): s = sys.stdout = sys.stderr = Streamer(sys.stdout) try: env = self.targets[0].get_build_env() - if cache_mode == FORCE: - # Set up the Decider() to force rebuilds by saying - # that every source has changed. Note that we still - # call the environment's underlying source decider so - # that the correct .sconsign info will get calculated - # and keep the build state consistent. - def force_build(dependency, target, prev_ni, - env_decider=env.decide_source): - env_decider(dependency, target, prev_ni) - return True - if env.decide_source.__code__ is not force_build.__code__: - env.Decider(force_build) env['PSTDOUT'] = env['PSTDERR'] = s try: sconf.cached = 0 @@ -405,12 +394,42 @@ class SConfBase(object): build tests in the VariantDir, not in the SourceDir) """ global SConfFS + + # Now create isolated override so setting source_decider doesn't affect parent Environment + if cache_mode == FORCE: + self.original_env = env + self.env = env.Clone() + + # Set up the Decider() to force rebuilds by saying + # that every source has changed. Note that we still + # call the environment's underlying source decider so + # that the correct .sconsign info will get calculated + # and keep the build state consistent. + def force_build(dependency, target, prev_ni, + env_decider=env.decide_source, + node=None): + try: + env_decider(dependency, target, prev_ni) + except DeciderNeedsNode as e: + e.decider(target, prev_ni, node=target) + except Exception as e: + raise e + return True + + if self.env.decide_source.__code__ is not force_build.__code__: + self.env.Decider(force_build) + + else: + self.env = env + + # print("Override env:%s"%env) + if not SConfFS: SConfFS = SCons.Node.FS.default_fs or \ SCons.Node.FS.FS(env.fs.pathTop) if sconf_global is not None: raise SCons.Errors.UserError - self.env = env + if log_file is not None: log_file = SConfFS.File(env.subst(log_file)) self.logfile = log_file @@ -449,6 +468,7 @@ class SConfBase(object): env = sconf.Finish() """ self._shutdown() + return self.env def Define(self, name, value = None, comment = None): @@ -503,6 +523,20 @@ class SConfBase(object): n.attributes = SCons.Node.Node.Attrs() n.attributes.keep_targetinfo = 1 + if True: + # Some checkers have intermediate files (for example anything that compiles a c file into a program to run + # Those files need to be set to not release their target info, otherwise taskmaster will throw a + # Nonetype not callable + for c in n.children(scan=False): + # Keep debug code here. + # print("Checking [%s] for builders and then setting keep_targetinfo"%c) + if c.has_builder(): + n.store_info = 0 + if not hasattr(c, 'attributes'): + c.attributes = SCons.Node.Node.Attrs() + c.attributes.keep_targetinfo = 1 + # pass + ret = 1 try: @@ -609,7 +643,7 @@ class SConfBase(object): ok = self.TryBuild(self.env.SConfActionBuilder, text, extension) del self.env['BUILDERS']['SConfActionBuilder'] if ok: - outputStr = self.lastTarget.get_contents().decode() + outputStr = self.lastTarget.get_text_contents() return (1, outputStr) return (0, "") @@ -739,10 +773,18 @@ class SConfBase(object): self.logstream.write("\n") self.logstream.close() self.logstream = None - # remove the SConfSourceBuilder from the environment - blds = self.env['BUILDERS'] - del blds['SConfSourceBuilder'] - self.env.Replace( BUILDERS=blds ) + + # Now reset the decider if we changed it due to --config=force + # We saved original Environment passed in and cloned it to isolate + # it from being changed. + if cache_mode == FORCE: + self.env.Decider(self.original_env.decide_source) + + # remove the SConfSourceBuilder from the environment + blds = self.env['BUILDERS'] + del blds['SConfSourceBuilder'] + self.env.Replace( BUILDERS=blds ) + self.active = 0 sconf_global = None if not self.config_h is None: @@ -1000,7 +1042,7 @@ def CheckLib(context, library = None, symbol = "main", compiles without flags. """ - if library == []: + if not library: library = [None] if not SCons.Util.is_List(library): diff --git a/engine/SCons/SConsign.py b/engine/SCons/SConsign.py index c619bc0..1fec6a0 100644 --- a/engine/SCons/SConsign.py +++ b/engine/SCons/SConsign.py @@ -5,7 +5,7 @@ Writing and reading information to the .sconsign file or files. """ # -# 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 @@ -29,7 +29,7 @@ Writing and reading information to the .sconsign file or files. from __future__ import print_function -__revision__ = "src/engine/SCons/SConsign.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/SConsign.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.compat @@ -394,7 +394,8 @@ class DirFile(Dir): # here, or in any of the following calls, would get # raised, indicating something like a potentially # serious disk or network issue. - open(self.sconsign, 'wb').write(open(fname, 'rb').read()) + with open(self.sconsign, 'wb') as f, open(fname, 'rb') as f2: + f.write(f2.read()) os.chmod(self.sconsign, mode) try: os.unlink(temp) diff --git a/engine/SCons/Scanner/C.py b/engine/SCons/Scanner/C.py index a34360e..6f59edb 100644 --- a/engine/SCons/Scanner/C.py +++ b/engine/SCons/Scanner/C.py @@ -5,7 +5,7 @@ This module implements the dependency scanner for C/C++ code. """ # -# 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 @@ -27,7 +27,7 @@ This module implements the dependency scanner for C/C++ code. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/C.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Scanner/C.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Node.FS import SCons.Scanner diff --git a/engine/SCons/Scanner/D.py b/engine/SCons/Scanner/D.py index 4dde4b8..543cc3c 100644 --- a/engine/SCons/Scanner/D.py +++ b/engine/SCons/Scanner/D.py @@ -8,7 +8,7 @@ Coded by Andy Friesen """ # -# 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 @@ -30,7 +30,7 @@ Coded by Andy Friesen # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/D.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Scanner/D.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Scanner diff --git a/engine/SCons/Scanner/Dir.py b/engine/SCons/Scanner/Dir.py index 48352e5..1b82046 100644 --- a/engine/SCons/Scanner/Dir.py +++ b/engine/SCons/Scanner/Dir.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/Scanner/Dir.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Scanner/Dir.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Node.FS import SCons.Scanner diff --git a/engine/SCons/Scanner/Fortran.py b/engine/SCons/Scanner/Fortran.py index 79ce628..b52269f 100644 --- a/engine/SCons/Scanner/Fortran.py +++ b/engine/SCons/Scanner/Fortran.py @@ -5,7 +5,7 @@ This module implements the dependency scanner for Fortran code. """ # -# 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 @@ This module implements the dependency scanner for Fortran code. # 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/Scanner/Fortran.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Scanner/Fortran.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import re @@ -78,7 +78,7 @@ class F90Scanner(SCons.Scanner.Classic): def scan(self, node, env, path=()): # cache the includes list in node so we only scan it once: - if node.includes != None: + if node.includes is not None: mods_and_includes = node.includes else: # retrieve all included filenames diff --git a/engine/SCons/Scanner/IDL.py b/engine/SCons/Scanner/IDL.py index f3b6b5e..843a147 100644 --- a/engine/SCons/Scanner/IDL.py +++ b/engine/SCons/Scanner/IDL.py @@ -6,7 +6,7 @@ Definition Language) files. """ # -# 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 @@ -28,7 +28,7 @@ Definition Language) files. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/IDL.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Scanner/IDL.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Node.FS import SCons.Scanner diff --git a/engine/SCons/Scanner/LaTeX.py b/engine/SCons/Scanner/LaTeX.py index 89925ff..d9e3692 100644 --- a/engine/SCons/Scanner/LaTeX.py +++ b/engine/SCons/Scanner/LaTeX.py @@ -5,7 +5,7 @@ This module implements the dependency scanner for LaTeX code. """ # -# 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 @@ -27,7 +27,7 @@ This module implements the dependency scanner for LaTeX code. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/LaTeX.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Scanner/LaTeX.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path import re @@ -128,8 +128,8 @@ class LaTeX(SCons.Scanner.Base): Unlike most scanners, which use regular expressions that just return the included file name, this returns a tuple consisting of the keyword for the inclusion ("include", "includegraphics", - "input", or "bibliography"), and then the file name itself. - Based on a quick look at LaTeX documentation, it seems that we + "input", or "bibliography"), and then the file name itself. + Based on a quick look at LaTeX documentation, it seems that we should append .tex suffix for the "include" keywords, append .tex if there is no extension for the "input" keyword, and need to add .bib for the "bibliography" keyword that does not accept extensions by itself. @@ -137,7 +137,7 @@ class LaTeX(SCons.Scanner.Base): Finally, if there is no extension for an "includegraphics" keyword latex will append .ps or .eps to find the file, while pdftex may use .pdf, .jpg, .tif, .mps, or .png. - + The actual subset and search order may be altered by DeclareGraphicsExtensions command. This complication is ignored. The default order corresponds to experimentation with teTeX:: @@ -333,7 +333,7 @@ class LaTeX(SCons.Scanner.Base): line_continues_a_comment = False for line in text.splitlines(): line,comment = self.comment_re.findall(line)[0] - if line_continues_a_comment == True: + if line_continues_a_comment: out[-1] = out[-1] + line.lstrip() else: out.append(line) @@ -349,7 +349,7 @@ class LaTeX(SCons.Scanner.Base): # path_dict = dict(list(path)) # add option for whitespace (\s) before the '[' noopt_cre = re.compile('\s*\[.*$') - if node.includes != None: + if node.includes is not None: includes = node.includes else: text = self.canonical_text(node.get_text_contents()) @@ -386,8 +386,8 @@ class LaTeX(SCons.Scanner.Base): directory of the main file just as latex does""" path_dict = dict(list(path)) - - queue = [] + + queue = [] queue.extend( self.scan(node) ) seen = {} @@ -402,7 +402,7 @@ class LaTeX(SCons.Scanner.Base): source_dir = node.get_dir() #for include in includes: while queue: - + include = queue.pop() inc_type, inc_subdir, inc_filename = include diff --git a/engine/SCons/Scanner/Prog.py b/engine/SCons/Scanner/Prog.py index 3f1a069..78deb18 100644 --- a/engine/SCons/Scanner/Prog.py +++ b/engine/SCons/Scanner/Prog.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/Scanner/Prog.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Scanner/Prog.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Node import SCons.Node.FS diff --git a/engine/SCons/Scanner/RC.py b/engine/SCons/Scanner/RC.py index 611eb62..cf970c5 100644 --- a/engine/SCons/Scanner/RC.py +++ b/engine/SCons/Scanner/RC.py @@ -6,7 +6,7 @@ Definition Language) files. """ # -# 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 @@ -28,7 +28,7 @@ Definition Language) files. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/RC.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Scanner/RC.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import re diff --git a/engine/SCons/Scanner/SWIG.py b/engine/SCons/Scanner/SWIG.py index 25a3841..6bffbe3 100644 --- a/engine/SCons/Scanner/SWIG.py +++ b/engine/SCons/Scanner/SWIG.py @@ -5,7 +5,7 @@ This module implements the dependency scanner for SWIG code. """ # -# 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 @@ -27,7 +27,7 @@ This module implements the dependency scanner for SWIG code. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/SWIG.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Scanner/SWIG.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Scanner diff --git a/engine/SCons/Scanner/__init__.py b/engine/SCons/Scanner/__init__.py index e8868b8..b5df1cc 100644 --- a/engine/SCons/Scanner/__init__.py +++ b/engine/SCons/Scanner/__init__.py @@ -5,7 +5,7 @@ The Scanner package for the SCons software construction utility. """ # -# 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 @@ -27,7 +27,7 @@ The Scanner package for the SCons software construction utility. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/__init__.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Scanner/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import re diff --git a/engine/SCons/Script/Interactive.py b/engine/SCons/Script/Interactive.py index 7a5e2a4..0e73204 100644 --- a/engine/SCons/Script/Interactive.py +++ b/engine/SCons/Script/Interactive.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. from __future__ import print_function -__revision__ = "src/engine/SCons/Script/Interactive.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Script/Interactive.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __doc__ = """ SCons interactive mode diff --git a/engine/SCons/Script/Main.py b/engine/SCons/Script/Main.py index 0c23612..c677937 100644 --- a/engine/SCons/Script/Main.py +++ b/engine/SCons/Script/Main.py @@ -17,7 +17,7 @@ unsupported_python_version = (2, 6, 0) deprecated_python_version = (2, 7, 0) -# 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 @@ -38,7 +38,7 @@ deprecated_python_version = (2, 7, 0) # 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/Script/Main.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Script/Main.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.compat @@ -48,6 +48,7 @@ import sys import time import traceback import sysconfig +import platform import SCons.CacheDir import SCons.Debug @@ -58,6 +59,7 @@ import SCons.Job import SCons.Node import SCons.Node.FS import SCons.Platform +import SCons.Platform.virtualenv import SCons.SConf import SCons.Script import SCons.Taskmaster @@ -622,7 +624,7 @@ def _SConstruct_exists(dirname='', repositories=[], filelist=None): current directory. """ if not filelist: - filelist = ['SConstruct', 'Sconstruct', 'sconstruct'] + filelist = ['SConstruct', 'Sconstruct', 'sconstruct', 'SConstruct.py', 'Sconstruct.py', 'sconstruct.py'] for file in filelist: sfile = os.path.join(dirname, file) if os.path.isfile(sfile): @@ -862,6 +864,13 @@ def _main(parser): for warning_type, message in delayed_warnings: SCons.Warnings.warn(warning_type, message) + if not SCons.Platform.virtualenv.virtualenv_enabled_by_default: + if options.enable_virtualenv: + SCons.Platform.virtualenv.enable_virtualenv = True + + if options.ignore_virtualenv: + SCons.Platform.virtualenv.ignore_virtualenv = True + if options.diskcheck: SCons.Node.FS.set_diskcheck(options.diskcheck) @@ -1253,7 +1262,11 @@ def _build_targets(fs, options, targets, target_top): BuildTask.options = options - python_has_threads = sysconfig.get_config_var('WITH_THREAD') + is_pypy = platform.python_implementation() == 'PyPy' + # As of 3.7, python removed support for threadless platforms. + # See https://www.python.org/dev/peps/pep-0011/ + is_37_or_later = sys.version_info >= (3, 7) + python_has_threads = sysconfig.get_config_var('WITH_THREAD') or is_pypy or is_37_or_later # to check if python configured with threads. global num_jobs num_jobs = options.num_jobs @@ -1347,7 +1360,7 @@ def main(): pass parts.append(version_string("engine", SCons)) parts.append(path_string("engine", SCons)) - parts.append("Copyright (c) 2001 - 2017 The SCons Foundation") + parts.append("Copyright (c) 2001 - 2019 The SCons Foundation") version = ''.join(parts) from . import SConsOptions @@ -1363,7 +1376,7 @@ def main(): revert_io() except SystemExit as s: if s: - exit_status = s + exit_status = s.code except KeyboardInterrupt: print("scons: Build interrupted.") sys.exit(2) diff --git a/engine/SCons/Script/SConsOptions.py b/engine/SCons/Script/SConsOptions.py index f9778e6..65e1868 100644 --- a/engine/SCons/Script/SConsOptions.py +++ b/engine/SCons/Script/SConsOptions.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/SConsOptions.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Script/SConsOptions.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import optparse import re @@ -38,6 +38,7 @@ except ImportError: _ = gettext import SCons.Node.FS +import SCons.Platform.virtualenv import SCons.Warnings OptionValueError = optparse.OptionValueError @@ -706,6 +707,12 @@ def Parser(version): action="callback", callback=opt_duplicate, help=opt_duplicate_help) + if not SCons.Platform.virtualenv.virtualenv_enabled_by_default: + op.add_option('--enable-virtualenv', + dest="enable_virtualenv", + action="store_true", + help="Import certain virtualenv variables to SCons") + op.add_option('-f', '--file', '--makefile', '--sconstruct', nargs=1, type="string", dest="file", default=[], @@ -733,6 +740,11 @@ def Parser(version): help="Search DIR for imported Python modules.", metavar="DIR") + op.add_option('--ignore-virtualenv', + dest="ignore_virtualenv", + action="store_true", + help="Do not import virtualenv variables to SCons") + op.add_option('--implicit-cache', dest='implicit_cache', default=False, action="store_true", @@ -906,6 +918,7 @@ def Parser(version): action="append", help="Search REPOSITORY for source and target files.") + # Options from Make and Cons classic that we do not yet support, # but which we may support someday and whose (potential) meanings # we don't want to change. These all get a "the -X option is not @@ -978,7 +991,6 @@ def Parser(version): action="callback", callback=opt_not_yet, # help="Warn when an undefined variable is referenced." help=SUPPRESS_HELP) - return op # Local Variables: diff --git a/engine/SCons/Script/SConscript.py b/engine/SCons/Script/SConscript.py index b366c4c..8377a54 100644 --- a/engine/SCons/Script/SConscript.py +++ b/engine/SCons/Script/SConscript.py @@ -6,7 +6,7 @@ files. """ # -# 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 @@ -27,7 +27,7 @@ files. # 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/Script/SConscript.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Script/SConscript.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons import SCons.Action @@ -153,6 +153,35 @@ def Return(*vars, **kw): stack_bottom = '% Stack boTTom %' # hard to define a variable w/this name :) +def handle_missing_SConscript(f, must_exist=None): + """Take appropriate action on missing file in SConscript() call. + + Print a warning or raise an exception on missing file. + On first warning, print a deprecation message. + + Args: + f (str): path of missing configuration file + must_exist (bool): raise exception if file does not exist + + Raises: + UserError if 'must_exist' is True or if global + SCons.Script._no_missing_sconscript is True. + """ + + if must_exist or (SCons.Script._no_missing_sconscript and must_exist is not False): + msg = "Fatal: missing SConscript '%s'" % f.get_internal_path() + raise SCons.Errors.UserError(msg) + + if SCons.Script._warn_missing_sconscript_deprecated: + msg = "Calling missing SConscript without error is deprecated.\n" + \ + "Transition by adding must_exist=0 to SConscript calls.\n" + \ + "Missing SConscript '%s'" % f.get_internal_path() + SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg) + SCons.Script._warn_missing_sconscript_deprecated = False + else: + msg = "Ignoring missing SConscript '%s'" % f.get_internal_path() + SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg) + def _SConscript(fs, *files, **kw): top = fs.Top sd = fs.SConstruct_dir.rdir() @@ -249,11 +278,12 @@ def _SConscript(fs, *files, **kw): pass try: try: -# _file_ = SCons.Util.to_str(_file_) if Main.print_time: time1 = time.time() - exec(compile(_file_.read(), _file_.name, 'exec'), - call_stack[-1].globals) + scriptdata = _file_.read() + scriptname = _file_.name + _file_.close() + exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals) except SConscriptReturn: pass finally: @@ -264,8 +294,7 @@ def _SConscript(fs, *files, **kw): if old_file is not None: call_stack[-1].globals.update({__file__:old_file}) else: - SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, - "Ignoring missing SConscript '%s'" % f.get_internal_path()) + handle_missing_SConscript(f, kw.get('must_exist', None)) finally: SCons.Script.sconscript_reading = SCons.Script.sconscript_reading - 1 @@ -369,9 +398,9 @@ class SConsEnvironment(SCons.Environment.Base): something like 3.2b1.""" version = version_string.split(' ')[0].split('.') v_major = int(version[0]) - v_minor = int(re.match('\d+', version[1]).group()) + v_minor = int(re.match(r'\d+', version[1]).group()) if len(version) >= 3: - v_revision = int(re.match('\d+', version[2]).group()) + v_revision = int(re.match(r'\d+', version[2]).group()) else: v_revision = 0 return v_major, v_minor, v_revision @@ -523,6 +552,31 @@ class SConsEnvironment(SCons.Environment.Base): raise SCons.Errors.UserError("Import of non-existent variable '%s'"%x) def SConscript(self, *ls, **kw): + """Execute SCons configuration files. + + Parameters: + *ls (str or list): configuration file(s) to execute. + + Keyword arguments: + dirs (list): execute SConscript in each listed directory. + name (str): execute script 'name' (used only with 'dirs'). + exports (list or dict): locally export variables the + called script(s) can import. + variant_dir (str): mirror sources needed for the build in + a variant directory to allow building in it. + duplicate (bool): physically duplicate sources instead of just + adjusting paths of derived files (used only with 'variant_dir') + (default is True). + must_exist (bool): fail if a requested script is missing + (default is False, default is deprecated). + + Returns: + list of variables returned by the called script + + Raises: + UserError: a script is not found and such exceptions are enabled. + """ + if 'build_dir' in kw: msg = """The build_dir keyword has been deprecated; use the variant_dir keyword instead.""" SCons.Warnings.warn(SCons.Warnings.DeprecatedBuildDirWarning, msg) diff --git a/engine/SCons/Script/__init__.py b/engine/SCons/Script/__init__.py index c28f211..d78e746 100644 --- a/engine/SCons/Script/__init__.py +++ b/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 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Script/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" 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/engine/SCons/Subst.py b/engine/SCons/Subst.py index 9d0ec2a..5fae669 100644 --- a/engine/SCons/Subst.py +++ b/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 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Subst.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" 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 diff --git a/engine/SCons/Taskmaster.py b/engine/SCons/Taskmaster.py index 5dfc03e..48a8241 100644 --- a/engine/SCons/Taskmaster.py +++ b/engine/SCons/Taskmaster.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 @@ -54,7 +54,7 @@ __doc__ = """ target(s) that it decides need to be evaluated and/or built. """ -__revision__ = "src/engine/SCons/Taskmaster.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Taskmaster.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from itertools import chain import operator @@ -470,14 +470,23 @@ class Task(object): pending_children.discard(t) for p in t.waiting_parents: parents[p] = parents.get(p, 0) + 1 + t.waiting_parents = set() for t in targets: if t.side_effects is not None: for s in t.side_effects: if s.get_state() == NODE_EXECUTING: s.set_state(NODE_NO_STATE) + + # The side-effects may have been transferred to + # NODE_NO_STATE by executed_with{,out}_callbacks, but was + # not taken out of the waiting parents/pending children + # data structures. Check for that now. + if s.get_state() == NODE_NO_STATE and s.waiting_parents: + pending_children.discard(s) for p in s.waiting_parents: parents[p] = parents.get(p, 0) + 1 + s.waiting_parents = set() for p in s.waiting_s_e: if p.ref_count == 0: self.tm.candidates.append(p) diff --git a/engine/SCons/Tool/386asm.py b/engine/SCons/Tool/386asm.py index a1d03ff..c01f09e 100644 --- a/engine/SCons/Tool/386asm.py +++ b/engine/SCons/Tool/386asm.py @@ -10,7 +10,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 @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/386asm.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/386asm.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from SCons.Tool.PharLapCommon import addPharLapPaths import SCons.Util diff --git a/engine/SCons/Tool/DCommon.py b/engine/SCons/Tool/DCommon.py index c41b54d..c4e42d0 100644 --- a/engine/SCons/Tool/DCommon.py +++ b/engine/SCons/Tool/DCommon.py @@ -9,7 +9,7 @@ Coded by Russel Winder (russel@winder.org.uk) """ # -# 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 @@ Coded by Russel Winder (russel@winder.org.uk) # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/DCommon.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/DCommon.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path diff --git a/engine/SCons/Tool/FortranCommon.py b/engine/SCons/Tool/FortranCommon.py index 9976b2b..9287396 100644 --- a/engine/SCons/Tool/FortranCommon.py +++ b/engine/SCons/Tool/FortranCommon.py @@ -5,7 +5,7 @@ Stuff for processing Fortran, common to all fortran dialects. """ # -# 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 @@ -28,7 +28,7 @@ Stuff for processing Fortran, common to all fortran dialects. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/FortranCommon.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/FortranCommon.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import re import os.path diff --git a/engine/SCons/Tool/GettextCommon.py b/engine/SCons/Tool/GettextCommon.py index 65bcab4..37da33a 100644 --- a/engine/SCons/Tool/GettextCommon.py +++ b/engine/SCons/Tool/GettextCommon.py @@ -3,7 +3,7 @@ Used by several tools of `gettext` toolset. """ -# 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,7 +24,7 @@ Used by several tools of `gettext` toolset. # 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/Tool/GettextCommon.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/GettextCommon.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Warnings import re @@ -390,7 +390,7 @@ def _detect_xgettext(env): """ Detects *xgettext(1)* binary """ if 'XGETTEXT' in env: return env['XGETTEXT'] - xgettext = env.Detect('xgettext'); + xgettext = env.Detect('xgettext') if xgettext: return xgettext raise SCons.Errors.StopError(XgettextNotFound, "Could not detect xgettext") @@ -409,7 +409,7 @@ def _detect_msginit(env): """ Detects *msginit(1)* program. """ if 'MSGINIT' in env: return env['MSGINIT'] - msginit = env.Detect('msginit'); + msginit = env.Detect('msginit') if msginit: return msginit raise SCons.Errors.StopError(MsginitNotFound, "Could not detect msginit") @@ -428,7 +428,7 @@ def _detect_msgmerge(env): """ Detects *msgmerge(1)* program. """ if 'MSGMERGE' in env: return env['MSGMERGE'] - msgmerge = env.Detect('msgmerge'); + msgmerge = env.Detect('msgmerge') if msgmerge: return msgmerge raise SCons.Errors.StopError(MsgmergeNotFound, "Could not detect msgmerge") @@ -447,7 +447,7 @@ def _detect_msgfmt(env): """ Detects *msgmfmt(1)* program. """ if 'MSGFMT' in env: return env['MSGFMT'] - msgfmt = env.Detect('msgfmt'); + msgfmt = env.Detect('msgfmt') if msgfmt: return msgfmt raise SCons.Errors.StopError(MsgfmtNotFound, "Could not detect msgfmt") diff --git a/engine/SCons/Tool/JavaCommon.py b/engine/SCons/Tool/JavaCommon.py index 9004cee..29ab007 100644 --- a/engine/SCons/Tool/JavaCommon.py +++ b/engine/SCons/Tool/JavaCommon.py @@ -5,7 +5,7 @@ Stuff for processing Java. """ # -# 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 @@ -27,16 +27,21 @@ Stuff for processing Java. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/JavaCommon.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/JavaCommon.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import os.path import re +import glob java_parsing = 1 default_java_version = '1.4' +# a switch for which jdk versions to use the Scope state for smarter +# anonymous inner class parsing. +scopeStateVersions = ('1.8') + if java_parsing: # Parse Java files for class names. # @@ -64,8 +69,9 @@ if java_parsing: interfaces, and anonymous inner classes.""" def __init__(self, version=default_java_version): - if not version in ('1.1', '1.2', '1.3','1.4', '1.5', '1.6', '1.7', - '1.8', '5', '6'): + if not version in ('1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', + '1.8', '5', '6', '9.0', '10.0', '11.0'): + msg = "Java version %s not supported" % version raise NotImplementedError(msg) @@ -115,8 +121,8 @@ if java_parsing: ret = SkipState(1, self) self.skipState = ret return ret - - def __getAnonStack(self): + + def _getAnonStack(self): return self.anonStacksStack[-1] def openBracket(self): @@ -125,15 +131,16 @@ if java_parsing: def closeBracket(self): self.brackets = self.brackets - 1 if len(self.stackBrackets) and \ - self.brackets == self.stackBrackets[-1]: + self.brackets == self.stackBrackets[-1]: self.listOutputs.append('$'.join(self.listClasses)) self.localClasses.pop() self.listClasses.pop() self.anonStacksStack.pop() self.stackBrackets.pop() if len(self.stackAnonClassBrackets) and \ - self.brackets == self.stackAnonClassBrackets[-1]: - self.__getAnonStack().pop() + self.brackets == self.stackAnonClassBrackets[-1] and \ + self.version not in scopeStateVersions: + self._getAnonStack().pop() self.stackAnonClassBrackets.pop() def parseToken(self, token): @@ -171,21 +178,87 @@ if java_parsing: if self.version in ('1.1', '1.2', '1.3', '1.4'): clazz = self.listClasses[0] self.listOutputs.append('%s$%d' % (clazz, self.nextAnon)) - elif self.version in ('1.5', '1.6', '1.7', '1.8', '5', '6'): + elif self.version in ('1.5', '1.6', '1.7', '1.8', '5', '6', '9.0', '10.0', '11.0'): self.stackAnonClassBrackets.append(self.brackets) className = [] className.extend(self.listClasses) - self.__getAnonStack()[-1] = self.__getAnonStack()[-1] + 1 - for anon in self.__getAnonStack(): + self._getAnonStack()[-1] = self._getAnonStack()[-1] + 1 + for anon in self._getAnonStack(): className.append(str(anon)) self.listOutputs.append('$'.join(className)) self.nextAnon = self.nextAnon + 1 - self.__getAnonStack().append(0) + self._getAnonStack().append(0) def setPackage(self, package): self.package = package + class ScopeState(object): + """ + A state that parses code within a scope normally, + within the confines of a scope. + """ + def __init__(self, old_state): + self.outer_state = old_state.outer_state + self.old_state = old_state + self.brackets = 0 + + def __getClassState(self): + try: + return self.classState + except AttributeError: + ret = ClassState(self) + self.classState = ret + return ret + + def __getAnonClassState(self): + try: + return self.anonState + except AttributeError: + ret = SkipState(1, AnonClassState(self)) + self.anonState = ret + return ret + + def __getSkipState(self): + try: + return self.skipState + except AttributeError: + ret = SkipState(1, self) + self.skipState = ret + return ret + + def openBracket(self): + self.brackets = self.brackets + 1 + + def closeBracket(self): + self.brackets = self.brackets - 1 + + def parseToken(self, token): + # if self.brackets == 0: + # return self.old_state.parseToken(token) + if token[:2] == '//': + return IgnoreState('\n', self) + elif token == '/*': + return IgnoreState('*/', self) + elif token == '{': + self.openBracket() + elif token == '}': + self.closeBracket() + if self.brackets == 0: + self.outer_state._getAnonStack().pop() + return self.old_state + elif token in ['"', "'"]: + return IgnoreState(token, self) + elif token == "new": + # anonymous inner class + return self.__getAnonClassState() + elif token == '.': + # Skip the attribute, it might be named "class", in which + # case we don't want to treat the following token as + # an inner class name... + return self.__getSkipState() + return self + class AnonClassState(object): """A state that looks for anonymous inner classes.""" def __init__(self, old_state): @@ -212,13 +285,15 @@ if java_parsing: if token == 'new': # look further for anonymous inner class return SkipState(1, AnonClassState(self)) - elif token in [ '"', "'" ]: + elif token in ['"', "'"]: return IgnoreState(token, self) elif token == ')': self.brace_level = self.brace_level - 1 return self if token == '{': self.outer_state.addAnonClass() + if self.outer_state.version in scopeStateVersions: + return ScopeState(old_state = self.old_state).parseToken(token) return self.old_state.parseToken(token) class SkipState(object): @@ -245,10 +320,10 @@ if java_parsing: # If that's an inner class which is declared in a method, it # requires an index prepended to the class-name, e.g. # 'Foo$1Inner' - # http://scons.tigris.org/issues/show_bug.cgi?id=2087 + # https://github.com/SCons/scons/issues/2087 if self.outer_state.localClasses and \ - self.outer_state.stackBrackets[-1] > \ - self.outer_state.stackBrackets[-2]+1: + self.outer_state.stackBrackets[-1] > \ + self.outer_state.stackBrackets[-2]+1: locals = self.outer_state.localClasses[-1] try: idx = locals[token] @@ -283,7 +358,9 @@ if java_parsing: return self.outer_state def parse_java_file(fn, version=default_java_version): - return parse_java(open(fn, 'r').read(), version) + with open(fn, 'r') as f: + data = f.read() + return parse_java(data, version) def parse_java(contents, version=default_java_version, trace=None): """Parse a .java file and return a double of package directory, @@ -315,7 +392,84 @@ else: is that the file name matches the public class name, and that the path to the file is the same as the package name. """ - return os.path.split(file) + return os.path.split(fn) + + + +java_win32_version_dir_glob = 'C:/Program Files*/Java/jdk%s*/bin' +java_win32_dir_glob = 'C:/Program Files*/Java/jdk*/bin' + +java_macos_include_dir = '/System/Library/Frameworks/JavaVM.framework/Headers/' +java_macos_version_include_dir = '/System/Library/Frameworks/JavaVM.framework/Versions/%s*/Headers/' + +java_linux_include_dirs = ['/usr/lib/jvm/default-java/include', + '/usr/lib/jvm/java-*/include'] +# Need to match path like below (from Centos 7) +# /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64/include/ +java_linux_version_include_dirs = ['/usr/lib/jvm/java-*-sun-%s*/include', + '/usr/lib/jvm/java-%s*-openjdk*/include', + '/usr/java/jdk%s*/include'] + + + +def get_java_install_dirs(platform, version=None): + """ + Using patterns above find the java jdk install dir + :param platform: + :param version: If specified, only look for java sdk's of this version + :return: list of default paths for java. + """ + paths = [] + if platform == 'win32': + if version: + paths = glob.glob(java_win32_version_dir_glob%version) + else: + paths = glob.glob(java_win32_dir_glob) + else: + # do nothing for now + pass + + paths=sorted(paths) + + return paths + +def get_java_include_paths(env, javac, version): + """ + Return java include paths + :param platform: + :param javac: + :return: + """ + paths = [] + if not javac: + # there are no paths if we've not detected javac. + pass + elif env['PLATFORM'] == 'win32': + javac_bin_dir = os.path.dirname(javac) + java_inc_dir = os.path.normpath(os.path.join(javac_bin_dir, '..', 'include')) + paths = [java_inc_dir, os.path.join(java_inc_dir, 'win32')] + elif env['PLATFORM'] == 'darwin': + if not version: + paths = [java_macos_include_dir] + else: + paths = sorted(glob.glob(java_macos_version_include_dir%version)) + else: + base_paths=[] + if not version: + for p in java_linux_include_dirs: + base_paths.extend(glob.glob(p)) + else: + for p in java_linux_version_include_dirs: + base_paths.extend(glob.glob(p%version)) + + for p in base_paths: + paths.extend([p, os.path.join(p,'linux')]) + + #print("PATHS:%s"%paths) + return paths + + + # Local Variables: # tab-width:4 diff --git a/engine/SCons/Tool/MSCommon/__init__.py b/engine/SCons/Tool/MSCommon/__init__.py index 615ea8c..2fb9c99 100644 --- a/engine/SCons/Tool/MSCommon/__init__.py +++ b/engine/SCons/Tool/MSCommon/__init__.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/Tool/MSCommon/__init__.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __doc__ = """ Common functions for Microsoft Visual Studio and Visual C/C++. diff --git a/engine/SCons/Tool/MSCommon/arch.py b/engine/SCons/Tool/MSCommon/arch.py index 1cf3b41..12ff1f9 100644 --- a/engine/SCons/Tool/MSCommon/arch.py +++ b/engine/SCons/Tool/MSCommon/arch.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/Tool/MSCommon/arch.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __doc__ = """Module to define supported Windows chip architectures. """ @@ -37,22 +37,22 @@ class ArchDefinition(object): self.synonyms = synonyms SupportedArchitectureList = [ - ArchitectureDefinition( + ArchDefinition( 'x86', ['i386', 'i486', 'i586', 'i686'], ), - ArchitectureDefinition( + ArchDefinition( 'x86_64', ['AMD64', 'amd64', 'em64t', 'EM64T', 'x86_64'], ), - ArchitectureDefinition( + ArchDefinition( 'ia64', ['IA64'], ), - ArchitectureDefinition( + ArchDefinition( 'arm', ['ARM'], ), diff --git a/engine/SCons/Tool/MSCommon/common.py b/engine/SCons/Tool/MSCommon/common.py index 4d52104..041c394 100644 --- a/engine/SCons/Tool/MSCommon/common.py +++ b/engine/SCons/Tool/MSCommon/common.py @@ -2,7 +2,7 @@ Common helper functions for working with the Microsoft tool chain. """ # -# 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 @@ -25,7 +25,7 @@ Common helper functions for working with the Microsoft tool chain. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/MSCommon/common.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/MSCommon/common.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import copy import os @@ -46,7 +46,7 @@ elif LOGFILE: debug = lambda message: open(LOGFILE, 'a').write(message + '\n') else: logging.basicConfig(filename=LOGFILE, level=logging.DEBUG) - debug = logging.debug + debug = logging.getLogger(name=__name__).debug else: debug = lambda x: None @@ -188,8 +188,10 @@ def get_output(vcbat, args = None, env = None): # Use the .stdout and .stderr attributes directly because the # .communicate() method uses the threading module on Windows # and won't work under Pythons not built with threading. - stdout = popen.stdout.read() - stderr = popen.stderr.read() + with popen.stdout: + stdout = popen.stdout.read() + with popen.stderr: + stderr = popen.stderr.read() # Extra debug logic, uncomment if necessary # debug('get_output():stdout:%s'%stdout) @@ -206,7 +208,7 @@ def get_output(vcbat, args = None, env = None): output = stdout.decode("mbcs") return output -def parse_output(output, keep=("INCLUDE", "LIB", "LIBPATH", "PATH")): +def parse_output(output, keep=("INCLUDE", "LIB", "LIBPATH", "PATH", 'VSCMD_ARG_app_plat')): """ Parse output from running visual c++/studios vcvarsall.bat and running set To capture the values listed in keep diff --git a/engine/SCons/Tool/MSCommon/netframework.py b/engine/SCons/Tool/MSCommon/netframework.py index 64b9417..a32a05d 100644 --- a/engine/SCons/Tool/MSCommon/netframework.py +++ b/engine/SCons/Tool/MSCommon/netframework.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/Tool/MSCommon/netframework.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __doc__ = """ """ diff --git a/engine/SCons/Tool/MSCommon/sdk.py b/engine/SCons/Tool/MSCommon/sdk.py index ca3a9ff..aa89f2a 100644 --- a/engine/SCons/Tool/MSCommon/sdk.py +++ b/engine/SCons/Tool/MSCommon/sdk.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/Tool/MSCommon/sdk.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __doc__ = """Module to detect the Platform/Windows SDK @@ -178,6 +178,16 @@ SDK100VCSetupScripts = {'x86' : r'bin\vcvars32.bat', # # If you update this list, update the documentation in Tool/mssdk.xml. SupportedSDKList = [ + WindowsSDK('10.0A', + sanity_check_file=r'bin\SetEnv.Cmd', + include_subdir='include', + lib_subdir={ + 'x86' : ['lib'], + 'x86_64' : [r'lib\x64'], + 'ia64' : [r'lib\ia64'], + }, + vc_setup_scripts = SDK70VCSetupScripts, + ), WindowsSDK('10.0', sanity_check_file=r'bin\SetEnv.Cmd', include_subdir='include', diff --git a/engine/SCons/Tool/MSCommon/vc.py b/engine/SCons/Tool/MSCommon/vc.py index 4139ee3..1f1332e 100644 --- a/engine/SCons/Tool/MSCommon/vc.py +++ b/engine/SCons/Tool/MSCommon/vc.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 @@ -30,7 +30,7 @@ # * test on 64 bits XP + VS 2005 (and VS 6 if possible) # * SDK # * Assembly -__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __doc__ = """Module for Visual C/C++ detection and configuration. """ @@ -43,6 +43,7 @@ import platform from string import digits as string_digits import SCons.Warnings +from SCons.Tool import find_program_path from . import common @@ -79,15 +80,43 @@ _ARCH_TO_CANONICAL = { "i486" : "x86", "i586" : "x86", "i686" : "x86", - "ia64" : "ia64", - "itanium" : "ia64", + "ia64" : "ia64", # deprecated + "itanium" : "ia64", # deprecated "x86" : "x86", "x86_64" : "amd64", - "x86_amd64" : "x86_amd64", # Cross compile to 64 bit from 32bits + "arm" : "arm", + "arm64" : "arm64", + "aarch64" : "arm64", } -# Given a (host, target) tuple, return the argument for the bat file. Both host -# and targets should be canonalized. +# get path to the cl.exe dir for newer VS versions +# based off a tuple of (host, target) platforms +_HOST_TARGET_TO_CL_DIR_GREATER_THAN_14 = { + ("amd64","amd64") : "Hostx64\\x64", + ("amd64","x86") : "Hostx64\\x86", + ("amd64","arm") : "Hostx64\\arm", + ("amd64","arm64") : "Hostx64\\arm64", + ("x86","amd64") : "Hostx86\\x64", + ("x86","x86") : "Hostx86\\x86", + ("x86","arm") : "Hostx86\\arm", + ("x86","arm64") : "Hostx86\\arm64", +} + +# get path to the cl.exe dir for older VS versions +# based off a tuple of (host, target) platforms +_HOST_TARGET_TO_CL_DIR = { + ("amd64","amd64") : "amd64", + ("amd64","x86") : "amd64_x86", + ("amd64","arm") : "amd64_arm", + ("amd64","arm64") : "amd64_arm64", + ("x86","amd64") : "x86_amd64", + ("x86","x86") : "", + ("x86","arm") : "x86_arm", + ("x86","arm64") : "x86_arm64", +} + +# Given a (host, target) tuple, return the argument for the bat file. +# Both host and targets should be canonalized. _HOST_TARGET_ARCH_TO_BAT_ARCH = { ("x86", "x86"): "x86", ("x86", "amd64"): "x86_amd64", @@ -95,9 +124,32 @@ _HOST_TARGET_ARCH_TO_BAT_ARCH = { ("amd64", "x86_amd64"): "x86_amd64", # This is present in (at least) VS2012 express ("amd64", "amd64"): "amd64", ("amd64", "x86"): "x86", - ("x86", "ia64"): "x86_ia64" + ("x86", "ia64"): "x86_ia64", # gone since 14.0 + ("arm", "arm"): "arm", # since 14.0, maybe gone 14.1? + ("x86", "arm"): "x86_arm", # since 14.0 + ("x86", "arm64"): "x86_arm64", # since 14.1 + ("amd64", "arm"): "amd64_arm", # since 14.0 + ("amd64", "arm64"): "amd64_arm64", # since 14.1 } +_CL_EXE_NAME = 'cl.exe' + +def get_msvc_version_numeric(msvc_version): + """Get the raw version numbers from a MSVC_VERSION string, so it + could be cast to float or other numeric values. For example, '14.0Exp' + would get converted to '14.0'. + + Args: + msvc_version: str + string representing the version number, could contain non + digit characters + + Returns: + str: the value converted to a numeric only string + + """ + return ''.join([x for x in msvc_version if x in string_digits + '.']) + def get_host_target(env): debug('vc.py:get_host_target()') @@ -188,7 +240,7 @@ _VCVER_TO_PRODUCT_DIR = { } def msvc_version_to_maj_min(msvc_version): - msvc_version_numeric = ''.join([x for x in msvc_version if x in string_digits + '.']) + msvc_version_numeric = get_msvc_version_numeric(msvc_version) t = msvc_version_numeric.split(".") if not len(t) == 2: @@ -201,21 +253,21 @@ def msvc_version_to_maj_min(msvc_version): raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric)) def is_host_target_supported(host_target, msvc_version): - """Return True if the given (host, target) tuple is supported given the - msvc version. - - Parameters - ---------- - host_target: tuple - tuple of (canonalized) host-target, e.g. ("x86", "amd64") for cross - compilation from 32 bits windows to 64 bits. - msvc_version: str - msvc version (major.minor, e.g. 10.0) - - Note - ---- - This only check whether a given version *may* support the given (host, - target), not that the toolchain is actually present on the machine. + """Check if the given (host, target) tuple is supported for given version. + + Args: + host_target: tuple + tuple of (canonalized) host-targets, e.g. ("x86", "amd64") + for cross compilation from 32 bit Windows to 64 bits. + msvc_version: str + msvc version (major.minor, e.g. 10.0) + + Returns: + bool: + + Note: + This only checks whether a given version *may* support the given (host, + target), not that the toolchain is actually present on the machine. """ # We assume that any Visual Studio version supports x86 as a target if host_target[1] != "x86": @@ -228,40 +280,69 @@ def is_host_target_supported(host_target, msvc_version): def find_vc_pdir_vswhere(msvc_version): """ - Find the MSVC product directory using vswhere.exe . + Find the MSVC product directory using vswhere.exe. + Run it asking for specified version and get MSVS install location :param msvc_version: - :return: MSVC install dir + :return: MSVC install dir or None """ - vswhere_path = os.path.join( - 'C:\\', - 'Program Files (x86)', - 'Microsoft Visual Studio', - 'Installer', - 'vswhere.exe' - ) - vswhere_cmd = [vswhere_path, '-version', msvc_version, '-property', 'installationPath'] + + # For bug 3333 - support default location of vswhere for both 64 and 32 bit windows + # installs. + for pf in ['Program Files (x86)', 'Program Files']: + vswhere_path = os.path.join( + 'C:\\', + pf, + 'Microsoft Visual Studio', + 'Installer', + 'vswhere.exe' + ) + if os.path.exists(vswhere_path): + # If we found vswhere, then use it. + break + + vswhere_cmd = [vswhere_path, '-products', '*', '-version', msvc_version, '-property', 'installationPath'] if os.path.exists(vswhere_path): - sp = subprocess.Popen(vswhere_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + #TODO PY27 cannot use Popen as context manager + # try putting it back to the old way for now + sp = subprocess.Popen(vswhere_cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) vsdir, err = sp.communicate() - vsdir = vsdir.decode("mbcs") - vsdir = vsdir.rstrip() - vc_pdir = os.path.join(vsdir, 'VC') - return vc_pdir + if vsdir: + vsdir = vsdir.decode("mbcs").splitlines() + # vswhere could easily return multiple lines + # we could define a way to pick the one we prefer, but since + # this data is currently only used to make a check for existence, + # returning the first hit should be good enough for now. + vc_pdir = os.path.join(vsdir[0], 'VC') + return vc_pdir else: # No vswhere on system, no install info available return None def find_vc_pdir(msvc_version): - """Try to find the product directory for the given - version. + """Find the product directory for the given version. + + Tries to look up the path using a registry key from the table + _VCVER_TO_PRODUCT_DIR; if there is no key, calls find_vc_pdir_wshere + for help instead. + + Args: + msvc_version: str + msvc version (major.minor, e.g. 10.0) + + Returns: + str: Path found in registry, or None - Note - ---- - If for some reason the requested version could not be found, an - exception which inherits from VisualCException will be raised.""" + Raises: + UnsupportedVersion: if the version is not known by this file. + MissingConfiguration: found version but the directory is missing. + + Both exceptions inherit from VisualCException. + """ root = 'Software\\' try: hkeys = _VCVER_TO_PRODUCT_DIR[msvc_version] @@ -275,8 +356,10 @@ def find_vc_pdir(msvc_version): if not key: comps = find_vc_pdir_vswhere(msvc_version) if not comps: - debug('find_vc_dir(): no VC found via vswhere for version {}'.format(repr(key))) + debug('find_vc_pdir_vswhere(): no VC found for version {}'.format(repr(msvc_version))) raise SCons.Util.WinError + debug('find_vc_pdir_vswhere(): VC found: {}'.format(repr(msvc_version))) + return comps else: if common.is_win64(): try: @@ -308,10 +391,10 @@ def find_batch_file(env,msvc_version,host_arch,target_arch): if pdir is None: raise NoVersionFound("No version of Visual Studio found") - debug('vc.py: find_batch_file() pdir:{}'.format(pdir)) + debug('vc.py: find_batch_file() in {}'.format(pdir)) # filter out e.g. "Exp" from the version name - msvc_ver_numeric = ''.join([x for x in msvc_version if x in string_digits + "."]) + msvc_ver_numeric = get_msvc_version_numeric(msvc_version) vernum = float(msvc_ver_numeric) if 7 <= vernum < 8: pdir = os.path.join(pdir, os.pardir, "Common7", "Tools") @@ -343,23 +426,132 @@ def find_batch_file(env,msvc_version,host_arch,target_arch): __INSTALLED_VCS_RUN = None -def cached_get_installed_vcs(): +def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): + """Find the cl.exe on the filesystem in the vc_dir depending on + TARGET_ARCH, HOST_ARCH and the msvc version. TARGET_ARCH and + HOST_ARCH can be extracted from the passed env, unless its None, + which then the native platform is assumed the host and target. + + Args: + env: Environment + a construction environment, usually if this is passed its + because there is a desired TARGET_ARCH to be used when searching + for a cl.exe + vc_dir: str + the path to the VC dir in the MSVC installation + msvc_version: str + msvc version (major.minor, e.g. 10.0) + + Returns: + bool: + + """ + + # determine if there is a specific target platform we want to build for and + # use that to find a list of valid VCs, default is host platform == target platform + # and same for if no env is specified to extract target platform from + if env: + (host_platform, target_platform, req_target_platform) = get_host_target(env) + else: + host_platform = platform.machine().lower() + target_platform = host_platform + + host_platform = _ARCH_TO_CANONICAL[host_platform] + target_platform = _ARCH_TO_CANONICAL[target_platform] + + debug('_check_cl_exists_in_vc_dir(): host platform %s, target platform %s' % (host_platform, target_platform)) + + ver_num = float(get_msvc_version_numeric(msvc_version)) + + # make sure the cl.exe exists meaning the tool is installed + if ver_num > 14: + # 2017 and newer allowed multiple versions of the VC toolset to be installed at the same time. + # Just get the default tool version for now + #TODO: support setting a specific minor VC version + default_toolset_file = os.path.join(vc_dir, r'Auxiliary\Build\Microsoft.VCToolsVersion.default.txt') + try: + with open(default_toolset_file) as f: + vc_specific_version = f.readlines()[0].strip() + except IOError: + debug('_check_cl_exists_in_vc_dir(): failed to read ' + default_toolset_file) + return False + except IndexError: + debug('_check_cl_exists_in_vc_dir(): failed to find MSVC version in ' + default_toolset_file) + return False + + host_trgt_dir = _HOST_TARGET_TO_CL_DIR_GREATER_THAN_14.get((host_platform, target_platform), None) + if not host_trgt_dir: + debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo') + return False + + cl_path = os.path.join(vc_dir, r'Tools\MSVC', vc_specific_version, 'bin', host_trgt_dir, _CL_EXE_NAME) + debug('_check_cl_exists_in_vc_dir(): checking for ' + _CL_EXE_NAME + ' at ' + cl_path) + if os.path.exists(cl_path): + debug('_check_cl_exists_in_vc_dir(): found ' + _CL_EXE_NAME + '!') + return True + + elif ver_num <= 14 and ver_num >= 8: + + host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get((host_platform, target_platform), None) + if not host_trgt_dir: + debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo') + return False + + cl_path = os.path.join(vc_dir, 'bin', host_trgt_dir, _CL_EXE_NAME) + debug('_check_cl_exists_in_vc_dir(): checking for ' + _CL_EXE_NAME + ' at ' + cl_path) + + cl_path_exists = os.path.exists(cl_path) + if not cl_path_exists and host_platform == 'amd64': + # older versions of visual studio only had x86 binaries, + # so if the host platform is amd64, we need to check cross + # compile options (x86 binary compiles some other target on a 64 bit os) + host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get(('x86', target_platform), None) + if not host_trgt_dir: + return False + + cl_path = os.path.join(vc_dir, 'bin', host_trgt_dir, _CL_EXE_NAME) + debug('_check_cl_exists_in_vc_dir(): checking for ' + _CL_EXE_NAME + ' at ' + cl_path) + cl_path_exists = os.path.exists(cl_path) + + if cl_path_exists: + debug('_check_cl_exists_in_vc_dir(): found ' + _CL_EXE_NAME + '!') + return True + + elif ver_num < 8 and ver_num >= 6: + # not sure about these versions so if a walk the VC dir (could be slow) + for root, _, files in os.walk(vc_dir): + if _CL_EXE_NAME in files: + debug('get_installed_vcs ' + _CL_EXE_NAME + ' found %s' % os.path.join(root, _CL_EXE_NAME)) + return True + return False + else: + # version not support return false + debug('_check_cl_exists_in_vc_dir(): unsupported MSVC version: ' + str(ver_num)) + + return False + +def cached_get_installed_vcs(env=None): global __INSTALLED_VCS_RUN if __INSTALLED_VCS_RUN is None: - ret = get_installed_vcs() + ret = get_installed_vcs(env) __INSTALLED_VCS_RUN = ret return __INSTALLED_VCS_RUN -def get_installed_vcs(): +def get_installed_vcs(env=None): installed_versions = [] + for ver in _VCVER: debug('trying to find VC %s' % ver) try: - if find_vc_pdir(ver): + VC_DIR = find_vc_pdir(ver) + if VC_DIR: debug('found VC %s' % ver) - installed_versions.append(ver) + if _check_cl_exists_in_vc_dir(env, VC_DIR, ver): + installed_versions.append(ver) + else: + debug('find_vc_pdir no compiler found %s' % ver) else: debug('find_vc_pdir return None for ver %s' % ver) except VisualCException as e: @@ -416,7 +608,7 @@ def get_default_version(env): % (msvc_version, msvs_version)) return msvs_version if not msvc_version: - installed_vcs = cached_get_installed_vcs() + installed_vcs = cached_get_installed_vcs(env) debug('installed_vcs:%s' % installed_vcs) if not installed_vcs: #msg = 'No installed VCs' @@ -443,16 +635,17 @@ def msvc_find_valid_batch_script(env,version): debug('vc.py:msvc_find_valid_batch_script()') # Find the host platform, target platform, and if present the requested # target platform - (host_platform, target_platform,req_target_platform) = get_host_target(env) + platforms = get_host_target(env) + debug("vc.py: msvs_find_valid_batch_script(): host_platform %s, target_platform %s req_target_platform:%s" % platforms) + host_platform, target_platform, req_target_platform = platforms try_target_archs = [target_platform] - debug("msvs_find_valid_batch_script(): req_target_platform %s target_platform:%s"%(req_target_platform,target_platform)) # VS2012 has a "cross compile" environment to build 64 bit # with x86_amd64 as the argument to the batch setup script - if req_target_platform in ('amd64','x86_64'): + if req_target_platform in ('amd64', 'x86_64'): try_target_archs.append('x86_amd64') - elif not req_target_platform and target_platform in ['amd64','x86_64']: + elif not req_target_platform and target_platform in ['amd64', 'x86_64']: # There may not be "native" amd64, but maybe "cross" x86_amd64 tools try_target_archs.append('x86_amd64') # If the user hasn't specifically requested a TARGET_ARCH, and @@ -474,7 +667,7 @@ def msvc_find_valid_batch_script(env,version): (host_target, version) SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg) arg = _HOST_TARGET_ARCH_TO_BAT_ARCH[host_target] - + # Get just version numbers maj, min = msvc_version_to_maj_min(version) # VS2015+ @@ -493,15 +686,17 @@ def msvc_find_valid_batch_script(env,version): warn_msg = "VC version %s not installed. " + \ "C/C++ compilers are most likely not set correctly.\n" + \ " Installed versions are: %s" - warn_msg = warn_msg % (version, cached_get_installed_vcs()) + warn_msg = warn_msg % (version, cached_get_installed_vcs(env)) SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, warn_msg) continue # Try to use the located batch file for this host/target platform combo debug('vc.py:msvc_find_valid_batch_script() use_script 2 %s, args:%s\n' % (repr(vc_script), arg)) + found = None if vc_script: try: d = script_env(vc_script, args=arg) + found = vc_script except BatchFileExecutionError as e: debug('vc.py:msvc_find_valid_batch_script() use_script 3: failed running VC script %s: %s: Error:%s'%(repr(vc_script),arg,e)) vc_script=None @@ -510,6 +705,7 @@ def msvc_find_valid_batch_script(env,version): debug('vc.py:msvc_find_valid_batch_script() use_script 4: trying sdk script: %s'%(sdk_script)) try: d = script_env(sdk_script) + found = sdk_script except BatchFileExecutionError as e: debug('vc.py:msvc_find_valid_batch_script() use_script 5: failed running SDK script %s: Error:%s'%(repr(sdk_script),e)) continue @@ -517,7 +713,7 @@ def msvc_find_valid_batch_script(env,version): debug('vc.py:msvc_find_valid_batch_script() use_script 6: Neither VC script nor SDK script found') continue - debug("vc.py:msvc_find_valid_batch_script() Found a working script/target: %s %s"%(repr(sdk_script),arg)) + debug("vc.py:msvc_find_valid_batch_script() Found a working script/target: %s/%s"%(repr(found),arg)) break # We've found a working target_platform, so stop looking # If we cannot find a viable installed compiler, reset the TARGET_ARCH @@ -566,8 +762,14 @@ def msvc_setup_env(env): debug('vc.py:msvc_setup_env() env:%s -> %s'%(k,v)) env.PrependENVPath(k, v, delete_existing=True) -def msvc_exists(version=None): - vcs = cached_get_installed_vcs() + # final check to issue a warning if the compiler is not present + msvc_cl = find_program_path(env, 'cl') + if not msvc_cl: + SCons.Warnings.warn(SCons.Warnings.VisualCMissingWarning, + "Could not find MSVC compiler 'cl', it may need to be installed separately with Visual Studio") + +def msvc_exists(env=None, version=None): + vcs = cached_get_installed_vcs(env) if version is None: return len(vcs) > 0 return version in vcs diff --git a/engine/SCons/Tool/MSCommon/vs.py b/engine/SCons/Tool/MSCommon/vs.py index e732079..f7f3de2 100644 --- a/engine/SCons/Tool/MSCommon/vs.py +++ b/engine/SCons/Tool/MSCommon/vs.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/Tool/MSCommon/vs.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __doc__ = """Module to detect Visual Studio and/or Visual C/C++ """ @@ -68,9 +68,9 @@ class VisualStudio(object): SCons.Tool.MSCommon.vc.get_installed_vcs() dir = SCons.Tool.MSCommon.vc.find_vc_pdir(self.vc_version) if not dir: - debug('find_vs_dir(): no installed VC %s' % self.vc_version) + debug('find_vs_dir_by_vc(): no installed VC %s' % self.vc_version) return None - return dir + return os.path.abspath(os.path.join(dir, os.pardir)) def find_vs_dir_by_reg(self): root = 'Software\\' @@ -95,12 +95,11 @@ class VisualStudio(object): First try to find by registry, and if that fails find via VC dir """ - - if True: - vs_dir=self.find_vs_dir_by_reg() - return vs_dir - else: - return self.find_vs_dir_by_vc() + vs_dir=self.find_vs_dir_by_reg() + if not vs_dir: + vs_dir = self.find_vs_dir_by_vc() + debug('find_vs_dir(): found VS in ' + str(vs_dir )) + return vs_dir def find_executable(self): vs_dir = self.get_vs_dir() diff --git a/engine/SCons/Tool/PharLapCommon.py b/engine/SCons/Tool/PharLapCommon.py index 91d6382..b78dc2a 100644 --- a/engine/SCons/Tool/PharLapCommon.py +++ b/engine/SCons/Tool/PharLapCommon.py @@ -7,7 +7,7 @@ Phar Lap ETS tool chain. Right now, this is linkloc and """ # -# 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 @@ -29,7 +29,7 @@ Phar Lap ETS tool chain. Right now, this is linkloc and # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/PharLapCommon.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/PharLapCommon.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/__init__.py b/engine/SCons/Tool/__init__.py index 2be4c57..fcd9bca 100644 --- a/engine/SCons/Tool/__init__.py +++ b/engine/SCons/Tool/__init__.py @@ -14,7 +14,7 @@ tool definition. """ # -# 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 @@ -35,7 +35,7 @@ tool definition. # 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/Tool/__init__.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import imp import importlib @@ -44,7 +44,6 @@ import re import os import shutil - import SCons.Builder import SCons.Errors import SCons.Node.FS @@ -56,7 +55,7 @@ import SCons.Scanner.Prog import SCons.Scanner.SWIG import collections -DefaultToolpath=[] +DefaultToolpath = [] CScanner = SCons.Scanner.C.CScanner() DScanner = SCons.Scanner.D.DScanner() @@ -97,20 +96,20 @@ for suffix in LaTeXSuffixes: SourceFileScanner.add_scanner(suffix, LaTeXScanner) SourceFileScanner.add_scanner(suffix, PDFLaTeXScanner) - # Tool aliases are needed for those tools whos module names also # occur in the python standard library. This causes module shadowing and # can break using python library functions under python3 TOOL_ALIASES = { - 'gettext':'gettext_tool', + 'gettext': 'gettext_tool', 'clang++': 'clangxx', } + class Tool(object): def __init__(self, name, toolpath=[], **kw): # Rename if there's a TOOL_ALIAS for this tool - self.name = TOOL_ALIASES.get(name,name) + self.name = TOOL_ALIASES.get(name, name) self.toolpath = toolpath + DefaultToolpath # remember these so we can merge them into the call self.init_kw = kw @@ -136,7 +135,7 @@ class Tool(object): sys.path = self.toolpath + sys.path # sys.stderr.write("Tool:%s\nPATH:%s\n"%(self.name,sys.path)) - if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] in (0,1,2,3,4)): + if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] in (0, 1, 2, 3, 4)): # Py 2 code try: try: @@ -149,7 +148,7 @@ class Tool(object): file.close() except ImportError as e: splitname = self.name.split('.') - if str(e)!="No module named %s"%splitname[0]: + if str(e) != "No module named %s" % splitname[0]: raise SCons.Errors.EnvironmentError(e) try: import zipimport @@ -184,44 +183,44 @@ class Tool(object): add_to_scons_tools_namespace = False for path in self.toolpath: sepname = self.name.replace('.', os.path.sep) - file_path = os.path.join(path, "%s.py"%sepname) + file_path = os.path.join(path, "%s.py" % sepname) file_package = os.path.join(path, sepname) - if debug: sys.stderr.write("Trying:%s %s\n"%(file_path, file_package)) + if debug: sys.stderr.write("Trying:%s %s\n" % (file_path, file_package)) if os.path.isfile(file_path): spec = importlib.util.spec_from_file_location(self.name, file_path) - if debug: print("file_Path:%s FOUND"%file_path) + if debug: print("file_Path:%s FOUND" % file_path) break elif os.path.isdir(file_package): file_package = os.path.join(file_package, '__init__.py') spec = importlib.util.spec_from_file_location(self.name, file_package) - if debug: print("PACKAGE:%s Found"%file_package) + if debug: print("PACKAGE:%s Found" % file_package) break else: continue if spec is None: - if debug: sys.stderr.write("NO SPEC :%s\n"%self.name) - spec = importlib.util.find_spec("."+self.name, package='SCons.Tool') + if debug: sys.stderr.write("NO SPEC :%s\n" % self.name) + spec = importlib.util.find_spec("." + self.name, package='SCons.Tool') if spec: - found_name = 'SCons.Tool.'+self.name + found_name = 'SCons.Tool.' + self.name add_to_scons_tools_namespace = True - if debug: sys.stderr.write("Spec Found? .%s :%s\n"%(self.name, spec)) + if debug: sys.stderr.write("Spec Found? .%s :%s\n" % (self.name, spec)) if spec is None: - error_string = "No module named %s"%self.name + error_string = "No module named %s" % self.name raise SCons.Errors.EnvironmentError(error_string) module = importlib.util.module_from_spec(spec) if module is None: - if debug: print("MODULE IS NONE:%s"%self.name) - error_string = "No module named %s"%self.name + if debug: print("MODULE IS NONE:%s" % self.name) + error_string = "No module named %s" % self.name raise SCons.Errors.EnvironmentError(error_string) # Don't reload a tool we already loaded. - sys_modules_value = sys.modules.get(found_name,False) + sys_modules_value = sys.modules.get(found_name, False) found_module = None if sys_modules_value and sys_modules_value.__file__ == spec.origin: @@ -238,12 +237,11 @@ class Tool(object): setattr(SCons.Tool, self.name, module) found_module = module - + if found_module is not None: sys.path = oldpythonpath return found_module - sys.path = oldpythonpath full_name = 'SCons.Tool.' + self.name @@ -259,11 +257,11 @@ class Tool(object): file.close() return module except ImportError as e: - if str(e)!="No module named %s"%self.name: + if str(e) != "No module named %s" % self.name: raise SCons.Errors.EnvironmentError(e) try: import zipimport - importer = zipimport.zipimporter( sys.modules['SCons.Tool'].__path__[0] ) + importer = zipimport.zipimporter(sys.modules['SCons.Tool'].__path__[0]) module = importer.load_module(full_name) setattr(SCons.Tool, self.name, module) return module @@ -284,13 +282,13 @@ class Tool(object): kw.update(call_kw) else: kw = self.init_kw - env.Append(TOOLS = [ self.name ]) + env.Append(TOOLS=[self.name]) if hasattr(self, 'options'): import SCons.Variables if 'options' not in env: from SCons.Script import ARGUMENTS - env['options']=SCons.Variables.Variables(args=ARGUMENTS) - opts=env['options'] + env['options'] = SCons.Variables.Variables(args=ARGUMENTS) + opts = env['options'] self.options(opts) opts.Update(env) @@ -300,6 +298,7 @@ class Tool(object): def __str__(self): return self.name + ########################################################################## # Create common executable program / library / object builders @@ -314,13 +313,13 @@ def createProgBuilder(env): program = env['BUILDERS']['Program'] except KeyError: import SCons.Defaults - program = SCons.Builder.Builder(action = SCons.Defaults.LinkAction, - emitter = '$PROGEMITTER', - prefix = '$PROGPREFIX', - suffix = '$PROGSUFFIX', - src_suffix = '$OBJSUFFIX', - src_builder = 'Object', - target_scanner = ProgramScanner) + program = SCons.Builder.Builder(action=SCons.Defaults.LinkAction, + emitter='$PROGEMITTER', + prefix='$PROGPREFIX', + suffix='$PROGSUFFIX', + src_suffix='$OBJSUFFIX', + src_builder='Object', + target_scanner=ProgramScanner) env['BUILDERS']['Program'] = program return program @@ -336,23 +335,24 @@ def createStaticLibBuilder(env): try: static_lib = env['BUILDERS']['StaticLibrary'] except KeyError: - action_list = [ SCons.Action.Action("$ARCOM", "$ARCOMSTR") ] - if env.get('RANLIB',False) or env.Detect('ranlib'): + action_list = [SCons.Action.Action("$ARCOM", "$ARCOMSTR")] + if env.get('RANLIB', False) or env.Detect('ranlib'): ranlib_action = SCons.Action.Action("$RANLIBCOM", "$RANLIBCOMSTR") action_list.append(ranlib_action) - static_lib = SCons.Builder.Builder(action = action_list, - emitter = '$LIBEMITTER', - prefix = '$LIBPREFIX', - suffix = '$LIBSUFFIX', - src_suffix = '$OBJSUFFIX', - src_builder = 'StaticObject') + static_lib = SCons.Builder.Builder(action=action_list, + emitter='$LIBEMITTER', + prefix='$LIBPREFIX', + suffix='$LIBSUFFIX', + src_suffix='$OBJSUFFIX', + src_builder='StaticObject') env['BUILDERS']['StaticLibrary'] = static_lib env['BUILDERS']['Library'] = static_lib return static_lib -def _call_linker_cb(env, callback, args, result = None): + +def _call_linker_cb(env, callback, args, result=None): """Returns the result of env['LINKCALLBACKS'][callback](*args) if env['LINKCALLBACKS'] is a dictionary and env['LINKCALLBACKS'][callback] is callable. If these conditions are not met, return the value provided as @@ -376,84 +376,109 @@ def _call_linker_cb(env, callback, args, result = None): if Verbose: print('_call_linker_cb: env["LINKCALLBACKS"][%r] found' % callback) print('_call_linker_cb: env["LINKCALLBACKS"][%r]=%r' % (callback, cbfun)) - if(isinstance(cbfun, collections.Callable)): + if isinstance(cbfun, collections.Callable): if Verbose: print('_call_linker_cb: env["LINKCALLBACKS"][%r] is callable' % callback) result = cbfun(env, *args) return result + def _call_env_subst(env, string, *args, **kw): kw2 = {} for k in ('raw', 'target', 'source', 'conv', 'executor'): - try: kw2[k] = kw[k] - except KeyError: pass + try: + kw2[k] = kw[k] + except KeyError: + pass return env.subst(string, *args, **kw2) + class _ShLibInfoSupport(object): def get_libtype(self): return 'ShLib' + def get_lib_prefix(self, env, *args, **kw): - return _call_env_subst(env,'$SHLIBPREFIX', *args, **kw) + return _call_env_subst(env, '$SHLIBPREFIX', *args, **kw) + def get_lib_suffix(self, env, *args, **kw): - return _call_env_subst(env,'$SHLIBSUFFIX', *args, **kw) + return _call_env_subst(env, '$SHLIBSUFFIX', *args, **kw) + def get_lib_version(self, env, *args, **kw): - return _call_env_subst(env,'$SHLIBVERSION', *args, **kw) + return _call_env_subst(env, '$SHLIBVERSION', *args, **kw) + def get_lib_noversionsymlinks(self, env, *args, **kw): - return _call_env_subst(env,'$SHLIBNOVERSIONSYMLINKS', *args, **kw) + return _call_env_subst(env, '$SHLIBNOVERSIONSYMLINKS', *args, **kw) + class _LdModInfoSupport(object): def get_libtype(self): return 'LdMod' + def get_lib_prefix(self, env, *args, **kw): - return _call_env_subst(env,'$LDMODULEPREFIX', *args, **kw) + return _call_env_subst(env, '$LDMODULEPREFIX', *args, **kw) + def get_lib_suffix(self, env, *args, **kw): - return _call_env_subst(env,'$LDMODULESUFFIX', *args, **kw) + return _call_env_subst(env, '$LDMODULESUFFIX', *args, **kw) + def get_lib_version(self, env, *args, **kw): - return _call_env_subst(env,'$LDMODULEVERSION', *args, **kw) + return _call_env_subst(env, '$LDMODULEVERSION', *args, **kw) + def get_lib_noversionsymlinks(self, env, *args, **kw): - return _call_env_subst(env,'$LDMODULENOVERSIONSYMLINKS', *args, **kw) + return _call_env_subst(env, '$LDMODULENOVERSIONSYMLINKS', *args, **kw) + class _ImpLibInfoSupport(object): def get_libtype(self): return 'ImpLib' + def get_lib_prefix(self, env, *args, **kw): - return _call_env_subst(env,'$IMPLIBPREFIX', *args, **kw) + return _call_env_subst(env, '$IMPLIBPREFIX', *args, **kw) + def get_lib_suffix(self, env, *args, **kw): - return _call_env_subst(env,'$IMPLIBSUFFIX', *args, **kw) + return _call_env_subst(env, '$IMPLIBSUFFIX', *args, **kw) + def get_lib_version(self, env, *args, **kw): - version = _call_env_subst(env,'$IMPLIBVERSION', *args, **kw) + version = _call_env_subst(env, '$IMPLIBVERSION', *args, **kw) if not version: - try: lt = kw['implib_libtype'] - except KeyError: pass + try: + lt = kw['implib_libtype'] + except KeyError: + pass else: if lt == 'ShLib': - version = _call_env_subst(env,'$SHLIBVERSION', *args, **kw) + version = _call_env_subst(env, '$SHLIBVERSION', *args, **kw) elif lt == 'LdMod': - version = _call_env_subst(env,'$LDMODULEVERSION', *args, **kw) + version = _call_env_subst(env, '$LDMODULEVERSION', *args, **kw) return version + def get_lib_noversionsymlinks(self, env, *args, **kw): disable = None - try: env['IMPLIBNOVERSIONSYMLINKS'] + try: + env['IMPLIBNOVERSIONSYMLINKS'] except KeyError: - try: lt = kw['implib_libtype'] - except KeyError: pass + try: + lt = kw['implib_libtype'] + except KeyError: + pass else: if lt == 'ShLib': - disable = _call_env_subst(env,'$SHLIBNOVERSIONSYMLINKS', *args, **kw) + disable = _call_env_subst(env, '$SHLIBNOVERSIONSYMLINKS', *args, **kw) elif lt == 'LdMod': - disable = _call_env_subst(env,'$LDMODULENOVERSIONSYMLINKS', *args, **kw) + disable = _call_env_subst(env, '$LDMODULENOVERSIONSYMLINKS', *args, **kw) else: - disable = _call_env_subst(env,'$IMPLIBNOVERSIONSYMLINKS', *args, **kw) + disable = _call_env_subst(env, '$IMPLIBNOVERSIONSYMLINKS', *args, **kw) return disable + class _LibInfoGeneratorBase(object): """Generator base class for library-related info such as suffixes for versioned libraries, symlink maps, sonames etc. It handles commonities of SharedLibrary and LoadableModule """ - _support_classes = { 'ShLib' : _ShLibInfoSupport, - 'LdMod' : _LdModInfoSupport, - 'ImpLib' : _ImpLibInfoSupport } + _support_classes = {'ShLib': _ShLibInfoSupport, + 'LdMod': _LdModInfoSupport, + 'ImpLib': _ImpLibInfoSupport} + def __init__(self, libtype, infoname): self.set_libtype(libtype) self.set_infoname(infoname) @@ -475,37 +500,41 @@ class _LibInfoGeneratorBase(object): return self.infoname def get_lib_prefix(self, env, *args, **kw): - return self._support.get_lib_prefix(env,*args,**kw) + return self._support.get_lib_prefix(env, *args, **kw) def get_lib_suffix(self, env, *args, **kw): - return self._support.get_lib_suffix(env,*args,**kw) + return self._support.get_lib_suffix(env, *args, **kw) def get_lib_version(self, env, *args, **kw): - return self._support.get_lib_version(env,*args,**kw) + return self._support.get_lib_version(env, *args, **kw) def get_lib_noversionsymlinks(self, env, *args, **kw): - return self._support.get_lib_noversionsymlinks(env,*args,**kw) + return self._support.get_lib_noversionsymlinks(env, *args, **kw) # Returns name of generator linker callback that shall be used to generate # our info for a versioned library. For example, if our libtype is 'ShLib' # and infoname is 'Prefix', it would return 'VersionedShLibPrefix'. def get_versioned_lib_info_generator(self, **kw): - try: libtype = kw['generator_libtype'] - except KeyError: libtype = self.get_libtype() + try: + libtype = kw['generator_libtype'] + except KeyError: + libtype = self.get_libtype() infoname = self.get_infoname() return 'Versioned%s%s' % (libtype, infoname) - def generate_versioned_lib_info(self, env, args, result = None, **kw): + def generate_versioned_lib_info(self, env, args, result=None, **kw): callback = self.get_versioned_lib_info_generator(**kw) return _call_linker_cb(env, callback, args, result) + class _LibPrefixGenerator(_LibInfoGeneratorBase): """Library prefix generator, used as target_prefix in SharedLibrary and LoadableModule builders""" + def __init__(self, libtype): super(_LibPrefixGenerator, self).__init__(libtype, 'Prefix') - def __call__(self, env, sources = None, **kw): + def __call__(self, env, sources=None, **kw): Verbose = False if sources and 'source' not in kw: @@ -514,7 +543,7 @@ class _LibPrefixGenerator(_LibInfoGeneratorBase): else: kw2 = kw - prefix = self.get_lib_prefix(env,**kw2) + prefix = self.get_lib_prefix(env, **kw2) if Verbose: print("_LibPrefixGenerator: input prefix=%r" % prefix) @@ -529,17 +558,20 @@ class _LibPrefixGenerator(_LibInfoGeneratorBase): print("_LibPrefixGenerator: return prefix=%r" % prefix) return prefix -ShLibPrefixGenerator = _LibPrefixGenerator('ShLib') -LdModPrefixGenerator = _LibPrefixGenerator('LdMod') + +ShLibPrefixGenerator = _LibPrefixGenerator('ShLib') +LdModPrefixGenerator = _LibPrefixGenerator('LdMod') ImpLibPrefixGenerator = _LibPrefixGenerator('ImpLib') + class _LibSuffixGenerator(_LibInfoGeneratorBase): """Library suffix generator, used as target_suffix in SharedLibrary and LoadableModule builders""" + def __init__(self, libtype): super(_LibSuffixGenerator, self).__init__(libtype, 'Suffix') - def __call__(self, env, sources = None, **kw): + def __call__(self, env, sources=None, **kw): Verbose = False if sources and 'source' not in kw: @@ -563,13 +595,16 @@ class _LibSuffixGenerator(_LibInfoGeneratorBase): print("_LibSuffixGenerator: return suffix=%r" % suffix) return suffix -ShLibSuffixGenerator = _LibSuffixGenerator('ShLib') -LdModSuffixGenerator = _LibSuffixGenerator('LdMod') + +ShLibSuffixGenerator = _LibSuffixGenerator('ShLib') +LdModSuffixGenerator = _LibSuffixGenerator('LdMod') ImpLibSuffixGenerator = _LibSuffixGenerator('ImpLib') + class _LibSymlinkGenerator(_LibInfoGeneratorBase): """Library symlink map generator. It generates a list of symlinks that should be created by SharedLibrary or LoadableModule builders""" + def __init__(self, libtype): super(_LibSymlinkGenerator, self).__init__(libtype, 'Symlinks') @@ -594,18 +629,20 @@ class _LibSymlinkGenerator(_LibInfoGeneratorBase): print('_LibSymlinkGenerator: disable=%r' % disable) if version and not disable: - prefix = self.get_lib_prefix(env,**kw2) - suffix = self.get_lib_suffix(env,**kw2) + prefix = self.get_lib_prefix(env, **kw2) + suffix = self.get_lib_suffix(env, **kw2) symlinks = self.generate_versioned_lib_info(env, [libnode, version, prefix, suffix], **kw2) if Verbose: print('_LibSymlinkGenerator: return symlinks=%r' % StringizeLibSymlinks(symlinks)) return symlinks -ShLibSymlinkGenerator = _LibSymlinkGenerator('ShLib') -LdModSymlinkGenerator = _LibSymlinkGenerator('LdMod') + +ShLibSymlinkGenerator = _LibSymlinkGenerator('ShLib') +LdModSymlinkGenerator = _LibSymlinkGenerator('LdMod') ImpLibSymlinkGenerator = _LibSymlinkGenerator('ImpLib') + class _LibNameGenerator(_LibInfoGeneratorBase): """Generates "unmangled" library name from a library file node. @@ -620,6 +657,7 @@ class _LibNameGenerator(_LibInfoGeneratorBase): the _LibNameGenerator shall return "libfoo.so". Other link tools may implement it's own way of library name unmangling. """ + def __init__(self, libtype): super(_LibNameGenerator, self).__init__(libtype, 'Name') @@ -642,8 +680,8 @@ class _LibNameGenerator(_LibInfoGeneratorBase): name = None if version: - prefix = self.get_lib_prefix(env,**kw2) - suffix = self.get_lib_suffix(env,**kw2) + prefix = self.get_lib_prefix(env, **kw2) + suffix = self.get_lib_suffix(env, **kw2) name = self.generate_versioned_lib_info(env, [libnode, version, prefix, suffix], **kw2) if not name: @@ -654,13 +692,16 @@ class _LibNameGenerator(_LibInfoGeneratorBase): return name -ShLibNameGenerator = _LibNameGenerator('ShLib') -LdModNameGenerator = _LibNameGenerator('LdMod') + +ShLibNameGenerator = _LibNameGenerator('ShLib') +LdModNameGenerator = _LibNameGenerator('LdMod') ImpLibNameGenerator = _LibNameGenerator('ImpLib') + class _LibSonameGenerator(_LibInfoGeneratorBase): """Library soname generator. Returns library soname (e.g. libfoo.so.0) for a given node (e.g. /foo/bar/libfoo.so.0.1.2)""" + def __init__(self, libtype): super(_LibSonameGenerator, self).__init__(libtype, 'Soname') @@ -679,12 +720,12 @@ class _LibSonameGenerator(_LibInfoGeneratorBase): soname = _call_env_subst(env, '$SONAME', **kw2) if not soname: - version = self.get_lib_version(env,**kw2) + version = self.get_lib_version(env, **kw2) if Verbose: print("_LibSonameGenerator: version=%r" % version) if version: - prefix = self.get_lib_prefix(env,**kw2) - suffix = self.get_lib_suffix(env,**kw2) + prefix = self.get_lib_prefix(env, **kw2) + suffix = self.get_lib_suffix(env, **kw2) soname = self.generate_versioned_lib_info(env, [libnode, version, prefix, suffix], **kw2) if not soname: @@ -698,40 +739,44 @@ class _LibSonameGenerator(_LibInfoGeneratorBase): return soname -ShLibSonameGenerator = _LibSonameGenerator('ShLib') -LdModSonameGenerator = _LibSonameGenerator('LdMod') + +ShLibSonameGenerator = _LibSonameGenerator('ShLib') +LdModSonameGenerator = _LibSonameGenerator('LdMod') + def StringizeLibSymlinks(symlinks): """Converts list with pairs of nodes to list with pairs of node paths (strings). Used mainly for debugging.""" if SCons.Util.is_List(symlinks): try: - return [ (k.get_path(), v.get_path()) for k,v in symlinks ] + return [(k.get_path(), v.get_path()) for k, v in symlinks] except (TypeError, ValueError): return symlinks else: return symlinks + def EmitLibSymlinks(env, symlinks, libnode, **kw): """Used by emitters to handle (shared/versioned) library symlinks""" Verbose = False # nodes involved in process... all symlinks + library - nodes = list(set([ x for x,y in symlinks ] + [libnode])) + nodes = list(set([x for x, y in symlinks] + [libnode])) clean_targets = kw.get('clean_targets', []) if not SCons.Util.is_List(clean_targets): - clean_targets = [ clean_targets ] + clean_targets = [clean_targets] for link, linktgt in symlinks: env.SideEffect(link, linktgt) - if(Verbose): + if (Verbose): print("EmitLibSymlinks: SideEffect(%r,%r)" % (link.get_path(), linktgt.get_path())) clean_list = [x for x in nodes if x != linktgt] env.Clean(list(set([linktgt] + clean_targets)), clean_list) - if(Verbose): + if (Verbose): print("EmitLibSymlinks: Clean(%r,%r)" % (linktgt.get_path(), [x.get_path() for x in clean_list])) + def CreateLibSymlinks(env, symlinks): """Physically creates symlinks. The symlinks argument must be a list in form [ (link, linktarget), ... ], where link and linktarget are SCons @@ -742,38 +787,40 @@ def CreateLibSymlinks(env, symlinks): for link, linktgt in symlinks: linktgt = link.get_dir().rel_path(linktgt) link = link.get_path() - if(Verbose): + if (Verbose): print("CreateLibSymlinks: preparing to add symlink %r -> %r" % (link, linktgt)) # Delete the (previously created) symlink if exists. Let only symlinks # to be deleted to prevent accidental deletion of source files... if env.fs.islink(link): env.fs.unlink(link) - if(Verbose): + if (Verbose): print("CreateLibSymlinks: removed old symlink %r" % link) # If a file or directory exists with the same name as link, an OSError # will be thrown, which should be enough, I think. env.fs.symlink(linktgt, link) - if(Verbose): + if (Verbose): print("CreateLibSymlinks: add symlink %r -> %r" % (link, linktgt)) return 0 + def LibSymlinksActionFunction(target, source, env): for tgt in target: - symlinks = getattr(getattr(tgt,'attributes', None), 'shliblinks', None) + symlinks = getattr(getattr(tgt, 'attributes', None), 'shliblinks', None) if symlinks: CreateLibSymlinks(env, symlinks) return 0 + def LibSymlinksStrFun(target, source, env, *args): cmd = None for tgt in target: - symlinks = getattr(getattr(tgt,'attributes', None), 'shliblinks', None) + symlinks = getattr(getattr(tgt, 'attributes', None), 'shliblinks', None) if symlinks: if cmd is None: cmd = "" if cmd: cmd += "\n" cmd += "Create symlinks for: %r" % tgt.get_path() try: - linkstr = ', '.join([ "%r->%r" %(k,v) for k,v in StringizeLibSymlinks(symlinks)]) + linkstr = ', '.join(["%r->%r" % (k, v) for k, v in StringizeLibSymlinks(symlinks)]) except (KeyError, ValueError): pass else: @@ -795,20 +842,21 @@ def createSharedLibBuilder(env): shared_lib = env['BUILDERS']['SharedLibrary'] except KeyError: import SCons.Defaults - action_list = [ SCons.Defaults.SharedCheck, - SCons.Defaults.ShLinkAction, - LibSymlinksAction ] - shared_lib = SCons.Builder.Builder(action = action_list, - emitter = "$SHLIBEMITTER", - prefix = ShLibPrefixGenerator, - suffix = ShLibSuffixGenerator, - target_scanner = ProgramScanner, - src_suffix = '$SHOBJSUFFIX', - src_builder = 'SharedObject') + action_list = [SCons.Defaults.SharedCheck, + SCons.Defaults.ShLinkAction, + LibSymlinksAction] + shared_lib = SCons.Builder.Builder(action=action_list, + emitter="$SHLIBEMITTER", + prefix=ShLibPrefixGenerator, + suffix=ShLibSuffixGenerator, + target_scanner=ProgramScanner, + src_suffix='$SHOBJSUFFIX', + src_builder='SharedObject') env['BUILDERS']['SharedLibrary'] = shared_lib return shared_lib + def createLoadableModuleBuilder(env): """This is a utility function that creates the LoadableModule Builder in an Environment if it is not there already. @@ -820,20 +868,21 @@ def createLoadableModuleBuilder(env): ld_module = env['BUILDERS']['LoadableModule'] except KeyError: import SCons.Defaults - action_list = [ SCons.Defaults.SharedCheck, - SCons.Defaults.LdModuleLinkAction, - LibSymlinksAction ] - ld_module = SCons.Builder.Builder(action = action_list, - emitter = "$LDMODULEEMITTER", - prefix = LdModPrefixGenerator, - suffix = LdModSuffixGenerator, - target_scanner = ProgramScanner, - src_suffix = '$SHOBJSUFFIX', - src_builder = 'SharedObject') + action_list = [SCons.Defaults.SharedCheck, + SCons.Defaults.LdModuleLinkAction, + LibSymlinksAction] + ld_module = SCons.Builder.Builder(action=action_list, + emitter="$LDMODULEEMITTER", + prefix=LdModPrefixGenerator, + suffix=LdModSuffixGenerator, + target_scanner=ProgramScanner, + src_suffix='$SHOBJSUFFIX', + src_builder='SharedObject') env['BUILDERS']['LoadableModule'] = ld_module return ld_module + def createObjBuilders(env): """This is a utility function that creates the StaticObject and SharedObject Builders in an Environment if they @@ -847,34 +896,34 @@ def createObjBuilders(env): The return is a 2-tuple of (StaticObject, SharedObject) """ - try: static_obj = env['BUILDERS']['StaticObject'] except KeyError: - static_obj = SCons.Builder.Builder(action = {}, - emitter = {}, - prefix = '$OBJPREFIX', - suffix = '$OBJSUFFIX', - src_builder = ['CFile', 'CXXFile'], - source_scanner = SourceFileScanner, - single_source = 1) + static_obj = SCons.Builder.Builder(action={}, + emitter={}, + prefix='$OBJPREFIX', + suffix='$OBJSUFFIX', + src_builder=['CFile', 'CXXFile'], + source_scanner=SourceFileScanner, + single_source=1) env['BUILDERS']['StaticObject'] = static_obj env['BUILDERS']['Object'] = static_obj try: shared_obj = env['BUILDERS']['SharedObject'] except KeyError: - shared_obj = SCons.Builder.Builder(action = {}, - emitter = {}, - prefix = '$SHOBJPREFIX', - suffix = '$SHOBJSUFFIX', - src_builder = ['CFile', 'CXXFile'], - source_scanner = SourceFileScanner, - single_source = 1) + shared_obj = SCons.Builder.Builder(action={}, + emitter={}, + prefix='$SHOBJPREFIX', + suffix='$SHOBJSUFFIX', + src_builder=['CFile', 'CXXFile'], + source_scanner=SourceFileScanner, + single_source=1) env['BUILDERS']['SharedObject'] = shared_obj return (static_obj, shared_obj) + def createCFileBuilders(env): """This is a utility function that creates the CFile/CXXFile Builders in an Environment if they @@ -891,24 +940,25 @@ def createCFileBuilders(env): try: c_file = env['BUILDERS']['CFile'] except KeyError: - c_file = SCons.Builder.Builder(action = {}, - emitter = {}, - suffix = {None:'$CFILESUFFIX'}) + c_file = SCons.Builder.Builder(action={}, + emitter={}, + suffix={None: '$CFILESUFFIX'}) env['BUILDERS']['CFile'] = c_file - env.SetDefault(CFILESUFFIX = '.c') + env.SetDefault(CFILESUFFIX='.c') try: cxx_file = env['BUILDERS']['CXXFile'] except KeyError: - cxx_file = SCons.Builder.Builder(action = {}, - emitter = {}, - suffix = {None:'$CXXFILESUFFIX'}) + cxx_file = SCons.Builder.Builder(action={}, + emitter={}, + suffix={None: '$CXXFILESUFFIX'}) env['BUILDERS']['CXXFile'] = cxx_file - env.SetDefault(CXXFILESUFFIX = '.cc') + env.SetDefault(CXXFILESUFFIX='.cc') return (c_file, cxx_file) + ########################################################################## # Create common Java builders @@ -926,68 +976,73 @@ def CreateJarBuilder(env): except KeyError: fs = SCons.Node.FS.get_default_fs() jar_com = SCons.Action.Action('$JARCOM', '$JARCOMSTR') - java_jar = SCons.Builder.Builder(action = jar_com, - suffix = '$JARSUFFIX', - src_suffix = '$JAVACLASSSUFFIX', - src_builder = 'JavaClassFile', - source_factory = fs.Entry) + java_jar = SCons.Builder.Builder(action=jar_com, + suffix='$JARSUFFIX', + src_suffix='$JAVACLASSSUFFIX', + src_builder='JavaClassFile', + source_factory=fs.Entry) env['BUILDERS']['JarFile'] = java_jar return java_jar + def CreateJavaHBuilder(env): try: java_javah = env['BUILDERS']['JavaH'] except KeyError: fs = SCons.Node.FS.get_default_fs() java_javah_com = SCons.Action.Action('$JAVAHCOM', '$JAVAHCOMSTR') - java_javah = SCons.Builder.Builder(action = java_javah_com, - src_suffix = '$JAVACLASSSUFFIX', - target_factory = fs.Entry, - source_factory = fs.File, - src_builder = 'JavaClassFile') + java_javah = SCons.Builder.Builder(action=java_javah_com, + src_suffix='$JAVACLASSSUFFIX', + target_factory=fs.Entry, + source_factory=fs.File, + src_builder='JavaClassFile') env['BUILDERS']['JavaH'] = java_javah return java_javah + def CreateJavaClassFileBuilder(env): try: java_class_file = env['BUILDERS']['JavaClassFile'] except KeyError: fs = SCons.Node.FS.get_default_fs() javac_com = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR') - java_class_file = SCons.Builder.Builder(action = javac_com, - emitter = {}, - #suffix = '$JAVACLASSSUFFIX', - src_suffix = '$JAVASUFFIX', - src_builder = ['JavaFile'], - target_factory = fs.Entry, - source_factory = fs.File) + java_class_file = SCons.Builder.Builder(action=javac_com, + emitter={}, + # suffix = '$JAVACLASSSUFFIX', + src_suffix='$JAVASUFFIX', + src_builder=['JavaFile'], + target_factory=fs.Entry, + source_factory=fs.File) env['BUILDERS']['JavaClassFile'] = java_class_file return java_class_file + def CreateJavaClassDirBuilder(env): try: java_class_dir = env['BUILDERS']['JavaClassDir'] except KeyError: fs = SCons.Node.FS.get_default_fs() javac_com = SCons.Action.Action('$JAVACCOM', '$JAVACCOMSTR') - java_class_dir = SCons.Builder.Builder(action = javac_com, - emitter = {}, - target_factory = fs.Dir, - source_factory = fs.Dir) + java_class_dir = SCons.Builder.Builder(action=javac_com, + emitter={}, + target_factory=fs.Dir, + source_factory=fs.Dir) env['BUILDERS']['JavaClassDir'] = java_class_dir return java_class_dir + def CreateJavaFileBuilder(env): try: java_file = env['BUILDERS']['JavaFile'] except KeyError: - java_file = SCons.Builder.Builder(action = {}, - emitter = {}, - suffix = {None:'$JAVASUFFIX'}) + java_file = SCons.Builder.Builder(action={}, + emitter={}, + suffix={None: '$JAVASUFFIX'}) env['BUILDERS']['JavaFile'] = java_file env['JAVASUFFIX'] = '.java' return java_file + class ToolInitializerMethod(object): """ This is added to a construction environment in place of a @@ -998,6 +1053,7 @@ class ToolInitializerMethod(object): whatever builder was (presumably) added to the construction environment in place of this particular instance. """ + def __init__(self, name, initializer): """ Note: we store the tool name as __name__ so it can be used by @@ -1036,6 +1092,7 @@ class ToolInitializerMethod(object): return [], [] return builder(*args, **kw) + class ToolInitializer(object): """ A class for delayed initialization of Tools modules. @@ -1047,6 +1104,7 @@ class ToolInitializer(object): ToolInitializerMethod objects for the various Builder methods that we want to use to delay Tool searches until necessary. """ + def __init__(self, env, tools, names): if not SCons.Util.is_List(tools): tools = [tools] @@ -1081,24 +1139,30 @@ class ToolInitializer(object): env.Tool(tool) return - # If we fall through here, there was no tool module found. - # This is where we can put an informative error message - # about the inability to find the tool. We'll start doing - # this as we cut over more pre-defined Builder+Tools to use - # the ToolInitializer class. + # If we fall through here, there was no tool module found. + # This is where we can put an informative error message + # about the inability to find the tool. We'll start doing + # this as we cut over more pre-defined Builder+Tools to use + # the ToolInitializer class. + def Initializers(env): ToolInitializer(env, ['install'], ['_InternalInstall', '_InternalInstallAs', '_InternalInstallVersionedLib']) + def Install(self, *args, **kw): return self._InternalInstall(*args, **kw) + def InstallAs(self, *args, **kw): return self._InternalInstallAs(*args, **kw) + def InstallVersionedLib(self, *args, **kw): return self._InternalInstallVersionedLib(*args, **kw) + env.AddMethod(Install) env.AddMethod(InstallAs) env.AddMethod(InstallVersionedLib) + def FindTool(tools, env): for tool in tools: t = Tool(tool) @@ -1106,14 +1170,16 @@ def FindTool(tools, env): return tool return None + def FindAllTools(tools, env): def ToolExists(tool, env=env): return Tool(tool).exists(env) - return list(filter (ToolExists, tools)) -def tool_list(platform, env): + return list(filter(ToolExists, tools)) + - other_plat_tools=[] +def tool_list(platform, env): + other_plat_tools = [] # XXX this logic about what tool to prefer on which platform # should be moved into either the platform files or # the tool files themselves. @@ -1121,21 +1187,21 @@ def tool_list(platform, env): # change these search orders, update the man page as well. if str(platform) == 'win32': "prefer Microsoft tools on Windows" - linkers = ['mslink', 'gnulink', 'ilink', 'linkloc', 'ilink32' ] - c_compilers = ['msvc', 'mingw', 'gcc', 'intelc', 'icl', 'icc', 'cc', 'bcc32' ] - cxx_compilers = ['msvc', 'intelc', 'icc', 'g++', 'cxx', 'bcc32' ] - assemblers = ['masm', 'nasm', 'gas', '386asm' ] + linkers = ['mslink', 'gnulink', 'ilink', 'linkloc', 'ilink32'] + c_compilers = ['msvc', 'mingw', 'gcc', 'intelc', 'icl', 'icc', 'cc', 'bcc32'] + cxx_compilers = ['msvc', 'intelc', 'icc', 'g++', 'cxx', 'bcc32'] + assemblers = ['masm', 'nasm', 'gas', '386asm'] fortran_compilers = ['gfortran', 'g77', 'ifl', 'cvf', 'f95', 'f90', 'fortran'] ars = ['mslib', 'ar', 'tlib'] other_plat_tools = ['msvs', 'midl'] elif str(platform) == 'os2': "prefer IBM tools on OS/2" - linkers = ['ilink', 'gnulink', ]#'mslink'] - c_compilers = ['icc', 'gcc',]# 'msvc', 'cc'] - cxx_compilers = ['icc', 'g++',]# 'msvc', 'cxx'] - assemblers = ['nasm',]# 'masm', 'gas'] + linkers = ['ilink', 'gnulink', ] # 'mslink'] + c_compilers = ['icc', 'gcc', ] # 'msvc', 'cc'] + cxx_compilers = ['icc', 'g++', ] # 'msvc', 'cxx'] + assemblers = ['nasm', ] # 'masm', 'gas'] fortran_compilers = ['ifl', 'g77'] - ars = ['ar',]# 'mslib'] + ars = ['ar', ] # 'mslib'] elif str(platform) == 'irix': "prefer MIPSPro on IRIX" linkers = ['sgilink', 'gnulink'] @@ -1188,11 +1254,11 @@ def tool_list(platform, env): else: "prefer GNU tools on all other platforms" linkers = ['gnulink', 'ilink'] - c_compilers = ['gcc', 'intelc', 'icc', 'cc'] + c_compilers = ['gcc', 'intelc', 'icc', 'cc'] cxx_compilers = ['g++', 'intelc', 'icc', 'cxx'] assemblers = ['gas', 'nasm', 'masm'] fortran_compilers = ['gfortran', 'g77', 'ifort', 'ifl', 'f95', 'f90', 'f77'] - ars = ['ar',] + ars = ['ar', ] if not str(platform) == 'win32': other_plat_tools += ['m4', 'rpm'] @@ -1224,22 +1290,24 @@ def tool_list(platform, env): d_compiler = FindTool(d_compilers, env) or d_compilers[0] other_tools = FindAllTools(other_plat_tools + [ - #TODO: merge 'install' into 'filesystem' and - # make 'filesystem' the default - 'filesystem', - 'wix', #'midl', 'msvs', - # Parser generators - 'lex', 'yacc', - # Foreign function interface - 'rpcgen', 'swig', - # Java - 'jar', 'javac', 'javah', 'rmic', - # TeX - 'dvipdf', 'dvips', 'gs', - 'tex', 'latex', 'pdflatex', 'pdftex', - # Archivers - 'tar', 'zip', - ], env) + # TODO: merge 'install' into 'filesystem' and + # make 'filesystem' the default + 'filesystem', + 'wix', # 'midl', 'msvs', + # Parser generators + 'lex', 'yacc', + # Foreign function interface + 'rpcgen', 'swig', + # Java + 'jar', 'javac', 'javah', 'rmic', + # TeX + 'dvipdf', 'dvips', 'gs', + 'tex', 'latex', 'pdflatex', 'pdftex', + # Archivers + 'tar', 'zip', + # File builders (text) + 'textfile', + ], env) tools = ([linker, c_compiler, cxx_compiler, fortran_compiler, assembler, ar, d_compiler] @@ -1247,6 +1315,33 @@ def tool_list(platform, env): return [x for x in tools if x] + +def find_program_path(env, key_program, default_paths=[]): + """ + Find the location of key_program and then return the path it was located at. + Checking the default install locations. + Mainly for windows where tools aren't all installed in /usr/bin,etc + :param env: Current Environment() + :param key_program: Program we're using to locate the directory to add to PATH. + """ + # First search in the SCons path + path = env.WhereIs(key_program) + if (path): + return path + # then the OS path: + path = SCons.Util.WhereIs(key_program) + if (path): + return path + + # If that doesn't work try default location for mingw + save_path = env['ENV']['PATH'] + for p in default_paths: + env.AppendENVPath('PATH', p) + path = env.WhereIs(key_program) + if not path: + env['ENV']['PATH'] = save_path + return path + # Local Variables: # tab-width:4 # indent-tabs-mode:nil diff --git a/engine/SCons/Tool/aixc++.py b/engine/SCons/Tool/aixc++.py index bb26584..5ededea 100644 --- a/engine/SCons/Tool/aixc++.py +++ b/engine/SCons/Tool/aixc++.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/aixc++.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/aixc++.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" #forward proxy to the preffered cxx version from SCons.Tool.aixcxx import * diff --git a/engine/SCons/Tool/aixcc.py b/engine/SCons/Tool/aixcc.py index 6ad20cb..d58184b 100644 --- a/engine/SCons/Tool/aixcc.py +++ b/engine/SCons/Tool/aixcc.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixcc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/aixcc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path diff --git a/engine/SCons/Tool/aixcxx.py b/engine/SCons/Tool/aixcxx.py index 3048cf8..c568366 100644 --- a/engine/SCons/Tool/aixcxx.py +++ b/engine/SCons/Tool/aixcxx.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/aixcxx.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/aixcxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path diff --git a/engine/SCons/Tool/aixf77.py b/engine/SCons/Tool/aixf77.py index 021a688..54f196f 100644 --- a/engine/SCons/Tool/aixf77.py +++ b/engine/SCons/Tool/aixf77.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixf77.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/aixf77.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path diff --git a/engine/SCons/Tool/aixlink.py b/engine/SCons/Tool/aixlink.py index 0aeec2c..0d808be 100644 --- a/engine/SCons/Tool/aixlink.py +++ b/engine/SCons/Tool/aixlink.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixlink.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/aixlink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/applelink.py b/engine/SCons/Tool/applelink.py index 8127828..dfb9d9d 100644 --- a/engine/SCons/Tool/applelink.py +++ b/engine/SCons/Tool/applelink.py @@ -1,6 +1,6 @@ """SCons.Tool.applelink -Tool-specific initialization for the Apple gnu-like linker. +Tool-specific initialization for Apple's gnu-like linker. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() @@ -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/applelink.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/applelink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Util @@ -39,25 +39,162 @@ import SCons.Util # the -rpath option, so we use the "link" tool instead of "gnulink". from . import link + +class AppleLinkInvalidCurrentVersionException(Exception): + pass + +class AppleLinkInvalidCompatibilityVersionException(Exception): + pass + + +def _applelib_versioned_lib_suffix(env, suffix, version): + """For suffix='.dylib' and version='0.1.2' it returns '.0.1.2.dylib'""" + Verbose = False + if Verbose: + print("_applelib_versioned_lib_suffix: suffix={!r}".format(suffix)) + print("_applelib_versioned_lib_suffix: version={!r}".format(version)) + if version not in suffix: + suffix = "." + version + suffix + if Verbose: + print("_applelib_versioned_lib_suffix: return suffix={!r}".format(suffix)) + return suffix + + +def _applelib_versioned_lib_soname(env, libnode, version, prefix, suffix, name_func): + """For libnode='/optional/dir/libfoo.X.Y.Z.dylib' it returns 'libfoo.X.dylib'""" + Verbose = False + if Verbose: + print("_applelib_versioned_lib_soname: version={!r}".format(version)) + name = name_func(env, libnode, version, prefix, suffix) + if Verbose: + print("_applelib_versioned_lib_soname: name={!r}".format(name)) + major = version.split('.')[0] + (libname,_suffix) = name.split('.') + soname = '.'.join([libname, major, _suffix]) + if Verbose: + print("_applelib_versioned_lib_soname: soname={!r}".format(soname)) + return soname + +def _applelib_versioned_shlib_soname(env, libnode, version, prefix, suffix): + return _applelib_versioned_lib_soname(env, libnode, version, prefix, suffix, link._versioned_shlib_name) + + +# User programmatically describes how SHLIBVERSION maps to values for compat/current. +_applelib_max_version_values = (65535, 255, 255) +def _applelib_check_valid_version(version_string): + """ + Check that the version # is valid. + X[.Y[.Z]] + where X 0-65535 + where Y either not specified or 0-255 + where Z either not specified or 0-255 + :param version_string: + :return: + """ + parts = version_string.split('.') + if len(parts) > 3: + return False, "Version string has too many periods [%s]"%version_string + if len(parts) <= 0: + return False, "Version string unspecified [%s]"%version_string + + for (i, p) in enumerate(parts): + try: + p_i = int(p) + except ValueError: + return False, "Version component %s (from %s) is not a number"%(p, version_string) + if p_i < 0 or p_i > _applelib_max_version_values[i]: + return False, "Version component %s (from %s) is not valid value should be between 0 and %d"%(p, version_string, _applelib_max_version_values[i]) + + return True, "" + + +def _applelib_currentVersionFromSoVersion(source, target, env, for_signature): + """ + A generator function to create the -Wl,-current_version flag if needed. + If env['APPLELINK_NO_CURRENT_VERSION'] contains a true value no flag will be generated + Otherwise if APPLELINK_CURRENT_VERSION is not specified, env['SHLIBVERSION'] + will be used. + + :param source: + :param target: + :param env: + :param for_signature: + :return: A string providing the flag to specify the current_version of the shared library + """ + if env.get('APPLELINK_NO_CURRENT_VERSION', False): + return "" + elif env.get('APPLELINK_CURRENT_VERSION', False): + version_string = env['APPLELINK_CURRENT_VERSION'] + elif env.get('SHLIBVERSION', False): + version_string = env['SHLIBVERSION'] + else: + return "" + + version_string = ".".join(version_string.split('.')[:3]) + + valid, reason = _applelib_check_valid_version(version_string) + if not valid: + raise AppleLinkInvalidCurrentVersionException(reason) + + return "-Wl,-current_version,%s" % version_string + + +def _applelib_compatVersionFromSoVersion(source, target, env, for_signature): + """ + A generator function to create the -Wl,-compatibility_version flag if needed. + If env['APPLELINK_NO_COMPATIBILITY_VERSION'] contains a true value no flag will be generated + Otherwise if APPLELINK_COMPATIBILITY_VERSION is not specified + the first two parts of env['SHLIBVERSION'] will be used with a .0 appended. + + :param source: + :param target: + :param env: + :param for_signature: + :return: A string providing the flag to specify the compatibility_version of the shared library + """ + if env.get('APPLELINK_NO_COMPATIBILITY_VERSION', False): + return "" + elif env.get('APPLELINK_COMPATIBILITY_VERSION', False): + version_string = env['APPLELINK_COMPATIBILITY_VERSION'] + elif env.get('SHLIBVERSION', False): + version_string = ".".join(env['SHLIBVERSION'].split('.')[:2] + ['0']) + else: + return "" + + if version_string is None: + return "" + + valid, reason = _applelib_check_valid_version(version_string) + if not valid: + raise AppleLinkInvalidCompatibilityVersionException(reason) + + return "-Wl,-compatibility_version,%s" % version_string + + def generate(env): """Add Builders and construction variables for applelink to an Environment.""" link.generate(env) env['FRAMEWORKPATHPREFIX'] = '-F' - env['_FRAMEWORKPATH'] = '${_concat(FRAMEWORKPATHPREFIX, FRAMEWORKPATH, "", __env__)}' + env['_FRAMEWORKPATH'] = '${_concat(FRAMEWORKPATHPREFIX, FRAMEWORKPATH, "", __env__, RDirs)}' + env['_FRAMEWORKS'] = '${_concat("-framework ", FRAMEWORKS, "", __env__)}' env['LINKCOM'] = env['LINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS' env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -dynamiclib') env['SHLINKCOM'] = env['SHLINKCOM'] + ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS' - # TODO: Work needed to generate versioned shared libraries - # Leaving this commented out, and also going to disable versioned library checking for now # see: http://docstore.mik.ua/orelly/unix3/mac/ch05_04.htm for proper naming - #link._setup_versioned_lib_variables(env, tool = 'applelink')#, use_soname = use_soname) - #env['LINKCALLBACKS'] = link._versioned_lib_callbacks() + link._setup_versioned_lib_variables(env, tool = 'applelink')#, use_soname = use_soname) + env['LINKCALLBACKS'] = link._versioned_lib_callbacks() + env['LINKCALLBACKS']['VersionedShLibSuffix'] = _applelib_versioned_lib_suffix + env['LINKCALLBACKS']['VersionedShLibSoname'] = _applelib_versioned_shlib_soname + env['_APPLELINK_CURRENT_VERSION'] = _applelib_currentVersionFromSoVersion + env['_APPLELINK_COMPATIBILITY_VERSION'] = _applelib_compatVersionFromSoVersion + env['_SHLIBVERSIONFLAGS'] = '$_APPLELINK_CURRENT_VERSION $_APPLELINK_COMPATIBILITY_VERSION ' + env['_LDMODULEVERSIONFLAGS'] = '$_APPLELINK_CURRENT_VERSION $_APPLELINK_COMPATIBILITY_VERSION ' # override the default for loadable modules, which are different # on OS X than dynamic shared libs. echoing what XCode does for @@ -67,6 +204,8 @@ def generate(env): env['LDMODULEFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -bundle') env['LDMODULECOM'] = '$LDMODULE -o ${TARGET} $LDMODULEFLAGS $SOURCES $_LIBDIRFLAGS $_LIBFLAGS $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS' + env['__SHLIBVERSIONFLAGS'] = '${__libversionflags(__env__,"SHLIBVERSION","_SHLIBVERSIONFLAGS")}' + def exists(env): diff --git a/engine/SCons/Tool/ar.py b/engine/SCons/Tool/ar.py index 54ef071..aee2426 100644 --- a/engine/SCons/Tool/ar.py +++ b/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 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/ar.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/as.py b/engine/SCons/Tool/as.py index 7353cd8..e0d0239 100644 --- a/engine/SCons/Tool/as.py +++ b/engine/SCons/Tool/as.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/as.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/as.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/bcc32.py b/engine/SCons/Tool/bcc32.py index 8cb045d..17cd4fc 100644 --- a/engine/SCons/Tool/bcc32.py +++ b/engine/SCons/Tool/bcc32.py @@ -5,7 +5,7 @@ XXX """ # -# 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 @@ -27,7 +27,7 @@ XXX # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/bcc32.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/bcc32.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/c++.py b/engine/SCons/Tool/c++.py index b6e4714..bdd067c 100644 --- a/engine/SCons/Tool/c++.py +++ b/engine/SCons/Tool/c++.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/c++.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/c++.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" #forward proxy to the preffered cxx version diff --git a/engine/SCons/Tool/cc.py b/engine/SCons/Tool/cc.py index 211be56..e00df46 100644 --- a/engine/SCons/Tool/cc.py +++ b/engine/SCons/Tool/cc.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/cc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/cc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Tool import SCons.Defaults diff --git a/engine/SCons/Tool/clang.py b/engine/SCons/Tool/clang.py index 46ee128..83311eb 100644 --- a/engine/SCons/Tool/clang.py +++ b/engine/SCons/Tool/clang.py @@ -11,7 +11,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 @@ -33,7 +33,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# __revision__ = "src/engine/SCons/Tool/clang.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +# __revision__ = "src/engine/SCons/Tool/clang.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" # Based on SCons/Tool/gcc.py by Paweł Tomulik 2014 as a separate tool. # Brought into the SCons mainline by Russel Winder 2017. @@ -45,6 +45,8 @@ import sys import SCons.Util import SCons.Tool.cc +from SCons.Tool.clangCommon import get_clang_install_dirs + compilers = ['clang'] @@ -52,11 +54,20 @@ def generate(env): """Add Builders and construction variables for clang to an Environment.""" SCons.Tool.cc.generate(env) + if env['PLATFORM'] == 'win32': + # Ensure that we have a proper path for clang + clang = SCons.Tool.find_program_path(env, compilers[0], + default_paths=get_clang_install_dirs(env['PLATFORM'])) + if clang: + clang_bin_dir = os.path.dirname(clang) + env.AppendENVPath('PATH', clang_bin_dir) + env['CC'] = env.Detect(compilers) or 'clang' if env['PLATFORM'] in ['cygwin', 'win32']: env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') else: env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS -fPIC') + # determine compiler version if env['CC']: #pipe = SCons.Action._subproc(env, [env['CC'], '-dumpversion'], diff --git a/engine/SCons/Tool/clangCommon/__init__.py b/engine/SCons/Tool/clangCommon/__init__.py new file mode 100644 index 0000000..37efbf6 --- /dev/null +++ b/engine/SCons/Tool/clangCommon/__init__.py @@ -0,0 +1,17 @@ +""" +Common routines and data for clang tools +""" + +clang_win32_dirs = [ + r'C:\Program Files\LLVM\bin', + r'C:\cygwin64\bin', + r'C:\msys64', + r'C:\cygwin\bin', + r'C:\msys', +] + +def get_clang_install_dirs(platform): + if platform == 'win32': + return clang_win32_dirs + else: + return [] \ No newline at end of file diff --git a/engine/SCons/Tool/clangxx.py b/engine/SCons/Tool/clangxx.py index 63a9dec..6e4199e 100644 --- a/engine/SCons/Tool/clangxx.py +++ b/engine/SCons/Tool/clangxx.py @@ -11,7 +11,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 @@ -33,7 +33,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# __revision__ = "src/engine/SCons/Tool/clangxx.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +# __revision__ = "src/engine/SCons/Tool/clangxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" # Based on SCons/Tool/g++.py by Paweł Tomulik 2014 as a separate tool. # Brought into the SCons mainline by Russel Winder 2017. @@ -46,6 +46,8 @@ import sys import SCons.Tool import SCons.Util import SCons.Tool.cxx +from SCons.Tool.clangCommon import get_clang_install_dirs + compilers = ['clang++'] @@ -66,13 +68,22 @@ def generate(env): env['SHOBJSUFFIX'] = '.pic.o' elif env['PLATFORM'] == 'sunos': env['SHOBJSUFFIX'] = '.pic.o' + elif env['PLATFORM'] == 'win32': + # Ensure that we have a proper path for clang++ + clangxx = SCons.Tool.find_program_path(env, compilers[0], default_paths=get_clang_install_dirs(env['PLATFORM'])) + if clangxx: + clangxx_bin_dir = os.path.dirname(clangxx) + env.AppendENVPath('PATH', clangxx_bin_dir) + # determine compiler version if env['CXX']: pipe = SCons.Action._subproc(env, [env['CXX'], '--version'], stdin='devnull', stderr='devnull', stdout=subprocess.PIPE) - if pipe.wait() != 0: return + if pipe.wait() != 0: + return + # clang -dumpversion is of no use line = pipe.stdout.readline() if sys.version_info[0] > 2: diff --git a/engine/SCons/Tool/cvf.py b/engine/SCons/Tool/cvf.py index 53af6ac..dde3a3e 100644 --- a/engine/SCons/Tool/cvf.py +++ b/engine/SCons/Tool/cvf.py @@ -5,7 +5,7 @@ Tool-specific initialization for the Compaq Visual Fortran compiler. """ # -# 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 @@ -27,7 +27,7 @@ Tool-specific initialization for the Compaq Visual Fortran compiler. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/cvf.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/cvf.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from . import fortran diff --git a/engine/SCons/Tool/cxx.py b/engine/SCons/Tool/cxx.py index ef1bc12..85fb2fb 100644 --- a/engine/SCons/Tool/cxx.py +++ b/engine/SCons/Tool/cxx.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/cxx.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/cxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path diff --git a/engine/SCons/Tool/default.py b/engine/SCons/Tool/default.py index ac69c7c..928e365 100644 --- a/engine/SCons/Tool/default.py +++ b/engine/SCons/Tool/default.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/default.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/default.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Tool diff --git a/engine/SCons/Tool/dmd.py b/engine/SCons/Tool/dmd.py index e60b722..d9bed9c 100644 --- a/engine/SCons/Tool/dmd.py +++ b/engine/SCons/Tool/dmd.py @@ -31,7 +31,7 @@ Lib tool variables: """ # -# 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 @@ -53,7 +53,7 @@ Lib tool variables: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/dmd.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/dmd.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import subprocess diff --git a/engine/SCons/Tool/docbook/__init__.py b/engine/SCons/Tool/docbook/__init__.py index ed63784..d7d10c0 100644 --- a/engine/SCons/Tool/docbook/__init__.py +++ b/engine/SCons/Tool/docbook/__init__.py @@ -10,7 +10,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 @@ -166,6 +166,8 @@ xsltproc_com_priority = ['xsltproc', 'saxon', 'saxon-xslt', 'xalan'] # see: http://saxon.sourceforge.net/ xsltproc_com = {'xsltproc' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE', 'saxon' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS', + # Note if saxon-xslt is version 5.5 the proper arguments are: (swap order of docbook_xsl and source) + # 'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $SOURCE $DOCBOOK_XSL $DOCBOOK_XSLTPROCPARAMS', 'saxon-xslt' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -o $TARGET $DOCBOOK_XSL $SOURCE $DOCBOOK_XSLTPROCPARAMS', 'xalan' : '$DOCBOOK_XSLTPROC $DOCBOOK_XSLTPROCFLAGS -q -out $TARGET -xsl $DOCBOOK_XSL -in $SOURCE'} xmllint_com = {'xmllint' : '$DOCBOOK_XMLLINT $DOCBOOK_XMLLINTFLAGS --xinclude $SOURCE > $TARGET'} diff --git a/engine/SCons/Tool/dvi.py b/engine/SCons/Tool/dvi.py index 185095b..7fbca27 100644 --- a/engine/SCons/Tool/dvi.py +++ b/engine/SCons/Tool/dvi.py @@ -5,7 +5,7 @@ Common DVI Builder definition for various other Tool modules that use it. """ # -# 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 @@ -27,7 +27,7 @@ Common DVI Builder definition for various other Tool modules that use it. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/dvi.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/dvi.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Builder import SCons.Tool diff --git a/engine/SCons/Tool/dvipdf.py b/engine/SCons/Tool/dvipdf.py index 66f248c..340929e 100644 --- a/engine/SCons/Tool/dvipdf.py +++ b/engine/SCons/Tool/dvipdf.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 @@ -30,7 +30,7 @@ selection method. # 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/Tool/dvipdf.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/dvipdf.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Action import SCons.Defaults diff --git a/engine/SCons/Tool/dvips.py b/engine/SCons/Tool/dvips.py index 45469f2..16d409d 100644 --- a/engine/SCons/Tool/dvips.py +++ b/engine/SCons/Tool/dvips.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/dvips.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/dvips.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/f03.py b/engine/SCons/Tool/f03.py index 3e6dbda..dddc650 100644 --- a/engine/SCons/Tool/f03.py +++ b/engine/SCons/Tool/f03.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/f03.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/f03.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/f08.py b/engine/SCons/Tool/f08.py index c2c88fe..c5209e4 100644 --- a/engine/SCons/Tool/f08.py +++ b/engine/SCons/Tool/f08.py @@ -11,7 +11,7 @@ selection method. from __future__ import absolute_import # -# 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 @@ -33,7 +33,7 @@ from __future__ import absolute_import # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f08.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/f08.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/f77.py b/engine/SCons/Tool/f77.py index 302a835..2665867 100644 --- a/engine/SCons/Tool/f77.py +++ b/engine/SCons/Tool/f77.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/f77.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/f77.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults import SCons.Scanner.Fortran diff --git a/engine/SCons/Tool/f90.py b/engine/SCons/Tool/f90.py index 9efc107..a6f5cff 100644 --- a/engine/SCons/Tool/f90.py +++ b/engine/SCons/Tool/f90.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/f90.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/f90.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults import SCons.Scanner.Fortran diff --git a/engine/SCons/Tool/f95.py b/engine/SCons/Tool/f95.py index 4c6c5db..3e611e8 100644 --- a/engine/SCons/Tool/f95.py +++ b/engine/SCons/Tool/f95.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/f95.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/f95.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/filesystem.py b/engine/SCons/Tool/filesystem.py index 38ce605..312f08c 100644 --- a/engine/SCons/Tool/filesystem.py +++ b/engine/SCons/Tool/filesystem.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/filesystem.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/filesystem.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons from SCons.Tool.install import copyFunc diff --git a/engine/SCons/Tool/fortran.py b/engine/SCons/Tool/fortran.py index 099c28b..b57a845 100644 --- a/engine/SCons/Tool/fortran.py +++ b/engine/SCons/Tool/fortran.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/fortran.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/fortran.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import re diff --git a/engine/SCons/Tool/g++.py b/engine/SCons/Tool/g++.py index d9a4fc7..b28e39d 100644 --- a/engine/SCons/Tool/g++.py +++ b/engine/SCons/Tool/g++.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/g++.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/g++.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" #forward proxy to the preffered cxx version diff --git a/engine/SCons/Tool/g77.py b/engine/SCons/Tool/g77.py index 5e7a935..1c1f101 100644 --- a/engine/SCons/Tool/g77.py +++ b/engine/SCons/Tool/g77.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/g77.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/g77.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Util from SCons.Tool.FortranCommon import add_all_to_env, add_f77_to_env diff --git a/engine/SCons/Tool/gas.py b/engine/SCons/Tool/gas.py index fbd056f..5ad8a76 100644 --- a/engine/SCons/Tool/gas.py +++ b/engine/SCons/Tool/gas.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/gas.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/gas.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" try: as_module = __import__('as', globals(), locals(), []) diff --git a/engine/SCons/Tool/gcc.py b/engine/SCons/Tool/gcc.py index a30483d..880fc80 100644 --- a/engine/SCons/Tool/gcc.py +++ b/engine/SCons/Tool/gcc.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/gcc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/gcc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from . import cc import os @@ -42,6 +42,7 @@ import SCons.Util compilers = ['gcc', 'cc'] + def generate(env): """Add Builders and construction variables for gcc to an Environment.""" @@ -59,38 +60,48 @@ def generate(env): if version: env['CCVERSION'] = version + def exists(env): # is executable, and is a GNU compiler (or accepts '--version' at least) return detect_version(env, env.Detect(env.get('CC', compilers))) + def detect_version(env, cc): """Return the version of the GNU compiler, or None if it is not a GNU compiler.""" + version = None cc = env.subst(cc) if not cc: - return None - version = None - #pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['-dumpversion'], - pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['--version'], - stdin = 'devnull', - stderr = 'devnull', - stdout = subprocess.PIPE) + return version + # -dumpversion was added in GCC 3.0. As long as we're supporting # GCC versions older than that, we should use --version and a # regular expression. - #line = pipe.stdout.read().strip() - #if line: - # version = line - line = SCons.Util.to_str(pipe.stdout.readline()) + # pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['-dumpversion'], + pipe = SCons.Action._subproc(env, SCons.Util.CLVar(cc) + ['--version'], + stdin='devnull', + stderr='devnull', + stdout=subprocess.PIPE) + if pipe.wait() != 0: + return version + + with pipe.stdout: + # -dumpversion variant: + # line = pipe.stdout.read().strip() + # --version variant: + line = SCons.Util.to_str(pipe.stdout.readline()) + # Non-GNU compiler's output (like AIX xlc's) may exceed the stdout buffer: + # So continue with reading to let the child process actually terminate. + while SCons.Util.to_str(pipe.stdout.readline()): + pass + + # -dumpversion variant: + # if line: + # version = line + # --version variant: match = re.search(r'[0-9]+(\.[0-9]+)+', line) if match: version = match.group(0) - # Non-GNU compiler's output (like AIX xlc's) may exceed the stdout buffer: - # So continue with reading to let the child process actually terminate. - while SCons.Util.to_str(pipe.stdout.readline()): - pass - ret = pipe.wait() - if ret != 0: - return None + return version # Local Variables: diff --git a/engine/SCons/Tool/gdc.py b/engine/SCons/Tool/gdc.py index 44dce71..2e5f03b 100644 --- a/engine/SCons/Tool/gdc.py +++ b/engine/SCons/Tool/gdc.py @@ -26,7 +26,7 @@ Lib tool variables: """ # -# 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 @@ -48,7 +48,7 @@ Lib tool variables: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gdc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/gdc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Action import SCons.Defaults diff --git a/engine/SCons/Tool/gettext_tool.py b/engine/SCons/Tool/gettext_tool.py index 3c6c8e4..504ec46 100644 --- a/engine/SCons/Tool/gettext_tool.py +++ b/engine/SCons/Tool/gettext_tool.py @@ -2,7 +2,7 @@ """ -# 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 @@ -23,14 +23,26 @@ # 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/Tool/gettext_tool.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/gettext_tool.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" ############################################################################# def generate(env,**kw): + import sys + import os import SCons.Tool + from SCons.Platform.mingw import MINGW_DEFAULT_PATHS + from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS + from SCons.Tool.GettextCommon \ import _translate, tool_list for t in tool_list(env['PLATFORM'], env): + if sys.platform == 'win32': + tool = SCons.Tool.find_program_path(env, t, default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) + if tool: + tool_bin_dir = os.path.dirname(tool) + env.AppendENVPath('PATH', tool_bin_dir) + else: + SCons.Warnings.Warning(t + ' tool requested, but binary not found in ENV PATH') env.Tool(t) env.AddMethod(_translate, 'Translate') ############################################################################# diff --git a/engine/SCons/Tool/gfortran.py b/engine/SCons/Tool/gfortran.py index 5f84dd6..e543efd 100644 --- a/engine/SCons/Tool/gfortran.py +++ b/engine/SCons/Tool/gfortran.py @@ -10,7 +10,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 @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gfortran.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/gfortran.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Util @@ -54,6 +54,8 @@ def generate(env): env['INC%sPREFIX' % dialect] = "-I" env['INC%sSUFFIX' % dialect] = "" + env['FORTRANMODDIRPREFIX'] = "-J" + def exists(env): return env.Detect('gfortran') diff --git a/engine/SCons/Tool/gnulink.py b/engine/SCons/Tool/gnulink.py index 6ffd185..cf8a65d 100644 --- a/engine/SCons/Tool/gnulink.py +++ b/engine/SCons/Tool/gnulink.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/gnulink.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/gnulink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Util import SCons.Tool diff --git a/engine/SCons/Tool/gs.py b/engine/SCons/Tool/gs.py index 9bd797c..a1e0bd9 100644 --- a/engine/SCons/Tool/gs.py +++ b/engine/SCons/Tool/gs.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/gs.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/gs.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/gxx.py b/engine/SCons/Tool/gxx.py index ceb4a8a..b98ae07 100644 --- a/engine/SCons/Tool/gxx.py +++ b/engine/SCons/Tool/gxx.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/gxx.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/gxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path import re @@ -45,12 +45,13 @@ from . import cxx compilers = ['g++'] + def generate(env): """Add Builders and construction variables for g++ to an Environment.""" static_obj, shared_obj = SCons.Tool.createObjBuilders(env) if 'CXX' not in env: - env['CXX'] = env.Detect(compilers) or compilers[0] + env['CXX'] = env.Detect(compilers) or compilers[0] cxx.generate(env) @@ -68,6 +69,7 @@ def generate(env): if version: env['CXXVERSION'] = version + def exists(env): # is executable, and is a GNU compiler (or accepts '--version' at least) return gcc.detect_version(env, env.Detect(env.get('CXX', compilers))) diff --git a/engine/SCons/Tool/hpc++.py b/engine/SCons/Tool/hpc++.py index bcfb2a6..5cbe20e 100644 --- a/engine/SCons/Tool/hpc++.py +++ b/engine/SCons/Tool/hpc++.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/hpc++.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/hpc++.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" #forward proxy to the preffered cxx version diff --git a/engine/SCons/Tool/hpcc.py b/engine/SCons/Tool/hpcc.py index c0408ee..27bdfa6 100644 --- a/engine/SCons/Tool/hpcc.py +++ b/engine/SCons/Tool/hpcc.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/hpcc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/hpcc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/hpcxx.py b/engine/SCons/Tool/hpcxx.py index aa1961f..6bfb600 100644 --- a/engine/SCons/Tool/hpcxx.py +++ b/engine/SCons/Tool/hpcxx.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/hpcxx.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/hpcxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path diff --git a/engine/SCons/Tool/hplink.py b/engine/SCons/Tool/hplink.py index d667022..502b945 100644 --- a/engine/SCons/Tool/hplink.py +++ b/engine/SCons/Tool/hplink.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/hplink.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/hplink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/icc.py b/engine/SCons/Tool/icc.py index c6c0510..f16e79a 100644 --- a/engine/SCons/Tool/icc.py +++ b/engine/SCons/Tool/icc.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/icc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/icc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from . import cc diff --git a/engine/SCons/Tool/icl.py b/engine/SCons/Tool/icl.py index e70a7cb..7a7b21b 100644 --- a/engine/SCons/Tool/icl.py +++ b/engine/SCons/Tool/icl.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/icl.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/icl.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Tool.intelc diff --git a/engine/SCons/Tool/ifl.py b/engine/SCons/Tool/ifl.py index d0620c7..d351e4e 100644 --- a/engine/SCons/Tool/ifl.py +++ b/engine/SCons/Tool/ifl.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/ifl.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/ifl.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults from SCons.Scanner.Fortran import FortranScan diff --git a/engine/SCons/Tool/ifort.py b/engine/SCons/Tool/ifort.py index a02e0e3..7a3128e 100644 --- a/engine/SCons/Tool/ifort.py +++ b/engine/SCons/Tool/ifort.py @@ -10,7 +10,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 @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ifort.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/ifort.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults from SCons.Scanner.Fortran import FortranScan diff --git a/engine/SCons/Tool/ilink.py b/engine/SCons/Tool/ilink.py index 70f90da..c27443a 100644 --- a/engine/SCons/Tool/ilink.py +++ b/engine/SCons/Tool/ilink.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/ilink.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/ilink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/ilink32.py b/engine/SCons/Tool/ilink32.py index 0108e77..69430ec 100644 --- a/engine/SCons/Tool/ilink32.py +++ b/engine/SCons/Tool/ilink32.py @@ -5,7 +5,7 @@ XXX """ # -# 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 @@ -27,7 +27,7 @@ XXX # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ilink32.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/ilink32.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Tool import SCons.Tool.bcc32 diff --git a/engine/SCons/Tool/install.py b/engine/SCons/Tool/install.py index 67b81ba..c388b2a 100644 --- a/engine/SCons/Tool/install.py +++ b/engine/SCons/Tool/install.py @@ -8,7 +8,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. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/install.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/install.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import re diff --git a/engine/SCons/Tool/intelc.py b/engine/SCons/Tool/intelc.py index e95573b..63df411 100644 --- a/engine/SCons/Tool/intelc.py +++ b/engine/SCons/Tool/intelc.py @@ -10,7 +10,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 @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import division, print_function -__revision__ = "src/engine/SCons/Tool/intelc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/intelc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import math, sys, os.path, glob, string, re @@ -73,7 +73,7 @@ def linux_ver_normalize(vstr): m = re.match(r'([0-9]+)\.([0-9]+)\.([0-9]+)', vstr) if m: vmaj,vmin,build = m.groups() - return float(vmaj) * 10. + float(vmin) + float(build) / 1000.; + return float(vmaj) * 10. + float(vmin) + float(build) / 1000. else: f = float(vstr) if is_windows: diff --git a/engine/SCons/Tool/ipkg.py b/engine/SCons/Tool/ipkg.py index e146bdd..0027781 100644 --- a/engine/SCons/Tool/ipkg.py +++ b/engine/SCons/Tool/ipkg.py @@ -11,7 +11,7 @@ packages fake_root. """ # -# 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 @@ -33,7 +33,7 @@ packages fake_root. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ipkg.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/ipkg.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os diff --git a/engine/SCons/Tool/jar.py b/engine/SCons/Tool/jar.py index cafa3bd..4d686af 100644 --- a/engine/SCons/Tool/jar.py +++ b/engine/SCons/Tool/jar.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,12 +31,14 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/jar.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/jar.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +import os import SCons.Subst import SCons.Util from SCons.Node.FS import _my_normcase -import os +from SCons.Tool.JavaCommon import get_java_install_dirs + def jarSources(target, source, env, for_signature): """Only include sources that are not a manifest file.""" @@ -52,7 +54,7 @@ def jarSources(target, source, env, for_signature): result = [] for src in source: contents = src.get_text_contents() - if contents[:16] != "Manifest-Version": + if not contents.startswith("Manifest-Version"): if jarchdir_set: _chdir = jarchdir else: @@ -73,7 +75,7 @@ def jarManifest(target, source, env, for_signature): """Look in sources for a manifest file, if any.""" for src in source: contents = src.get_text_contents() - if contents[:16] == "Manifest-Version": + if contents.startswith("Manifest-Version"): return src return '' @@ -83,7 +85,7 @@ def jarFlags(target, source, env, for_signature): jarflags = env.subst('$JARFLAGS', target=target, source=source) for src in source: contents = src.get_text_contents() - if contents[:16] == "Manifest-Version": + if contents.startswith("Manifest-Version"): if not 'm' in jarflags: return jarflags + 'm' break @@ -115,7 +117,7 @@ def Jar(env, target = None, source = [], *args, **kw): return jars # they passed no target so make a target implicitly - if target == None: + if target is None: try: # make target from the first source file target = os.path.splitext(str(source[0]))[0] + env.subst('$JARSUFFIX') @@ -133,68 +135,68 @@ def Jar(env, target = None, source = [], *args, **kw): # setup for checking through all the sources and handle accordingly java_class_suffix = env.subst('$JAVACLASSSUFFIX') java_suffix = env.subst('$JAVASUFFIX') - target_classes = [] + target_nodes = [] # function for determining what to do with a file and not a directory # if its already a class file then it can be used as a # source for jar, otherwise turn it into a class file then # return the source def file_to_class(s): - if(str(_my_normcase(s)).endswith(java_suffix)): + if _my_normcase(str(s)).endswith(java_suffix): return env.JavaClassFile(source = s, *args, **kw) else: return [env.fs.File(s)] - # In the case that we are passed just string to a node which is directory - # but does not exist, we need to check all the current targets to see if - # that directory is going to exist so we can add it as a source to Jar builder - def get_all_targets(env, node='.'): - def get_all_targets_iter(env, node): - if node.has_builder(): - yield node - for kid in node.all_children(): - for kid in get_all_targets(env, kid): - yield kid - node = env.arg2nodes(node, env.fs.Entry)[0] - return list(get_all_targets_iter(env, node)) + # function for calling the JavaClassDir builder if a directory is + # passed as a source to Jar builder. The JavaClassDir builder will + # return an empty list if there were not target classes built from + # the directory, in this case assume the user wanted the directory + # copied into the jar as is (it contains other files such as + # resources or class files compiled from proir commands) + # TODO: investigate the expexcted behavior for directories that + # have mixed content, such as Java files along side other files + # files. + def dir_to_class(s): + dir_targets = env.JavaClassDir(source = s, *args, **kw) + if(dir_targets == []): + # no classes files could be built from the source dir + # so pass the dir as is. + return [env.fs.Dir(s)] + else: + return dir_targets # loop through the sources and handle each accordingly # the goal here is to get all the source files into a class # file or a directory that contains class files - for s in source: + for s in SCons.Util.flatten(source): s = env.subst(s) if isinstance(s, SCons.Node.FS.Base): if isinstance(s, SCons.Node.FS.File): # found a file so make sure its a class file - target_classes.extend(file_to_class(s)) + target_nodes.extend(file_to_class(s)) else: - # found a dir so make sure its a dir of class files - target_classes.extend(env.JavaClassDir(source = env.fs.Dir(s), *args, **kw)) + # found a dir so get the class files out of it + target_nodes.extend(dir_to_class(s)) else: - if os.path.isfile(s): - # found a file that exists on the FS, make sure its a class file - target_classes.extend(file_to_class(s)) - elif os.path.isdir(s): - # found a dir on the FS, add it as a dir of class files - target_classes.append(env.fs.Dir(s)) - elif s[-len(java_suffix):] == java_suffix or s[-len(java_class_suffix):] == java_class_suffix: - # found a file that may not exists and is only a string - # so add it after converting it to a class file - target_classes.extend(file_to_class(s)) - else: - # found a swig file so add it after converting it to class files - if(os.path.splitext(str(s))[1] == ".i"): - target_classes.extend(env.JavaClassFile(source = s, *args, **kw)) - else: - # found a directory that does not yet exist, but can exist as a node - # check the target nodes to make sure it will be built, then add - # it as a source - for node in get_all_targets(env): - if(s in str(node) and os.path.splitext(str(node))[1] == ""): - target_classes.append(node) + try: + # source is string try to convert it to file + target_nodes.extend(file_to_class(env.fs.File(s))) + continue + except: + pass + + try: + # source is string try to covnert it to dir + target_nodes.extend(dir_to_class(env.fs.Dir(s))) + continue + except: + pass + + SCons.Warnings.Warning("File: " + str(s) + " could not be identified as File or Directory, skipping.") + # at this point all our sources have been converted to classes or directories of class # so pass it to the Jar builder - return env.JarFile(target = target, source = target_classes, *args, **kw) + return env.JarFile(target = target, source = target_nodes, *args, **kw) def generate(env): """Add Builders and construction variables for jar to an Environment.""" @@ -206,6 +208,14 @@ def generate(env): env.AddMethod(Jar) + if env['PLATFORM'] == 'win32': + # Ensure that we have a proper path for clang + jar = SCons.Tool.find_program_path(env, 'jar', + default_paths=get_java_install_dirs(env['PLATFORM'])) + if jar: + jar_bin_dir = os.path.dirname(jar) + env.AppendENVPath('PATH', jar_bin_dir) + env['JAR'] = 'jar' env['JARFLAGS'] = SCons.Util.CLVar('cf') env['_JARFLAGS'] = jarFlags diff --git a/engine/SCons/Tool/javac.py b/engine/SCons/Tool/javac.py index ded1a3e..a295bfe 100644 --- a/engine/SCons/Tool/javac.py +++ b/engine/SCons/Tool/javac.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 @@ -30,15 +30,16 @@ selection method. # 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/Tool/javac.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/javac.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import os.path +from collections import OrderedDict import SCons.Action import SCons.Builder from SCons.Node.FS import _my_normcase -from SCons.Tool.JavaCommon import parse_java_file +from SCons.Tool.JavaCommon import parse_java_file, get_java_install_dirs, get_java_include_paths import SCons.Util def classname(path): @@ -70,7 +71,7 @@ def emit_java_classes(target, source, env): if isinstance(entry, SCons.Node.FS.File): slist.append(entry) elif isinstance(entry, SCons.Node.FS.Dir): - result = SCons.Util.OrderedDict() + result = OrderedDict() dirnode = entry.rdir() def find_java_files(arg, dirpath, filenames): java_files = sorted([n for n in filenames @@ -207,6 +208,21 @@ def generate(env): env.AddMethod(Java) + version = env.get('JAVAVERSION', None) + + javac = SCons.Tool.find_program_path(env, 'javac') + if env['PLATFORM'] == 'win32': + # Ensure that we have a proper path for javac + paths=get_java_install_dirs(env['PLATFORM'], version=version) + javac = SCons.Tool.find_program_path(env, 'javac', + default_paths=paths) + if javac: + javac_bin_dir = os.path.dirname(javac) + env.AppendENVPath('PATH', javac_bin_dir) + + env['JAVAINCLUDES'] = get_java_include_paths(env, javac, version) + + env['JAVAC'] = 'javac' env['JAVACFLAGS'] = SCons.Util.CLVar('') env['JAVABOOTCLASSPATH'] = [] diff --git a/engine/SCons/Tool/javah.py b/engine/SCons/Tool/javah.py index 2ff5ccf..791c7ab 100644 --- a/engine/SCons/Tool/javah.py +++ b/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 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/javah.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" 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/engine/SCons/Tool/latex.py b/engine/SCons/Tool/latex.py index d9011bf..008a98a 100644 --- a/engine/SCons/Tool/latex.py +++ b/engine/SCons/Tool/latex.py @@ -10,7 +10,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 @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/latex.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/latex.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Action import SCons.Defaults diff --git a/engine/SCons/Tool/ldc.py b/engine/SCons/Tool/ldc.py index 4c05bdb..c2e9a8f 100644 --- a/engine/SCons/Tool/ldc.py +++ b/engine/SCons/Tool/ldc.py @@ -26,7 +26,7 @@ Lib tool variables: """ # -# 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 @@ -48,7 +48,7 @@ Lib tool variables: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ldc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/ldc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import subprocess diff --git a/engine/SCons/Tool/lex.py b/engine/SCons/Tool/lex.py index b61ec90..fc6322f 100644 --- a/engine/SCons/Tool/lex.py +++ b/engine/SCons/Tool/lex.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,13 +31,17 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/lex.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/lex.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path +import sys import SCons.Action import SCons.Tool import SCons.Util +from SCons.Platform.mingw import MINGW_DEFAULT_PATHS +from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS +from SCons.Platform.win32 import CHOCO_DEFAULT_PATH LexAction = SCons.Action.Action("$LEXCOM", "$LEXCOMSTR") @@ -64,6 +68,29 @@ def lexEmitter(target, source, env): target.append(fileName) return (target, source) +def get_lex_path(env, append_paths=False): + """ + Find the a path containing the lex or flex binaries. If a construction + environment is passed in then append the path to the ENV PATH. + """ + # save existing path to reset if we don't want to append any paths + envPath = env['ENV']['PATH'] + bins = ['flex', 'lex', 'win_flex'] + + for prog in bins: + bin_path = SCons.Tool.find_program_path( + env, + prog, + default_paths=CHOCO_DEFAULT_PATH + MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) + if bin_path: + if not append_paths: + env['ENV']['PATH'] = envPath + else: + env.AppendENVPath('PATH', os.path.dirname(bin_path)) + return bin_path + SCons.Warnings.Warning('lex tool requested, but lex or flex binary not found in ENV PATH') + + def generate(env): """Add Builders and construction variables for lex to an Environment.""" c_file, cxx_file = SCons.Tool.createCFileBuilders(env) @@ -83,12 +110,23 @@ def generate(env): cxx_file.add_action(".ll", LexAction) cxx_file.add_emitter(".ll", lexEmitter) - env["LEX"] = env.Detect("flex") or "lex" env["LEXFLAGS"] = SCons.Util.CLVar("") - env["LEXCOM"] = "$LEX $LEXFLAGS -t $SOURCES > $TARGET" + + if sys.platform == 'win32': + get_lex_path(env, append_paths=True) + env["LEX"] = env.Detect(['flex', 'lex', 'win_flex']) + if not env.get("LEXUNISTD"): + env["LEXUNISTD"] = SCons.Util.CLVar("") + env["LEXCOM"] = "$LEX $LEXUNISTD $LEXFLAGS -t $SOURCES > $TARGET" + else: + env["LEX"] = env.Detect(["flex", "lex"]) + env["LEXCOM"] = "$LEX $LEXFLAGS -t $SOURCES > $TARGET" def exists(env): - return env.Detect(["flex", "lex"]) + if sys.platform == 'win32': + return get_lex_path(env) + else: + return env.Detect(["flex", "lex"]) # Local Variables: # tab-width:4 diff --git a/engine/SCons/Tool/link.py b/engine/SCons/Tool/link.py index 1ff27a8..95a00cc 100644 --- a/engine/SCons/Tool/link.py +++ b/engine/SCons/Tool/link.py @@ -1,4 +1,3 @@ - """SCons.Tool.link Tool-specific initialization for the generic Posix linker. @@ -10,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 @@ -33,7 +32,7 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/link.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/link.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import sys import re @@ -47,22 +46,21 @@ from SCons.Tool.FortranCommon import isfortran from SCons.Tool.DCommon import isD -import SCons.Tool.cxx -cplusplus = SCons.Tool.cxx -# cplusplus = __import__(__package__+'.cxx', globals(), locals(), ['*']) +from SCons.Tool.cxx import iscplusplus issued_mixed_link_warning = False + def smart_link(source, target, env, for_signature): - has_cplusplus = cplusplus.iscplusplus(source) + has_cplusplus = iscplusplus(source) has_fortran = isfortran(env, source) has_d = isD(env, source) if has_cplusplus and has_fortran and not has_d: global issued_mixed_link_warning if not issued_mixed_link_warning: msg = "Using $CXX to link Fortran and C++ code together.\n\t" + \ - "This may generate a buggy executable if the '%s'\n\t" + \ - "compiler does not know how to deal with Fortran runtimes." + "This may generate a buggy executable if the '%s'\n\t" + \ + "compiler does not know how to deal with Fortran runtimes." SCons.Warnings.warn(SCons.Warnings.FortranCxxMixWarning, msg % env.subst('$CXX')) issued_mixed_link_warning = True @@ -77,11 +75,14 @@ def smart_link(source, target, env, for_signature): return '$CXX' return '$CC' + def _lib_emitter(target, source, env, **kw): Verbose = False if Verbose: - print("_lib_emitter: target[0]={:r}".format(target[0].get_path())) + print("_lib_emitter: target[0]={!r}".format(target[0].get_path())) for tgt in target: + if SCons.Util.is_String(tgt): + tgt = env.File(tgt) tgt.attributes.shared = 1 try: @@ -90,21 +91,24 @@ def _lib_emitter(target, source, env, **kw): pass else: if Verbose: - print("_lib_emitter: symlink_generator={:r}".format(symlink_generator)) + print("_lib_emitter: symlink_generator={!r}".format(symlink_generator)) symlinks = symlink_generator(env, target[0]) if Verbose: - print("_lib_emitter: symlinks={:r}".format(symlinks)) + print("_lib_emitter: symlinks={!r}".format(symlinks)) if symlinks: SCons.Tool.EmitLibSymlinks(env, symlinks, target[0]) target[0].attributes.shliblinks = symlinks return (target, source) + def shlib_emitter(target, source, env): - return _lib_emitter(target, source, env, symlink_generator = SCons.Tool.ShLibSymlinkGenerator) + return _lib_emitter(target, source, env, symlink_generator=SCons.Tool.ShLibSymlinkGenerator) + def ldmod_emitter(target, source, env): - return _lib_emitter(target, source, env, symlink_generator = SCons.Tool.LdModSymlinkGenerator) + return _lib_emitter(target, source, env, symlink_generator=SCons.Tool.LdModSymlinkGenerator) + # This is generic enough to be included here... def _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, suffix_generator, **kw): @@ -112,98 +116,107 @@ def _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, Verbose = False if Verbose: - print("_versioned_lib_name: libnode={:r}".format(libnode.get_path())) - print("_versioned_lib_name: version={:r}".format(version)) - print("_versioned_lib_name: prefix={:r}".format(prefix)) - print("_versioned_lib_name: suffix={:r}".format(suffix)) - print("_versioned_lib_name: suffix_generator={:r}".format(suffix_generator)) + print("_versioned_lib_name: libnode={!r}".format(libnode.get_path())) + print("_versioned_lib_name: version={!r}".format(version)) + print("_versioned_lib_name: prefix={!r}".format(prefix)) + print("_versioned_lib_name: suffix={!r}".format(suffix)) + print("_versioned_lib_name: suffix_generator={!r}".format(suffix_generator)) versioned_name = os.path.basename(libnode.get_path()) if Verbose: - print("_versioned_lib_name: versioned_name={:r}".format(versioned_name)) + print("_versioned_lib_name: versioned_name={!r}".format(versioned_name)) versioned_prefix = prefix_generator(env, **kw) versioned_suffix = suffix_generator(env, **kw) if Verbose: - print("_versioned_lib_name: versioned_prefix={:r}".format(versioned_prefix)) - print("_versioned_lib_name: versioned_suffix={:r}".format(versioned_suffix)) + print("_versioned_lib_name: versioned_prefix={!r}".format(versioned_prefix)) + print("_versioned_lib_name: versioned_suffix={!r}".format(versioned_suffix)) versioned_prefix_re = '^' + re.escape(versioned_prefix) versioned_suffix_re = re.escape(versioned_suffix) + '$' name = re.sub(versioned_prefix_re, prefix, versioned_name) name = re.sub(versioned_suffix_re, suffix, name) if Verbose: - print("_versioned_lib_name: name={:r}".format(name)) + print("_versioned_lib_name: name={!r}".format(name)) return name + def _versioned_shlib_name(env, libnode, version, prefix, suffix, **kw): - pg = SCons.Tool.ShLibPrefixGenerator - sg = SCons.Tool.ShLibSuffixGenerator - return _versioned_lib_name(env, libnode, version, prefix, suffix, pg, sg, **kw) + prefix_generator = SCons.Tool.ShLibPrefixGenerator + suffix_generator = SCons.Tool.ShLibSuffixGenerator + return _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, suffix_generator, **kw) + def _versioned_ldmod_name(env, libnode, version, prefix, suffix, **kw): - pg = SCons.Tool.LdModPrefixGenerator - sg = SCons.Tool.LdModSuffixGenerator - return _versioned_lib_name(env, libnode, version, prefix, suffix, pg, sg, **kw) + prefix_generator = SCons.Tool.LdModPrefixGenerator + suffix_generator = SCons.Tool.LdModSuffixGenerator + return _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, suffix_generator, **kw) + def _versioned_lib_suffix(env, suffix, version): """For suffix='.so' and version='0.1.2' it returns '.so.0.1.2'""" Verbose = False if Verbose: - print("_versioned_lib_suffix: suffix={:r}".format(suffix)) - print("_versioned_lib_suffix: version={:r}".format(version)) + print("_versioned_lib_suffix: suffix={!r}".format(suffix)) + print("_versioned_lib_suffix: version={!r}".format(version)) if not suffix.endswith(version): suffix = suffix + '.' + version if Verbose: - print("_versioned_lib_suffix: return suffix={:r}".format(suffix)) + print("_versioned_lib_suffix: return suffix={!r}".format(suffix)) return suffix + def _versioned_lib_soname(env, libnode, version, prefix, suffix, name_func): """For libnode='/optional/dir/libfoo.so.X.Y.Z' it returns 'libfoo.so.X'""" Verbose = False if Verbose: - print("_versioned_lib_soname: version={:r}".format(version)) + print("_versioned_lib_soname: version={!r}".format(version)) name = name_func(env, libnode, version, prefix, suffix) if Verbose: - print("_versioned_lib_soname: name={:r}".format(name)) + print("_versioned_lib_soname: name={!r}".format(name)) major = version.split('.')[0] soname = name + '.' + major if Verbose: - print("_versioned_lib_soname: soname={:r}".format(soname)) + print("_versioned_lib_soname: soname={!r}".format(soname)) return soname + def _versioned_shlib_soname(env, libnode, version, prefix, suffix): return _versioned_lib_soname(env, libnode, version, prefix, suffix, _versioned_shlib_name) + def _versioned_ldmod_soname(env, libnode, version, prefix, suffix): return _versioned_lib_soname(env, libnode, version, prefix, suffix, _versioned_ldmod_name) + def _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, soname_func): - """Generate link names that should be created for a versioned shared lirbrary. + """Generate link names that should be created for a versioned shared library. Returns a dictionary in the form { linkname : linktarget } """ Verbose = False if Verbose: - print("_versioned_lib_symlinks: libnode={:r}".format(libnode.get_path())) - print("_versioned_lib_symlinks: version={:r}".format(version)) + print("_versioned_lib_symlinks: libnode={!r}".format(libnode.get_path())) + print("_versioned_lib_symlinks: version={!r}".format(version)) if sys.platform.startswith('openbsd'): # OpenBSD uses x.y shared library versioning numbering convention # and doesn't use symlinks to backwards-compatible libraries if Verbose: - print("_versioned_lib_symlinks: return symlinks={:r}".format(None)) + print("_versioned_lib_symlinks: return symlinks={!r}".format(None)) return None linkdir = libnode.get_dir() if Verbose: - print("_versioned_lib_symlinks: linkdir={:r}".format(linkdir.get_path())) + print("_versioned_lib_symlinks: linkdir={!r}".format(linkdir.get_path())) name = name_func(env, libnode, version, prefix, suffix) if Verbose: - print("_versioned_lib_symlinks: name={:r}".format(name)) + print("_versioned_lib_symlinks: name={!r}".format(name)) soname = soname_func(env, libnode, version, prefix, suffix) + if Verbose: + print("_versioned_lib_symlinks: soname={!r}".format(soname)) link0 = env.fs.File(soname, linkdir) link1 = env.fs.File(name, linkdir) @@ -211,50 +224,63 @@ def _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, so # We create direct symlinks, not daisy-chained. if link0 == libnode: # This enables SHLIBVERSION without periods (e.g. SHLIBVERSION=1) - symlinks = [ (link1, libnode) ] + symlinks = [(link1, libnode)] else: # This handles usual SHLIBVERSION, i.e. '1.2', '1.2.3', etc. - symlinks = [ (link0, libnode), (link1, libnode) ] + symlinks = [(link0, libnode), (link1, libnode)] if Verbose: - print("_versioned_lib_symlinks: return symlinks={:r}".format(SCons.Tool.StringizeLibSymlinks(symlinks))) + print("_versioned_lib_symlinks: return symlinks={!r}".format(SCons.Tool.StringizeLibSymlinks(symlinks))) return symlinks + def _versioned_shlib_symlinks(env, libnode, version, prefix, suffix): - nf = _versioned_shlib_name - sf = _versioned_shlib_soname - return _versioned_lib_symlinks(env, libnode, version, prefix, suffix, nf, sf) + name_func = env['LINKCALLBACKS']['VersionedShLibName'] + soname_func = env['LINKCALLBACKS']['VersionedShLibSoname'] + + return _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, soname_func) + def _versioned_ldmod_symlinks(env, libnode, version, prefix, suffix): - nf = _versioned_ldmod_name - sf = _versioned_ldmod_soname - return _versioned_lib_symlinks(env, libnode, version, prefix, suffix, nf, sf) + name_func = _versioned_ldmod_name + soname_func = _versioned_ldmod_soname + + name_func = env['LINKCALLBACKS']['VersionedLdModName'] + soname_func = env['LINKCALLBACKS']['VersionedLdModSoname'] + + return _versioned_lib_symlinks(env, libnode, version, prefix, suffix, name_func, soname_func) + def _versioned_lib_callbacks(): return { - 'VersionedShLibSuffix' : _versioned_lib_suffix, - 'VersionedLdModSuffix' : _versioned_lib_suffix, - 'VersionedShLibSymlinks' : _versioned_shlib_symlinks, - 'VersionedLdModSymlinks' : _versioned_ldmod_symlinks, - 'VersionedShLibName' : _versioned_shlib_name, - 'VersionedLdModName' : _versioned_ldmod_name, - 'VersionedShLibSoname' : _versioned_shlib_soname, - 'VersionedLdModSoname' : _versioned_ldmod_soname, + 'VersionedShLibSuffix': _versioned_lib_suffix, + 'VersionedLdModSuffix': _versioned_lib_suffix, + 'VersionedShLibSymlinks': _versioned_shlib_symlinks, + 'VersionedLdModSymlinks': _versioned_ldmod_symlinks, + 'VersionedShLibName': _versioned_shlib_name, + 'VersionedLdModName': _versioned_ldmod_name, + 'VersionedShLibSoname': _versioned_shlib_soname, + 'VersionedLdModSoname': _versioned_ldmod_soname, }.copy() + def _setup_versioned_lib_variables(env, **kw): """ Setup all variables required by the versioning machinery """ tool = None - try: tool = kw['tool'] - except KeyError: pass + try: + tool = kw['tool'] + except KeyError: + pass use_soname = False - try: use_soname = kw['use_soname'] - except KeyError: pass + try: + use_soname = kw['use_soname'] + except KeyError: + pass # The $_SHLIBVERSIONFLAGS define extra commandline flags used when # building VERSIONED shared libraries. It's always set, but used only @@ -284,22 +310,25 @@ def generate(env): SCons.Tool.createSharedLibBuilder(env) SCons.Tool.createProgBuilder(env) - env['SHLINK'] = '$LINK' + env['SHLINK'] = '$LINK' env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared') - env['SHLINKCOM'] = '$SHLINK -o $TARGET $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' - # don't set up the emitter, cause AppendUnique will generate a list + env['SHLINKCOM'] = '$SHLINK -o $TARGET $SHLINKFLAGS $__SHLIBVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' + + # don't set up the emitter, because AppendUnique will generate a list # starting with None :-( - env.Append(SHLIBEMITTER = [shlib_emitter]) - env['SMARTLINK'] = smart_link - env['LINK'] = "$SMARTLINK" - env['LINKFLAGS'] = SCons.Util.CLVar('') + env.Append(SHLIBEMITTER=[shlib_emitter]) + + env['SMARTLINK'] = smart_link + env['LINK'] = "$SMARTLINK" + env['LINKFLAGS'] = SCons.Util.CLVar('') + # __RPATH is only set to something ($_RPATH typically) on platforms that support it. - env['LINKCOM'] = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' - env['LIBDIRPREFIX']='-L' - env['LIBDIRSUFFIX']='' - env['_LIBFLAGS']='${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}' - env['LIBLINKPREFIX']='-l' - env['LIBLINKSUFFIX']='' + env['LINKCOM'] = '$LINK -o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' + env['LIBDIRPREFIX'] = '-L' + env['LIBDIRSUFFIX'] = '' + env['_LIBFLAGS'] = '${_stripixes(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, LIBPREFIXES, LIBSUFFIXES, __env__)}' + env['LIBLINKPREFIX'] = '-l' + env['LIBLINKSUFFIX'] = '' if env['PLATFORM'] == 'hpux': env['SHLIBSUFFIX'] = '.sl' @@ -311,14 +340,16 @@ def generate(env): # setting them the same means that LoadableModule works everywhere. SCons.Tool.createLoadableModuleBuilder(env) env['LDMODULE'] = '$SHLINK' - env.Append(LDMODULEEMITTER = [ldmod_emitter]) + env.Append(LDMODULEEMITTER=[ldmod_emitter]) env['LDMODULEPREFIX'] = '$SHLIBPREFIX' env['LDMODULESUFFIX'] = '$SHLIBSUFFIX' env['LDMODULEFLAGS'] = '$SHLINKFLAGS' - env['LDMODULECOM'] = '$LDMODULE -o $TARGET $LDMODULEFLAGS $__LDMODULEVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' + env[ + 'LDMODULECOM'] = '$LDMODULE -o $TARGET $LDMODULEFLAGS $__LDMODULEVERSIONFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS' env['LDMODULEVERSION'] = '$SHLIBVERSION' env['LDMODULENOVERSIONSYMLINKS'] = '$SHLIBNOVERSIONSYMLINKS' + def exists(env): # This module isn't really a Tool on its own, it's common logic for # other linkers. diff --git a/engine/SCons/Tool/linkloc.py b/engine/SCons/Tool/linkloc.py index b9b7eb4..42c180e 100644 --- a/engine/SCons/Tool/linkloc.py +++ b/engine/SCons/Tool/linkloc.py @@ -10,7 +10,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 @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/linkloc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/linkloc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path import re diff --git a/engine/SCons/Tool/m4.py b/engine/SCons/Tool/m4.py index 0c696d5..bb27b53 100644 --- a/engine/SCons/Tool/m4.py +++ b/engine/SCons/Tool/m4.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/m4.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/m4.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/masm.py b/engine/SCons/Tool/masm.py index 288f33b..092f5dc 100644 --- a/engine/SCons/Tool/masm.py +++ b/engine/SCons/Tool/masm.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/masm.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/masm.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/midl.py b/engine/SCons/Tool/midl.py index a648cb6..2dfd347 100644 --- a/engine/SCons/Tool/midl.py +++ b/engine/SCons/Tool/midl.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/midl.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/midl.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Action import SCons.Builder @@ -79,7 +79,7 @@ def generate(env): env['BUILDERS']['TypeLibrary'] = midl_builder def exists(env): - return msvc_exists() + return msvc_exists(env) # Local Variables: # tab-width:4 diff --git a/engine/SCons/Tool/mingw.py b/engine/SCons/Tool/mingw.py index be5dd47..cb9bc3c 100644 --- a/engine/SCons/Tool/mingw.py +++ b/engine/SCons/Tool/mingw.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,10 +31,11 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mingw.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/mingw.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import os.path +import glob import SCons.Action import SCons.Builder @@ -42,29 +43,17 @@ import SCons.Defaults import SCons.Tool import SCons.Util -# This is what we search for to find mingw: -key_program = 'mingw32-gcc' - -def find(env): - # First search in the SCons path - path=env.WhereIs(key_program) - if (path): - return path - # then the OS path: - path=SCons.Util.WhereIs(key_program) - if (path): - return path - - # If that doesn't work try default location for mingw - save_path=env['ENV']['PATH'] - env.AppendENVPath('PATH',r'c:\MinGW\bin') - path =env.WhereIs(key_program) - if not path: - env['ENV']['PATH']=save_path - return path +mingw_paths = [ + r'c:\MinGW\bin', + r'C:\cygwin64\bin', + r'C:\msys64', + r'C:\cygwin\bin', + r'C:\msys', +] + def shlib_generator(target, source, env, for_signature): - cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS']) + cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS']) dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX') if dll: cmd.extend(['-o', dll]) @@ -72,31 +61,32 @@ def shlib_generator(target, source, env, for_signature): cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS']) implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX') - if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature)) + if implib: cmd.append('-Wl,--out-implib,' + implib.get_string(for_signature)) def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') insert_def = env.subst("$WINDOWS_INSERT_DEF") if not insert_def in ['', '0', 0] and def_target: \ - cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature)) + cmd.append('-Wl,--output-def,' + def_target.get_string(for_signature)) return [cmd] + def shlib_emitter(target, source, env): dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX') no_import_lib = env.get('no_import_lib', 0) if not dll: - raise SCons.Errors.UserError("A shared library should have exactly one target with the suffix: %s Target(s) are:%s" % \ + raise SCons.Errors.UserError( + "A shared library should have exactly one target with the suffix: %s Target(s) are:%s" % \ (env.subst("$SHLIBSUFFIX"), ",".join([str(t) for t in target]))) - - if not no_import_lib and \ - not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'): + if not no_import_lib and \ + not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'): # Create list of target libraries as strings - targetStrings=env.ReplaceIxes(dll, - 'SHLIBPREFIX', 'SHLIBSUFFIX', - 'LIBPREFIX', 'LIBSUFFIX') - + targetStrings = env.ReplaceIxes(dll, + 'SHLIBPREFIX', 'SHLIBSUFFIX', + 'LIBPREFIX', 'LIBSUFFIX') + # Now add file nodes to target list target.append(env.fs.File(targetStrings)) @@ -108,17 +98,18 @@ def shlib_emitter(target, source, env): skip_def_insert = env.subst("$WINDOWS_INSERT_DEF") in ['', '0', 0] if not def_source and not def_target and not skip_def_insert: # Create list of target libraries and def files as strings - targetStrings=env.ReplaceIxes(dll, - 'SHLIBPREFIX', 'SHLIBSUFFIX', - 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') - + targetStrings = env.ReplaceIxes(dll, + 'SHLIBPREFIX', 'SHLIBSUFFIX', + 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') + # Now add file nodes to target list target.append(env.fs.File(targetStrings)) return (target, source) - -shlib_action = SCons.Action.Action(shlib_generator, generator=1) + +shlib_action = SCons.Action.Action(shlib_generator, '$SHLINKCOMSTR', generator=1) +ldmodule_action = SCons.Action.Action(shlib_generator, '$LDMODULECOMSTR', generator=1) res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR') @@ -126,38 +117,63 @@ res_builder = SCons.Builder.Builder(action=res_action, suffix='.o', source_scanner=SCons.Tool.SourceFileScanner) SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan) +# This is what we search for to find mingw: +# key_program = 'mingw32-gcc' +key_program = 'mingw32-make' + + +def find_version_specific_mingw_paths(): + """ + One example of default mingw install paths is: + C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev2\mingw64\bin + + Use glob'ing to find such and add to mingw_paths + """ + new_paths = glob.glob(r"C:\mingw-w64\*\mingw64\bin") + + return new_paths + + def generate(env): - mingw = find(env) + global mingw_paths + # Check for reasoanble mingw default paths + mingw_paths += find_version_specific_mingw_paths() + + mingw = SCons.Tool.find_program_path(env, key_program, default_paths=mingw_paths) if mingw: - dir = os.path.dirname(mingw) - env.PrependENVPath('PATH', dir ) - + mingw_bin_dir = os.path.dirname(mingw) + env.AppendENVPath('PATH', mingw_bin_dir) # Most of mingw is the same as gcc and friends... gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas', 'gfortran', 'm4'] for tool in gnu_tools: SCons.Tool.Tool(tool)(env) - #... but a few things differ: + # ... but a few things differ: env['CC'] = 'gcc' + # make sure the msvc tool doesnt break us, it added a /flag + if 'CCFLAGS' in env: + # make sure its a CLVar to handle list or str cases + if type(env['CCFLAGS']) is not SCons.Util.CLVar: + env['CCFLAGS'] = SCons.Util.CLVar(env['CCFLAGS']) + env['CCFLAGS'] = SCons.Util.CLVar(str(env['CCFLAGS']).replace('/nologo', '')) env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS') env['CXX'] = 'g++' env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS') env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared') - env['SHLINKCOM'] = shlib_action - env['LDMODULECOM'] = shlib_action - env.Append(SHLIBEMITTER = [shlib_emitter]) - env.Append(LDMODULEEMITTER = [shlib_emitter]) + env['SHLINKCOM'] = shlib_action + env['LDMODULECOM'] = ldmodule_action + env.Append(SHLIBEMITTER=[shlib_emitter]) + env.Append(LDMODULEEMITTER=[shlib_emitter]) env['AS'] = 'as' - env['WIN32DEFPREFIX'] = '' - env['WIN32DEFSUFFIX'] = '.def' - env['WINDOWSDEFPREFIX'] = '${WIN32DEFPREFIX}' - env['WINDOWSDEFSUFFIX'] = '${WIN32DEFSUFFIX}' + env['WIN32DEFPREFIX'] = '' + env['WIN32DEFSUFFIX'] = '.def' + env['WINDOWSDEFPREFIX'] = '${WIN32DEFPREFIX}' + env['WINDOWSDEFSUFFIX'] = '${WIN32DEFSUFFIX}' env['SHOBJSUFFIX'] = '.o' env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 - env['RC'] = 'windres' env['RCFLAGS'] = SCons.Util.CLVar('') env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)' @@ -165,15 +181,21 @@ def generate(env): env['RCINCSUFFIX'] = '' env['RCCOM'] = '$RC $_CPPDEFFLAGS $RCINCFLAGS ${RCINCPREFIX} ${SOURCE.dir} $RCFLAGS -i $SOURCE -o $TARGET' env['BUILDERS']['RES'] = res_builder - + # Some setting from the platform also have to be overridden: env['OBJSUFFIX'] = '.o' env['LIBPREFIX'] = 'lib' env['LIBSUFFIX'] = '.a' env['PROGSUFFIX'] = '.exe' + def exists(env): - return find(env) + mingw = SCons.Tool.find_program_path(env, key_program, default_paths=mingw_paths) + if mingw: + mingw_bin_dir = os.path.dirname(mingw) + env.AppendENVPath('PATH', mingw_bin_dir) + + return mingw # Local Variables: # tab-width:4 diff --git a/engine/SCons/Tool/msgfmt.py b/engine/SCons/Tool/msgfmt.py index b9180ad..3a73abd 100644 --- a/engine/SCons/Tool/msgfmt.py +++ b/engine/SCons/Tool/msgfmt.py @@ -1,6 +1,6 @@ """ msgfmt tool """ -# 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 @@ # 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/Tool/msgfmt.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/msgfmt.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from SCons.Builder import BuilderBase ############################################################################# @@ -75,8 +75,22 @@ def _create_mo_file_builder(env, **kw): ############################################################################# def generate(env,**kw): """ Generate `msgfmt` tool """ + import sys + import os import SCons.Util + import SCons.Tool from SCons.Tool.GettextCommon import _detect_msgfmt + from SCons.Platform.mingw import MINGW_DEFAULT_PATHS + from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS + + if sys.platform == 'win32': + msgfmt = SCons.Tool.find_program_path(env, 'msgfmt', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) + if msgfmt: + msgfmt_bin_dir = os.path.dirname(msgfmt) + env.AppendENVPath('PATH', msgfmt_bin_dir) + else: + SCons.Warnings.Warning('msgfmt tool requested, but binary not found in ENV PATH') + try: env['MSGFMT'] = _detect_msgfmt(env) except: diff --git a/engine/SCons/Tool/msginit.py b/engine/SCons/Tool/msginit.py index e8970f9..5b3dc0b 100644 --- a/engine/SCons/Tool/msginit.py +++ b/engine/SCons/Tool/msginit.py @@ -3,7 +3,7 @@ Tool specific initialization of msginit tool. """ -# 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,7 +24,7 @@ Tool specific initialization of msginit tool. # 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/Tool/msginit.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/msginit.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Warnings import SCons.Builder @@ -77,8 +77,22 @@ def _POInitBuilderWrapper(env, target=None, source=_null, **kw): ############################################################################# def generate(env,**kw): """ Generate the `msginit` tool """ + import sys + import os import SCons.Util + import SCons.Tool from SCons.Tool.GettextCommon import _detect_msginit + from SCons.Platform.mingw import MINGW_DEFAULT_PATHS + from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS + + if sys.platform == 'win32': + msginit = SCons.Tool.find_program_path(env, 'msginit', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) + if msginit: + msginit_bin_dir = os.path.dirname(msginit) + env.AppendENVPath('PATH', msginit_bin_dir) + else: + SCons.Warnings.Warning('msginit tool requested, but binary not found in ENV PATH') + try: env['MSGINIT'] = _detect_msginit(env) except: diff --git a/engine/SCons/Tool/msgmerge.py b/engine/SCons/Tool/msgmerge.py index aad0928..c8b7688 100644 --- a/engine/SCons/Tool/msgmerge.py +++ b/engine/SCons/Tool/msgmerge.py @@ -3,7 +3,7 @@ Tool specific initialization for `msgmerge` tool. """ -# 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,7 +24,7 @@ Tool specific initialization for `msgmerge` tool. # 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/Tool/msgmerge.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/msgmerge.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" ############################################################################# def _update_or_init_po_files(target, source, env): @@ -68,8 +68,21 @@ def _POUpdateBuilderWrapper(env, target=None, source=_null, **kw): ############################################################################# def generate(env,**kw): - """ Generate the `xgettext` tool """ + """ Generate the `msgmerge` tool """ + import sys + import os + import SCons.Tool from SCons.Tool.GettextCommon import _detect_msgmerge + from SCons.Platform.mingw import MINGW_DEFAULT_PATHS + from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS + + if sys.platform == 'win32': + msgmerge = SCons.Tool.find_program_path(env, 'msgmerge', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) + if msgmerge: + msgmerge_bin_dir = os.path.dirname(msgmerge) + env.AppendENVPath('PATH', msgmerge_bin_dir) + else: + SCons.Warnings.Warning('msgmerge tool requested, but binary not found in ENV PATH') try: env['MSGMERGE'] = _detect_msgmerge(env) except: diff --git a/engine/SCons/Tool/mslib.py b/engine/SCons/Tool/mslib.py index 94e498f..1434773 100644 --- a/engine/SCons/Tool/mslib.py +++ b/engine/SCons/Tool/mslib.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/mslib.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/mslib.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults import SCons.Tool @@ -55,7 +55,7 @@ def generate(env): env['LIBSUFFIX'] = '.lib' def exists(env): - return msvc_exists() + return msvc_exists(env) # Local Variables: # tab-width:4 diff --git a/engine/SCons/Tool/mslink.py b/engine/SCons/Tool/mslink.py index b38ec46..9fd84c7 100644 --- a/engine/SCons/Tool/mslink.py +++ b/engine/SCons/Tool/mslink.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 @@ -32,7 +32,7 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/mslink.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/mslink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path @@ -328,7 +328,7 @@ def generate(env): env['LDMODULECOM'] = compositeLdmodAction def exists(env): - return msvc_exists() + return msvc_exists(env) # Local Variables: # tab-width:4 diff --git a/engine/SCons/Tool/mssdk.py b/engine/SCons/Tool/mssdk.py index 2200613..1372e87 100644 --- a/engine/SCons/Tool/mssdk.py +++ b/engine/SCons/Tool/mssdk.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/Tool/mssdk.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/mssdk.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" """engine.SCons.Tool.mssdk diff --git a/engine/SCons/Tool/msvc.py b/engine/SCons/Tool/msvc.py index c36b5b2..4649963 100644 --- a/engine/SCons/Tool/msvc.py +++ b/engine/SCons/Tool/msvc.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/msvc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/msvc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path import re @@ -112,7 +112,7 @@ def object_emitter(target, source, env, parent_emitter): # # See issue #2505 for a discussion of what to do if it turns # out this assumption causes trouble in the wild: - # http://scons.tigris.org/issues/show_bug.cgi?id=2505 + # https://github.com/SCons/scons/issues/2505 if 'PCH' in env: pch = env['PCH'] if str(target[0]) != SCons.Util.splitext(str(pch))[0] + '.obj': @@ -195,7 +195,10 @@ def msvc_output_flag(target, source, env, for_signature): # that the test(s) for this can be run on non-Windows systems # without having a hard-coded backslash mess up command-line # argument parsing. - return '/Fo${TARGET.dir}' + os.sep + # Adding double os.sep's as if the TARGET.dir has a space or otherwise + # needs to be quoted they are needed per MSVC's odd behavior + # See: https://github.com/SCons/scons/issues/3106 + return '/Fo${TARGET.dir}' + os.sep*2 CAction = SCons.Action.Action("$CCCOM", "$CCCOMSTR", batch_key=msvc_batch_key, @@ -259,7 +262,7 @@ def generate(env): env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1 env['RC'] = 'rc' - env['RCFLAGS'] = SCons.Util.CLVar('') + env['RCFLAGS'] = SCons.Util.CLVar('/nologo') env['RCSUFFIXES']=['.rc','.rc2'] env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES' env['BUILDERS']['RES'] = res_builder @@ -268,6 +271,10 @@ def generate(env): env['SHOBJPREFIX'] = '$OBJPREFIX' env['SHOBJSUFFIX'] = '$OBJSUFFIX' + # MSVC probably wont support unistd.h so default + # without it for lex generation + env["LEXUNISTD"] = SCons.Util.CLVar("--nounistd") + # Set-up ms tools paths msvc_setup_env_once(env) @@ -286,7 +293,7 @@ def generate(env): env['ENV']['SystemRoot'] = SCons.Platform.win32.get_system_root() def exists(env): - return msvc_exists() + return msvc_exists(env) # Local Variables: # tab-width:4 diff --git a/engine/SCons/Tool/msvs.py b/engine/SCons/Tool/msvs.py index 9976d42..afe4bef 100644 --- a/engine/SCons/Tool/msvs.py +++ b/engine/SCons/Tool/msvs.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 @@ -32,7 +32,7 @@ selection method. from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/msvs.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/msvs.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.compat @@ -149,9 +149,9 @@ def splitFully(path): return [base] def makeHierarchy(sources): - '''Break a list of files into a hierarchy; for each value, if it is a string, + """Break a list of files into a hierarchy; for each value, if it is a string, then it is a file. If it is a dictionary, it is a folder. The string is - the original path of the file.''' + the original path of the file.""" hierarchy = {} for file in sources: @@ -189,7 +189,7 @@ class _UserGenerator(object): elif SCons.Util.is_List(env['variant']): variants = env['variant'] - if 'DebugSettings' not in env or env['DebugSettings'] == None: + if 'DebugSettings' not in env or env['DebugSettings'] is None: dbg_settings = [] elif SCons.Util.is_Dict(env['DebugSettings']): dbg_settings = [env['DebugSettings']] @@ -520,7 +520,7 @@ class _DSPGenerator(object): config.cmdargs = cmdargs config.runfile = runfile - match = re.match('(.*)\|(.*)', variant) + match = re.match(r'(.*)\|(.*)', variant) if match: config.variant = match.group(1) config.platform = match.group(2) @@ -1096,12 +1096,17 @@ V10DSPCommandLine = """\ \t\t$(NMakeForcedUsingAssemblies) """ +V15DSPHeader = """\ + + +""" + class _GenerateV10DSP(_DSPGenerator, _GenerateV10User): """Generates a Project file for MSVS 2010""" - def __init__(self, dspfile, source, env): + def __init__(self, dspfile, header, source, env): _DSPGenerator.__init__(self, dspfile, source, env) - self.dspheader = V10DSPHeader + self.dspheader = header self.dspconfiguration = V10DSPProjectConfiguration self.dspglobals = V10DSPGlobals @@ -1287,7 +1292,7 @@ class _GenerateV10DSP(_DSPGenerator, _GenerateV10User): 'Other Files': ''} cats = sorted([k for k in list(categories.keys()) if self.sources[k]], - key = lambda a: a.lower()) + key = lambda a: a.lower()) # print vcxproj.filters file first self.filters_file.write('\t\n') @@ -1423,7 +1428,7 @@ class _GenerateV7DSW(_DSWGenerator): def AddConfig(self, variant, dswfile=dswfile): config = Config() - match = re.match('(.*)\|(.*)', variant) + match = re.match(r'(.*)\|(.*)', variant) if match: config.variant = match.group(1) config.platform = match.group(2) @@ -1501,7 +1506,9 @@ class _GenerateV7DSW(_DSWGenerator): def PrintSolution(self): """Writes a solution file""" self.file.write('Microsoft Visual Studio Solution File, Format Version %s\n' % self.versionstr) - if self.version_num >= 12.0: + if self.version_num > 14.0: + self.file.write('# Visual Studio 15\n') + elif self.version_num >= 12.0: self.file.write('# Visual Studio 14\n') elif self.version_num >= 11.0: self.file.write('# Visual Studio 11\n') @@ -1519,7 +1526,7 @@ class _GenerateV7DSW(_DSWGenerator): name = base self.file.write('Project("%s") = "%s", "%s", "%s"\n' % (external_makefile_guid, name, dspinfo['SLN_RELATIVE_FILE_PATH'], dspinfo['GUID'])) - if self.version_num >= 7.1 and self.version_num < 8.0: + if 7.1 <= self.version_num < 8.0: self.file.write('\tProjectSection(ProjectDependencies) = postProject\n' '\tEndProjectSection\n') self.file.write('EndProject\n') @@ -1679,8 +1686,11 @@ def GenerateDSP(dspfile, source, env): version_num = 6.0 if 'MSVS_VERSION' in env: version_num, suite = msvs_parse_version(env['MSVS_VERSION']) - if version_num >= 10.0: - g = _GenerateV10DSP(dspfile, source, env) + if version_num > 14.0: + g = _GenerateV10DSP(dspfile, V15DSPHeader, source, env) + g.Build() + elif version_num >= 10.0: + g = _GenerateV10DSP(dspfile, V10DSPHeader, source, env) g.Build() elif version_num >= 7.0: g = _GenerateV7DSP(dspfile, source, env) @@ -1990,7 +2000,7 @@ def generate(env): env['SCONS_HOME'] = os.environ.get('SCONS_HOME') def exists(env): - return msvc_exists() + return msvc_exists(env) # Local Variables: # tab-width:4 diff --git a/engine/SCons/Tool/mwcc.py b/engine/SCons/Tool/mwcc.py index c50b52c..bc1e62c 100644 --- a/engine/SCons/Tool/mwcc.py +++ b/engine/SCons/Tool/mwcc.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mwcc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/mwcc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/mwld.py b/engine/SCons/Tool/mwld.py index ba301e5..f671319 100644 --- a/engine/SCons/Tool/mwld.py +++ b/engine/SCons/Tool/mwld.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mwld.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/mwld.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Tool diff --git a/engine/SCons/Tool/nasm.py b/engine/SCons/Tool/nasm.py index bda2ab0..1615b6b 100644 --- a/engine/SCons/Tool/nasm.py +++ b/engine/SCons/Tool/nasm.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/nasm.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/nasm.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/packaging/__init__.py b/engine/SCons/Tool/packaging/__init__.py index 489b07c..af60e8b 100644 --- a/engine/SCons/Tool/packaging/__init__.py +++ b/engine/SCons/Tool/packaging/__init__.py @@ -4,7 +4,7 @@ SCons Packaging Tool. """ # -# 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 @@ -25,18 +25,23 @@ SCons Packaging Tool. # 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/Tool/packaging/__init__.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/packaging/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +import SCons.Defaults import SCons.Environment from SCons.Variables import * from SCons.Errors import * from SCons.Util import is_List, make_path_relative from SCons.Warnings import warn, Warning -import os, imp -import SCons.Defaults +import os +import imp -__all__ = [ 'src_targz', 'src_tarbz2', 'src_zip', 'tarbz2', 'targz', 'zip', 'rpm', 'msi', 'ipk' ] +__all__ = [ + 'src_targz', 'src_tarbz2', 'src_xz', 'src_zip', + 'targz', 'tarbz2', 'xz', 'zip', + 'rpm', 'msi', 'ipk', +] # # Utility and Builder function @@ -102,7 +107,7 @@ def Package(env, target=None, source=None, **kw): from SCons.Script import GetOption kw['PACKAGETYPE'] = GetOption('package_type') - if kw['PACKAGETYPE'] == None: + if kw['PACKAGETYPE'] is None: if 'Tar' in env['BUILDERS']: kw['PACKAGETYPE']='targz' elif 'Zip' in env['BUILDERS']: @@ -163,15 +168,22 @@ def Package(env, target=None, source=None, **kw): # this exception means that a needed argument for the packager is # missing. As our packagers get their "tags" as named function # arguments we need to find out which one is missing. - from inspect import getargspec - args,varargs,varkw,defaults=getargspec(packager.package) - if defaults!=None: - args=args[:-len(defaults)] # throw away arguments with default values + #TODO: getargspec deprecated in Py3. cleanup when Py2.7 dropped. + try: + from inspect import getfullargspec + argspec = getfullargspec(packager.package) + except ImportError: + from inspect import getargspec + argspec = getargspec(packager.package) + args = argspec.args + if argspec.defaults: + # throw away arguments with default values + args = args[:-len(argspec.defaults)] args.remove('env') args.remove('target') args.remove('source') # now remove any args for which we have a value in kw. - args=[x for x in args if x not in kw] + args = [x for x in args if x not in kw] if len(args)==0: raise # must be a different error, so re-raise @@ -283,10 +295,9 @@ def stripinstallbuilder(target, source, env): It also warns about files which have no install builder attached. """ def has_no_install_location(file): - return not (file.has_builder() and\ - hasattr(file.builder, 'name') and\ - (file.builder.name=="InstallBuilder" or\ - file.builder.name=="InstallAsBuilder")) + return not (file.has_builder() and hasattr(file.builder, 'name') + and file.builder.name in ["InstallBuilder", "InstallAsBuilder"]) + if len([src for src in source if has_no_install_location(src)]): warn(Warning, "there are files to package which have no\ diff --git a/engine/SCons/Tool/packaging/ipk.py b/engine/SCons/Tool/packaging/ipk.py index 78af950..2ebc168 100644 --- a/engine/SCons/Tool/packaging/ipk.py +++ b/engine/SCons/Tool/packaging/ipk.py @@ -2,7 +2,7 @@ """ # -# 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,11 +24,13 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/ipk.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/packaging/ipk.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" + +import os import SCons.Builder import SCons.Node.FS -import os +import SCons.Util from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot @@ -119,7 +121,9 @@ def build_specfiles(source, target, env): try: return opened_files[needle] except KeyError: - file=filter(lambda x: x.get_path().rfind(needle)!=-1, haystack)[0] + files = filter(lambda x: x.get_path().rfind(needle) != -1, haystack) + # Py3: filter returns an iterable, not a list + file = list(files)[0] opened_files[needle]=open(file.get_abspath(), 'w') return opened_files[needle] diff --git a/engine/SCons/Tool/packaging/msi.py b/engine/SCons/Tool/packaging/msi.py index 3f67d63..fbb8b21 100644 --- a/engine/SCons/Tool/packaging/msi.py +++ b/engine/SCons/Tool/packaging/msi.py @@ -4,7 +4,7 @@ The msi packager. """ # -# 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 @@ -25,7 +25,7 @@ The msi packager. # 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/Tool/packaging/msi.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/packaging/msi.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import SCons @@ -63,8 +63,8 @@ def convert_to_id(s, id_set): """ charset = 'ABCDEFGHIJKLMNOPQRSTUVWXYabcdefghijklmnopqrstuvwxyz0123456789_.' if s[0] in '0123456789.': - s += '_'+s - id = [c for c in s if c in charset] + s = '_' + s + id = ''.join([c for c in s if c in charset]) # did we already generate an id for this file? try: @@ -108,14 +108,13 @@ def gen_dos_short_file_name(file, filename_set): # strip forbidden characters. forbidden = '."/[]:;=, ' - fname = [c for c in fname if c not in forbidden] + fname = ''.join([c for c in fname if c not in forbidden]) # check if we already generated a filename with the same number: # thisis1.txt, thisis2.txt etc. duplicate, num = not None, 1 while duplicate: - shortname = "%s%s" % (fname[:8-len(str(num))].upper(),\ - str(num)) + shortname = "%s%s" % (fname[:8-len(str(num))].upper(), str(num)) if len(ext) >= 2: shortname = "%s%s" % (shortname, ext[:4].upper()) @@ -301,7 +300,7 @@ def build_wxsfile_file_section(root, files, NAME, VERSION, VENDOR, filename_set, if c.nodeName == 'Directory' and c.attributes['LongName'].value == escape(d)] - if already_created != []: + if already_created: Directory = already_created[0] dir_parts.remove(d) upper_dir += d diff --git a/engine/SCons/Tool/packaging/rpm.py b/engine/SCons/Tool/packaging/rpm.py index 73b3ae7..3f44d83 100644 --- a/engine/SCons/Tool/packaging/rpm.py +++ b/engine/SCons/Tool/packaging/rpm.py @@ -4,7 +4,7 @@ The rpm packager. """ # -# 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 @@ -25,7 +25,7 @@ The rpm packager. # 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/Tool/packaging/rpm.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/packaging/rpm.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os @@ -51,10 +51,9 @@ def package(env, target, source, PACKAGEROOT, NAME, VERSION, if str(target[0])!="%s-%s"%(NAME, VERSION): raise UserError( "Setting target is not supported for rpm." ) else: - # This should be overridable from the construction environment, - # which it is by using ARCHITECTURE=. + # Deduce the build architecture, but allow it to be overridden + # by setting ARCHITECTURE in the construction env. buildarchitecture = SCons.Tool.rpmutils.defaultMachine() - if 'ARCHITECTURE' in kw: buildarchitecture = kw['ARCHITECTURE'] @@ -126,20 +125,18 @@ def build_specfile(target, source, env): """ Builds a RPM specfile from a dictionary with string metadata and by analyzing a tree of nodes. """ - file = open(target[0].get_abspath(), 'w') - - try: - file.write( build_specfile_header(env) ) - file.write( build_specfile_sections(env) ) - file.write( build_specfile_filesection(env, source) ) - file.close() + with open(target[0].get_abspath(), 'w') as file: + try: + file.write(build_specfile_header(env)) + file.write(build_specfile_sections(env)) + file.write(build_specfile_filesection(env, source)) - # call a user specified function - if 'CHANGE_SPECFILE' in env: - env['CHANGE_SPECFILE'](target, source) + # call a user specified function + if 'CHANGE_SPECFILE' in env: + env['CHANGE_SPECFILE'](target, source) - except KeyError as e: - raise SCons.Errors.UserError( '"%s" package field for RPM is missing.' % e.args[0] ) + except KeyError as e: + raise SCons.Errors.UserError('"%s" package field for RPM is missing.' % e.args[0]) # @@ -201,7 +198,8 @@ def build_specfile_header(spec): 'PACKAGEVERSION' : '%%define release %s\nRelease: %%{release}\n', 'X_RPM_GROUP' : 'Group: %s\n', 'SUMMARY' : 'Summary: %s\n', - 'LICENSE' : 'License: %s\n', } + 'LICENSE' : 'License: %s\n', + } str = str + SimpleTagCompiler(mandatory_header_fields).compile( spec ) @@ -211,6 +209,7 @@ def build_specfile_header(spec): 'X_RPM_URL' : 'Url: %s\n', 'SOURCE_URL' : 'Source: %s\n', 'SUMMARY_' : 'Summary(%s): %s\n', + 'ARCHITECTURE' : 'BuildArch: %s\n', 'X_RPM_DISTRIBUTION' : 'Distribution: %s\n', 'X_RPM_ICON' : 'Icon: %s\n', 'X_RPM_PACKAGER' : 'Packager: %s\n', @@ -229,19 +228,33 @@ def build_specfile_header(spec): 'X_RPM_PREFIX' : 'Prefix: %s\n', # internal use - 'X_RPM_BUILDROOT' : 'BuildRoot: %s\n', } + 'X_RPM_BUILDROOT' : 'BuildRoot: %s\n', + } # fill in default values: - # Adding a BuildRequires renders the .rpm unbuildable under System, which + # Adding a BuildRequires renders the .rpm unbuildable under systems which # are not managed by rpm, since the database to resolve this dependency is # missing (take Gentoo as an example) -# if not s.has_key('x_rpm_BuildRequires'): -# s['x_rpm_BuildRequires'] = 'scons' + #if 'X_RPM_BUILDREQUIRES' not in spec: + # spec['X_RPM_BUILDREQUIRES'] = 'scons' if 'X_RPM_BUILDROOT' not in spec: spec['X_RPM_BUILDROOT'] = '%{_tmppath}/%{name}-%{version}-%{release}' str = str + SimpleTagCompiler(optional_header_fields, mandatory=0).compile( spec ) + + # Add any extra specfile definitions the user may have supplied. + # These flags get no processing, they are just added. + # github #3164: if we don't turn off debug package generation + # the tests which build packages all fail. If there are no + # extra flags, default to adding this one. If the user wants + # to turn this back on, supply the flag set to None. + + if 'X_RPM_EXTRADEFS' not in spec: + spec['X_RPM_EXTRADEFS'] = ['%global debug_package %{nil}'] + for extra in spec['X_RPM_EXTRADEFS']: + str += extra + '\n' + return str # diff --git a/engine/SCons/Tool/packaging/src_tarbz2.py b/engine/SCons/Tool/packaging/src_tarbz2.py index c52daa1..eea29cb 100644 --- a/engine/SCons/Tool/packaging/src_tarbz2.py +++ b/engine/SCons/Tool/packaging/src_tarbz2.py @@ -1,10 +1,10 @@ -"""SCons.Tool.Packaging.tarbz2 +"""SCons.Tool.Packaging.src_tarbz2 The tarbz2 SRC packager. """ # -# 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 @@ The tarbz2 SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/engine/SCons/Tool/packaging/src_targz.py b/engine/SCons/Tool/packaging/src_targz.py index 83bb01f..94ebea4 100644 --- a/engine/SCons/Tool/packaging/src_targz.py +++ b/engine/SCons/Tool/packaging/src_targz.py @@ -1,10 +1,10 @@ -"""SCons.Tool.Packaging.targz +"""SCons.Tool.Packaging.src_targz The targz SRC packager. """ # -# 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 @@ The targz SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_targz.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/packaging/src_targz.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/engine/SCons/Tool/packaging/src_tarxz.py b/engine/SCons/Tool/packaging/src_tarxz.py new file mode 100644 index 0000000..62db2e2 --- /dev/null +++ b/engine/SCons/Tool/packaging/src_tarxz.py @@ -0,0 +1,43 @@ +"""SCons.Tool.Packaging.src_tarxz + +The tarxz SRC packager. +""" + +# +# 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 +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# 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/Tool/packaging/src_tarxz.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" + +from SCons.Tool.packaging import putintopackageroot + +def package(env, target, source, PACKAGEROOT, **kw): + bld = env['BUILDERS']['Tar'] + bld.set_suffix('.tar.xz') + target, source = putintopackageroot(target, source, env, PACKAGEROOT, honor_install_location=0) + return bld(env, target, source, TARFLAGS='-Jc') + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/engine/SCons/Tool/packaging/src_zip.py b/engine/SCons/Tool/packaging/src_zip.py index 376e9c7..b1f63fb 100644 --- a/engine/SCons/Tool/packaging/src_zip.py +++ b/engine/SCons/Tool/packaging/src_zip.py @@ -4,7 +4,7 @@ The zip SRC packager. """ # -# 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 @@ The zip SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_zip.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/packaging/src_zip.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/engine/SCons/Tool/packaging/tarbz2.py b/engine/SCons/Tool/packaging/tarbz2.py index 27991d6..70e7ee4 100644 --- a/engine/SCons/Tool/packaging/tarbz2.py +++ b/engine/SCons/Tool/packaging/tarbz2.py @@ -1,10 +1,10 @@ """SCons.Tool.Packaging.tarbz2 -The tarbz2 SRC packager. +The tarbz2 packager. """ # -# 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,13 +26,13 @@ The tarbz2 SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot def package(env, target, source, PACKAGEROOT, **kw): bld = env['BUILDERS']['Tar'] - bld.set_suffix('.tar.gz') + bld.set_suffix('.tar.bz2') target, source = putintopackageroot(target, source, env, PACKAGEROOT) target, source = stripinstallbuilder(target, source, env) return bld(env, target, source, TARFLAGS='-jc') diff --git a/engine/SCons/Tool/packaging/targz.py b/engine/SCons/Tool/packaging/targz.py index dbffe4a..fa8800d 100644 --- a/engine/SCons/Tool/packaging/targz.py +++ b/engine/SCons/Tool/packaging/targz.py @@ -1,10 +1,10 @@ """SCons.Tool.Packaging.targz -The targz SRC packager. +The targz packager. """ # -# 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 @@ The targz SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/targz.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/packaging/targz.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot diff --git a/engine/SCons/Tool/packaging/tarxz.py b/engine/SCons/Tool/packaging/tarxz.py new file mode 100644 index 0000000..bad495b --- /dev/null +++ b/engine/SCons/Tool/packaging/tarxz.py @@ -0,0 +1,44 @@ +"""SCons.Tool.Packaging.tarxz + +The tarxz packager. +""" + +# +# 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 +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# 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/Tool/packaging/tarxz.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" + +from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot + +def package(env, target, source, PACKAGEROOT, **kw): + bld = env['BUILDERS']['Tar'] + bld.set_suffix('.tar.xz') + target, source = putintopackageroot(target, source, env, PACKAGEROOT) + target, source = stripinstallbuilder(target, source, env) + return bld(env, target, source, TARFLAGS='-Jc') + +# Local Variables: +# tab-width:4 +# indent-tabs-mode:nil +# End: +# vim: set expandtab tabstop=4 shiftwidth=4: diff --git a/engine/SCons/Tool/packaging/zip.py b/engine/SCons/Tool/packaging/zip.py index 1b8511d..c5dd7cc 100644 --- a/engine/SCons/Tool/packaging/zip.py +++ b/engine/SCons/Tool/packaging/zip.py @@ -4,7 +4,7 @@ The zip SRC packager. """ # -# 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 @@ The zip SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/zip.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/packaging/zip.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot diff --git a/engine/SCons/Tool/pdf.py b/engine/SCons/Tool/pdf.py index 765a0a9..792c4ca 100644 --- a/engine/SCons/Tool/pdf.py +++ b/engine/SCons/Tool/pdf.py @@ -6,7 +6,7 @@ Add an explicit action to run epstopdf to convert .eps files to .pdf """ # -# 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 @@ -28,7 +28,7 @@ Add an explicit action to run epstopdf to convert .eps files to .pdf # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/pdf.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/pdf.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Builder import SCons.Tool diff --git a/engine/SCons/Tool/pdflatex.py b/engine/SCons/Tool/pdflatex.py index 63c062c..8d4a1a7 100644 --- a/engine/SCons/Tool/pdflatex.py +++ b/engine/SCons/Tool/pdflatex.py @@ -10,7 +10,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 @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/pdflatex.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/pdflatex.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Action import SCons.Util diff --git a/engine/SCons/Tool/pdftex.py b/engine/SCons/Tool/pdftex.py index f4a16ed..c30066d 100644 --- a/engine/SCons/Tool/pdftex.py +++ b/engine/SCons/Tool/pdftex.py @@ -10,7 +10,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 @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/pdftex.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/pdftex.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import SCons.Action diff --git a/engine/SCons/Tool/qt.py b/engine/SCons/Tool/qt.py index 6c39b3b..1b1925c 100644 --- a/engine/SCons/Tool/qt.py +++ b/engine/SCons/Tool/qt.py @@ -10,7 +10,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 @@ -33,10 +33,11 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/qt.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/qt.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path import re +import glob import SCons.Action import SCons.Builder @@ -44,6 +45,8 @@ import SCons.Defaults import SCons.Scanner import SCons.Tool import SCons.Util +import SCons.Tool.cxx +cplusplus = SCons.Tool.cxx class ToolQtWarning(SCons.Warnings.Warning): pass @@ -60,12 +63,33 @@ header_extensions = [".h", ".hxx", ".hpp", ".hh"] if SCons.Util.case_sensitive_suffixes('.h', '.H'): header_extensions.append('.H') -import SCons.Tool.cxx -cplusplus = SCons.Tool.cxx -#cplusplus = __import__('cxx', globals(), locals(), []) - cxx_suffixes = cplusplus.CXXSuffixes + +# +def find_platform_specific_qt_paths(): + """ + If the platform has non-standard paths which it installs QT in,return the likely default path + :return: + """ + + # qt_bin_dirs = [] + qt_bin_dir = None + if os.path.isfile('/etc/redhat-release'): + with open('/etc/redhat-release','r') as rr: + lines = rr.readlines() + distro = lines[0].split()[0] + if distro == 'CentOS': + # Centos installs QT under /usr/{lib,lib64}/qt{4,5,-3.3}/bin + # so we need to handle this differently + # qt_bin_dirs = glob.glob('/usr/lib64/qt*/bin') + qt_bin_dir = '/usr/lib64/qt-3.3/bin' + + return qt_bin_dir + + +QT_BIN_DIR = find_platform_specific_qt_paths() + def checkMocIncluded(target, source, env): moc = target[0] cpp = source[0] @@ -188,13 +212,12 @@ AutomocStatic = _Automoc('StaticObject') def _detect(env): """Not really safe, but fast method to detect the QT library""" - QTDIR = None - if not QTDIR: - QTDIR = env.get('QTDIR',None) + + QTDIR = env.get('QTDIR',None) if not QTDIR: QTDIR = os.environ.get('QTDIR',None) if not QTDIR: - moc = env.WhereIs('moc') + moc = env.WhereIs('moc') or env.WhereIs('moc',QT_BIN_DIR) if moc: QTDIR = os.path.dirname(os.path.dirname(moc)) SCons.Warnings.warn( diff --git a/engine/SCons/Tool/rmic.py b/engine/SCons/Tool/rmic.py index 6607e90..b2df405 100644 --- a/engine/SCons/Tool/rmic.py +++ b/engine/SCons/Tool/rmic.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/rmic.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/rmic.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path @@ -40,6 +40,9 @@ import SCons.Builder import SCons.Node.FS import SCons.Util +from SCons.Tool.JavaCommon import get_java_install_dirs + + def emit_rmic_classes(target, source, env): """Create and return lists of Java RMI stub and skeleton class files to be created from a set of class files. @@ -105,6 +108,18 @@ def generate(env): """Add Builders and construction variables for rmic to an Environment.""" env['BUILDERS']['RMIC'] = RMICBuilder + if env['PLATFORM'] == 'win32': + version = env.get('JAVAVERSION', None) + default_paths=get_java_install_dirs(env['PLATFORM'], version=version) + + # Ensure that we have a proper path for rmic + rmic = SCons.Tool.find_program_path(env, 'rmic', default_paths=default_paths) + + # print("RMIC: %s"%rmic) + if rmic: + rmic_bin_dir = os.path.dirname(rmic) + env.AppendENVPath('PATH', rmic_bin_dir) + env['RMIC'] = 'rmic' env['RMICFLAGS'] = SCons.Util.CLVar('') env['RMICCOM'] = '$RMIC $RMICFLAGS -d ${TARGET.attributes.java_lookupdir} -classpath ${SOURCE.attributes.java_classdir} ${SOURCES.attributes.java_classname}' diff --git a/engine/SCons/Tool/rpcgen.py b/engine/SCons/Tool/rpcgen.py index ec64090..a495fdd 100644 --- a/engine/SCons/Tool/rpcgen.py +++ b/engine/SCons/Tool/rpcgen.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/rpcgen.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/rpcgen.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from SCons.Builder import Builder import SCons.Util @@ -43,7 +43,7 @@ rpcgen_service = cmd % ('m', '$RPCGENSERVICEFLAGS') rpcgen_xdr = cmd % ('c', '$RPCGENXDRFLAGS') def generate(env): - "Add RPCGEN Builders and construction variables for an Environment." + """Add RPCGEN Builders and construction variables for an Environment.""" client = Builder(action=rpcgen_client, suffix='_clnt.c', src_suffix='.x') header = Builder(action=rpcgen_header, suffix='.h', src_suffix='.x') diff --git a/engine/SCons/Tool/rpm.py b/engine/SCons/Tool/rpm.py index f359298..9531431 100644 --- a/engine/SCons/Tool/rpm.py +++ b/engine/SCons/Tool/rpm.py @@ -11,7 +11,7 @@ tar.gz consisting of the source file and a specfile. """ # -# 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 @@ -33,7 +33,7 @@ tar.gz consisting of the source file and a specfile. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/rpm.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/rpm.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import re diff --git a/engine/SCons/Tool/rpmutils.py b/engine/SCons/Tool/rpmutils.py index caa9203..6c87f73 100644 --- a/engine/SCons/Tool/rpmutils.py +++ b/engine/SCons/Tool/rpmutils.py @@ -14,7 +14,7 @@ exact syntax. """ -# 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 @@ -36,7 +36,7 @@ exact syntax. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/rpmutils.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/rpmutils.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import platform diff --git a/engine/SCons/Tool/sgiar.py b/engine/SCons/Tool/sgiar.py index db83152..feab04f 100644 --- a/engine/SCons/Tool/sgiar.py +++ b/engine/SCons/Tool/sgiar.py @@ -11,7 +11,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 @@ -33,7 +33,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgiar.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/sgiar.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/sgic++.py b/engine/SCons/Tool/sgic++.py index f208b69..9d5fc96 100644 --- a/engine/SCons/Tool/sgic++.py +++ b/engine/SCons/Tool/sgic++.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/sgic++.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/sgic++.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" #forward proxy to the preffered cxx version from SCons.Tool.sgicxx import * diff --git a/engine/SCons/Tool/sgicc.py b/engine/SCons/Tool/sgicc.py index dff2d28..f957534 100644 --- a/engine/SCons/Tool/sgicc.py +++ b/engine/SCons/Tool/sgicc.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/sgicc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/sgicc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" from . import cc diff --git a/engine/SCons/Tool/sgicxx.py b/engine/SCons/Tool/sgicxx.py index 7b0190d..f4bfb8d 100644 --- a/engine/SCons/Tool/sgicxx.py +++ b/engine/SCons/Tool/sgicxx.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/sgicxx.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/sgicxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sgilink.py b/engine/SCons/Tool/sgilink.py index 0970c46..fa64736 100644 --- a/engine/SCons/Tool/sgilink.py +++ b/engine/SCons/Tool/sgilink.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/sgilink.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/sgilink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sunar.py b/engine/SCons/Tool/sunar.py index 49cbf09..abce0a4 100644 --- a/engine/SCons/Tool/sunar.py +++ b/engine/SCons/Tool/sunar.py @@ -10,7 +10,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 @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunar.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/sunar.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/sunc++.py b/engine/SCons/Tool/sunc++.py index 6fa31d8..ef915f6 100644 --- a/engine/SCons/Tool/sunc++.py +++ b/engine/SCons/Tool/sunc++.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/sunc++.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/sunc++.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" #forward proxy to the preffered cxx version diff --git a/engine/SCons/Tool/suncc.py b/engine/SCons/Tool/suncc.py index a967f3b..5b01402 100644 --- a/engine/SCons/Tool/suncc.py +++ b/engine/SCons/Tool/suncc.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/suncc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/suncc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/suncxx.py b/engine/SCons/Tool/suncxx.py index 4de5465..d421946 100644 --- a/engine/SCons/Tool/suncxx.py +++ b/engine/SCons/Tool/suncxx.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/suncxx.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/suncxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons diff --git a/engine/SCons/Tool/sunf77.py b/engine/SCons/Tool/sunf77.py index cbfc2af..9938d91 100644 --- a/engine/SCons/Tool/sunf77.py +++ b/engine/SCons/Tool/sunf77.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/sunf77.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/sunf77.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sunf90.py b/engine/SCons/Tool/sunf90.py index 1ffb630..2f6ef97 100644 --- a/engine/SCons/Tool/sunf90.py +++ b/engine/SCons/Tool/sunf90.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/sunf90.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/sunf90.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sunf95.py b/engine/SCons/Tool/sunf95.py index 5449d7c..1854165 100644 --- a/engine/SCons/Tool/sunf95.py +++ b/engine/SCons/Tool/sunf95.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/sunf95.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/sunf95.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sunlink.py b/engine/SCons/Tool/sunlink.py index e804ae9..28ec971 100644 --- a/engine/SCons/Tool/sunlink.py +++ b/engine/SCons/Tool/sunlink.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunlink.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/sunlink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/swig.py b/engine/SCons/Tool/swig.py index 7007a92..a8d6400 100644 --- a/engine/SCons/Tool/swig.py +++ b/engine/SCons/Tool/swig.py @@ -10,7 +10,7 @@ selection method. from __future__ import print_function # -# 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 @@ -32,9 +32,10 @@ from __future__ import print_function # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/swig.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/swig.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path +import sys import re import subprocess @@ -69,7 +70,9 @@ def _find_modules(src): directors = 0 mnames = [] try: - matches = _reModule.findall(open(src).read()) + with open(src) as f: + data = f.read() + matches = _reModule.findall(data) except IOError: # If the file's not yet generated, guess the module name from the file stem matches = [] @@ -134,21 +137,31 @@ def _swigEmitter(target, source, env): def _get_swig_version(env, swig): """Run the SWIG command line tool to get and return the version number""" + version = None swig = env.subst(swig) + if not swig: + return version pipe = SCons.Action._subproc(env, SCons.Util.CLVar(swig) + ['-version'], stdin = 'devnull', stderr = 'devnull', stdout = subprocess.PIPE) - if pipe.wait() != 0: return + if pipe.wait() != 0: + return version # MAYBE: out = SCons.Util.to_str (pipe.stdout.read()) - out = SCons.Util.to_str(pipe.stdout.read()) - match = re.search('SWIG Version\s+(\S+).*', out, re.MULTILINE) + with pipe.stdout: + out = SCons.Util.to_str(pipe.stdout.read()) + + match = re.search(r'SWIG Version\s+(\S+).*', out, re.MULTILINE) if match: - if verbose: print("Version is:%s"%match.group(1)) - return match.group(1) + version = match.group(1) + if verbose: + print("Version is: %s" % version) else: - if verbose: print("Unable to detect version: [%s]"%out) + if verbose: + print("Unable to detect version: [%s]" % out) + + return version def generate(env): """Add Builders and construction variables for swig to an Environment.""" @@ -169,6 +182,17 @@ def generate(env): java_file.add_action('.i', SwigAction) java_file.add_emitter('.i', _swigEmitter) + from SCons.Platform.mingw import MINGW_DEFAULT_PATHS + from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS + + if sys.platform == 'win32': + swig = SCons.Tool.find_program_path(env, 'swig', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS + [r'C:\ProgramData\chocolatey\bin'] ) + if swig: + swig_bin_dir = os.path.dirname(swig) + env.AppendENVPath('PATH', swig_bin_dir) + else: + SCons.Warnings.Warning('swig tool requested, but binary not found in ENV PATH') + if 'SWIG' not in env: env['SWIG'] = env.Detect(swigs) or swigs[0] env['SWIGVERSION'] = _get_swig_version(env, env['SWIG']) diff --git a/engine/SCons/Tool/tar.py b/engine/SCons/Tool/tar.py index e841231..05a7c70 100644 --- a/engine/SCons/Tool/tar.py +++ b/engine/SCons/Tool/tar.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/tar.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/tar.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/tex.py b/engine/SCons/Tool/tex.py index d70d35e..4607d2f 100644 --- a/engine/SCons/Tool/tex.py +++ b/engine/SCons/Tool/tex.py @@ -10,7 +10,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 @@ -33,7 +33,7 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/tex.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/tex.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path import re @@ -74,15 +74,15 @@ openout_bcf_re = re.compile(r"OUTPUT *(.*\.bcf)") #printglossary_re = re.compile(r"^[^%]*\\printglossary", re.MULTILINE) # search to find rerun warnings -warning_rerun_str = '(^LaTeX Warning:.*Rerun)|(^Package \w+ Warning:.*Rerun)' +warning_rerun_str = r'(^LaTeX Warning:.*Rerun)|(^Package \w+ Warning:.*Rerun)' warning_rerun_re = re.compile(warning_rerun_str, re.MULTILINE) # search to find citation rerun warnings -rerun_citations_str = "^LaTeX Warning:.*\n.*Rerun to get citations correct" +rerun_citations_str = r"^LaTeX Warning:.*\n.*Rerun to get citations correct" rerun_citations_re = re.compile(rerun_citations_str, re.MULTILINE) # search to find undefined references or citations warnings -undefined_references_str = '(^LaTeX Warning:.*undefined references)|(^Package \w+ Warning:.*undefined citations)' +undefined_references_str = r'(^LaTeX Warning:.*undefined references)|(^Package \w+ Warning:.*undefined citations)' undefined_references_re = re.compile(undefined_references_str, re.MULTILINE) # used by the emitter @@ -297,7 +297,8 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None logfilename = targetbase + '.log' logContent = '' if os.path.isfile(logfilename): - logContent = open(logfilename, "r").read() + with open(logfilename, "r") as f: + logContent = f.read() # Read the fls file to find all .aux files @@ -305,7 +306,8 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None flsContent = '' auxfiles = [] if os.path.isfile(flsfilename): - flsContent = open(flsfilename, "r").read() + with open(flsfilename, "r") as f: + flsContent = f.read() auxfiles = openout_aux_re.findall(flsContent) # remove duplicates dups = {} @@ -315,7 +317,8 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None bcffiles = [] if os.path.isfile(flsfilename): - flsContent = open(flsfilename, "r").read() + with open(flsfilename, "r") as f: + flsContent = f.read() bcffiles = openout_bcf_re.findall(flsContent) # remove duplicates dups = {} @@ -338,7 +341,8 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None already_bibtexed.append(auxfilename) target_aux = os.path.join(targetdir, auxfilename) if os.path.isfile(target_aux): - content = open(target_aux, "r").read() + with open(target_aux, "r") as f: + content = f.read() if content.find("bibdata") != -1: if Verbose: print("Need to run bibtex on ",auxfilename) @@ -361,7 +365,8 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None already_bibtexed.append(bcffilename) target_bcf = os.path.join(targetdir, bcffilename) if os.path.isfile(target_bcf): - content = open(target_bcf, "r").read() + with open(target_bcf, "r") as f: + content = f.read() if content.find("bibdata") != -1: if Verbose: print("Need to run biber on ",bcffilename) @@ -647,7 +652,7 @@ def ScanFiles(theFile, target, paths, file_tests, file_tests_search, env, graphi if incResult: aux_files.append(os.path.join(targetdir, incResult.group(1))) if Verbose: - print("\include file names : ", aux_files) + print(r"\include file names : ", aux_files) # recursively call this on each of the included files inc_files = [ ] inc_files.extend( include_re.findall(content) ) @@ -790,7 +795,7 @@ def tex_emitter_core(target, source, env, graphics_extensions): for multibibmatch in multibib_re.finditer(content): if Verbose: print("multibib match ",multibibmatch.group(1)) - if multibibmatch != None: + if multibibmatch is not None: baselist = multibibmatch.group(1).split(',') if Verbose: print("multibib list ", baselist) @@ -813,7 +818,8 @@ def tex_emitter_core(target, source, env, graphics_extensions): # read fls file to get all other files that latex creates and will read on the next pass # remove files from list that we explicitly dealt with above if os.path.isfile(flsfilename): - content = open(flsfilename, "r").read() + with open(flsfilename, "r") as f: + content = f.read() out_files = openout_re.findall(content) myfiles = [auxfilename, logfilename, flsfilename, targetbase+'.dvi',targetbase+'.pdf'] for filename in out_files[:]: diff --git a/engine/SCons/Tool/textfile.py b/engine/SCons/Tool/textfile.py index 28ef9d0..2cfa906 100644 --- a/engine/SCons/Tool/textfile.py +++ b/engine/SCons/Tool/textfile.py @@ -1,6 +1,6 @@ # -*- python -*- # -# 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 @@ -44,7 +44,7 @@ Textfile/Substfile builder for SCons. is unpredictable whether the expansion will occur. """ -__revision__ = "src/engine/SCons/Tool/textfile.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/textfile.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons diff --git a/engine/SCons/Tool/tlib.py b/engine/SCons/Tool/tlib.py index 098ac7b..70dd18a 100644 --- a/engine/SCons/Tool/tlib.py +++ b/engine/SCons/Tool/tlib.py @@ -5,7 +5,7 @@ XXX """ # -# 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 @@ -27,7 +27,7 @@ XXX # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/tlib.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/tlib.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Tool import SCons.Tool.bcc32 diff --git a/engine/SCons/Tool/wix.py b/engine/SCons/Tool/wix.py index c5f12a1..b4f63ad 100644 --- a/engine/SCons/Tool/wix.py +++ b/engine/SCons/Tool/wix.py @@ -8,7 +8,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 @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/wix.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/wix.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import SCons.Builder import SCons.Action diff --git a/engine/SCons/Tool/xgettext.py b/engine/SCons/Tool/xgettext.py index 46ea768..8925a9d 100644 --- a/engine/SCons/Tool/xgettext.py +++ b/engine/SCons/Tool/xgettext.py @@ -3,7 +3,7 @@ Tool specific initialization of `xgettext` tool. """ -# 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,7 +24,7 @@ Tool specific initialization of `xgettext` tool. # 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/Tool/xgettext.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/xgettext.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" ############################################################################# @@ -288,9 +288,21 @@ def _POTUpdateBuilder(env, **kw): ############################################################################# def generate(env, **kw): """ Generate `xgettext` tool """ + import sys + import os import SCons.Util + import SCons.Tool from SCons.Tool.GettextCommon import RPaths, _detect_xgettext - + from SCons.Platform.mingw import MINGW_DEFAULT_PATHS + from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS + + if sys.platform == 'win32': + xgettext = SCons.Tool.find_program_path(env, 'xgettext', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) + if xgettext: + xgettext_bin_dir = os.path.dirname(xgettext) + env.AppendENVPath('PATH', xgettext_bin_dir) + else: + SCons.Warnings.Warning('xgettext tool requested, but binary not found in ENV PATH') try: env['XGETTEXT'] = _detect_xgettext(env) except: diff --git a/engine/SCons/Tool/yacc.py b/engine/SCons/Tool/yacc.py index 0a73f60..d328d20 100644 --- a/engine/SCons/Tool/yacc.py +++ b/engine/SCons/Tool/yacc.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,13 +31,17 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/yacc.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/yacc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path +import sys import SCons.Defaults import SCons.Tool import SCons.Util +from SCons.Platform.mingw import MINGW_DEFAULT_PATHS +from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS +from SCons.Platform.win32 import CHOCO_DEFAULT_PATH YaccAction = SCons.Action.Action("$YACCCOM", "$YACCCOMSTR") @@ -94,6 +98,28 @@ def ymEmitter(target, source, env): def yyEmitter(target, source, env): return _yaccEmitter(target, source, env, ['.yy'], '$YACCHXXFILESUFFIX') +def get_yacc_path(env, append_paths=False): + """ + Find the a path containing the lex or flex binaries. If a construction + environment is passed in then append the path to the ENV PATH. + """ + # save existing path to reset if we don't want to append any paths + envPath = env['ENV']['PATH'] + bins = ['bison', 'yacc', 'win_bison'] + + for prog in bins: + bin_path = SCons.Tool.find_program_path( + env, + prog, + default_paths=CHOCO_DEFAULT_PATH + MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) + if bin_path: + if not append_paths: + env['ENV']['PATH'] = envPath + else: + env.AppendENVPath('PATH', os.path.dirname(bin_path)) + return bin_path + SCons.Warnings.Warning('lex tool requested, but lex or flex binary not found in ENV PATH') + def generate(env): """Add Builders and construction variables for yacc to an Environment.""" c_file, cxx_file = SCons.Tool.createCFileBuilders(env) @@ -113,7 +139,20 @@ def generate(env): cxx_file.add_action('.yy', YaccAction) cxx_file.add_emitter('.yy', yyEmitter) - env['YACC'] = env.Detect('bison') or 'yacc' + if sys.platform == 'win32': + bison = SCons.Tool.find_program_path(env, 'bison', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) + if bison: + bison_bin_dir = os.path.dirname(bison) + env.AppendENVPath('PATH', bison_bin_dir) + else: + SCons.Warnings.Warning('yacc tool requested, but bison binary not found in ENV PATH') + + if sys.platform == 'win32': + get_yacc_path(env, append_paths=True) + env["YACC"] = env.Detect(['bison', 'yacc', 'win_bison']) + else: + env["YACC"] = env.Detect(["bison", "yacc"]) + env['YACCFLAGS'] = SCons.Util.CLVar('') env['YACCCOM'] = '$YACC $YACCFLAGS -o $TARGET $SOURCES' env['YACCHFILESUFFIX'] = '.h' diff --git a/engine/SCons/Tool/zip.py b/engine/SCons/Tool/zip.py index 8b243f8..2689634 100644 --- a/engine/SCons/Tool/zip.py +++ b/engine/SCons/Tool/zip.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/zip.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Tool/zip.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path diff --git a/engine/SCons/Util.py b/engine/SCons/Util.py index c9aa2b5..476f5d8 100644 --- a/engine/SCons/Util.py +++ b/engine/SCons/Util.py @@ -3,7 +3,7 @@ Various utility functions go 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 @@ -24,7 +24,7 @@ Various utility functions go here. # 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/Util.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Util.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import sys @@ -37,21 +37,18 @@ import pprint PY3 = sys.version_info[0] == 3 try: + from collections import UserDict, UserList, UserString +except ImportError: from UserDict import UserDict -except ImportError as e: - from collections import UserDict - -try: from UserList import UserList -except ImportError as e: - from collections import UserList - -from collections import Iterable + from UserString import UserString try: - from UserString import UserString -except ImportError as e: - from collections import UserString + from collections.abc import Iterable, MappingView +except ImportError: + from collections import Iterable + +from collections import OrderedDict # Don't "from types import ..." these because we need to get at the # types module later to look for UnicodeType. @@ -63,7 +60,7 @@ MethodType = types.MethodType FunctionType = types.FunctionType try: - unicode + _ = type(unicode) except NameError: UnicodeType = str else: @@ -106,7 +103,7 @@ def containsOnly(str, set): return 1 def splitext(path): - "Same as os.path.splitext() but faster." + """Same as os.path.splitext() but faster.""" sep = rightmost_separator(path, os.sep) dot = path.rfind('.') # An ext is only real if it has at least one non-digit char @@ -371,7 +368,13 @@ def print_tree(root, child_func, prune=0, showtags=0, margin=[0], visited=None): DictTypes = (dict, UserDict) ListTypes = (list, UserList) -SequenceTypes = (list, tuple, UserList) + +try: + # Handle getting dictionary views. + SequenceTypes = (list, tuple, UserList, MappingView) +except NameError: + SequenceTypes = (list, tuple, UserList) + # Note that profiling data shows a speed-up when comparing # explicitly with str and unicode instead of simply comparing @@ -1029,64 +1032,9 @@ class CLVar(UserList): return UserList.__add__(self, CLVar(other)) def __radd__(self, other): return UserList.__radd__(self, CLVar(other)) - def __coerce__(self, other): - return (self, CLVar(other)) def __str__(self): return ' '.join(self.data) -# A dictionary that preserves the order in which items are added. -# Submitted by David Benjamin to ActiveState's Python Cookbook web site: -# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747 -# Including fixes/enhancements from the follow-on discussions. -class OrderedDict(UserDict): - def __init__(self, dict = None): - self._keys = [] - UserDict.__init__(self, dict) - - def __delitem__(self, key): - UserDict.__delitem__(self, key) - self._keys.remove(key) - - def __setitem__(self, key, item): - UserDict.__setitem__(self, key, item) - if key not in self._keys: self._keys.append(key) - - def clear(self): - UserDict.clear(self) - self._keys = [] - - def copy(self): - dict = OrderedDict() - dict.update(self) - return dict - - def items(self): - return list(zip(self._keys, list(self.values()))) - - def keys(self): - return self._keys[:] - - def popitem(self): - try: - key = self._keys[-1] - except IndexError: - raise KeyError('dictionary is empty') - - val = self[key] - del self[key] - - return (key, val) - - def setdefault(self, key, failobj = None): - UserDict.setdefault(self, key, failobj) - if key not in self._keys: self._keys.append(key) - - def update(self, dict): - for (key, val) in dict.items(): - self.__setitem__(key, val) - - def values(self): - return list(map(self.get, self._keys)) class Selector(OrderedDict): """A callable ordered dictionary that maps file suffixes to @@ -1428,8 +1376,8 @@ def make_path_relative(path): # The original idea for AddMethod() and RenameFunction() come from the # following post to the ActiveState Python Cookbook: # -# ASPN: Python Cookbook : Install bound methods in an instance -# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/223613 +# ASPN: Python Cookbook : Install bound methods in an instance +# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/223613 # # That code was a little fragile, though, so the following changes # have been wrung on it: @@ -1446,8 +1394,8 @@ def make_path_relative(path): # the "new" module, as alluded to in Alex Martelli's response to the # following Cookbook post: # -# ASPN: Python Cookbook : Dynamically added methods to a class -# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81732 +# ASPN: Python Cookbook : Dynamically added methods to a class +# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81732 def AddMethod(obj, function, name=None): """ @@ -1517,6 +1465,11 @@ else: md5 = True def MD5signature(s): + """ + Generate a String of Hex digits representing the md5 signature of the string + :param s: either string or bytes. Normally should be bytes + :return: String of hex digits + """ m = hashlib.md5() try: @@ -1527,6 +1480,11 @@ else: return m.hexdigest() def MD5filesignature(fname, chunksize=65536): + """ + :param fname: + :param chunksize: + :return: String of Hex digits + """ m = hashlib.md5() f = open(fname, "rb") while True: @@ -1537,6 +1495,7 @@ else: f.close() return m.hexdigest() + def MD5collect(signatures): """ Collects a list of signatures into an aggregate signature. @@ -1609,19 +1568,27 @@ class NullSeq(Null): del __revision__ -def to_bytes (s): + +def to_bytes(s): + if s is None: + return b'None' + if not PY3 and isinstance(s, UnicodeType): + # PY2, must encode unicode + return bytearray(s, 'utf-8') if isinstance (s, (bytes, bytearray)) or bytes is str: + # Above case not covered here as py2 bytes and strings are the same return s - return bytes (s, 'utf-8') + return bytes(s, 'utf-8') + -def to_str (s): +def to_str(s): + if s is None: + return 'None' if bytes is str or is_String(s): return s return str (s, 'utf-8') - -# No cmp in py3, so we'll define it. def cmp(a, b): """ Define cmp because it's no longer available in python3 @@ -1630,6 +1597,37 @@ def cmp(a, b): return (a > b) - (a < b) +def get_env_bool(env, name, default=False): + """Get a value of env[name] converted to boolean. The value of env[name] is + interpreted as follows: 'true', 'yes', 'y', 'on' (case insensitive) and + anything convertible to int that yields non-zero integer are True values; + '0', 'false', 'no', 'n' and 'off' (case insensitive) are False values. For + all other cases, default value is returned. + + :Parameters: + - `env` - dict or dict-like object, a convainer with variables + - `name` - name of the variable in env to be returned + - `default` - returned when env[name] does not exist or can't be converted to bool + """ + try: + var = env[name] + except KeyError: + return default + try: + return bool(int(var)) + except ValueError: + if str(var).lower() in ('true', 'yes', 'y', 'on'): + return True + elif str(var).lower() in ('false', 'no', 'n', 'off'): + return False + else: + return default + + +def get_os_env_bool(name, default=False): + """Same as get_env_bool(os.environ, name, default).""" + return get_env_bool(os.environ, name, default) + # Local Variables: # tab-width:4 # indent-tabs-mode:nil diff --git a/engine/SCons/Variables/BoolVariable.py b/engine/SCons/Variables/BoolVariable.py index 8e723fe..71b554a 100644 --- a/engine/SCons/Variables/BoolVariable.py +++ b/engine/SCons/Variables/BoolVariable.py @@ -12,7 +12,7 @@ Usage example:: """ # -# 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 @@ Usage example:: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/BoolVariable.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Variables/BoolVariable.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __all__ = ['BoolVariable',] diff --git a/engine/SCons/Variables/EnumVariable.py b/engine/SCons/Variables/EnumVariable.py index fdc7851..4995bb1 100644 --- a/engine/SCons/Variables/EnumVariable.py +++ b/engine/SCons/Variables/EnumVariable.py @@ -15,7 +15,7 @@ Usage example:: """ # -# 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 @@ -37,7 +37,7 @@ Usage example:: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/EnumVariable.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Variables/EnumVariable.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __all__ = ['EnumVariable',] diff --git a/engine/SCons/Variables/ListVariable.py b/engine/SCons/Variables/ListVariable.py index 616d18b..4995382 100644 --- a/engine/SCons/Variables/ListVariable.py +++ b/engine/SCons/Variables/ListVariable.py @@ -25,7 +25,7 @@ Usage example:: """ # -# 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 @@ -46,7 +46,7 @@ Usage example:: # 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/Variables/ListVariable.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Variables/ListVariable.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" # Known Bug: This should behave like a Set-Type, but does not really, # since elements can occur twice. diff --git a/engine/SCons/Variables/PackageVariable.py b/engine/SCons/Variables/PackageVariable.py index 9a81c6d..e1d2e3d 100644 --- a/engine/SCons/Variables/PackageVariable.py +++ b/engine/SCons/Variables/PackageVariable.py @@ -28,7 +28,7 @@ Usage example: """ # -# 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 @@ -50,7 +50,7 @@ Usage example: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/PackageVariable.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Variables/PackageVariable.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __all__ = ['PackageVariable',] diff --git a/engine/SCons/Variables/PathVariable.py b/engine/SCons/Variables/PathVariable.py index 8b01593..8003ba6 100644 --- a/engine/SCons/Variables/PathVariable.py +++ b/engine/SCons/Variables/PathVariable.py @@ -45,7 +45,7 @@ Usage example:: """ # -# 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 @@ -67,7 +67,7 @@ Usage example:: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/PathVariable.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Variables/PathVariable.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __all__ = ['PathVariable',] diff --git a/engine/SCons/Variables/__init__.py b/engine/SCons/Variables/__init__.py index 2c48da6..c218e18 100644 --- a/engine/SCons/Variables/__init__.py +++ b/engine/SCons/Variables/__init__.py @@ -5,7 +5,7 @@ customizable variables to an SCons build. """ # -# 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 @@ customizable variables to an SCons build. # 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/Variables/__init__.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Variables/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os.path import sys diff --git a/engine/SCons/Warnings.py b/engine/SCons/Warnings.py index ecac38b..d3143fd 100644 --- a/engine/SCons/Warnings.py +++ b/engine/SCons/Warnings.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 @@ -27,7 +27,7 @@ This file implements the warnings framework for SCons. """ -__revision__ = "src/engine/SCons/Warnings.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/Warnings.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import sys @@ -74,12 +74,6 @@ class MisleadingKeywordsWarning(WarningOnByDefault): class MissingSConscriptWarning(WarningOnByDefault): pass -class NoMD5ModuleWarning(WarningOnByDefault): - pass - -class NoMetaclassSupportWarning(WarningOnByDefault): - pass - class NoObjectCountWarning(WarningOnByDefault): pass @@ -153,6 +147,9 @@ class DeprecatedSigModuleWarning(MandatoryDeprecatedWarning): class DeprecatedBuilderKeywordsWarning(MandatoryDeprecatedWarning): pass +class DeprecatedMissingSConscriptWarning(DeprecatedWarning): + pass + # The below is a list of 2-tuples. The first element is a class object. # The second element is true if that class is enabled, false if it is disabled. @@ -185,8 +182,8 @@ def warn(clazz, *args): global _enabled, _warningAsException, _warningOut warning = clazz(args) - for clazz, flag in _enabled: - if isinstance(warning, clazz): + for cls, flag in _enabled: + if isinstance(warning, cls): if flag: if _warningAsException: raise warning diff --git a/engine/SCons/__init__.py b/engine/SCons/__init__.py index 53386cc..27c37eb 100644 --- a/engine/SCons/__init__.py +++ b/engine/SCons/__init__.py @@ -5,7 +5,7 @@ The main package for the SCons software construction utility. """ # -# 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 @@ -27,17 +27,17 @@ The main package for the SCons software construction utility. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/__init__.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" -__version__ = "3.0.1" +__version__ = "3.0.5" -__build__ = "74b2c53bc42290e911b334a6b44f187da698a668" +__build__ = "a56bbd8c09fb219ab8a9673330ffcd55279219d0" -__buildsys__ = "hpmicrodog" +__buildsys__ = "kufra" -__date__ = "2017/11/14 13:16:53" +__date__ = "2019-03-26 23:16:31" -__developer__ = "bdbaddog" +__developer__ = "bdeegan" # make sure compatibility is always in place import SCons.compat diff --git a/engine/SCons/compat/__init__.py b/engine/SCons/compat/__init__.py index 4356940..7846577 100644 --- a/engine/SCons/compat/__init__.py +++ b/engine/SCons/compat/__init__.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 @@ -57,7 +57,7 @@ function defined below loads the module as the "real" name (without the rest of our code will find our pre-loaded compatibility module. """ -__revision__ = "src/engine/SCons/compat/__init__.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/compat/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import sys @@ -98,7 +98,7 @@ import pickle # Was pickle.HIGHEST_PROTOCOL # Changed to 2 so py3.5+'s pickle will be compatible with py2.7. -PICKLE_PROTOCOL = 2 +PICKLE_PROTOCOL = pickle.HIGHEST_PROTOCOL # TODO: FIXME # In 3.x, 'profile' automatically loads the fast version if available. diff --git a/engine/SCons/compat/_scons_dbm.py b/engine/SCons/compat/_scons_dbm.py index e1e4b3a..a57f105 100644 --- a/engine/SCons/compat/_scons_dbm.py +++ b/engine/SCons/compat/_scons_dbm.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 @@ -30,7 +30,7 @@ that the whichdb.whichdb() implementstation in the various 2.X versions of Python won't blow up even if dbm wasn't compiled in. """ -__revision__ = "src/engine/SCons/compat/_scons_dbm.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/compat/_scons_dbm.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" class error(Exception): pass diff --git a/engine/SCons/cpp.py b/engine/SCons/cpp.py index 44611b8..eb537e2 100644 --- a/engine/SCons/cpp.py +++ b/engine/SCons/cpp.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/cpp.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/cpp.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" __doc__ = """ SCons C Pre-Processor module @@ -43,15 +43,18 @@ import re # that we want to fetch, using the regular expressions to which the lists # of preprocessor directives map. cpp_lines_dict = { - # Fetch the rest of a #if/#elif/#ifdef/#ifndef as one argument, + # Fetch the rest of a #if/#elif as one argument, + # with white space optional. + ('if', 'elif') : r'\s*(.+)', + + # Fetch the rest of a #ifdef/#ifndef as one argument, # separated from the keyword by white space. - ('if', 'elif', 'ifdef', 'ifndef',) - : '\s+(.+)', + ('ifdef', 'ifndef',): r'\s+(.+)', # Fetch the rest of a #import/#include/#include_next line as one # argument, with white space optional. ('import', 'include', 'include_next',) - : '\s*(.+)', + : r'\s*(.+)', # We don't care what comes after a #else or #endif line. ('else', 'endif',) : '', @@ -61,10 +64,10 @@ cpp_lines_dict = { # 2) The optional parentheses and arguments (if it's a function-like # macro, '' if it's not). # 3) The expansion value. - ('define',) : '\s+([_A-Za-z][_A-Za-z0-9_]*)(\([^)]*\))?\s*(.*)', + ('define',) : r'\s+([_A-Za-z][_A-Za-z0-9_]*)(\([^)]*\))?\s*(.*)', # Fetch the #undefed keyword from a #undef line. - ('undef',) : '\s+([_A-Za-z][A-Za-z0-9_]*)', + ('undef',) : r'\s+([_A-Za-z][A-Za-z0-9_]*)', } # Create a table that maps each individual C preprocessor directive to @@ -82,9 +85,9 @@ del op_list # Create a list of the expressions we'll use to match all of the # preprocessor directives. These are the same as the directives # themselves *except* that we must use a negative lookahead assertion -# when matching "if" so it doesn't match the "if" in "ifdef." +# when matching "if" so it doesn't match the "if" in "ifdef" or "ifndef". override = { - 'if' : 'if(?!def)', + 'if' : 'if(?!n?def)', } l = [override.get(x, x) for x in list(Table.keys())] @@ -94,7 +97,7 @@ l = [override.get(x, x) for x in list(Table.keys())] # a list of tuples, one for each preprocessor line. The preprocessor # directive will be the first element in each tuple, and the rest of # the line will be the second element. -e = '^\s*#\s*(' + '|'.join(l) + ')(.*)$' +e = r'^\s*#\s*(' + '|'.join(l) + ')(.*)$' # And last but not least, compile the expression. CPP_Expression = re.compile(e, re.M) @@ -141,12 +144,12 @@ CPP_to_Python_Ops_Expression = re.compile(expr) # A separate list of expressions to be evaluated and substituted # sequentially, not all at once. CPP_to_Python_Eval_List = [ - ['defined\s+(\w+)', '"\\1" in __dict__'], - ['defined\s*\((\w+)\)', '"\\1" in __dict__'], - ['/\*.*\*/', ''], - ['/\*.*', ''], - ['//.*', ''], - ['(0x[0-9A-Fa-f]*)[UL]+', '\\1'], + [r'defined\s+(\w+)', '"\\1" in __dict__'], + [r'defined\s*\((\w+)\)', '"\\1" in __dict__'], + [r'/\*.*\*/', ''], + [r'/\*.*', ''], + [r'//.*', ''], + [r'(0x[0-9A-Fa-f]*)[UL]+', '\\1'], ] # Replace the string representations of the regular expressions in the @@ -222,11 +225,11 @@ line_continuations = re.compile('\\\\\r?\n') # Search for a "function call" macro on an expansion. Returns the # two-tuple of the "function" name itself, and a string containing the # arguments within the call parentheses. -function_name = re.compile('(\S+)\(([^)]*)\)') +function_name = re.compile(r'(\S+)\(([^)]*)\)') # Split a string containing comma-separated function call arguments into # the separate arguments. -function_arg_separator = re.compile(',\s*') +function_arg_separator = re.compile(r',\s*') diff --git a/engine/SCons/dblite.py b/engine/SCons/dblite.py index 87a1763..14bd93d 100644 --- a/engine/SCons/dblite.py +++ b/engine/SCons/dblite.py @@ -75,7 +75,8 @@ class dblite(object): def __init__(self, file_base_name, flag, mode): assert flag in (None, "r", "w", "c", "n") - if (flag is None): flag = "r" + if flag is None: + flag = "r" base, ext = os.path.splitext(file_base_name) if ext == dblite_suffix: @@ -106,17 +107,20 @@ class dblite(object): self._chown_to = -1 # don't chown self._chgrp_to = -1 # don't chgrp - if (self._flag == "n"): - self._open(self._file_name, "wb", self._mode) + if self._flag == "n": + with self._open(self._file_name, "wb", self._mode): + pass # just make sure it exists else: try: f = self._open(self._file_name, "rb") except IOError as e: - if (self._flag != "c"): + if self._flag != "c": raise e - self._open(self._file_name, "wb", self._mode) + with self._open(self._file_name, "wb", self._mode): + pass # just make sure it exists else: p = f.read() + f.close() if len(p) > 0: try: if bytes is not str: @@ -132,7 +136,7 @@ class dblite(object): corruption_warning(self._file_name) def close(self): - if (self._needs_sync): + if self._needs_sync: self.sync() def __del__(self): diff --git a/engine/SCons/exitfuncs.py b/engine/SCons/exitfuncs.py index d6d3f70..e1b9382 100644 --- a/engine/SCons/exitfuncs.py +++ b/engine/SCons/exitfuncs.py @@ -5,7 +5,7 @@ Register functions which are executed when SCons exits for any reason. """ # -# 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 @@ -27,7 +27,7 @@ Register functions which are executed when SCons exits for any reason. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/exitfuncs.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/engine/SCons/exitfuncs.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import atexit diff --git a/scons-time.1 b/scons-time.1 index 4311170..d9e9bae 100644 --- a/scons-time.1 +++ b/scons-time.1 @@ -2,12 +2,12 @@ .\" Title: SCONS-TIME .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 11/14/2017 -.\" Manual: SCons 3.0.1 -.\" Source: SCons 3.0.1 +.\" Date: 03/26/2019 +.\" Manual: SCons 3.0.5 +.\" Source: SCons 3.0.5 .\" Language: English .\" -.TH "SCONS\-TIME" "1" "11/14/2017" "SCons 3\&.0\&.1" "SCons 3\&.0\&.1" +.TH "SCONS\-TIME" "1" "03/26/2019" "SCons 3\&.0\&.5" "SCons 3\&.0\&.5" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/scons.1 b/scons.1 index bbbb96c..b9e2594 100644 --- a/scons.1 +++ b/scons.1 @@ -2,12 +2,12 @@ .\" Title: SCONS .\" Author: Steven Knight .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 2004 - 2016 -.\" Manual: SCons 3.0.1 -.\" Source: SCons 3.0.1 version 3.0.1 +.\" Date: 2004 - 2019 +.\" Manual: SCons 3.0.5 +.\" Source: SCons 3.0.5 version 3.0.5 .\" Language: English .\" -.TH "SCONS" "1" "2004 - 2016" "SCons 3\&.0\&.1 version 3.0.1" "SCons 3\&.0\&.1" +.TH "SCONS" "1" "2004 - 2019" "SCons 3\&.0\&.5 version 3.0.5" "SCons 3\&.0\&.5" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -42,8 +42,12 @@ By default, \fBscons\fR searches for a file named \fISConstruct\fR, -\fISconstruct\fR, or -\fIsconstruct\fR +\fISconstruct\fR, +\fIsconstruct\fR, +\fISConstruct\&.py\fR +\fISconstruct\&.py\fR +or +\fIsconstruct\&.py\fR (in that order) in the current directory and reads its configuration from the first file found\&. An alternate file name may be specified via the \fB\-f\fR option\&. @@ -181,7 +185,7 @@ scons .RE .\} .PP -will build all target files in or below the current directory\&. Explicit default targets (to be built when no targets are specified on the command line) may be defined the SConscript file(s) using the +will build all target files in or below the current directory\&. Explicit default targets (to be built when no targets are specified on the command line) may be defined in the SConscript file(s) using the \fBDefault()\fR function, described below\&. .PP @@ -360,7 +364,7 @@ else: The command\-line variable arguments are also available in the ARGLIST list, indexed by their order on the command line\&. This allows you to process them in order rather than by name, if necessary\&. ARGLIST[0] returns a tuple containing (argname, argvalue)\&. A Python exception is thrown if you try to access a list member that does not exist\&. .PP \fBscons\fR -requires Python version 2\&.7 or later\&. There should be no other dependencies or requirements to run +requires either Python 2\&.7 or Python 3\&.5 or higher\&. There should be no other dependencies or requirements to run \fBscons\&.\fR .PP By default, @@ -462,8 +466,12 @@ Change to the specified \fIdirectory\fR before searching for the \fISConstruct\fR, -\fISconstruct\fR, or -\fIsconstruct\fR +\fISconstruct\fR, +\fIsconstruct\fR, +\fISConstruct\&.py\fR +\fISconstruct\&.py\fR +or +\fIsconstruct\&.py\fR file, or doing anything else\&. Multiple \fB\-C\fR options are interpreted relative to the previous one, and the right\-most @@ -471,8 +479,12 @@ options are interpreted relative to the previous one, and the right\-most option wins\&. (This option is nearly equivalent to \fB\-f directory/SConstruct\fR, except that it will search for \fISConstruct\fR, -\fISconstruct\fR, or -\fIsconstruct\fR +\fISconstruct\fR, +\fIsconstruct\fR, +\fISConstruct\&.py\fR +\fISconstruct\&.py\fR +or +\fIsconstruct\&.py\fR in the specified directory\&.) .RE .PP @@ -616,7 +628,8 @@ Prints various time profiling information: .sp -1 .IP \(bu 2.3 .\} -The time spent executing each individual build command.RE +The time spent executing each individual build command +.RE .sp .RS 4 .ie n \{\ @@ -626,7 +639,8 @@ The time spent executing each individual build command.RE .sp -1 .IP \(bu 2.3 .\} -The total build time (time SCons ran from beginning to end).RE +The total build time (time SCons ran from beginning to end) +.RE .sp .RS 4 .ie n \{\ @@ -636,7 +650,8 @@ The total build time (time SCons ran from beginning to end).RE .sp -1 .IP \(bu 2.3 .\} -The total time spent reading and executing SConscript files.RE +The total time spent reading and executing SConscript files +.RE .sp .RS 4 .ie n \{\ @@ -646,8 +661,8 @@ The total time spent reading and executing SConscript files.RE .sp -1 .IP \(bu 2.3 .\} -The total time spent SCons itself spend running -(that is, not counting reading and executing SConscript files).RE +The total time spent SCons itself spend running (that is, not counting reading and executing SConscript files) +.RE .sp .RS 4 .ie n \{\ @@ -657,7 +672,8 @@ The total time spent SCons itself spend running .sp -1 .IP \(bu 2.3 .\} -The total time spent executing all build commands.RE +The total time spent executing all build commands +.RE .sp .RS 4 .ie n \{\ @@ -667,7 +683,8 @@ The total time spent executing all build commands.RE .sp -1 .IP \(bu 2.3 .\} -The elapsed wall\-clock time spent executing those build commands.RE +The elapsed wall\-clock time spent executing those build commands +.RE .sp .RS 4 .ie n \{\ @@ -677,7 +694,10 @@ The elapsed wall\-clock time spent executing those build commands.RE .sp -1 .IP \(bu 2.3 .\} -The time spent processing each file passed to the \fISConscript()\fR function.RE +The time spent processing each file passed to the +\fISConscript()\fR +function +.RE .sp (When \fBscons\fR @@ -727,6 +747,11 @@ or \fIcopy\fR\&. SCons will attempt to duplicate files using the mechanisms in the specified order\&. .RE .PP +\-\-enable\-virtualenv +.RS 4 +Import virtualenv\-related variables to SCons\&. +.RE +.PP \-f\fI file\fR, \-\-file=\fIfile\fR, \-\-makefile=\fIfile\fR, \-\-sconstruct=\fIfile\fR .RS 4 Use @@ -764,6 +789,11 @@ to search for imported Python modules\&. If several options are used, the directories are searched in the order specified\&. .RE .PP +\-\-ignore\-virtualenv +.RS 4 +Suppress importing virtualenv\-related variables to SCons\&. +.RE +.PP \-\-implicit\-cache .RS 4 Cache implicit dependencies\&. This causes @@ -1153,9 +1183,12 @@ scons \-\-tree=all,prune,status target .RS 4 Walks up the directory structure until an \fISConstruct ,\fR -\fISconstruct\fR +\fISconstruct ,\fR +\fIsconstruct ,\fR +\fISConstruct\&.py\fR +\fISconstruct\&.py\fR or -\fIsconstruct\fR +\fIsconstruct\&.py\fR file is found, and uses that as the top of the directory tree\&. If no targets are specified on the command line, only targets at or below the current directory will be built\&. .RE .PP @@ -1291,18 +1324,6 @@ These warnings are enabled by default\&. Enables or disables warnings about missing SConscript files\&. These warnings are enabled by default\&. .RE .PP -\-\-warn=no\-md5\-module, \-\-warn=no\-no\-md5\-module -.RS 4 -Enables or disables warnings about the version of Python not having an MD5 checksum module available\&. These warnings are enabled by default\&. -.RE -.PP -\-\-warn=no\-metaclass\-support, \-\-warn=no\-no\-metaclass\-support -.RS 4 -Enables or disables warnings about the version of Python not supporting metaclasses when the -\fB\-\-debug=memoizer\fR -option is used\&. These warnings are enabled by default\&. -.RE -.PP \-\-warn=no\-object\-count, \-\-warn=no\-no\-object\-count .RS 4 Enables or disables warnings about the @@ -1630,6 +1651,10 @@ applelink Sets construction variables for the Apple linker (similar to the GNU linker)\&. .sp Sets: +\fB$APPLELINK_COMPATIBILITY_VERSION\fR, +\fB$APPLELINK_CURRENT_VERSION\fR, +\fB$APPLELINK_NO_COMPATIBILITY_VERSION\fR, +\fB$APPLELINK_NO_CURRENT_VERSION\fR, \fB$FRAMEWORKPATHPREFIX\fR, \fB$LDMODULECOM\fR, \fB$LDMODULEFLAGS\fR, @@ -1638,6 +1663,8 @@ Sets: \fB$LINKCOM\fR, \fB$SHLINKCOM\fR, \fB$SHLINKFLAGS\fR, +\fB$_APPLELINK_COMPATIBILITY_VERSION\fR, +\fB$_APPLELINK_CURRENT_VERSION\fR, \fB$_FRAMEWORKPATH\fR, \fB$_FRAMEWORKS\fR\&. .sp @@ -2747,6 +2774,7 @@ Sets: \fB$JAVACFLAGS\fR, \fB$JAVACLASSPATH\fR, \fB$JAVACLASSSUFFIX\fR, +\fB$JAVAINCLUDES\fR, \fB$JAVASOURCEPATH\fR, \fB$JAVASUFFIX\fR\&. .sp @@ -2840,7 +2868,8 @@ lexical analyser\&. Sets: \fB$LEX\fR, \fB$LEXCOM\fR, -\fB$LEXFLAGS\fR\&. +\fB$LEXFLAGS\fR, +\fB$LEXUNISTD\fR\&. .sp Uses: \fB$LEXCOMSTR\fR\&. @@ -3731,7 +3760,9 @@ env\&.Program(\*(Aqbar\*(Aq, source = \*(Aqbar\&.c foo\&.c\*(Aq\&.split()) Target and source file names that are not absolute path names (that is, do not begin with \fB/\fR on POSIX systems or -\fB\efR on Windows systems, with or without an optional drive letter) are interpreted relative to the directory containing the SConscript\fR +\fB\e\fR +on Windows systems, with or without an optional drive letter) are interpreted relative to the directory containing the +\fBSConscript\fR file being read\&. An initial \fB#\fR (hash mark) on a path name means that the rest of the file name is interpreted relative to the directory containing the top\-level @@ -4642,9 +4673,10 @@ Examples: .RS 4 .\} .nf -env\&.Java(target = \*(Aqclasses\*(Aq, source = \*(Aqsrc\*(Aq) -env\&.Java(target = \*(Aqclasses\*(Aq, source = [\*(Aqsrc1\*(Aq, \*(Aqsrc2\*(Aq]) -env\&.Java(target = \*(Aqclasses\*(Aq, source = [\*(AqFile1\&.java\*(Aq, \*(AqFile2\&.java\*(Aq]) + env\&.Java(target = \*(Aqclasses\*(Aq, source = \*(Aqsrc\*(Aq) + env\&.Java(target = \*(Aqclasses\*(Aq, source = [\*(Aqsrc1\*(Aq, \*(Aqsrc2\*(Aq]) + env\&.Java(target = \*(Aqclasses\*(Aq, source = [\*(AqFile1\&.java\*(Aq, \*(AqFile2\&.java\*(Aq]) + .fi .if n \{\ .RE @@ -4658,8 +4690,9 @@ environment variable to tell the compiler what encoding is used\&. For portibili .RS 4 .\} .nf -env = Environment() -env[\*(AqENV\*(Aq][\*(AqLANG\*(Aq] = \*(Aqen_GB\&.UTF\-8\*(Aq + env = Environment() + env[\*(AqENV\*(Aq][\*(AqLANG\*(Aq] = \*(Aqen_GB\&.UTF\-8\*(Aq + .fi .if n \{\ .RE @@ -4960,23 +4993,24 @@ barlocalincs = [\*(AqStdAfx\&.h\*(Aq] barresources = [\*(Aqbar\&.rc\*(Aq,\*(Aqresource\&.h\*(Aq] barmisc = [\*(Aqbar_readme\&.txt\*(Aq] -dll = env\&.SharedLibrary(target = \*(Aqbar\&.dll\*(Aq, - source = barsrcs) +dll = env\&.SharedLibrary(target=\*(Aqbar\&.dll\*(Aq, + source=barsrcs) buildtarget = [s for s in dll if str(s)\&.endswith(\*(Aqdll\*(Aq)] -env\&.MSVSProject(target = \*(AqBar\*(Aq + env[\*(AqMSVSPROJECTSUFFIX\*(Aq], - srcs = barsrcs, - incs = barincs, - localincs = barlocalincs, - resources = barresources, - misc = barmisc, - buildtarget = buildtarget, - variant = \*(AqRelease\*(Aq) +env\&.MSVSProject(target=\*(AqBar\*(Aq + env[\*(AqMSVSPROJECTSUFFIX\*(Aq], + srcs=barsrcs, + incs=barincs, + localincs=barlocalincs, + resources=barresources, + misc=barmisc, + buildtarget=buildtarget, + variant=\*(AqRelease\*(Aq) + .fi .if n \{\ .RE .\} .sp -Starting with version 2\&.4 of SCons it\*(Aqs also possible to specify the optional argument +Starting with version 2\&.4 of SCons it is also possible to specify the optional argument \fIDebugSettings\fR, which creates files for debugging under Visual Studio: .PP DebugSettings @@ -5009,7 +5043,7 @@ if msvcver == \*(Aq9\*(Aq or msvcver == \*(Aq11\*(Aq: env = Environment(MSVC_VERSION=msvcver+\*(Aq\&.0\*(Aq, MSVC_BATCH=False) else: env = Environment() - + AddOption(\*(Aq\-\-userfile\*(Aq, action=\*(Aqstore_true\*(Aq, dest=\*(Aquserfile\*(Aq, default=False, help="Create Visual Studio Project user file") @@ -5044,10 +5078,10 @@ V9DebugSettings = { } # -# 2\&. Because there are a lot of different options depending on the Microsoft -# Visual Studio version, if you use more than one version you have to -# define a dictionary per version, for instance if you want to create a user -# file to launch a specific application for testing your dll with Microsoft +# 2\&. Because there are a lot of different options depending on the Microsoft +# Visual Studio version, if you use more than one version you have to +# define a dictionary per version, for instance if you want to create a user +# file to launch a specific application for testing your dll with Microsoft # Visual Studio 2012 (v11): # V10DebugSettings = { @@ -5079,7 +5113,7 @@ V10DebugSettings = { } # -# 3\&. Select the dictionary you want depending on the version of visual Studio +# 3\&. Select the dictionary you want depending on the version of visual Studio # Files you want to generate\&. # if not env\&.GetOption(\*(Aquserfile\*(Aq): @@ -5088,7 +5122,7 @@ elif env\&.get(\*(AqMSVC_VERSION\*(Aq, None) == \*(Aq9\&.0\*(Aq: dbgSettings = V9DebugSettings elif env\&.get(\*(AqMSVC_VERSION\*(Aq, None) == \*(Aq11\&.0\*(Aq: dbgSettings = V10DebugSettings -else: +else: dbgSettings = None # @@ -5100,19 +5134,20 @@ barlocalincs = [\*(AqStdAfx\&.h\*(Aq] barresources = [\*(Aqbar\&.rc\*(Aq,\*(Aqresource\&.h\*(Aq] barmisc = [\*(AqReadMe\&.txt\*(Aq] -dll = env\&.SharedLibrary(target = \*(Aqbar\&.dll\*(Aq, - source = barsrcs) +dll = env\&.SharedLibrary(target=\*(Aqbar\&.dll\*(Aq, + source=barsrcs) -env\&.MSVSProject(target = \*(AqBar\*(Aq + env[\*(AqMSVSPROJECTSUFFIX\*(Aq], - srcs = barsrcs, - incs = barincs, - localincs = barlocalincs, - resources = barresources, - misc = barmisc, - buildtarget = [dll[0]] * 2, - variant = (\*(AqDebug|Win32\*(Aq, \*(AqRelease|Win32\*(Aq), - cmdargs = \*(Aqvc=%s\*(Aq % msvcver, - DebugSettings = (dbgSettings, {})) +env\&.MSVSProject(target=\*(AqBar\*(Aq + env[\*(AqMSVSPROJECTSUFFIX\*(Aq], + srcs=barsrcs, + incs=barincs, + localincs=barlocalincs, + resources=barresources, + misc=barmisc, + buildtarget=[dll[0]] * 2, + variant=(\*(AqDebug|Win32\*(Aq, \*(AqRelease|Win32\*(Aq), + cmdargs=\*(Aqvc=%s\*(Aq % msvcver, + DebugSettings=(dbgSettings, {})) + .fi .if n \{\ .RE @@ -5158,8 +5193,8 @@ Example Usage: .RS 4 .\} .nf -env\&.MSVSSolution(target = \*(AqBar\*(Aq + env[\*(AqMSVSSOLUTIONSUFFIX\*(Aq], projects = [\*(Aqbar\*(Aq -+ env[\*(AqMSVSPROJECTSUFFIX\*(Aq]], variant = \*(AqRelease\*(Aq) +env\&.MSVSSolution(target=\*(AqBar\*(Aq + env[\*(AqMSVSSOLUTIONSUFFIX\*(Aq], projects=[\*(Aqbar\*(Aq + env[\*(AqMSVSPROJECTSUFFIX\*(Aq]], variant=\*(AqRelease\*(Aq) + .fi .if n \{\ .RE @@ -5207,7 +5242,7 @@ The target packager may be selected with the "PACKAGETYPE" command line option o \fB$PACKAGETYPE\fR construction variable\&. Currently the following packagers available: .sp -* msi \- Microsoft Installer * rpm \- Redhat Package Manger * ipkg \- Itsy Package Management System * tarbz2 \- compressed tar * targz \- compressed tar * zip \- zip file * src_tarbz2 \- compressed tar source * src_targz \- compressed tar source * src_zip \- zip file source +* msi \- Microsoft Installer * rpm \- RPM Package Manger * ipkg \- Itsy Package Management System * tarbz2 \- bzip2 compressed tar * targz \- gzip compressed tar * tarxz \- xz compressed tar * zip \- zip file * src_tarbz2 \- bzip2 compressed tar source * src_targz \- gzip compressed tar source * src_tarxz \- xz compressed tar source * src_zip \- zip file source .sp An updated list is always available under the "package_type" option when running "scons \-\-help" on a project that has packaging activated\&. .sp @@ -6432,7 +6467,7 @@ Any occurrences of a key in the source are replaced by the corresponding value, .RS 4 .\} .nf -env = Environment(tools = [\*(Aqdefault\*(Aq, \*(Aqtextfile\*(Aq]) +env = Environment(tools=[\*(Aqdefault\*(Aq]) env[\*(Aqprefix\*(Aq] = \*(Aq/usr/bin\*(Aq script_dict = {\*(Aq@prefix@\*(Aq: \*(Aq/bin\*(Aq, \*(Aq@exec_prefix@\*(Aq: \*(Aq$prefix\*(Aq} @@ -6459,7 +6494,7 @@ env\&.Substfile(\*(Aqbar\&.in\*(Aq, SUBST_DICT = good_bar) # the SUBST_DICT may be in common (and not an override) substutions = {} -subst = Environment(tools = [\*(Aqtextfile\*(Aq], SUBST_DICT = substitutions) +subst = Environment(tools=[\*(Aqtextfile\*(Aq], SUBST_DICT=substitutions) substitutions[\*(Aq@foo@\*(Aq] = \*(Aqfoo\*(Aq subst[\*(AqSUBST_DICT\*(Aq][\*(Aq@bar@\*(Aq] = \*(Aqbar\*(Aq subst\&.Substfile(\*(Aqpgm1\&.c\*(Aq, [Value(\*(Aq#include "@foo@\&.h"\*(Aq), @@ -7708,7 +7743,7 @@ This specifies a list of default targets, which will be built by scons if no explicit targets are given on the command line\&. Multiple calls to \fBDefault\fR -are legal, and add to the list of default targets\&. +are legal, and add to the list of default targets\&. As noted above, both forms of this call affect the same global list of default targets; the construction environment method applies construction variable expansion to the targets\&. .sp Multiple targets should be specified as separate arguments to the \fBDefault\fR @@ -9238,7 +9273,7 @@ Creates a Scanner object for the specified \fIfunction\fR\&. See the section "Scanner Objects," below, for a complete explanation of the arguments and behavior\&. .RE .PP -SConscript(scripts, [exports, variant_dir, duplicate]), env\&.SConscript(scripts, [exports, variant_dir, duplicate]), SConscript(dirs=subdirs, [name=script, exports, variant_dir, duplicate]), env\&.SConscript(dirs=subdirs, [name=script, exports, variant_dir, duplicate]) +SConscript(scripts, [exports, variant_dir, duplicate, must_exist]), env\&.SConscript(scripts, [exports, variant_dir, duplicate, must_exist]), SConscript(dirs=subdirs, [name=script, exports, variant_dir, duplicate, must_exist]), env\&.SConscript(dirs=subdirs, [name=script, exports, variant_dir, duplicate, must_exist]) .RS 4 This tells scons @@ -9400,6 +9435,14 @@ SConscript(\*(Aqbuild/SConscript\*(Aq) .\} .sp +.sp +The optional +\fImust_exist\fR +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\&. .sp Here are some composite examples: .sp @@ -10352,7 +10395,7 @@ Example: .\} .nf print(str(DEFAULT_TARGETS[0])) -if \*(Aqfoo\*(Aq in map(str, DEFAULT_TARGETS): +if \*(Aqfoo\*(Aq in [str(t) for t in DEFAULT_TARGETS]: print("Don\*(Aqt forget to test the `foo\*(Aq program!") .fi .if n \{\ @@ -10369,13 +10412,13 @@ list change on on each successive call to the .RS 4 .\} .nf -print(map(str, DEFAULT_TARGETS)) # originally [] +print([str(t) for t in DEFAULT_TARGETS]) # originally [] Default(\*(Aqfoo\*(Aq) -print(map(str, DEFAULT_TARGETS)) # now a node [\*(Aqfoo\*(Aq] +print([str(t) for t in DEFAULT_TARGETS]) # now a node [\*(Aqfoo\*(Aq] Default(\*(Aqbar\*(Aq) -print(map(str, DEFAULT_TARGETS)) # now a node [\*(Aqfoo\*(Aq, \*(Aqbar\*(Aq] +print([str(t) for t in DEFAULT_TARGETS]) # now a node [\*(Aqfoo\*(Aq, \*(Aqbar\*(Aq] Default(None) -print(map(str, DEFAULT_TARGETS)) # back to [] +print([str(t) for t in DEFAULT_TARGETS]) # back to [] .fi .if n \{\ .RE @@ -10411,6 +10454,74 @@ if is set\&. Othervise it evaluates to an empty string\&. .RE .PP +_APPLELINK_COMPATIBILITY_VERSION +.RS 4 +A macro (by default a generator function) used to create the linker flags to specify apple\*(Aqs linker\*(Aqs \-compatibility_version flag\&. The default generator uses +\fB$APPLELINK_COMPATIBILITY_VERSION\fR +and +\fB$APPLELINK_NO_COMPATIBILITY_VERSION\fR +and +\fB$SHLIBVERSION\fR +to determine the correct flag\&. +.RE +.PP +APPLELINK_COMPATIBILITY_VERSION +.RS 4 +On Mac OS X this is used to set the linker flag: \-compatibility_version +.sp +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 +\fB$SHLIBVERSION\fR +if not specified\&. The lowest digit will be dropped and replaced by a 0\&. +.sp +If the +\fB$APPLELINK_NO_COMPATIBILITY_VERSION\fR +is set then no \-compatibility_version will be output\&. +.sp +See MacOS\*(Aqs ld manpage for more details +.RE +.PP +_APPLELINK_CURRENT_VERSION +.RS 4 +A macro (by default a generator function) used to create the linker flags to specify apple\*(Aqs linker\*(Aqs \-current_version flag\&. The default generator uses +\fB$APPLELINK_CURRENT_VERSION\fR +and +\fB$APPLELINK_NO_CURRENT_VERSION\fR +and +\fB$SHLIBVERSION\fR +to determine the correct flag\&. +.RE +.PP +APPLELINK_CURRENT_VERSION +.RS 4 +On Mac OS X this is used to set the linker flag: \-current_version +.sp +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 +\fB$SHLIBVERSION\fR +if not specified\&. +.sp +If the +\fB$APPLELINK_NO_CURRENT_VERSION\fR +is set then no \-current_version will be output\&. +.sp +See MacOS\*(Aqs ld manpage for more details +.RE +.PP +APPLELINK_NO_COMPATIBILITY_VERSION +.RS 4 +Set this to any True (1|True|non\-empty string) value to disable adding \-compatibility_version flag when generating versioned shared libraries\&. +.sp +This overrides +\fB$APPLELINK_COMPATIBILITY_VERSION\fR\&. +.RE +.PP +APPLELINK_NO_CURRENT_VERSION +.RS 4 +Set this to any True (1|True|non\-empty string) value to disable adding \-current_version flag when generating versioned shared libraries\&. +.sp +This overrides +\fB$APPLELINK_CURRENT_VERSION\fR\&. +.RE +.PP AR .RS 4 The static library archiver\&. @@ -10422,7 +10533,11 @@ Specifies the system architecture for which the package is being built\&. The de Architecture: field in an Ipkg control -file, and as part of the name of a generated RPM file\&. +file, and the +BuildArch: +field in the RPM +\&.spec +file, as well as forming part of the name of a generated RPM package file\&. .RE .PP ARCOM @@ -10582,7 +10697,7 @@ or this: .\} .nf env = Environment() -env[\*(AqBUILDERS][\*(AqNewBuilder\*(Aq] = foo +env[\*(AqBUILDERS\*(Aq][\*(AqNewBuilder\*(Aq] = foo .fi .if n \{\ .RE @@ -10706,7 +10821,7 @@ for RPM, the control for Ipkg, the \&.wxs -for MSI)\&. If set, the function will be called after the SCons template for the file has been written\&. XXX +for MSI)\&. If set, the function will be called after the SCons template for the file has been written\&. .RE .PP CHANGED_SOURCES @@ -10766,7 +10881,7 @@ _CPPDEFFLAGS .RS 4 An automatically\-generated construction variable containing the C preprocessor command\-line options to define values\&. The value of \fB$_CPPDEFFLAGS\fR -is created by appending +is created by respectively prepending and appending \fB$CPPDEFPREFIX\fR and \fB$CPPDEFSUFFIX\fR @@ -10787,7 +10902,8 @@ is a string, the values of the \fB$CPPDEFPREFIX\fR and \fB$CPPDEFSUFFIX\fR -construction variables will be added to the beginning and end\&. +construction variables will be respectively prepended and appended to the beginning and end of each definition in +\fB$CPPDEFINES\fR\&. .sp .if n \{\ .RS 4 @@ -10807,7 +10923,7 @@ is a list, the values of the \fB$CPPDEFPREFIX\fR and \fB$CPPDEFSUFFIX\fR -construction variables will be appended to the beginning and end of each element in the list\&. If any element is a list or tuple, then the first item is the name being defined and the second item is its value: +construction variables will be respectively prepended and appended to the beginning and end of each element in the list\&. If any element is a list or tuple, then the first item is the name being defined and the second item is its value: .sp .if n \{\ .RS 4 @@ -10827,7 +10943,7 @@ is a dictionary, the values of the \fB$CPPDEFPREFIX\fR and \fB$CPPDEFSUFFIX\fR -construction variables will be appended to the beginning and end of each item from the dictionary\&. The key of each dictionary item is a name being defined to the dictionary item\*(Aqs corresponding value; if the value is +construction variables will be respectively prepended and appended to the beginning and end of each item from the dictionary\&. The key of each dictionary item is a name being defined to the dictionary item\*(Aqs corresponding value; if the value is None, then the name is defined without an explicit value\&. Note that the resulting flags are sorted by keyword to ensure that the order of the options on the command line is consistent each time scons is run\&. @@ -10847,7 +10963,7 @@ env = Environment(CPPDEFINES={\*(AqB\*(Aq:2, \*(AqA\*(Aq:None}) .PP CPPDEFPREFIX .RS 4 -The prefix used to specify preprocessor definitions on the C compiler command line\&. This will be appended to the beginning of each definition in the +The prefix used to specify preprocessor definitions on the C compiler command line\&. This will be prepended to the beginning of each definition in the \fB$CPPDEFINES\fR construction variable when the \fB$_CPPDEFFLAGS\fR @@ -10892,7 +11008,7 @@ _CPPINCFLAGS .RS 4 An automatically\-generated construction variable containing the C preprocessor command\-line options for specifying directories to be searched for include files\&. The value of \fB$_CPPINCFLAGS\fR -is created by appending +is created by respectively prepending and appending \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR @@ -10932,7 +11048,7 @@ env = Environment(CPPPATH=include) .sp The directory list will be added to command lines through the automatically\-generated \fB$_CPPINCFLAGS\fR -construction variable, which is constructed by appending the values of the +construction variable, which is constructed by respectively prepending and appending the value of the \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR @@ -12366,7 +12482,7 @@ _FORTRANINCFLAGS .RS 4 An automatically\-generated construction variable containing the Fortran compiler command\-line options for specifying directories to be searched for include files and module files\&. The value of \fB$_FORTRANINCFLAGS\fR -is created by prepending/appending +is created by respectively prepending and appending \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR @@ -12381,7 +12497,7 @@ Directory location where the Fortran compiler should place any module files it g .PP FORTRANMODDIRPREFIX .RS 4 -The prefix used to specify a module directory on the Fortran compiler command line\&. This will be appended to the beginning of the directory in the +The prefix used to specify a module directory on the Fortran compiler command line\&. This will be prepended to the beginning of the directory in the \fB$FORTRANMODDIR\fR construction variables when the \fB$_FORTRANMODFLAG\fR @@ -12390,7 +12506,7 @@ variables is automatically generated\&. .PP FORTRANMODDIRSUFFIX .RS 4 -The suffix used to specify a module directory on the Fortran compiler command line\&. This will be appended to the beginning of the directory in the +The suffix used to specify a module directory on the Fortran compiler command line\&. This will be appended to the end of the directory in the \fB$FORTRANMODDIR\fR construction variables when the \fB$_FORTRANMODFLAG\fR @@ -12401,7 +12517,7 @@ _FORTRANMODFLAG .RS 4 An automatically\-generated construction variable containing the Fortran compiler command\-line option for specifying the directory location where the Fortran compiler should place any module files that happen to get generated during compilation\&. The value of \fB$_FORTRANMODFLAG\fR -is created by prepending/appending +is created by respectively prepending and appending \fB$FORTRANMODDIRPREFIX\fR and \fB$FORTRANMODDIRSUFFIX\fR @@ -12453,7 +12569,7 @@ env = Environment(FORTRANPATH=include) .sp The directory list will be added to command lines through the automatically\-generated \fB$_FORTRANINCFLAGS\fR -construction variable, which is constructed by appending the values of the +construction variable, which is constructed by respectively prepending and appending the values of the \fB$INCPREFIX\fR and \fB$INCSUFFIX\fR @@ -12520,7 +12636,8 @@ On Mac OS X with gcc, a list containing the paths to search for frameworks\&. Us .RS 4 .\} .nf - env\&.AppendUnique(FRAMEWORKPATH=\*(Aq#myframeworkdir\*(Aq) + env\&.AppendUnique(FRAMEWORKPATH=\*(Aq#myframeworkdir\*(Aq) + .fi .if n \{\ .RE @@ -12532,7 +12649,8 @@ will add .RS 4 .\} .nf - \&.\&.\&. \-Fmyframeworkdir + \&.\&.\&. \-Fmyframeworkdir + .fi .if n \{\ .RE @@ -12574,7 +12692,8 @@ On Mac OS X with gcc, a list of the framework names to be linked into a program .RS 4 .\} .nf - env\&.AppendUnique(FRAMEWORKS=Split(\*(AqSystem Cocoa SystemConfiguration\*(Aq)) + env\&.AppendUnique(FRAMEWORKS=Split(\*(AqSystem Cocoa SystemConfiguration\*(Aq)) + .fi .if n \{\ .RE @@ -12723,7 +12842,7 @@ env = Environment(IMPLICIT_COMMAND_DEPENDENCIES = 0) .PP INCPREFIX .RS 4 -The prefix used to specify an include directory on the C compiler command line\&. This will be appended to the beginning of each directory in the +The prefix used to specify an include directory on the C compiler command line\&. This will be prepended to the beginning of each directory in the \fB$CPPPATH\fR and \fB$FORTRANPATH\fR @@ -12906,7 +13025,8 @@ The string displayed when compiling a directory tree of Java source files to cor .RS 4 .\} .nf -env = Environment(JAVACCOMSTR = "Compiling class files $TARGETS from $SOURCES") + env = Environment(JAVACCOMSTR = "Compiling class files $TARGETS from $SOURCES") + .fi .if n \{\ .RE @@ -12992,6 +13112,11 @@ JAVAHFLAGS General options passed to the C header and stub file generator for Java classes\&. .RE .PP +JAVAINCLUDES +.RS 4 +Include path for Java header files (such as jni\&.h) +.RE +.PP JAVASOURCEPATH .RS 4 Specifies the list of directories that will be searched for input @@ -13235,11 +13360,16 @@ LEXFLAGS General options passed to the lexical analyzer generator\&. .RE .PP +LEXUNISTD +.RS 4 +Used only on windows environments to set a lex flag to prevent \*(Aqunistd\&.h\*(Aq from being included\&. The default value is \*(Aq\-\-nounistd\*(Aq\&. +.RE +.PP _LIBDIRFLAGS .RS 4 An automatically\-generated construction variable containing the linker command\-line options for specifying directories to be searched for library\&. The value of \fB$_LIBDIRFLAGS\fR -is created by appending +is created by respectively prepending and appending \fB$LIBDIRPREFIX\fR and \fB$LIBDIRSUFFIX\fR @@ -13249,7 +13379,7 @@ to the beginning and end of each directory in .PP LIBDIRPREFIX .RS 4 -The prefix used to specify a library directory on the linker command line\&. This will be appended to the beginning of each directory in the +The prefix used to specify a library directory on the linker command line\&. This will be prepended to the beginning of each directory in the \fB$LIBPATH\fR construction variable when the \fB$_LIBDIRFLAGS\fR @@ -13274,7 +13404,7 @@ _LIBFLAGS .RS 4 An automatically\-generated construction variable containing the linker command\-line options for specifying libraries to be linked with the resulting target\&. The value of \fB$_LIBFLAGS\fR -is created by appending +is created by respectively prepending and appending \fB$LIBLINKPREFIX\fR and \fB$LIBLINKSUFFIX\fR @@ -13284,7 +13414,7 @@ to the beginning and end of each filename in .PP LIBLINKPREFIX .RS 4 -The prefix used to specify a library to link on the linker command line\&. This will be appended to the beginning of each library in the +The prefix used to specify a library to link on the linker command line\&. This will be prepended to the beginning of each library in the \fB$LIBS\fR construction variable when the \fB$_LIBFLAGS\fR @@ -13336,7 +13466,7 @@ env = Environment(LIBPATH=libs) .sp The directory list will be added to command lines through the automatically\-generated \fB$_LIBDIRFLAGS\fR -construction variable, which is constructed by appending the values of the +construction variable, which is constructed by respectively prepending and appending the values of the \fB$LIBDIRPREFIX\fR and \fB$LIBDIRSUFFIX\fR @@ -13373,7 +13503,7 @@ A list of one or more libraries that will be linked with any executable programs .sp The library list will be added to command lines through the automatically\-generated \fB$_LIBFLAGS\fR -construction variable, which is constructed by appending the values of the +construction variable, which is constructed by respectively prepending and appending the values of the \fB$LIBLINKPREFIX\fR and \fB$LIBLINKSUFFIX\fR @@ -13426,7 +13556,7 @@ list, the base library name, and these suffixes\&. .PP LICENSE .RS 4 -The abbreviated name of the license under which this project is released (gpl, lpgl, bsd etc\&.)\&. See http://www\&.opensource\&.org/licenses/alphabetical for a list of license names\&. +The abbreviated name, preferably the SPDX code, of the license under which this project is released (GPL\-3\&.0, LGPL\-2\&.1, BSD\-2\-Clause etc\&.)\&. See http://www\&.opensource\&.org/licenses/alphabetical for a list of license names and SPDX codes\&. .RE .PP LINESEPARATOR @@ -13795,6 +13925,7 @@ If is not set, SCons will (by default) select the latest version of Visual C/C++ installed on your system\&. If the specified version isn\*(Aqt installed, tool initialization will fail\&. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect\&. .sp Valid values for Windows are +14\&.1, 14\&.0, 14\&.0Exp, 12\&.0, @@ -13869,7 +14000,7 @@ PLATFORMSDK_MODULES dictionary of installed Platform SDK modules, where the dictionary keys are keywords for the various modules, and the values are 2\-tuples where the first is the release date, and the second is the version number\&. .RE .sp -If a value isn\*(Aqt set, it wasn\*(Aqt available in the registry\&. +If a value is not set, it was not available in the registry\&. .RE .PP MSVS_ARCH @@ -13881,7 +14012,11 @@ x86\&. amd64 is also supported by SCons -for some Visual Studio versions\&. Trying to set +for most Visual Studio versions\&. Since Visual Studio 2015 +arm +is supported, and since Visual Studio 2017 +arm64 +is supported\&. Trying to set \fB$MSVS_ARCH\fR to an architecture that\*(Aqs not supported for a given Visual Studio version will generate an error\&. .RE @@ -14768,7 +14903,7 @@ RCINCFLAGS .RS 4 An automatically\-generated construction variable containing the command\-line options for specifying directories to be searched by the resource compiler\&. The value of \fB$RCINCFLAGS\fR -is created by appending +is created by respectively prepending and appending \fB$RCINCPREFIX\fR and \fB$RCINCSUFFIX\fR @@ -14778,7 +14913,7 @@ to the beginning and end of each directory in .PP RCINCPREFIX .RS 4 -The prefix (flag) used to specify an include directory on the resource compiler command line\&. This will be appended to the beginning of each directory in the +The prefix (flag) used to specify an include directory on the resource compiler command line\&. This will be prepended to the beginning of each directory in the \fB$CPPPATH\fR construction variable when the \fB$RCINCFLAGS\fR @@ -14867,9 +15002,9 @@ _RPATH .RS 4 An automatically\-generated construction variable containing the rpath flags to be used when linking a program with shared libraries\&. The value of \fB$_RPATH\fR -is created by appending +is created by respectively prepending \fB$RPATHPREFIX\fR -and +and appending \fB$RPATHSUFFIX\fR to the beginning and end of each directory in \fB$RPATH\fR\&. @@ -14884,7 +15019,7 @@ in any way: if you want an absolute path, you must make it absolute yourself\&. .PP RPATHPREFIX .RS 4 -The prefix used to specify a directory to be searched for shared libraries when running programs\&. This will be appended to the beginning of each directory in the +The prefix used to specify a directory to be searched for shared libraries when running programs\&. This will be prepended to the beginning of each directory in the \fB$RPATH\fR construction variable when the \fB$_RPATH\fR @@ -15708,7 +15843,7 @@ _SWIGINCFLAGS .RS 4 An automatically\-generated construction variable containing the SWIG command\-line options for specifying directories to be searched for included files\&. The value of \fB$_SWIGINCFLAGS\fR -is created by appending +is created by respectively prepending and appending \fB$SWIGINCPREFIX\fR and \fB$SWIGINCSUFFIX\fR @@ -15718,7 +15853,7 @@ to the beginning and end of each directory in .PP SWIGINCPREFIX .RS 4 -The prefix used to specify an include directory on the SWIG command line\&. This will be appended to the beginning of each directory in the +The prefix used to specify an include directory on the SWIG command line\&. This will be prepended to the beginning of each directory in the \fB$SWIGPATH\fR construction variable when the \fB$_SWIGINCFLAGS\fR @@ -15777,7 +15912,7 @@ env = Environment(SWIGPATH=include) .sp The directory list will be added to command lines through the automatically\-generated \fB$_SWIGINCFLAGS\fR -construction variable, which is constructed by appending the values of the +construction variable, which is constructed by respectively prepending and appending the values of the \fB$SWIGINCPREFIX\fR and \fB$SWIGINCSUFFIX\fR @@ -15843,13 +15978,15 @@ TARGET_ARCH The name of the target hardware architecture for the compiled objects created by this Environment\&. This defaults to the value of HOST_ARCH, and the user can override it\&. Currently only set for Win32\&. .sp Sets the target architecture for Visual Studio compiler (i\&.e\&. the arch of the binaries generated by the compiler)\&. If not set, default to -\fB$HOST_ARCH\fR, or, if that is unset, to the architecture of the running machine\*(Aqs OS (note that the python build or architecture has no effect)\&. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect\&. This is currently only used on Windows, but in the future it will be used on other OSes as well\&. +\fB$HOST_ARCH\fR, or, if that is unset, to the architecture of the running machine\*(Aqs OS (note that the python build or architecture has no effect)\&. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect\&. This is currently only used on Windows, but in the future it will be used on other OSes as well\&. If this is set and MSVC_VERSION is not set, this will search for all installed MSVC\*(Aqs that support the TARGET_ARCH, selecting the latest version for use\&. .sp Valid values for Windows are x86, +arm, i386 (for 32 bits); amd64, +arm64, emt64, x86_64 (for 64 bits); and @@ -15876,7 +16013,12 @@ The suffix used for tar file names\&. .PP TEMPFILEPREFIX .RS 4 -The prefix for a temporary file used to execute lines longer than $MAXLINELENGTH\&. The default is \*(Aq@\*(Aq\&. This may be set for toolchains that use other values, such as \*(Aq\-@\*(Aq for the diab compiler or \*(Aq\-via\*(Aq for ARM toolchain\&. +The prefix for a temporary file used to store lines lines longer than $MAXLINELENGTH as operations which call out to a shell will fail if the line is too long, which particularly impacts linking\&. The default is \*(Aq@\*(Aq, which works for the Microsoft and GNU toolchains on Windows\&. Set this appropriately for other toolchains, for example \*(Aq\-@\*(Aq for the diab compiler or \*(Aq\-via\*(Aq for ARM toolchain\&. +.RE +.PP +TEMPFILESUFFIX +.RS 4 +The suffix used for the temporary file name used for long command lines\&. The name should include the dot (\*(Aq\&.\*(Aq) if one is wanted as it will not be added automatically\&. The default is \*(Aq\&.lnk\*(Aq\&. .RE .PP TEX @@ -16152,7 +16294,7 @@ This is used to fill in the BuildRequires: field in the RPM \&.spec -file\&. +file\&. Note this should only be used on a host managed by rpm as the dependencies will not be resolvable at build time otherwise\&. .RE .PP X_RPM_BUILDROOT @@ -16193,7 +16335,9 @@ X_RPM_EPOCH .RS 4 This is used to fill in the Epoch: -field in the controlling information for RPM packages\&. +field in the RPM +\&.spec +file\&. .RE .PP X_RPM_EXCLUDEARCH @@ -16214,6 +16358,32 @@ field in the RPM file\&. .RE .PP +X_RPM_EXTRADEFS +.RS 4 +A list used to supply extra defintions or flags to be added to the RPM +\&.spec +file\&. Each item is added as\-is with a carriage return appended\&. This is useful if some specific RPM feature not otherwise anticipated by SCons needs to be turned on or off\&. Note if this variable is omitted, SCons will by default supply the value +\*(Aq%global debug_package %{nil}\*(Aq +to disable debug package generation\&. To enable debug package generation, include this variable set either to None, or to a custom list that does not include the default line\&. Added in version 3\&.1\&. +.sp +.if n \{\ +.RS 4 +.\} +.nf +env\&.Package( + NAME = \*(Aqfoo\*(Aq, +\&.\&.\&. + X_RPM_EXTRADEFS = [ + \*(Aq%define _unpackaged_files_terminate_build 0\*(Aq + \*(Aq%define _missing_doc_files_terminate_build 0\*(Aq + ], +\&.\&.\&. ) +.fi +.if n \{\ +.RE +.\} +.RE +.PP X_RPM_GROUP .RS 4 This is used to fill in the @@ -18211,14 +18381,16 @@ If the first argument is a Python function, a function Action is returned\&. The \fBtarget\fR and \fBsource\fR -arguments may be lists of Node objects if there is more than one target file or source file\&. The actual target and source file name(s) may be retrieved from their Node objects via the built\-in Python str() function: +arguments may be lists of Node objects if there is more than one target file or source file\&. The actual target and source file name(s) may be retrieved from their Node objects via the built\-in Python +\fBstr\fR +function: .sp .if n \{\ .RS 4 .\} .nf target_file_name = str(target) -source_file_names = map(lambda x: str(x), source) +source_file_names = [str(x) for x in source] .fi .if n \{\ .RE @@ -19784,5 +19956,5 @@ Author. \fBSteven Knight and the SCons Development Team\fR .SH "COPYRIGHT" .br -Copyright \(co 2004 - 2016 The SCons Foundation +Copyright \(co 2004 - 2019 The SCons Foundation .br diff --git a/sconsign.1 b/sconsign.1 index 471caf4..34d417b 100644 --- a/sconsign.1 +++ b/sconsign.1 @@ -2,12 +2,12 @@ .\" Title: SCONSIGN .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 11/14/2017 -.\" Manual: SCons 3.0.1 -.\" Source: SCons 3.0.1 +.\" Date: 03/26/2019 +.\" Manual: SCons 3.0.5 +.\" Source: SCons 3.0.5 .\" Language: English .\" -.TH "SCONSIGN" "1" "11/14/2017" "SCons 3\&.0\&.1" "SCons 3\&.0\&.1" +.TH "SCONSIGN" "1" "03/26/2019" "SCons 3\&.0\&.5" "SCons 3\&.0\&.5" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -59,14 +59,16 @@ suffix contains signature entries for more than one directory (that is, was spec \fBSConsignFile ()\fR function)\&. Any \fIfile\fR -argument that does not end in -\fB\&.dbm\fR +argument that ends in +\fB\&.dblite\fR is assumed to be a traditional \fB\&.sconsign\fR -file containing the signature entries for a single directory\&. An explicit format may be specified using the +file containing the signature entries for a single directory\&. If neither of those is true, +\fBsconsign\fR +attempts to guess the format\&. If that does not work, an explicit format may be specified using the \fB\-f\fR or -\fB\-\-file=\fR +\fB\-\-format=\fR options\&. .SH "OPTIONS" .PP diff --git a/script/scons b/script/scons old mode 100644 new mode 100755 index fe9d724..c0fe872 --- a/script/scons +++ b/script/scons @@ -2,7 +2,7 @@ # # SCons - a Software Constructor # -# 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 @@ -25,22 +25,30 @@ from __future__ import print_function -__revision__ = "src/script/scons.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/script/scons.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" -__version__ = "3.0.1" +__version__ = "3.0.5" -__build__ = "74b2c53bc42290e911b334a6b44f187da698a668" +__build__ = "a56bbd8c09fb219ab8a9673330ffcd55279219d0" -__buildsys__ = "hpmicrodog" +__buildsys__ = "kufra" -__date__ = "2017/11/14 13:16:53" +__date__ = "2019-03-26 23:16:31" -__developer__ = "bdbaddog" +__developer__ = "bdeegan" + +# This is the entry point to the SCons program. +# The only job of this script is to work out where the guts of the program +# could be and import them, where the real work begins. +# SCons can be invoked several different ways +# - from an installed location +# - from a "local install" copy +# - from a source tree, which has a different dir struture than the other two +# Try to account for all those possibilities. import os import sys - ############################################################################## # BEGIN STANDARD SCons SCRIPT HEADER # @@ -50,57 +58,53 @@ import sys # should also change other scripts that use this same header. ############################################################################## -# Strip the script directory from sys.path() so on case-insensitive -# (WIN32) systems Python doesn't think that the "scons" script is the -# "SCons" package. Replace it with our own library directories -# (version-specific first, in case they installed by hand there, -# followed by generic) so we pick up the right version of the build -# engine modules if they're in either directory. - - +# compatibility check if (3,0,0) < sys.version_info < (3,5,0) or sys.version_info < (2,7,0): msg = "scons: *** SCons version %s does not run under Python version %s.\n\ -Python < 3.5 is not yet supported.\n" +Python 2.7 or >= 3.5 is required.\n" sys.stderr.write(msg % (__version__, sys.version.split()[0])) sys.exit(1) - +# Strip the script directory from sys.path so on case-insensitive +# (WIN32) systems Python doesn't think that the "scons" script is the +# "SCons" package. script_dir = os.path.dirname(os.path.realpath(__file__)) - -if script_dir in sys.path: - sys.path.remove(script_dir) +script_path = os.path.realpath(os.path.dirname(__file__)) +if script_path in sys.path: + sys.path.remove(script_path) libs = [] if "SCONS_LIB_DIR" in os.environ: libs.append(os.environ["SCONS_LIB_DIR"]) -# - running from source takes priority (since 2.3.2), excluding SCONS_LIB_DIR settings -script_path = os.path.abspath(os.path.dirname(__file__)) -source_path = os.path.join(script_path, '..', 'engine') -libs.append(source_path) +# running from source takes 2nd priority (since 2.3.2), following SCONS_LIB_DIR +source_path = os.path.join(script_path, os.pardir, 'engine') +if os.path.isdir(source_path): + libs.append(source_path) +# add local-install locations local_version = 'scons-local-' + __version__ local = 'scons-local' if script_dir: local_version = os.path.join(script_dir, local_version) local = os.path.join(script_dir, local) -libs.append(os.path.abspath(local_version)) -libs.append(os.path.abspath(local)) +if os.path.isdir(local_version): + libs.append(os.path.abspath(local_version)) +if os.path.isdir(local): + libs.append(os.path.abspath(local)) scons_version = 'scons-%s' % __version__ # preferred order of scons lookup paths prefs = [] - -# - running from egg check +# if we can find package information, use it try: import pkg_resources except ImportError: pass else: - # when running from an egg add the egg's directory try: d = pkg_resources.get_distribution('scons') except pkg_resources.DistributionNotFound: @@ -109,18 +113,18 @@ else: prefs.append(d.location) if sys.platform == 'win32': - # sys.prefix is (likely) C:\Python*; - # check only C:\Python*. + # Use only sys.prefix on Windows prefs.append(sys.prefix) prefs.append(os.path.join(sys.prefix, 'Lib', 'site-packages')) else: # On other (POSIX) platforms, things are more complicated due to - # the variety of path names and library locations. Try to be smart - # about it. + # the variety of path names and library locations. + # Build up some possibilities, then transform them into candidates + temp = [] if script_dir == 'bin': # script_dir is `pwd`/bin; # check `pwd`/lib/scons*. - prefs.append(os.getcwd()) + temp.append(os.getcwd()) else: if script_dir == '.' or script_dir == '': script_dir = os.getcwd() @@ -128,42 +132,41 @@ else: if tail == "bin": # script_dir is /foo/bin; # check /foo/lib/scons*. - prefs.append(head) + temp.append(head) head, tail = os.path.split(sys.prefix) if tail == "usr": # sys.prefix is /foo/usr; # check /foo/usr/lib/scons* first, # then /foo/usr/local/lib/scons*. - prefs.append(sys.prefix) - prefs.append(os.path.join(sys.prefix, "local")) + temp.append(sys.prefix) + temp.append(os.path.join(sys.prefix, "local")) elif tail == "local": h, t = os.path.split(head) if t == "usr": # sys.prefix is /foo/usr/local; # check /foo/usr/local/lib/scons* first, # then /foo/usr/lib/scons*. - prefs.append(sys.prefix) - prefs.append(head) + temp.append(sys.prefix) + temp.append(head) else: # sys.prefix is /foo/local; # check only /foo/local/lib/scons*. - prefs.append(sys.prefix) + temp.append(sys.prefix) else: # sys.prefix is /foo (ends in neither /usr or /local); # check only /foo/lib/scons*. - prefs.append(sys.prefix) + temp.append(sys.prefix) + + # suffix these to add to our original prefs: + prefs.extend([os.path.join(x, 'lib') for x in temp]) + prefs.extend([os.path.join(x, 'lib', 'python' + sys.version[:3], + 'site-packages') for x in temp]) - temp = [os.path.join(x, 'lib') for x in prefs] - temp.extend([os.path.join(x, - 'lib', - 'python' + sys.version[:3], - 'site-packages') for x in prefs]) - prefs = temp # Add the parent directory of the current python's library to the - # preferences. On SuSE-91/AMD64, for example, this is /usr/lib64, - # not /usr/lib. + # preferences. This picks up differences between, e.g., lib and lib64, + # and finds the base location in case of a non-copying virtualenv. try: libpath = os.__file__ except AttributeError: @@ -177,9 +180,9 @@ else: prefs.append(libpath) # Look first for 'scons-__version__' in all of our preference libs, -# then for 'scons'. -libs.extend([os.path.join(x, scons_version) for x in prefs]) -libs.extend([os.path.join(x, 'scons') for x in prefs]) +# then for 'scons'. Skip paths that do not exist. +libs.extend([os.path.join(x, scons_version) for x in prefs if os.path.isdir(x)]) +libs.extend([os.path.join(x, 'scons') for x in prefs if os.path.isdir(x)]) sys.path = libs + sys.path @@ -191,9 +194,9 @@ if __name__ == "__main__": try: import SCons.Script except ImportError: - print("SCons import failed. Unable to find engine files in:") + sys.stderr.write("SCons import failed. Unable to find engine files in:\n") for path in libs: - print(" {}".format(path)) + sys.stderr.write(" {}\n".format(path)) raise # this does all the work, and calls sys.exit diff --git a/script/scons-configure-cache b/script/scons-configure-cache index cbb058d..798b8fa 100644 --- a/script/scons-configure-cache +++ b/script/scons-configure-cache @@ -2,7 +2,7 @@ # # SCons - a Software Constructor # -# 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 @@ -23,102 +23,139 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +'''Show or convert the configuration of an SCons cache directory. + +A cache of derived files is stored by file signature. +The files are split into directories named by the first few +digits of the signature. The prefix length used for directory +names can be changed by this script. +''' + from __future__ import print_function +import argparse +import glob +import json +import os -__revision__ = "src/script/scons-configure-cache.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/script/scons-configure-cache.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" -__version__ = "3.0.1" +__version__ = "3.0.5" -__build__ = "74b2c53bc42290e911b334a6b44f187da698a668" +__build__ = "a56bbd8c09fb219ab8a9673330ffcd55279219d0" -__buildsys__ = "hpmicrodog" +__buildsys__ = "kufra" -__date__ = "2017/11/14 13:16:53" +__date__ = "2019-03-26 23:16:31" -__developer__ = "bdbaddog" +__developer__ = "bdeegan" -import argparse -import glob -import json -import os def rearrange_cache_entries(current_prefix_len, new_prefix_len): - print('Changing prefix length from', current_prefix_len, 'to', new_prefix_len) + '''Move cache files if prefix length changed. + + Move the existing cache files to new directories of the + appropriate name length and clean up the old directories. + ''' + print('Changing prefix length from', current_prefix_len, + 'to', new_prefix_len) dirs = set() old_dirs = set() for file in glob.iglob(os.path.join('*', '*')): name = os.path.basename(file) - dir = name[:current_prefix_len].upper() - if dir not in old_dirs: - print('Migrating', dir) - old_dirs.add(dir) - dir = name[:new_prefix_len].upper() - if dir not in dirs: - os.mkdir(dir) - dirs.add(dir) - os.rename(file, os.path.join(dir, name)) + dname = name[:current_prefix_len].upper() + if dname not in old_dirs: + print('Migrating', dname) + old_dirs.add(dname) + dname = name[:new_prefix_len].upper() + if dname not in dirs: + os.mkdir(dname) + dirs.add(dname) + os.rename(file, os.path.join(dname, name)) # Now delete the original directories - for dir in old_dirs: - os.rmdir(dir) + for dname in old_dirs: + os.rmdir(dname) + -# This dictionary should have one entry per entry in the cache config -# Each entry should have the following: +# The configuration dictionary should have one entry per entry in the +# cache config. The value of each entry should include the following: # implicit - (optional) This is to allow adding a new config entry and also # changing the behaviour of the system at the same time. This -# indicates the value the config entry would have had if it had been -# specified. +# indicates the value the config entry would have had if it had +# been specified. # default - The value the config entry should have if it wasn't previously # specified # command-line - parameters to pass to ArgumentParser.add_argument -# converter - (optional) Function to call if it's necessary to do some work +# converter - (optional) Function to call if conversion is required # if this configuration entry changes config_entries = { - 'prefix_len' : { - 'implicit' : 1, - 'default' : 2 , - 'command-line' : { - 'help' : 'Length of cache file name used as subdirectory prefix', - 'metavar' : '', - 'type' : int - }, - 'converter' : rearrange_cache_entries + 'prefix_len': { + 'implicit': 1, + 'default': 2, + 'command-line': { + 'help': 'Length of cache file name used as subdirectory prefix', + 'metavar': '', + 'type': int + }, + 'converter': rearrange_cache_entries } } + parser = argparse.ArgumentParser( - description = 'Modify the configuration of an scons cache directory', - epilog = ''' - Unless you specify an option, it will not be changed (if it is - already set in the cache config), or changed to an appropriate - default (it it is not set). - ''' - ) + description='Modify the configuration of an scons cache directory', + epilog=''' + Unspecified options will not be changed unless they are not + set at all, in which case they are set to an appropriate default. + ''') parser.add_argument('cache-dir', help='Path to scons cache directory') for param in config_entries: - parser.add_argument('--' + param.replace('_', '-'), + parser.add_argument('--' + param.replace('_', '-'), **config_entries[param]['command-line']) -parser.add_argument('--version', action='version', version='%(prog)s 1.0') +parser.add_argument('--version', + action='version', + version='%(prog)s 1.0') +parser.add_argument('--show', + action="store_true", + help="show current configuration") # Get the command line as a dict without any of the unspecified entries. args = dict([x for x in vars(parser.parse_args()).items() if x[1]]) # It seems somewhat strange to me, but positional arguments don't get the - # in the name changed to _, whereas optional arguments do... -os.chdir(args['cache-dir']) +cache = args['cache-dir'] +if not os.path.isdir(cache): + raise RuntimeError("There is no cache directory named %s" % cache) +os.chdir(cache) del args['cache-dir'] if not os.path.exists('config'): + # old config dirs did not have a 'config' file. Try to update. # Validate the only files in the directory are directories 0-9, a-f - expected = [ '{:X}'.format(x) for x in range(0, 16) ] + expected = ['{:X}'.format(x) for x in range(0, 16)] if not set(os.listdir('.')).issubset(expected): - raise RuntimeError("This doesn't look like a version 1 cache directory") + raise RuntimeError( + "%s does not look like a valid version 1 cache directory" % cache) config = dict() else: with open('config') as conf: config = json.load(conf) -# Find any keys that aren't currently set but should be +if args.get('show', None): + print("Current configuration in '%s':" % cache) + print(json.dumps(config, sort_keys=True, + indent=4, separators=(',', ': '))) + # in case of the show argument, emit some stats as well + file_count = 0 + for _, _, files in os.walk('.'): + file_count += len(files) + if file_count: # skip config file if it exists + file_count -= 1 + print("Cache contains %s files" % file_count) + del args['show'] + +# Find any keys that are not currently set but should be for key in config_entries: if key not in config: if 'implicit' in config_entries[key]: @@ -128,10 +165,10 @@ for key in config_entries: if key not in args: args[key] = config_entries[key]['default'] -#Now we go through each entry in args to see if it changes an existing config -#setting. +# Now go through each entry in args to see if it changes an existing config +# setting. for key in args: - if args[key] != config[key]: + if args[key] != config[key]: if 'converter' in config_entries[key]: config_entries[key]['converter'](config[key], args[key]) config[key] = args[key] diff --git a/script/scons-time b/script/scons-time index 3fdb8f2..26ddd77 100644 --- a/script/scons-time +++ b/script/scons-time @@ -9,7 +9,7 @@ # # -# 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 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import division, print_function -__revision__ = "src/script/scons-time.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/script/scons-time.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import getopt import glob @@ -58,12 +58,12 @@ def make_temp_file(**kw): return result def HACK_for_exec(cmd, *args): - ''' + """ For some reason, Python won't allow an exec() within a function that also declares an internal function (including lambda functions). This function is a hack that calls exec() in a function with no internal functions. - ''' + """ if not args: exec(cmd) elif len(args) == 1: exec(cmd, args[0]) else: exec(cmd, args[0], args[1]) @@ -147,7 +147,7 @@ class Gnuplotter(Plotter): return line.plot_string() def vertical_bar(self, x, type, label, comment): - if self.get_min_x() <= x and x <= self.get_max_x(): + if self.get_min_x() <= x <= self.get_max_x(): points = [(x, 0), (x, self.max_graph_value(self.get_max_y()))] self.line(points, type, label, comment) @@ -814,7 +814,9 @@ class SConsTimer(object): self.title = a if self.config_file: - exec(open(self.config_file, 'r').read(), self.__dict__) + with open(self.config_file, 'r') as f: + config = f.read() + exec(config, self.__dict__) if self.chdir: os.chdir(self.chdir) @@ -933,7 +935,9 @@ class SConsTimer(object): self.title = a if self.config_file: - HACK_for_exec(open(self.config_file, 'r').read(), self.__dict__) + with open(self.config_file, 'r') as f: + config = f.read() + HACK_for_exec(config, self.__dict__) if self.chdir: os.chdir(self.chdir) @@ -1053,7 +1057,9 @@ class SConsTimer(object): object_name = args.pop(0) if self.config_file: - HACK_for_exec(open(self.config_file, 'r').read(), self.__dict__) + with open(self.config_file, 'r') as f: + config = f.read() + HACK_for_exec(config, self.__dict__) if self.chdir: os.chdir(self.chdir) @@ -1191,7 +1197,9 @@ class SConsTimer(object): sys.exit(1) if self.config_file: - exec(open(self.config_file, 'r').read(), self.__dict__) + with open(self.config_file, 'r') as f: + config = f.read() + exec(config, self.__dict__) if args: self.archive_list = args diff --git a/script/scons.bat b/script/scons.bat index 4d0e6e6..45c77ab 100644 --- a/script/scons.bat +++ b/script/scons.bat @@ -1,11 +1,11 @@ -@REM Copyright (c) 2001 - 2017 The SCons Foundation -@REM src/script/scons.bat 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog +@REM Copyright (c) 2001 - 2019 The SCons Foundation +@REM src/script/scons.bat a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan @echo off set SCONS_ERRORLEVEL= if "%OS%" == "Windows_NT" goto WinNT @REM for 9x/Me you better not have more than 9 args -python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-3.0.1'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-3.0.1'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9 +python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-3.0.5'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-3.0.5'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9 @REM no way to set exit status of this script for 9x/Me goto endscons @@ -16,10 +16,14 @@ goto endscons :WinNT setlocal @REM ensure the script will be executed with the Python it was installed for -set path=%~dp0;%~dp0..;%path% +pushd %~dp0.. +set path=%~dp0;%CD%;%path% +popd @REM try the script named as the .bat file in current dir, then in Scripts subdir set scriptname=%~dp0%~n0.py if not exist "%scriptname%" set scriptname=%~dp0Scripts\%~n0.py +@REM Handle when running from wheel where the script has no .py extension +if not exist "%scriptname%" set scriptname=%~dp0%~n0 python "%scriptname%" %* endlocal & set SCONS_ERRORLEVEL=%ERRORLEVEL% diff --git a/script/sconsign b/script/sconsign index 7391807..3b1e52d 100644 --- a/script/sconsign +++ b/script/sconsign @@ -2,7 +2,7 @@ # # SCons - a Software Constructor # -# 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 @@ -25,17 +25,17 @@ from __future__ import print_function -__revision__ = "src/script/sconsign.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/script/sconsign.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" -__version__ = "3.0.1" +__version__ = "3.0.5" -__build__ = "74b2c53bc42290e911b334a6b44f187da698a668" +__build__ = "a56bbd8c09fb219ab8a9673330ffcd55279219d0" -__buildsys__ = "hpmicrodog" +__buildsys__ = "kufra" -__date__ = "2017/11/14 13:16:53" +__date__ = "2019-03-26 23:16:31" -__developer__ = "bdbaddog" +__developer__ = "bdeegan" import os import sys @@ -49,48 +49,53 @@ import sys # should also change other scripts that use this same header. ############################################################################## -# Strip the script directory from sys.path() so on case-insensitive -# (WIN32) systems Python doesn't think that the "scons" script is the -# "SCons" package. Replace it with our own library directories -# (version-specific first, in case they installed by hand there, -# followed by generic) so we pick up the right version of the build -# engine modules if they're in either directory. - +# compatibility check +if (3,0,0) < sys.version_info < (3,5,0) or sys.version_info < (2,7,0): + msg = "scons: *** SCons version %s does not run under Python version %s.\n\ +Python 2.7 or >= 3.5 is required.\n" + sys.stderr.write(msg % (__version__, sys.version.split()[0])) + sys.exit(1) +# Strip the script directory from sys.path so on case-insensitive +# (WIN32) systems Python doesn't think that the "scons" script is the +# "SCons" package. script_dir = os.path.dirname(os.path.realpath(__file__)) - -if script_dir in sys.path: - sys.path.remove(script_dir) +script_path = os.path.realpath(os.path.dirname(__file__)) +if script_path in sys.path: + sys.path.remove(script_path) libs = [] if "SCONS_LIB_DIR" in os.environ: libs.append(os.environ["SCONS_LIB_DIR"]) -# - running from source takes priority (since 2.3.2), excluding SCONS_LIB_DIR settings -script_path = os.path.abspath(os.path.dirname(__file__)) -source_path = os.path.join(script_path, '..', 'engine') -libs.append(source_path) +# running from source takes 2nd priority (since 2.3.2), following SCONS_LIB_DIR +source_path = os.path.join(script_path, os.pardir, 'engine') +if os.path.isdir(source_path): + libs.append(source_path) +# add local-install locations local_version = 'scons-local-' + __version__ local = 'scons-local' if script_dir: local_version = os.path.join(script_dir, local_version) local = os.path.join(script_dir, local) -libs.append(os.path.abspath(local_version)) -libs.append(os.path.abspath(local)) +if os.path.isdir(local_version): + libs.append(os.path.abspath(local_version)) +if os.path.isdir(local): + libs.append(os.path.abspath(local)) scons_version = 'scons-%s' % __version__ # preferred order of scons lookup paths prefs = [] +# if we can find package information, use it try: import pkg_resources except ImportError: pass else: - # when running from an egg add the egg's directory try: d = pkg_resources.get_distribution('scons') except pkg_resources.DistributionNotFound: @@ -99,18 +104,18 @@ else: prefs.append(d.location) if sys.platform == 'win32': - # sys.prefix is (likely) C:\Python*; - # check only C:\Python*. + # Use only sys.prefix on Windows prefs.append(sys.prefix) prefs.append(os.path.join(sys.prefix, 'Lib', 'site-packages')) else: # On other (POSIX) platforms, things are more complicated due to - # the variety of path names and library locations. Try to be smart - # about it. + # the variety of path names and library locations. + # Build up some possibilities, then transform them into candidates + temp = [] if script_dir == 'bin': # script_dir is `pwd`/bin; # check `pwd`/lib/scons*. - prefs.append(os.getcwd()) + temp.append(os.getcwd()) else: if script_dir == '.' or script_dir == '': script_dir = os.getcwd() @@ -118,58 +123,57 @@ else: if tail == "bin": # script_dir is /foo/bin; # check /foo/lib/scons*. - prefs.append(head) + temp.append(head) head, tail = os.path.split(sys.prefix) if tail == "usr": # sys.prefix is /foo/usr; # check /foo/usr/lib/scons* first, # then /foo/usr/local/lib/scons*. - prefs.append(sys.prefix) - prefs.append(os.path.join(sys.prefix, "local")) + temp.append(sys.prefix) + temp.append(os.path.join(sys.prefix, "local")) elif tail == "local": h, t = os.path.split(head) if t == "usr": # sys.prefix is /foo/usr/local; # check /foo/usr/local/lib/scons* first, # then /foo/usr/lib/scons*. - prefs.append(sys.prefix) - prefs.append(head) + temp.append(sys.prefix) + temp.append(head) else: # sys.prefix is /foo/local; # check only /foo/local/lib/scons*. - prefs.append(sys.prefix) + temp.append(sys.prefix) else: # sys.prefix is /foo (ends in neither /usr or /local); # check only /foo/lib/scons*. - prefs.append(sys.prefix) + temp.append(sys.prefix) + + # suffix these to add to our original prefs: + prefs.extend([os.path.join(x, 'lib') for x in temp]) + prefs.extend([os.path.join(x, 'lib', 'python' + sys.version[:3], + 'site-packages') for x in temp]) - temp = [os.path.join(x, 'lib') for x in prefs] - temp.extend([os.path.join(x, - 'lib', - 'python' + sys.version[:3], - 'site-packages') for x in prefs]) - prefs = temp # Add the parent directory of the current python's library to the - # preferences. On SuSE-91/AMD64, for example, this is /usr/lib64, - # not /usr/lib. + # preferences. This picks up differences between, e.g., lib and lib64, + # and finds the base location in case of a non-copying virtualenv. try: libpath = os.__file__ except AttributeError: pass else: # Split /usr/libfoo/python*/os.py to /usr/libfoo/python*. - libpath, tail = os.path.split(libpath) + libpath, _ = os.path.split(libpath) # Split /usr/libfoo/python* to /usr/libfoo libpath, tail = os.path.split(libpath) # Check /usr/libfoo/scons*. prefs.append(libpath) # Look first for 'scons-__version__' in all of our preference libs, -# then for 'scons'. -libs.extend([os.path.join(x, scons_version) for x in prefs]) -libs.extend([os.path.join(x, 'scons') for x in prefs]) +# then for 'scons'. Skip paths that do not exist. +libs.extend([os.path.join(x, scons_version) for x in prefs if os.path.isdir(x)]) +libs.extend([os.path.join(x, 'scons') for x in prefs if os.path.isdir(x)]) sys.path = libs + sys.path @@ -191,6 +195,7 @@ import imp import SCons.SConsign + def my_whichdb(filename): if filename[-7:] == ".dblite": return "SCons.dblite" @@ -221,24 +226,41 @@ def my_import(mname): fp, pathname, description = imp.find_module(mname) return imp.load_module(mname, fp, pathname, description) + class Flagger(object): default_value = 1 + def __setitem__(self, item, value): self.__dict__[item] = value self.default_value = 0 + def __getitem__(self, item): return self.__dict__.get(item, self.default_value) + Do_Call = None Print_Directories = [] Print_Entries = [] Print_Flags = Flagger() Verbose = 0 Readable = 0 +Warns = 0 + + def default_mapper(entry, name): + ''' + Stringify an entry that doesn't have an explicit mapping. + + Args: + entry: entry + name: field name + + Returns: str + + ''' try: - val = eval("entry."+name) + val = eval("entry." + name) except: val = None if sys.version_info.major >= 3 and isinstance(val, bytes): @@ -248,7 +270,18 @@ def default_mapper(entry, name): val = val.decode() return str(val) -def map_action(entry, name): + +def map_action(entry, _): + ''' + Stringify an action entry and signature. + + Args: + entry: action entry + second argument is not used + + Returns: str + + ''' try: bact = entry.bact bactsig = entry.bactsig @@ -256,7 +289,17 @@ def map_action(entry, name): return None return '%s [%s]' % (bactsig, bact) -def map_timestamp(entry, name): +def map_timestamp(entry, _): + ''' + Stringify a timestamp entry. + + Args: + entry: timestamp entry + second argument is not used + + Returns: str + + ''' try: timestamp = entry.timestamp except AttributeError: @@ -266,19 +309,38 @@ def map_timestamp(entry, name): else: return str(timestamp) -def map_bkids(entry, name): +def map_bkids(entry, _): + ''' + Stringify an implicit entry. + + Args: + entry: + second argument is not used + + Returns: str + + ''' try: bkids = entry.bsources + entry.bdepends + entry.bimplicit bkidsigs = entry.bsourcesigs + entry.bdependsigs + entry.bimplicitsigs except AttributeError: return None - result = [] - for i in range(len(bkids)): - result.append(nodeinfo_string(bkids[i], bkidsigs[i], " ")) - if result == []: + + if len(bkids) != len(bkidsigs): + global Warns + Warns += 1 + # add warning to result rather than direct print so it will line up + msg = "Warning: missing information, {} ids but {} sigs" + result = [msg.format(len(bkids), len(bkidsigs))] + else: + result = [] + result += [nodeinfo_string(bkid, bkidsig, " ") + for bkid, bkidsig in zip(bkids, bkidsigs)] + if not result: return None return "\n ".join(result) + map_field = { 'action' : map_action, 'timestamp' : map_timestamp, @@ -289,6 +351,7 @@ map_name = { 'implicit' : 'bkids', } + def field(name, entry, verbose=Verbose): if not Print_Flags[name]: return None @@ -299,6 +362,7 @@ def field(name, entry, verbose=Verbose): val = name + ": " + val return val + def nodeinfo_raw(name, ninfo, prefix=""): # This just formats the dictionary, which we would normally use str() # to do, except that we want the keys sorted for deterministic output. @@ -314,6 +378,7 @@ def nodeinfo_raw(name, ninfo, prefix=""): name = repr(name) return name + ': {' + ', '.join(l) + '}' + def nodeinfo_cooked(name, ninfo, prefix=""): try: field_list = ninfo.field_list @@ -321,15 +386,19 @@ def nodeinfo_cooked(name, ninfo, prefix=""): field_list = [] if '\n' in name: name = repr(name) - outlist = [name+':'] + [_f for _f in [field(x, ninfo, Verbose) for x in field_list] if _f] + outlist = [name + ':'] + [ + f for f in [field(x, ninfo, Verbose) for x in field_list] if f + ] if Verbose: sep = '\n ' + prefix else: sep = ' ' return sep.join(outlist) + nodeinfo_string = nodeinfo_cooked + def printfield(name, entry, prefix=""): outlist = field("implicit", entry, 0) if outlist: @@ -343,13 +412,15 @@ def printfield(name, entry, prefix=""): else: print(" " + outact) + def printentries(entries, location): if Print_Entries: for name in Print_Entries: try: entry = entries[name] except KeyError: - sys.stderr.write("sconsign: no entry `%s' in `%s'\n" % (name, location)) + err = "sconsign: no entry `%s' in `%s'\n" % (name, location) + sys.stderr.write(err) else: try: ninfo = entry.ninfo @@ -369,6 +440,7 @@ def printentries(entries, location): print(nodeinfo_string(name, entry.ninfo)) printfield(name, entry.binfo) + class Do_SConsignDB(object): def __init__(self, dbm_name, dbm): self.dbm_name = dbm_name @@ -403,15 +475,17 @@ class Do_SConsignDB(object): # Nope, that file doesn't even exist, so report that # fact back. print_e = e - sys.stderr.write("sconsign: %s\n" % (print_e)) + sys.stderr.write("sconsign: %s\n" % print_e) return except KeyboardInterrupt: raise except pickle.UnpicklingError: - sys.stderr.write("sconsign: ignoring invalid `%s' file `%s'\n" % (self.dbm_name, fname)) + sys.stderr.write("sconsign: ignoring invalid `%s' file `%s'\n" + % (self.dbm_name, fname)) return except Exception as e: - sys.stderr.write("sconsign: ignoring invalid `%s' file `%s': %s\n" % (self.dbm_name, fname, e)) + sys.stderr.write("sconsign: ignoring invalid `%s' file `%s': %s\n" + % (self.dbm_name, fname, e)) return if Print_Directories: @@ -419,35 +493,44 @@ class Do_SConsignDB(object): try: val = db[dir] except KeyError: - sys.stderr.write("sconsign: no dir `%s' in `%s'\n" % (dir, args[0])) + err = "sconsign: no dir `%s' in `%s'\n" % (dir, args[0]) + sys.stderr.write(err) else: self.printentries(dir, val) else: for dir in sorted(db.keys()): self.printentries(dir, db[dir]) - def printentries(self, dir, val): - print('=== ' + dir + ':') + @staticmethod + def printentries(dir, val): + try: + print('=== ' + dir + ':') + except TypeError: + print('=== ' + dir.decode() + ':') printentries(pickle.loads(val), dir) + def Do_SConsignDir(name): try: fp = open(name, 'rb') except (IOError, OSError) as e: - sys.stderr.write("sconsign: %s\n" % (e)) + sys.stderr.write("sconsign: %s\n" % e) return try: sconsign = SCons.SConsign.Dir(fp) except KeyboardInterrupt: raise except pickle.UnpicklingError: - sys.stderr.write("sconsign: ignoring invalid .sconsign file `%s'\n" % (name)) + err = "sconsign: ignoring invalid .sconsign file `%s'\n" % (name) + sys.stderr.write(err) return except Exception as e: - sys.stderr.write("sconsign: ignoring invalid .sconsign file `%s': %s\n" % (name, e)) + err = "sconsign: ignoring invalid .sconsign file `%s': %s\n" % (name, e) + sys.stderr.write(err) return printentries(sconsign.entries, args[0]) + ############################################################################## import getopt @@ -489,8 +572,7 @@ for o, a in opts: elif o in ('-f', '--format'): # Try to map the given DB format to a known module # name, that we can then try to import... - Module_Map = {'dblite' : 'SCons.dblite', - 'sconsign' : None} + Module_Map = {'dblite': 'SCons.dblite', 'sconsign': None} dbm_name = Module_Map.get(a, a) if dbm_name: try: @@ -498,6 +580,7 @@ for o, a in opts: dbm = my_import(dbm_name) else: import SCons.dblite + dbm = SCons.dblite # Ensure that we don't ignore corrupt DB files, # this was handled by calling my_import('SCons.dblite') @@ -526,7 +609,6 @@ for o, a in opts: elif o in ('-v', '--verbose'): Verbose = 1 - if Do_Call: for a in args: Do_Call(a) @@ -534,11 +616,12 @@ else: for a in args: dbm_name = whichdb(a) if dbm_name: - Map_Module = {'SCons.dblite' : 'dblite'} + Map_Module = {'SCons.dblite': 'dblite'} if dbm_name != "SCons.dblite": dbm = my_import(dbm_name) else: import SCons.dblite + dbm = SCons.dblite # Ensure that we don't ignore corrupt DB files, # this was handled by calling my_import('SCons.dblite') @@ -548,6 +631,8 @@ else: else: Do_SConsignDir(a) + if Warns: + print("NOTE: there were %d warnings, please check output" % Warns) sys.exit(0) # Local Variables: diff --git a/setup.py b/setup.py old mode 100644 new mode 100755 index f4a08c3..cea0d37 --- a/setup.py +++ b/setup.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,6 +20,17 @@ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +from __future__ import print_function + + +import distutils.command.build_scripts +import distutils.command.install_scripts +import distutils.command.install_lib +import distutils.command.install_data +import distutils.command.install +import distutils.core +import distutils +# import setuptools """ NOTE: Installed SCons is not importable like usual Python packages. It is executed explicitly with command line scripts. This allows multiple @@ -32,15 +43,14 @@ NOTE: Installed SCons is not importable like usual Python packages. It is below is dedicated to make it happen on various platforms. """ -from __future__ import print_function -__revision__ = "src/setup.py 74b2c53bc42290e911b334a6b44f187da698a668 2017/11/14 13:16:53 bdbaddog" +__revision__ = "src/setup.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" import os import stat import sys -Version = "3.0.1" +Version = "3.0.5" man_pages = [ 'scons.1', @@ -66,15 +76,6 @@ if not sys.platform == 'win32': else: is_win32 = 1 -import distutils -import distutils.core -import distutils.command.install -import distutils.command.install_data -import distutils.command.install_lib -import distutils.command.install_scripts -import distutils.command.build_scripts -import distutils.msvccompiler - _install = distutils.command.install.install _install_data = distutils.command.install_data.install_data @@ -165,7 +166,7 @@ class install(_install): self.no_scons_script = 0 self.no_version_script = 0 self.install_bat = 0 - self.no_install_bat = not is_win32 + self.no_install_bat = False # not is_win32 self.install_man = 0 self.no_install_man = is_win32 self.standard_lib = 0 @@ -247,10 +248,12 @@ class install_lib(_install_lib): if Options.standalone_lib: # ...but they asked for a standalone directory. self.install_dir = os.path.join(prefix, "scons") - elif Options.version_lib or not Options.standard_lib: + elif Options.version_lib: # ...they asked for a version-specific directory, - # or they get it by default. self.install_dir = os.path.join(prefix, "scons-%s" % Version) + elif not Options.standard_lib: + # default. + self.install_dir = os.path.join(prefix, "scons") msg = "Installed SCons library modules into %s" % self.install_dir Installed.append(msg) @@ -323,8 +326,8 @@ class install_scripts(_install_scripts): scons = os.path.join(self.install_dir, base) scons_ver = scons + '-' + Version if is_win32: - scons += '.py' - scons_ver += '.py' + scons = scons + '.py' + scons_ver = scons_ver + '.py' create_version_script(src, scons_ver) create_basename_script(src, scons, scons_ver) @@ -352,7 +355,8 @@ class install_scripts(_install_scripts): # Use symbolic versions of permissions so this script doesn't fail to parse under python3.x exec_and_read_permission = stat.S_IXOTH | stat.S_IXUSR | stat.S_IXGRP | stat.S_IROTH | stat.S_IRUSR | stat.S_IRGRP mode_mask = 4095 # Octal 07777 used because python3 has different octal syntax than python 2 - mode = ((os.stat(file)[stat.ST_MODE]) | exec_and_read_permission) & mode_mask + mode = ((os.stat(file)[stat.ST_MODE]) | + exec_and_read_permission) & mode_mask # log.info("changing mode of %s to %o", file, mode) os.chmod(file, mode) # --- /distutils copy/paste --- @@ -410,18 +414,19 @@ arguments = { 'version': Version, 'description': description, 'long_description': long_description, - 'author': 'Steven Knight', - 'author_email': 'knight@baldmt.com', + 'author': 'William Deegan', + 'author_email': 'bill@baddogconsulting.com', 'url': "http://www.scons.org/", 'packages': ["SCons", "SCons.compat", "SCons.Node", - "SCons.Options", "SCons.Platform", "SCons.Scanner", "SCons.Script", "SCons.Tool", + "SCons.Tool.clangCommon", "SCons.Tool.docbook", + 'SCons.Tool.clangCommon', "SCons.Tool.MSCommon", "SCons.Tool.packaging", "SCons.Variables", @@ -502,7 +507,7 @@ arguments = { 'install_lib': install_lib, 'install_data': install_data, 'install_scripts': install_scripts, - 'build_scripts': build_scripts} + 'build_scripts': build_scripts}, } distutils.core.setup(**arguments) -- cgit v1.2.3 From 7cff8ecb55b0eee07bf8c52ec5b3ea5c156bcbad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Jul 2019 17:52:11 +0200 Subject: add .bzrignore --- .bzrignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .bzrignore diff --git a/.bzrignore b/.bzrignore new file mode 100644 index 0000000..2386f62 --- /dev/null +++ b/.bzrignore @@ -0,0 +1,3 @@ +.git +**/.git +**/.pc -- cgit v1.2.3 From c1083e1f5530a09b256975a3855ac2363d5ed6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Jul 2019 18:16:07 +0200 Subject: Refresh / remove patches --- debian/changelog | 8 ++++++-- debian/patches/0110-remove_stale_files.patch | 2 +- debian/patches/0120-fix-bibtex-call.patch | 4 ++-- debian/patches/0600-manpage-spelling.patch | 28 ++++++++++++++-------------- debian/patches/series | 4 ++-- 5 files changed, 25 insertions(+), 21 deletions(-) diff --git a/debian/changelog b/debian/changelog index 457f04c..a9456a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,9 @@ -scons (3.0.1-2) UNRELEASED; urgency=medium +scons (3.0.5-1) UNRELEASED; urgency=medium + * New upstream release: + - Refresh patches.at + - Remove 0115-secure_script_scons.patch and + 0105-java_ignore_nonexistent_files.patch. * Refresh debian/patches/0110-remove_stale_files.patch for python 3 compatibility (Closes: #893740). Thanks to Bernd Zeimetz . @@ -15,7 +19,7 @@ scons (3.0.1-2) UNRELEASED; urgency=medium - Remove trailing whitespaces. - Add python3 support. - -- Jörg Frings-Fürst Fri, 12 Oct 2018 19:47:43 +0200 + -- Jörg Frings-Fürst Fri, 12 Jul 2019 17:54:18 +0200 scons (3.0.1-1) unstable; urgency=medium diff --git a/debian/patches/0110-remove_stale_files.patch b/debian/patches/0110-remove_stale_files.patch index 298d47c..9fbb186 100644 --- a/debian/patches/0110-remove_stale_files.patch +++ b/debian/patches/0110-remove_stale_files.patch @@ -7,7 +7,7 @@ Index: trunk/engine/SCons/Script/Main.py =================================================================== --- trunk.orig/engine/SCons/Script/Main.py +++ trunk/engine/SCons/Script/Main.py -@@ -1106,6 +1106,21 @@ def _main(parser): +@@ -1115,6 +1115,21 @@ def _main(parser): print('Found nothing to build') exit_status = 2 diff --git a/debian/patches/0120-fix-bibtex-call.patch b/debian/patches/0120-fix-bibtex-call.patch index 0bdbee8..98b2db6 100644 --- a/debian/patches/0120-fix-bibtex-call.patch +++ b/debian/patches/0120-fix-bibtex-call.patch @@ -10,7 +10,7 @@ Index: trunk/engine/SCons/Tool/tex.py =================================================================== --- trunk.orig/engine/SCons/Tool/tex.py +++ trunk/engine/SCons/Tool/tex.py -@@ -347,6 +347,13 @@ def InternalLaTeXAuxAction(XXXLaTeXActio +@@ -351,6 +351,13 @@ def InternalLaTeXAuxAction(XXXLaTeXActio if result != 0: check_file_error_message(env['BIBTEX'], 'blg') must_rerun_latex = True @@ -24,7 +24,7 @@ Index: trunk/engine/SCons/Tool/tex.py # Now decide if biber will need to be run. # When the backend for biblatex is biber (by choice or default) the -@@ -370,6 +377,13 @@ def InternalLaTeXAuxAction(XXXLaTeXActio +@@ -375,6 +382,13 @@ def InternalLaTeXAuxAction(XXXLaTeXActio if result != 0: check_file_error_message(env['BIBER'], 'blg') must_rerun_latex = True diff --git a/debian/patches/0600-manpage-spelling.patch b/debian/patches/0600-manpage-spelling.patch index 6d576ce..0942458 100644 --- a/debian/patches/0600-manpage-spelling.patch +++ b/debian/patches/0600-manpage-spelling.patch @@ -7,7 +7,7 @@ Index: trunk/scons.1 =================================================================== --- trunk.orig/scons.1 +++ trunk/scons.1 -@@ -443,7 +443,7 @@ call should use or generate the results +@@ -447,7 +447,7 @@ call should use or generate the results .PP \-\-config=auto .RS 4 @@ -16,7 +16,7 @@ Index: trunk/scons.1 .RE .PP \-\-config=force -@@ -1545,7 +1545,7 @@ The tool definition (i\&.e\&. my_tool()) +@@ -1566,7 +1566,7 @@ The tool definition (i\&.e\&. my_tool()) .PP If no tool list is specified, then SCons will auto\-detect the installed tools using the PATH variable in the ENV construction variable and the platform name when the Environment is constructed\&. Changing the PATH variable after the Environment is constructed will not cause the tools to be redetected\&. .PP @@ -25,7 +25,7 @@ Index: trunk/scons.1 .sp .if n \{\ .RS 4 -@@ -6449,7 +6449,7 @@ env\&.Substfile(\*(Aqfoo\&.in\*(Aq, SUBS +@@ -6484,7 +6484,7 @@ env\&.Substfile(\*(Aqfoo\&.in\*(Aq, SUBS good_foo = [(\*(Aq$foobar\*(Aq, \*(Aq$foobar\*(Aq), (\*(Aq$foo\*(Aq, \*(Aq$foo\*(Aq)] env\&.Substfile(\*(Aqfoo\&.in\*(Aq, SUBST_DICT = good_foo) @@ -34,7 +34,7 @@ Index: trunk/scons.1 bad_bar = {\*(Aq@bar@\*(Aq: \*(Aq@soap@\*(Aq, \*(Aq@soap@\*(Aq: \*(Aqlye\*(Aq} env\&.Substfile(\*(Aqbar\&.in\*(Aq, SUBST_DICT = bad_bar) -@@ -6681,7 +6681,7 @@ file\&. Note, that the updated +@@ -6716,7 +6716,7 @@ file\&. Note, that the updated POT and PO @@ -43,7 +43,7 @@ Index: trunk/scons.1 po/ directory contains LINGUAS -@@ -7221,7 +7221,7 @@ Example: +@@ -7256,7 +7256,7 @@ Example: AllowSubstExceptions() # Also allow a string containing a zero\-division expansion @@ -52,7 +52,7 @@ Index: trunk/scons.1 AllowSubstExceptions(IndexError, NameError, ZeroDivisionError) .fi .if n \{\ -@@ -9196,7 +9196,7 @@ Return([vars\&.\&.\&., stop=]) +@@ -9231,7 +9231,7 @@ Return([vars\&.\&.\&., stop=]) .RS 4 By default, this stops processing the current SConscript file and returns to the calling SConscript file the values of the variables named in the \fIvars\fR @@ -61,7 +61,7 @@ Index: trunk/scons.1 \fBReturn\fR\&. Any strings that contain white space .sp The optional -@@ -10096,7 +10096,7 @@ function to create a copy of your source +@@ -10139,7 +10139,7 @@ function to create a copy of your source \fIvariant_dir\fR is not found but exists under \fIsrc_dir\fR, the file or directory is copied to @@ -70,7 +70,7 @@ Index: trunk/scons.1 .sp \fBVariantDir\fR -@@ -11363,7 +11363,7 @@ is used to create PDF output from an XML +@@ -11479,7 +11479,7 @@ is used to create PDF output from an XML .PP DOCBOOK_FOPFLAGS .RS 4 @@ -79,7 +79,7 @@ Index: trunk/scons.1 fop or xep\&. -@@ -11390,7 +11390,7 @@ is used to resolve XIncludes for a given +@@ -11506,7 +11506,7 @@ is used to resolve XIncludes for a given .PP DOCBOOK_XMLLINTFLAGS .RS 4 @@ -88,7 +88,7 @@ Index: trunk/scons.1 xmllint\&. .RE .PP -@@ -11421,7 +11421,7 @@ is used to transform an XML file via a g +@@ -11537,7 +11537,7 @@ is used to transform an XML file via a g .PP DOCBOOK_XSLTPROCFLAGS .RS 4 @@ -97,7 +97,7 @@ Index: trunk/scons.1 xsltproc (or saxon, -@@ -11430,7 +11430,7 @@ xalan)\&. +@@ -11546,7 +11546,7 @@ xalan)\&. .PP DOCBOOK_XSLTPROCPARAMS .RS 4 @@ -106,7 +106,7 @@ Index: trunk/scons.1 saxon and saxon\-xslt, respectively\&. -@@ -14081,7 +14081,7 @@ A list of installed versions of the Metr +@@ -14216,7 +14216,7 @@ A list of installed versions of the Metr .PP NAME .RS 4 @@ -115,7 +115,7 @@ Index: trunk/scons.1 .RE .PP no_import_lib -@@ -16414,7 +16414,7 @@ builder\&. +@@ -16584,7 +16584,7 @@ builder\&. .PP _XGETTEXTFROMFLAGS .RS 4 @@ -124,7 +124,7 @@ Index: trunk/scons.1 \-D flags from the \fB$XGETTEXTPATH\fR -@@ -18354,7 +18354,7 @@ a = Action("build < ${SOURCE\&.file} > $ +@@ -18526,7 +18526,7 @@ a = Action("build < ${SOURCE\&.file} > $ The \fBAction\fR() global function also takes an \fBexitstatfunc\fR diff --git a/debian/patches/series b/debian/patches/series index d84f384..20ca14e 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,6 +1,6 @@ 0600-manpage-spelling.patch -0115-secure_script_scons.patch -0105-java_ignore_nonexistent_files.patch +#0115-secure_script_scons.patch +#0105-java_ignore_nonexistent_files.patch 0110-remove_stale_files.patch 0100-parallel_build.patch 0120-fix-bibtex-call.patch -- cgit v1.2.3 From 2fa650932693967c84f40e9b69000fa622d0c219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Jul 2019 18:17:32 +0200 Subject: Migrate to debhelper 12 --- debian/changelog | 6 +++--- debian/compat | 2 +- debian/control | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index a9456a1..7715eff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,9 +7,9 @@ scons (3.0.5-1) UNRELEASED; urgency=medium * Refresh debian/patches/0110-remove_stale_files.patch for python 3 compatibility (Closes: #893740). Thanks to Bernd Zeimetz . - * Migrate to debhelper 11: - - Change debian/compat to 11. - - Bump minimum debhelper version in debian/control to >= 11. + * Migrate to debhelper 12: + - Change debian/compat to 12. + - Bump minimum debhelper version in debian/control to >= 12. * Declare compliance with Debian Policy 4.2.1 (No changes needed). * debian/control: - Remove trailing whitespaces. diff --git a/debian/compat b/debian/compat index b4de394..48082f7 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -11 +12 diff --git a/debian/control b/debian/control index 462778b..b6d1434 100644 --- a/debian/control +++ b/debian/control @@ -4,7 +4,7 @@ Priority: optional Maintainer: Jörg Frings-Fürst Uploaders: Laszlo Boszormenyi (GCS) Build-Depends: - debhelper (>= 11), + debhelper (>= 12), dh-python, python-all, python3-all -- cgit v1.2.3 From 0a1b85d1f4be822f6c494f6c426b1084a132e58d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Jul 2019 18:18:15 +0200 Subject: Declare compliance with Debian Policy 4.4.0 --- debian/changelog | 2 +- debian/control | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7715eff..14fd84c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,7 +10,7 @@ scons (3.0.5-1) UNRELEASED; urgency=medium * Migrate to debhelper 12: - Change debian/compat to 12. - Bump minimum debhelper version in debian/control to >= 12. - * Declare compliance with Debian Policy 4.2.1 (No changes needed). + * Declare compliance with Debian Policy 4.4.0 (No changes needed). * debian/control: - Remove trailing whitespaces. - Add python3 support. diff --git a/debian/control b/debian/control index b6d1434..f1d05f3 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Build-Depends: dh-python, python-all, python3-all -Standards-Version: 4.2.1 +Standards-Version: 4.4.0 Homepage: http://www.scons.org/ Vcs-Git: git://jff.email/opt/git/scons.git Vcs-Browser: https://jff.email/cgit/scons.git -- cgit v1.2.3 From bc95f6faea1c4cf8655d2b77397fb2850f5337cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 12 Jul 2019 18:36:53 +0200 Subject: Use pybuild as buildsystem --- debian/changelog | 3 ++- debian/rules | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 14fd84c..920bca1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,8 +2,9 @@ scons (3.0.5-1) UNRELEASED; urgency=medium * New upstream release: - Refresh patches.at - - Remove 0115-secure_script_scons.patch and + - Remove 0115-secure_script_scons.patch and 0105-java_ignore_nonexistent_files.patch. + - Use pybuild as buildsystem. * Refresh debian/patches/0110-remove_stale_files.patch for python 3 compatibility (Closes: #893740). Thanks to Bernd Zeimetz . diff --git a/debian/rules b/debian/rules index d375e94..6171813 100755 --- a/debian/rules +++ b/debian/rules @@ -1,11 +1,11 @@ #!/usr/bin/make -f %: - dh $@ --with python2,python3 + dh $@ --with python2,python3 --buildsystem=pybuild -clean: - rm -fr build - dh $@ +#clean: +# rm -fr build +# dh $@ -override_dh_auto_install: - dh_auto_install -- --no-version-script --standalone-lib --no-install-man +#override_dh_auto_install: +# dh_auto_install -- --no-version-script --standalone-lib --no-install-man -- cgit v1.2.3 From b8f9f5298ba221af32f7106fe093903aedd76d43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 13 Jul 2019 09:26:41 +0200 Subject: some changes for pybuild --- debian/rules | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/debian/rules b/debian/rules index 6171813..2e449d9 100755 --- a/debian/rules +++ b/debian/rules @@ -1,11 +1,6 @@ #!/usr/bin/make -f +export PYBUILD_INSTALL_ARGS=--no-version-script --standalone-lib --no-install-man + %: dh $@ --with python2,python3 --buildsystem=pybuild - -#clean: -# rm -fr build -# dh $@ - -#override_dh_auto_install: -# dh_auto_install -- --no-version-script --standalone-lib --no-install-man -- cgit v1.2.3 From 6f4176859c7871af6b1f21b2c0651da81993ac8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 13 Jul 2019 10:02:59 +0200 Subject: add --no-install-bat; add ; remove dh-python --- debian/control | 3 +-- debian/rules | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index f1d05f3..0c66ca1 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,6 @@ Maintainer: Jörg Frings-Fürst Uploaders: Laszlo Boszormenyi (GCS) Build-Depends: debhelper (>= 12), - dh-python, python-all, python3-all Standards-Version: 4.4.0 @@ -16,7 +15,7 @@ Vcs-Browser: https://jff.email/cgit/scons.git Package: scons Architecture: all Depends: - ${python:Depends}, + ${python2:Depends}, ${python3:Depends}, ${misc:Depends} Description: replacement for make diff --git a/debian/rules b/debian/rules index 2e449d9..a6576fe 100755 --- a/debian/rules +++ b/debian/rules @@ -1,6 +1,6 @@ #!/usr/bin/make -f -export PYBUILD_INSTALL_ARGS=--no-version-script --standalone-lib --no-install-man +export PYBUILD_INSTALL_ARGS=--no-version-script --standalone-lib --no-install-man --no-install-bat %: dh $@ --with python2,python3 --buildsystem=pybuild -- cgit v1.2.3 From d3a8764d9b672bf65478d576b65b630d45bed796 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 13 Jul 2019 10:06:40 +0200 Subject: d/copyright: Add year 2019, Use secure URI --- debian/changelog | 3 +++ debian/copyright | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index 920bca1..26a29a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -19,6 +19,9 @@ scons (3.0.5-1) UNRELEASED; urgency=medium * debian/rules: - Remove trailing whitespaces. - Add python3 support. + * debian/copyright: + - Add year 2019. + - Use secure URI. -- Jörg Frings-Fürst Fri, 12 Jul 2019 17:54:18 +0200 diff --git a/debian/copyright b/debian/copyright index 468939f..6d77f47 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,10 +1,10 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: scons Upstream-Contact: Steven Knight -Source: http://www.scons.org +Source: https://www.scons.org Files: * -Copyright: 2001-2017 The SCons Foundation +Copyright: 2001-2019 The SCons Foundation 1999-2006 Gregory P. Ward 2001-2003 Steven Knight 2001-2004 Twisted Matrix Laboratories @@ -17,12 +17,12 @@ Files: debian/* Copyright: 2002 Moshe Zadka 2003-2008 Mark Brown 2008-2014 Luca Falavigna - 2014-2017 Jörg Frings-Fürst + 2014-2019 Jörg Frings-Fürst License: GPL-3.0+ Files: debian/patches/* Copyright: 2010-2014 Luca Falavigna - 2014-2017 Jörg Frings-Fürst + 2014-2019 Jörg Frings-Fürst License: Expat License: Expat -- cgit v1.2.3 From b4371df49f76990e518fadb8b3c0352d5a5cfa50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 13 Jul 2019 10:08:31 +0200 Subject: d/control: Use secure URI for homepage --- debian/changelog | 1 + debian/control | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 26a29a1..bfc54b5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,7 @@ scons (3.0.5-1) UNRELEASED; urgency=medium - Remove trailing whitespaces. - Add python3 support. - Change VCS-* to point to the new repository. + - Use secure URI for homepage. * debian/rules: - Remove trailing whitespaces. - Add python3 support. diff --git a/debian/control b/debian/control index 0c66ca1..095ae50 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Build-Depends: python-all, python3-all Standards-Version: 4.4.0 -Homepage: http://www.scons.org/ +Homepage: https://www.scons.org/ Vcs-Git: git://jff.email/opt/git/scons.git Vcs-Browser: https://jff.email/cgit/scons.git -- cgit v1.2.3 From bce851611f80881291b218657d201ee7b41011a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 13 Jul 2019 10:14:21 +0200 Subject: Sync with Salsa --- debian/changelog | 18 ++++++++++++++++++ debian/control | 2 ++ 2 files changed, 20 insertions(+) diff --git a/debian/changelog b/debian/changelog index bfc54b5..f640e7c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,24 @@ scons (3.0.5-1) UNRELEASED; urgency=medium -- Jörg Frings-Fürst Fri, 12 Jul 2019 17:54:18 +0200 +scons (3.0.1-2) unstable; urgency=medium + + [ Ondřej Nový ] + * d/control: Remove ancient X-Python-Version field + * d/copyright: Use https protocol in Format field + * d/control: Set Vcs-* to salsa.debian.org + * d/watch: Use https protocol + + [ Christian Ehrhardt ] + * d/p/0110-remove_stale_files.patch: update for python3 + compatibility (Closes: #893740) + + [ Laszlo Boszormenyi (GCS) ] + * Update debhelper level to 11 . + * Update Standards-Version to 4.2.1 . + + -- Laszlo Boszormenyi (GCS) Fri, 09 Nov 2018 18:35:29 +0000 + scons (3.0.1-1) unstable; urgency=medium * New upstream release: diff --git a/debian/control b/debian/control index 095ae50..c2d5bf8 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,8 @@ Build-Depends: python3-all Standards-Version: 4.4.0 Homepage: https://www.scons.org/ +Vcs-Git: https://salsa.debian.org/debian/scons.git +Vcs-Browser: https://salsa.debian.org/debian/scons Vcs-Git: git://jff.email/opt/git/scons.git Vcs-Browser: https://jff.email/cgit/scons.git -- cgit v1.2.3 From 0aa26f1c87abad4b1e0dc25041a2277e61d6cab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 13 Jul 2019 10:29:29 +0200 Subject: Add dh-python again --- debian/control | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/control b/debian/control index c2d5bf8..5c6305c 100644 --- a/debian/control +++ b/debian/control @@ -5,14 +5,13 @@ Maintainer: Jörg Frings-Fürst Uploaders: Laszlo Boszormenyi (GCS) Build-Depends: debhelper (>= 12), + dh-python, python-all, python3-all Standards-Version: 4.4.0 Homepage: https://www.scons.org/ Vcs-Git: https://salsa.debian.org/debian/scons.git Vcs-Browser: https://salsa.debian.org/debian/scons -Vcs-Git: git://jff.email/opt/git/scons.git -Vcs-Browser: https://jff.email/cgit/scons.git Package: scons Architecture: all -- cgit v1.2.3 From a340885007a394d44fd8f04c36d7536062b871ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 13 Jul 2019 10:38:36 +0200 Subject: Refresh patches --- debian/patches/0600-manpage-spelling.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/patches/0600-manpage-spelling.patch b/debian/patches/0600-manpage-spelling.patch index 0942458..1b7e99d 100644 --- a/debian/patches/0600-manpage-spelling.patch +++ b/debian/patches/0600-manpage-spelling.patch @@ -34,6 +34,15 @@ Index: trunk/scons.1 bad_bar = {\*(Aq@bar@\*(Aq: \*(Aq@soap@\*(Aq, \*(Aq@soap@\*(Aq: \*(Aqlye\*(Aq} env\&.Substfile(\*(Aqbar\&.in\*(Aq, SUBST_DICT = bad_bar) +@@ -6633,7 +6633,7 @@ files will be automatically created (i\& + \fB$LINGUAS_FILE\fR + and + \fB$POTDOMAIN\fR +-are taken into acount too\&. All other construction variables used by ++are taken into account too\&. All other construction variables used by + \fBPOTUpdate\fR, and + \fBPOUpdate\fR + work here too\&. @@ -6716,7 +6716,7 @@ file\&. Note, that the updated POT and -- cgit v1.2.3 From 9e35beff6976a673d0953aa6949045917a5091c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 13 Jul 2019 10:52:49 +0200 Subject: d/watch: sysnc with salsa --- debian/watch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/watch b/debian/watch index 916aabd..f61c313 100644 --- a/debian/watch +++ b/debian/watch @@ -2,4 +2,4 @@ # remove zip to get tar.gz # version=4 -http://sf.net/scons/scons-(\d\S*)\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) +https://sf.net/scons/scons-(\d\S*)\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))) -- cgit v1.2.3 From 77340fd25f9cdc798fc2ea9d89ab3e3d16bf7882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 13 Jul 2019 10:57:53 +0200 Subject: d/changelog: Change distribution, date and time; Remove double tags --- debian/changelog | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/debian/changelog b/debian/changelog index f640e7c..4f67f4b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,13 +1,11 @@ -scons (3.0.5-1) UNRELEASED; urgency=medium +scons (3.0.5-1) unstable; urgency=medium + [ Jörg Frings-Fürst ] * New upstream release: - Refresh patches.at - Remove 0115-secure_script_scons.patch and 0105-java_ignore_nonexistent_files.patch. - Use pybuild as buildsystem. - * Refresh debian/patches/0110-remove_stale_files.patch for python 3 - compatibility (Closes: #893740). - Thanks to Bernd Zeimetz . * Migrate to debhelper 12: - Change debian/compat to 12. - Bump minimum debhelper version in debian/control to >= 12. @@ -24,7 +22,7 @@ scons (3.0.5-1) UNRELEASED; urgency=medium - Add year 2019. - Use secure URI. - -- Jörg Frings-Fürst Fri, 12 Jul 2019 17:54:18 +0200 + -- Jörg Frings-Fürst Sat, 13 Jul 2019 10:54:17 +0200 scons (3.0.1-2) unstable; urgency=medium -- cgit v1.2.3 From 9c04223086bf606eaac6dc2848af80518210d823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 23 Jul 2019 13:30:08 +0200 Subject: New upstream version 3.1.0 --- CHANGES.txt | 98 ++++++++++++++- MANIFEST | 1 + PKG-INFO | 2 +- RELEASE.txt | 102 ++++++++++----- engine/SCons/Action.py | 41 +++--- engine/SCons/Builder.py | 25 ++-- engine/SCons/CacheDir.py | 118 +++++++++++++---- engine/SCons/Conftest.py | 22 ++-- engine/SCons/Debug.py | 2 +- engine/SCons/Defaults.py | 5 +- engine/SCons/Environment.py | 70 +++++++---- engine/SCons/Errors.py | 6 +- engine/SCons/Executor.py | 25 ++-- engine/SCons/Job.py | 36 +++--- engine/SCons/Memoize.py | 2 +- engine/SCons/Node/Alias.py | 2 +- engine/SCons/Node/FS.py | 146 +++++++++++++-------- engine/SCons/Node/Python.py | 2 +- engine/SCons/Node/__init__.py | 98 ++++++++------- engine/SCons/PathList.py | 2 +- engine/SCons/Platform/__init__.py | 17 ++- engine/SCons/Platform/aix.py | 2 +- engine/SCons/Platform/cygwin.py | 2 +- engine/SCons/Platform/darwin.py | 13 +- engine/SCons/Platform/hpux.py | 2 +- engine/SCons/Platform/irix.py | 2 +- engine/SCons/Platform/mingw.py | 2 +- engine/SCons/Platform/os2.py | 2 +- engine/SCons/Platform/posix.py | 2 +- engine/SCons/Platform/sunos.py | 2 +- engine/SCons/Platform/virtualenv.py | 2 +- engine/SCons/Platform/win32.py | 14 ++- engine/SCons/SConf.py | 14 +-- engine/SCons/SConsign.py | 14 ++- engine/SCons/Scanner/C.py | 2 +- engine/SCons/Scanner/D.py | 4 +- engine/SCons/Scanner/Dir.py | 2 +- engine/SCons/Scanner/Fortran.py | 38 +++--- engine/SCons/Scanner/IDL.py | 2 +- engine/SCons/Scanner/LaTeX.py | 18 +-- engine/SCons/Scanner/Prog.py | 2 +- engine/SCons/Scanner/RC.py | 8 +- engine/SCons/Scanner/SWIG.py | 4 +- engine/SCons/Scanner/__init__.py | 4 +- engine/SCons/Script/Interactive.py | 2 +- engine/SCons/Script/Main.py | 36 +++--- engine/SCons/Script/SConsOptions.py | 53 ++------ engine/SCons/Script/SConscript.py | 2 +- engine/SCons/Script/__init__.py | 2 +- engine/SCons/Subst.py | 8 +- engine/SCons/Taskmaster.py | 10 +- engine/SCons/Tool/386asm.py | 2 +- engine/SCons/Tool/DCommon.py | 2 +- engine/SCons/Tool/FortranCommon.py | 5 +- engine/SCons/Tool/GettextCommon.py | 58 ++++----- engine/SCons/Tool/JavaCommon.py | 140 +++++++++++++-------- engine/SCons/Tool/MSCommon/__init__.py | 2 +- engine/SCons/Tool/MSCommon/arch.py | 2 +- engine/SCons/Tool/MSCommon/common.py | 5 +- engine/SCons/Tool/MSCommon/netframework.py | 4 +- engine/SCons/Tool/MSCommon/sdk.py | 2 +- engine/SCons/Tool/MSCommon/vc.py | 145 ++++++++++++--------- engine/SCons/Tool/MSCommon/vs.py | 15 ++- engine/SCons/Tool/PharLapCommon.py | 5 +- engine/SCons/Tool/__init__.py | 96 +++++++------- engine/SCons/Tool/aixc++.py | 2 +- engine/SCons/Tool/aixcc.py | 2 +- engine/SCons/Tool/aixcxx.py | 2 +- engine/SCons/Tool/aixf77.py | 2 +- engine/SCons/Tool/aixlink.py | 2 +- engine/SCons/Tool/applelink.py | 2 +- engine/SCons/Tool/ar.py | 2 +- engine/SCons/Tool/as.py | 2 +- engine/SCons/Tool/bcc32.py | 2 +- engine/SCons/Tool/c++.py | 2 +- engine/SCons/Tool/cc.py | 2 +- engine/SCons/Tool/clang.py | 5 +- engine/SCons/Tool/clangxx.py | 5 +- engine/SCons/Tool/cvf.py | 2 +- engine/SCons/Tool/cxx.py | 2 +- engine/SCons/Tool/cyglink.py | 2 +- engine/SCons/Tool/default.py | 2 +- engine/SCons/Tool/dmd.py | 2 +- engine/SCons/Tool/docbook/__init__.py | 182 +++++++++++++-------------- engine/SCons/Tool/dvi.py | 2 +- engine/SCons/Tool/dvipdf.py | 2 +- engine/SCons/Tool/dvips.py | 2 +- engine/SCons/Tool/f03.py | 2 +- engine/SCons/Tool/f08.py | 2 +- engine/SCons/Tool/f77.py | 2 +- engine/SCons/Tool/f90.py | 2 +- engine/SCons/Tool/f95.py | 2 +- engine/SCons/Tool/filesystem.py | 2 +- engine/SCons/Tool/fortran.py | 2 +- engine/SCons/Tool/g++.py | 2 +- engine/SCons/Tool/g77.py | 2 +- engine/SCons/Tool/gas.py | 2 +- engine/SCons/Tool/gcc.py | 2 +- engine/SCons/Tool/gdc.py | 2 +- engine/SCons/Tool/gettext_tool.py | 2 +- engine/SCons/Tool/gfortran.py | 2 +- engine/SCons/Tool/gnulink.py | 2 +- engine/SCons/Tool/gs.py | 2 +- engine/SCons/Tool/gxx.py | 2 +- engine/SCons/Tool/hpc++.py | 2 +- engine/SCons/Tool/hpcc.py | 2 +- engine/SCons/Tool/hpcxx.py | 5 +- engine/SCons/Tool/hplink.py | 2 +- engine/SCons/Tool/icc.py | 2 +- engine/SCons/Tool/icl.py | 2 +- engine/SCons/Tool/ifl.py | 2 +- engine/SCons/Tool/ifort.py | 2 +- engine/SCons/Tool/ilink.py | 2 +- engine/SCons/Tool/ilink32.py | 2 +- engine/SCons/Tool/install.py | 2 +- engine/SCons/Tool/intelc.py | 15 +-- engine/SCons/Tool/ipkg.py | 8 +- engine/SCons/Tool/jar.py | 16 +-- engine/SCons/Tool/javac.py | 10 +- engine/SCons/Tool/javah.py | 8 +- engine/SCons/Tool/latex.py | 2 +- engine/SCons/Tool/ldc.py | 2 +- engine/SCons/Tool/lex.py | 40 +++--- engine/SCons/Tool/link.py | 2 +- engine/SCons/Tool/linkloc.py | 2 +- engine/SCons/Tool/m4.py | 2 +- engine/SCons/Tool/masm.py | 2 +- engine/SCons/Tool/midl.py | 2 +- engine/SCons/Tool/mingw.py | 6 +- engine/SCons/Tool/msgfmt.py | 2 +- engine/SCons/Tool/msginit.py | 2 +- engine/SCons/Tool/msgmerge.py | 2 +- engine/SCons/Tool/mslib.py | 11 +- engine/SCons/Tool/mslink.py | 15 ++- engine/SCons/Tool/mssdk.py | 2 +- engine/SCons/Tool/msvc.py | 13 +- engine/SCons/Tool/msvs.py | 195 +++++++++++++++++++---------- engine/SCons/Tool/mwcc.py | 2 +- engine/SCons/Tool/mwld.py | 2 +- engine/SCons/Tool/nasm.py | 2 +- engine/SCons/Tool/packaging/__init__.py | 16 +-- engine/SCons/Tool/packaging/ipk.py | 16 +-- engine/SCons/Tool/packaging/msi.py | 23 ++-- engine/SCons/Tool/packaging/rpm.py | 10 +- engine/SCons/Tool/packaging/src_tarbz2.py | 2 +- engine/SCons/Tool/packaging/src_targz.py | 2 +- engine/SCons/Tool/packaging/src_tarxz.py | 2 +- engine/SCons/Tool/packaging/src_zip.py | 2 +- engine/SCons/Tool/packaging/tarbz2.py | 2 +- engine/SCons/Tool/packaging/targz.py | 2 +- engine/SCons/Tool/packaging/tarxz.py | 2 +- engine/SCons/Tool/packaging/zip.py | 2 +- engine/SCons/Tool/pdf.py | 2 +- engine/SCons/Tool/pdflatex.py | 2 +- engine/SCons/Tool/pdftex.py | 2 +- engine/SCons/Tool/qt.py | 35 +++--- engine/SCons/Tool/rmic.py | 8 +- engine/SCons/Tool/rpcgen.py | 2 +- engine/SCons/Tool/rpm.py | 25 ++-- engine/SCons/Tool/rpmutils.py | 41 +++--- engine/SCons/Tool/sgiar.py | 2 +- engine/SCons/Tool/sgic++.py | 2 +- engine/SCons/Tool/sgicc.py | 2 +- engine/SCons/Tool/sgicxx.py | 2 +- engine/SCons/Tool/sgilink.py | 2 +- engine/SCons/Tool/sunar.py | 2 +- engine/SCons/Tool/sunc++.py | 2 +- engine/SCons/Tool/suncc.py | 2 +- engine/SCons/Tool/suncxx.py | 18 ++- engine/SCons/Tool/sunf77.py | 2 +- engine/SCons/Tool/sunf90.py | 2 +- engine/SCons/Tool/sunf95.py | 2 +- engine/SCons/Tool/sunlink.py | 2 +- engine/SCons/Tool/swig.py | 5 +- engine/SCons/Tool/tar.py | 2 +- engine/SCons/Tool/tex.py | 4 +- engine/SCons/Tool/textfile.py | 2 +- engine/SCons/Tool/tlib.py | 2 +- engine/SCons/Tool/wix.py | 2 +- engine/SCons/Tool/xgettext.py | 55 +++----- engine/SCons/Tool/yacc.py | 56 ++++----- engine/SCons/Tool/zip.py | 2 +- engine/SCons/Util.py | 102 +++++++-------- engine/SCons/Variables/BoolVariable.py | 2 +- engine/SCons/Variables/EnumVariable.py | 4 +- engine/SCons/Variables/ListVariable.py | 4 +- engine/SCons/Variables/PackageVariable.py | 2 +- engine/SCons/Variables/PathVariable.py | 2 +- engine/SCons/Variables/__init__.py | 8 +- engine/SCons/Warnings.py | 10 +- engine/SCons/__init__.py | 8 +- engine/SCons/__main__.py | 4 + engine/SCons/compat/__init__.py | 27 ++-- engine/SCons/compat/_scons_dbm.py | 2 +- engine/SCons/cpp.py | 6 +- engine/SCons/exitfuncs.py | 2 +- scons-time.1 | 8 +- scons.1 | 67 ++++++++-- sconsign.1 | 54 +++++--- script/scons | 8 +- script/scons-configure-cache | 8 +- script/scons-time | 81 ++++++------ script/scons.bat | 4 +- script/sconsign | 106 +++++++++------- setup.py | 4 +- 205 files changed, 1812 insertions(+), 1310 deletions(-) create mode 100644 engine/SCons/__main__.py diff --git a/CHANGES.txt b/CHANGES.txt index c46a804..a23140c 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,102 @@ Change Log +RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 + + From Joseph Brill: + - Code to supply correct version-specifier argument to vswhere for + VS version selection. + + From William Deegan: + - Enhanced --debug=explain output. Now the separate components of the dependency list are split up + as follows: + + scons: rebuilding `file3' because: + the dependency order changed: + ->Sources + Old:xxx New:zzz + Old:yyy New:yyy + Old:zzz New:xxx + ->Depends + ->Implicit + Old:/usr/bin/python New:/usr/bin/python + - Fix Issue #3350 - SCons Exception EnvironmentError is conflicting with Python's EnvironmentError. + - Fix spurious rebuilds on second build for cases where builder has > 1 target and the source file + is generated. This was causing the > 1th target to not have it's implicit list cleared when the source + file was actually built, leaving an implicit list similar to follows for 2nd and higher target + ['/usr/bin/python', 'xxx', 'yyy', 'zzz'] + This was getting persisted to SConsign and on rebuild it would be corrected to be similar to this + ['zzz', 'yyy', 'xxx', '/usr/bin/python'] + Which would trigger a rebuild because the order changed. + The fix involved added logic to mark all shared targets as peers and then ensure they're implicit + list is all cleared together. + - Fix Issue #3349 - SCons Exception EnvironmentError is conflicting with Python's EnvironmentError. + Renamed to SConsEnvironmentError + - Fix Issue #3350 - mslink failing when too many objects. This is resolved by adding TEMPFILEARGJOIN variable + which specifies what character to join all the argements output into the tempfile. The default remains a space + when mslink, msvc, or mslib tools are loaded they change the TEMPFILEARGJOIN to be a line separator (\r\n on win32) + - Fix performance degradation for MD5-timestamp decider. NOTE: This changes the Decider() function arguments. + From: + def my_decider(dependency, target, prev_ni): + To: + def my_decider(dependency, target, prev_ni, repo_node): + Where repo_node is the repository (or other) node to use to check if the node is out of date instead of dependency. + + From Peter Diener: + - Additional fix to issue #3135 - Also handle 'pure' and 'elemental' type bound procedures + - Fix issue #3135 - Handle Fortran submodules and type bound procedures + + From Adam Gross: + - Upgraded and improved Visual Studio solution/project generation code using the MSVSProject builder. + - Added support for Visual Studio 2017 and 2019. + - Added support for the following per-variant parameters to the builder: + - cpppaths: Provides per-variant include paths. + - cppdefines: Provides per-variant preprocessor definitions. + + From Michael Hartmann: + - Fix handling of Visual Studio Compilers to properly reject any unknown HOST_PLATFORM or TARGET_PLATFORM + + From Bert Huijben: + - Added support for Visual Studio 2019 toolset. + + From Mathew Robinson: + - Update cache debug output to include cache hit rate. + - No longer unintentionally hide exceptions in Action.py + - Allow builders and pseudo-builders to inherit from OverrideEnvironments + + From Leonard de Ruijter: + - Add logic to derive correct version argument to vswhere + + From Lukas Schrangl: + - Enable LaTeX scanner to find more than one include per line + + From Mats Wichmann: + - scons-time takes more care closing files and uses safer mkdtemp to avoid + possible races on multi-job runs. + - Use importlib to dynamically load tool and platform modules instead of imp module + - sconsign: default to .sconsign.dblite if no filename is specified. + Be more informative in case of unsupported pickle protocol (py2 only). + - Fix issue #3336 - on Windows, paths were being added to PATH even if + tools were not found in those paths. + - More fixes for newer Java versions (since 9): handle new jdk directory + naming (jdk-X.Y instead of jdkX.Y) on Windows; handle two-digit major + version. Docstrings improved. + - Fixups for pylint: exception types, redefined functions, + globals, etc. Some old code removed to resolve issues (hashlib is + always present on modern Pythons; no longer need the code for + 2.5-and-earlier optparse). cmp is not a builtin function in Py3, + drop one (unused) use; replace one. Fix another instance of + renaming to SConsEnvironmentError. Trailing whitespace. + Consistently use not is/in (if not x is y -> if x is not y). + - Add a PY3-only function for setting up the cachedir that should be less + prone to races. Add a hack to the PY2 version (from Issue #3351) to + be less prone to a race in the check for old-style cache. + - Fix coding error in docbook tool only exercised when using python lxml + - Recognize two additional GNU compiler header directory options in + ParseFlags: -iquote and -idirafter. + - Fix more re patterns that contain \ but not specified as raw strings + (affects scanners for D, LaTeX, swig) + RELEASE 3.0.5 - Mon, 26 Mar 2019 15:04:42 -0700 @@ -24,7 +120,7 @@ RELEASE 3.0.5 - Mon, 26 Mar 2019 15:04:42 -0700 From Maciej Kumorek: - Update the MSVC tool to include the nologo flag by default in RCFLAGS - From Daniel Moody: +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. diff --git a/MANIFEST b/MANIFEST index 879d8d9..85d8bee 100644 --- a/MANIFEST +++ b/MANIFEST @@ -191,6 +191,7 @@ engine/SCons/Variables/PathVariable.py engine/SCons/Variables/__init__.py engine/SCons/Warnings.py engine/SCons/__init__.py +engine/SCons/__main__.py engine/SCons/compat/__init__.py engine/SCons/compat/_scons_dbm.py engine/SCons/cpp.py diff --git a/PKG-INFO b/PKG-INFO index 7909b30..57bd341 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: scons -Version: 3.0.5 +Version: 3.1.0 Summary: Open Source next-generation build tool. Home-page: http://www.scons.org/ Author: William Deegan diff --git a/RELEASE.txt b/RELEASE.txt index 90cc745..5927ef8 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -1,43 +1,81 @@ -A new SCons release, 3.0.5, is now available on the SCons download page: + A new SCons checkpoint release, 3.1.0, is now available + on the SCons download page: - https://scons.org/pages/download.html + https://scons.org/pages/download.html + Here is a summary of the changes since 3.0.5: -Here is a summary of the changes since 3.0.4: + NEW FUNCTIONALITY -CHANGED/ENHANCED EXISTING FUNCTIONALITY + - Added variable TEMPFILEARGJOIN to specify how to join arguments written + to temp files used when command lines exceed MAXLINELENGTH when the + command uses $TEMPFILE{...} + - Support for MSVC 2019 + - Upgraded and improved Visual Studio solution/project generation code using the MSVSProject builder. + - Added support for Visual Studio 2017 and 2019. + - Added support for the following per-variant parameters to the builder: + - cpppaths: Provides per-variant include paths. + - cppdefines: Provides per-variant preprocessor definitions. - - 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 -FIXES + CHANGED/ENHANCED EXISTING FUNCTIONALITY - - 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. + - Fix performance degradation for MD5-timestamp decider. NOTE: This changes the Decider() function arguments. + From: + def my_decider(dependency, target, prev_ni): + To: + def my_decider(dependency, target, prev_ni, repo_node): + Where repo_node is the repository (or other) node to use to check if the node is out of date instead of dependency. + - Enhanced --debug=explain output. Now the separate components of the dependency list are split up + as follows: -IMPROVEMENTS - - Do not store build host+user name if reproducible builds are wanted + scons: rebuilding `file3' because: + the dependency order changed: + ->Sources + Old:xxx New:zzz + Old:yyy New:yyy + Old:zzz New:xxx + ->Depends + ->Implicit + Old:/usr/bin/python New:/usr/bin/python + - Changed: Pseudo-builders now inherit OverrideEnvironments. For + example when calling a pseudo-builder from another + pseudo-builder the override variables passed to the first + pseudo-builder call had to be explicitly passed on to the + internal pseudo-builder call. Now the second pseudo-builder call + will automatically inherit these override values. -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 + FIXES + - Fix Issue #3350 - SCons Exception EnvironmentError is conflicting with Python's EnvironmentError. + - Fix spurious rebuilds on second build for cases where builder has > 1 target and the source file + is generated. This was causing the > 1th target to not have it's implicit list cleared when the source + file was actually built, leaving an implicit list similar to follows for 2nd and higher target + ['/usr/bin/python', 'xxx', 'yyy', 'zzz'] + This was getting persisted to SConsign and on rebuild it would be corrected to be similar to this + ['zzz', 'yyy', 'xxx', '/usr/bin/python'] + Which would trigger a rebuild because the order changed. + The fix involved added logic to mark all shared targets as peers and then ensure they're implicit + list is all cleared together. + - Fix Issue #3349 - SCons Exception EnvironmentError is conflicting with Python's EnvironmentError. + Renamed to SConsEnvironmentError + - Fix Issue #3350 - mslink failing when too many objects. This is resolved by adding TEMPFILEARGJOIN variable + which specifies what character to join all the argements output into the tempfile. The default remains a space + when mslink, msvc, or mslib tools are loaded they change the TEMPFILEARGJOIN to be a line separator (\r\n on win32) + - Additional fix to issue #3135 - Also handle 'pure' and 'elemental' type bound procedures + + - Fix handling of Visual Studio Compilers to properly reject any unknown HOST_PLATFORM or TARGET_PLATFORM + - Enable LaTeX scanner to find more than one include per line + + under which they would be observed), or major code cleanups + +git shortlog --no-merges -ns 3.0.5..HEAD + 64 William Deegan + 56 Mats Wichmann + 10 Adam Gross + 4 Mathew Robinson + 4 Peter Diener + 3 Lukas Schrangl + 1 Daniel Holth + 1 bdbaddog diff --git a/engine/SCons/Action.py b/engine/SCons/Action.py index 861db48..b541256 100644 --- a/engine/SCons/Action.py +++ b/engine/SCons/Action.py @@ -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 a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Action.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import pickle @@ -211,7 +211,7 @@ def _object_contents(obj): def _code_contents(code, docstring=None): - """Return the signature contents of a code object. + r"""Return the signature contents of a code object. By providing direct access to the code object of the function, Python makes this extremely easy. Hooray! @@ -534,7 +534,7 @@ class ActionBase(object): result = self.get_presig(target, source, env) if not isinstance(result,(bytes, bytearray)): - result = bytearray("",'utf-8').join([ SCons.Util.to_bytes(r) for r in result ]) + result = bytearray(result, 'utf-8') else: # Make a copy and put in bytearray, without this the contents returned by get_presig # can be changed by the logic below, appending with each call and causing very @@ -767,16 +767,22 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw): it'll have to be tweaked to get the full desired functionality. one special arg (so far?), 'error', to tell what to do with exceptions. """ - # allow std{in,out,err} to be "'devnull'" - io = kw.get('stdin') - if is_String(io) and io == 'devnull': - kw['stdin'] = open(os.devnull) - io = kw.get('stdout') - if is_String(io) and io == 'devnull': - kw['stdout'] = open(os.devnull, 'w') - io = kw.get('stderr') - if is_String(io) and io == 'devnull': - kw['stderr'] = open(os.devnull, 'w') + # allow std{in,out,err} to be "'devnull'". This is like + # subprocess.DEVNULL, which does not exist for Py2. Use the + # subprocess one if possible. + # Clean this up when Py2 support is dropped + try: + from subprocess import DEVNULL + except ImportError: + DEVNULL = None + + for stream in 'stdin', 'stdout', 'stderr': + io = kw.get(stream) + if is_String(io) and io == 'devnull': + if DEVNULL: + kw[stream] = DEVNULL + else: + kw[stream] = open(os.devnull, "r+") # Figure out what shell environment to use ENV = kw.get('env', None) @@ -802,7 +808,7 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw): kw['env'] = new_env try: - pobj = 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 @@ -820,9 +826,10 @@ def _subproc(scons_env, cmd, error = 'ignore', **kw): finally: # clean up open file handles stored in parent's kw for k, v in kw.items(): - if hasattr(v, 'close'): + if inspect.ismethod(getattr(v, 'close', None)): v.close() - return pobj + + return pobj class CommandAction(_ActionAction): @@ -1091,7 +1098,7 @@ class LazyAction(CommandGeneratorAction, CommandAction): def get_parent_class(self, env): c = env.get(self.var) - if is_String(c) and not '\n' in c: + if is_String(c) and '\n' not in c: return CommandAction return CommandGeneratorAction diff --git a/engine/SCons/Builder.py b/engine/SCons/Builder.py index 2d337c9..7777436 100644 --- a/engine/SCons/Builder.py +++ b/engine/SCons/Builder.py @@ -98,7 +98,7 @@ There are the following methods for internal use within this module: # 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/Builder.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Builder.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import collections @@ -274,7 +274,7 @@ def Builder(**kw): result = BuilderBase(**kw) - if not composite is None: + if composite is not None: result = CompositeBuilder(result, composite) return result @@ -293,7 +293,7 @@ def _node_errors(builder, env, tlist, slist): if t.has_explicit_builder(): # Check for errors when the environments are different # No error if environments are the same Environment instance - if (not t.env is None and not t.env is env and + if (t.env is not None and t.env is not env and # Check OverrideEnvironment case - no error if wrapped Environments # are the same instance, and overrides lists match not (getattr(t.env, '__subject', 0) is getattr(env, '__subject', 1) and @@ -309,7 +309,7 @@ def _node_errors(builder, env, tlist, slist): else: try: msg = "Two environments with different actions were specified for the same target: %s\n(action 1: %s)\n(action 2: %s)" % (t,t_contents.decode('utf-8'),contents.decode('utf-8')) - except UnicodeDecodeError as e: + except UnicodeDecodeError: msg = "Two environments with different actions were specified for the same target: %s"%t raise UserError(msg) if builder.multi: @@ -424,7 +424,7 @@ class BuilderBase(object): if name: self.name = name self.executor_kw = {} - if not chdir is _null: + if chdir is not _null: self.executor_kw['chdir'] = chdir self.is_explicit = is_explicit @@ -554,8 +554,10 @@ class BuilderBase(object): result = [] if target is None: target = [None]*len(source) for tgt, src in zip(target, source): - if not tgt is None: tgt = [tgt] - if not src is None: src = [src] + if tgt is not None: + tgt = [tgt] + if src is not None: + src = [src] result.extend(self._execute(env, tgt, src, overwarn)) return SCons.Node.NodeList(result) @@ -563,6 +565,13 @@ class BuilderBase(object): tlist, slist = self._create_nodes(env, target, source) + # If there is more than one target ensure that if we need to reset + # the implicit list to new scan of dependency all targets implicit lists + # are cleared. (SCons GH Issue #2811 and MongoDB SERVER-33111) + if len(tlist) > 1: + for t in tlist: + t.target_peers = tlist + # Check for errors with the specified target/source lists. _node_errors(self, env, tlist, slist) @@ -744,7 +753,7 @@ class BuilderBase(object): for s in SCons.Util.flatten(source): if SCons.Util.is_String(s): match_suffix = match_src_suffix(env.subst(s)) - if not match_suffix and not '.' in s: + if not match_suffix and '.' not in s: src_suf = self.get_src_suffix(env) s = self._adjustixes(s, None, src_suf)[0] else: diff --git a/engine/SCons/CacheDir.py b/engine/SCons/CacheDir.py index 81c74f0..c9e8ea7 100644 --- a/engine/SCons/CacheDir.py +++ b/engine/SCons/CacheDir.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/CacheDir.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/CacheDir.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __doc__ = """ CacheDir support @@ -35,6 +35,7 @@ import sys import SCons.Action import SCons.Warnings +from SCons.Util import PY3 cache_enabled = True cache_debug = False @@ -46,10 +47,12 @@ def CacheRetrieveFunc(target, source, env): t = target[0] fs = t.fs cd = env.get_CacheDir() + cd.requests += 1 cachedir, cachefile = cd.cachepath(t) if not fs.exists(cachefile): cd.CacheDebug('CacheRetrieve(%s): %s not in cache\n', t, cachefile) return 1 + cd.hits += 1 cd.CacheDebug('CacheRetrieve(%s): retrieving from %s\n', t, cachefile) if SCons.Action.execute_actions: if fs.islink(cachefile): @@ -111,7 +114,7 @@ def CachePushFunc(target, source, env): # has beaten us creating the directory. if not fs.isdir(cachedir): msg = errfmt % (str(target), cachefile) - raise SCons.Errors.EnvironmentError(msg) + raise SCons.Errors.SConsEnvironmentError(msg) try: if fs.islink(t.get_internal_path()): @@ -139,34 +142,97 @@ warned = dict() class CacheDir(object): def __init__(self, path): + """ + Initialize a CacheDir object. + + The cache configuration is stored in the object. It + is read from the config file in the supplied path if + one exists, if not the config file is created and + the default config is written, as well as saved in the object. + """ + self.requests = 0 + self.hits = 0 self.path = path self.current_cache_debug = None self.debugFP = None self.config = dict() if path is None: return - # See if there's a config file in the cache directory. If there is, - # use it. If there isn't, and the directory exists and isn't empty, - # produce a warning. If the directory doesn't exist or is empty, - # write a config file. + + if PY3: + self._readconfig3(path) + else: + self._readconfig2(path) + + + def _readconfig3(self, path): + """ + Python3 version of reading the cache config. + + If directory or config file do not exist, create. Take advantage + of Py3 capability in os.makedirs() and in file open(): just try + the operation and handle failure appropriately. + + Omit the check for old cache format, assume that's old enough + there will be none of those left to worry about. + + :param path: path to the cache directory + """ + config_file = os.path.join(path, 'config') + try: + os.makedirs(path, exist_ok=True) + except FileExistsError: + pass + except OSError: + msg = "Failed to create cache directory " + path + raise SCons.Errors.EnvironmentError(msg) + + try: + with open(config_file, 'x') as config: + self.config['prefix_len'] = 2 + try: + json.dump(self.config, config) + except Exception: + msg = "Failed to write cache configuration for " + path + raise SCons.Errors.EnvironmentError(msg) + except FileExistsError: + try: + with open(config_file) as config: + self.config = json.load(config) + except ValueError: + msg = "Failed to read cache configuration for " + path + raise SCons.Errors.EnvironmentError(msg) + + + def _readconfig2(self, path): + """ + Python2 version of reading cache config. + + See if there is a config file in the cache directory. If there is, + use it. If there isn't, and the directory exists and isn't empty, + produce a warning. If the directory does not exist or is empty, + write a config file. + + :param path: path to the cache directory + """ config_file = os.path.join(path, 'config') if not os.path.exists(config_file): - # A note: There is a race hazard here, if two processes start and + # A note: There is a race hazard here if two processes start and # attempt to create the cache directory at the same time. However, - # python doesn't really give you the option to do exclusive file - # creation (it doesn't even give you the option to error on opening - # an existing file for writing...). The ordering of events here - # as an attempt to alleviate this, on the basis that it's a pretty - # unlikely occurence (it'd require two builds with a brand new cache + # Python 2.x does not give you the option to do exclusive file + # creation (not even the option to error on opening an existing + # file for writing...). The ordering of events here is an attempt + # to alleviate this, on the basis that it's a pretty unlikely + # occurrence (would require two builds with a brand new cache # directory) - if os.path.isdir(path) and len(os.listdir(path)) != 0: + if os.path.isdir(path) and any(f != "config" for f in os.listdir(path)): self.config['prefix_len'] = 1 # When building the project I was testing this on, the warning # was output over 20 times. That seems excessive global warned if self.path not in warned: msg = "Please upgrade your cache by running " +\ - " scons-configure-cache.py " + self.path + "scons-configure-cache.py " + self.path SCons.Warnings.warn(SCons.Warnings.CacheVersionWarning, msg) warned[self.path] = True else: @@ -177,24 +243,24 @@ class CacheDir(object): # If someone else is trying to create the directory at # the same time as me, bad things will happen msg = "Failed to create cache directory " + path - raise SCons.Errors.EnvironmentError(msg) - + raise SCons.Errors.SConsEnvironmentError(msg) + self.config['prefix_len'] = 2 if not os.path.exists(config_file): try: with open(config_file, 'w') as config: json.dump(self.config, config) - except: + except Exception: msg = "Failed to write cache configuration for " + path - raise SCons.Errors.EnvironmentError(msg) + raise SCons.Errors.SConsEnvironmentError(msg) else: try: with open(config_file) as config: self.config = json.load(config) except ValueError: msg = "Failed to read cache configuration for " + path - raise SCons.Errors.EnvironmentError(msg) - + raise SCons.Errors.SConsEnvironmentError(msg) + def CacheDebug(self, fmt, target, cachefile): if cache_debug != self.current_cache_debug: @@ -207,9 +273,19 @@ class CacheDir(object): self.current_cache_debug = cache_debug if self.debugFP: self.debugFP.write(fmt % (target, os.path.split(cachefile)[1])) + self.debugFP.write("requests: %d, hits: %d, misses: %d, hit rate: %.2f%%\n" % + (self.requests, self.hits, self.misses, self.hit_ratio)) + + @property + def hit_ratio(self): + return (100.0 * self.hits / self.requests if self.requests > 0 else 100) + + @property + def misses(self): + return self.requests - self.hits def is_enabled(self): - return cache_enabled and not self.path is None + return cache_enabled and self.path is not None def is_readonly(self): return cache_readonly diff --git a/engine/SCons/Conftest.py b/engine/SCons/Conftest.py index 84aa992..1163aa3 100644 --- a/engine/SCons/Conftest.py +++ b/engine/SCons/Conftest.py @@ -354,7 +354,7 @@ def CheckHeader(context, header_name, header = None, language = None, context.Display("Checking for %s header file %s... " % (lang, header_name)) ret = context.CompileProg(text, suffix) - _YesNoResult(context, ret, "HAVE_" + header_name, text, + _YesNoResult(context, ret, "HAVE_" + header_name, text, "Define to 1 if you have the <%s> header file." % header_name) return ret @@ -439,7 +439,7 @@ def CheckTypeSize(context, type_name, header = None, language = None, expect = N Returns: status : int 0 if the check failed, or the found size of the type if the check succeeded.""" - + # Include "confdefs.h" first, so that the header can use HAVE_HEADER_H. if context.headerfilename: includetext = '#include "%s"' % context.headerfilename @@ -454,8 +454,8 @@ def CheckTypeSize(context, type_name, header = None, language = None, expect = N context.Display("Cannot check for %s type: %s\n" % (type_name, msg)) return msg - src = includetext + header - if not expect is None: + src = includetext + header + if expect is not None: # Only check if the given size is the right one context.Display('Checking %s is %d bytes... ' % (type_name, expect)) @@ -477,7 +477,7 @@ int main(void) st = context.CompileProg(src % (type_name, expect), suffix) if not st: context.Display("yes\n") - _Have(context, "SIZEOF_%s" % type_name, expect, + _Have(context, "SIZEOF_%s" % type_name, expect, "The size of `%s', as computed by sizeof." % type_name) return expect else: @@ -541,7 +541,7 @@ def CheckDeclaration(context, symbol, includes = None, language = None): Returns: status : bool True if the check failed, False if succeeded.""" - + # Include "confdefs.h" first, so that the header can use HAVE_HEADER_H. if context.headerfilename: includetext = '#include "%s"' % context.headerfilename @@ -556,7 +556,7 @@ def CheckDeclaration(context, symbol, includes = None, language = None): context.Display("Cannot check for declaration %s: %s\n" % (symbol, msg)) return msg - src = includetext + includes + src = includetext + includes context.Display('Checking whether %s is declared... ' % symbol) src = src + r""" @@ -677,7 +677,7 @@ return 0; "Define to 1 if you have the `%s' library." % lib_name) if oldLIBS != -1 and (ret or not autoadd): context.SetLIBS(oldLIBS) - + if not ret: return ret @@ -704,7 +704,7 @@ def CheckProg(context, prog_name): # def _YesNoResult(context, ret, key, text, comment = None): - """ + r""" Handle the result of a test with a "yes" or "no" result. :Parameters: @@ -723,7 +723,7 @@ def _YesNoResult(context, ret, key, text, comment = None): def _Have(context, key, have, comment = None): - """ + r""" Store result of a test in context.havedict and context.headerfilename. :Parameters: @@ -751,7 +751,7 @@ def _Have(context, key, have, comment = None): line = "#define %s %d\n" % (key_up, have) else: line = "#define %s %s\n" % (key_up, str(have)) - + if comment is not None: lines = "\n/* %s */\n" % comment + line else: diff --git a/engine/SCons/Debug.py b/engine/SCons/Debug.py index be19a01..c19862a 100644 --- a/engine/SCons/Debug.py +++ b/engine/SCons/Debug.py @@ -31,7 +31,7 @@ caller_trace() # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Debug.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Debug.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import sys diff --git a/engine/SCons/Defaults.py b/engine/SCons/Defaults.py index 15ad91e..30c0052 100644 --- a/engine/SCons/Defaults.py +++ b/engine/SCons/Defaults.py @@ -33,7 +33,7 @@ from distutils.msvccompiler. # from __future__ import division -__revision__ = "src/engine/SCons/Defaults.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Defaults.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os @@ -193,7 +193,7 @@ def chmod_func(dest, mode): SCons.Node.FS.invalidate_node_memos(dest) if not SCons.Util.is_List(dest): dest = [dest] - if SCons.Util.is_String(mode) and not 0 in [i in digits for i in mode]: + if SCons.Util.is_String(mode) and 0 not in [i in digits for i in mode]: mode = int(mode, 8) if not SCons.Util.is_String(mode): for element in dest: @@ -582,6 +582,7 @@ ConstructionEnvironment = { '__DSHLIBVERSIONFLAGS' : '${__libversionflags(__env__,"DSHLIBVERSION","_DSHLIBVERSIONFLAGS")}', 'TEMPFILE' : NullCmdGenerator, + 'TEMPFILEARGJOIN': ' ', 'Dir' : Variable_Method_Caller('TARGET', 'Dir'), 'Dirs' : Variable_Method_Caller('TARGET', 'Dirs'), 'File' : Variable_Method_Caller('TARGET', 'File'), diff --git a/engine/SCons/Environment.py b/engine/SCons/Environment.py index 0fcd617..31a4721 100644 --- a/engine/SCons/Environment.py +++ b/engine/SCons/Environment.py @@ -31,7 +31,7 @@ Environment # 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/Environment.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Environment.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import copy @@ -608,7 +608,7 @@ class SubstitutionEnvironment(object): Removes the specified function's MethodWrapper from the added_methods list, so we don't re-bind it when making a clone. """ - self.added_methods = [dm for dm in self.added_methods if not dm.method is function] + self.added_methods = [dm for dm in self.added_methods if dm.method is not function] def Override(self, overrides): """ @@ -719,6 +719,12 @@ class SubstitutionEnvironment(object): elif append_next_arg_to == '-isystem': t = ('-isystem', arg) dict['CCFLAGS'].append(t) + elif append_next_arg_to == '-iquote': + t = ('-iquote', arg) + dict['CCFLAGS'].append(t) + elif append_next_arg_to == '-idirafter': + t = ('-idirafter', arg) + dict['CCFLAGS'].append(t) elif append_next_arg_to == '-arch': t = ('-arch', arg) dict['CCFLAGS'].append(t) @@ -791,7 +797,7 @@ class SubstitutionEnvironment(object): elif arg[0] == '+': dict['CCFLAGS'].append(arg) dict['LINKFLAGS'].append(arg) - elif arg in ['-include', '-isysroot', '-isystem', '-arch']: + elif arg in ['-include', '-isysroot', '-isystem', '-iquote', '-idirafter', '-arch']: append_next_arg_to = arg else: dict['CCFLAGS'].append(arg) @@ -858,18 +864,21 @@ class SubstitutionEnvironment(object): return self -def default_decide_source(dependency, target, prev_ni): +def default_decide_source(dependency, target, prev_ni, repo_node=None): f = SCons.Defaults.DefaultEnvironment().decide_source - return f(dependency, target, prev_ni) + return f(dependency, target, prev_ni, repo_node) -def default_decide_target(dependency, target, prev_ni): + +def default_decide_target(dependency, target, prev_ni, repo_node=None): f = SCons.Defaults.DefaultEnvironment().decide_target - return f(dependency, target, prev_ni) + return f(dependency, target, prev_ni, repo_node) + def default_copy_from_cache(src, dst): f = SCons.Defaults.DefaultEnvironment().copy_from_cache return f(src, dst) + class Base(SubstitutionEnvironment): """Base class for "real" construction Environments. These are the primary objects used to communicate dependency and construction @@ -1342,7 +1351,7 @@ class Base(SubstitutionEnvironment): dk = list(filter(lambda x, val=val: x not in val, dk)) self._dict[key] = dk + [val] else: - if not val in dk: + if val not in dk: self._dict[key] = dk + [val] else: if key == 'CPPDEFINES': @@ -1428,30 +1437,30 @@ class Base(SubstitutionEnvironment): _warn_copy_deprecated = False return self.Clone(*args, **kw) - def _changed_build(self, dependency, target, prev_ni): - if dependency.changed_state(target, prev_ni): + def _changed_build(self, dependency, target, prev_ni, repo_node=None): + if dependency.changed_state(target, prev_ni, repo_node): return 1 - return self.decide_source(dependency, target, prev_ni) + return self.decide_source(dependency, target, prev_ni, repo_node) - def _changed_content(self, dependency, target, prev_ni): - return dependency.changed_content(target, prev_ni) + def _changed_content(self, dependency, target, prev_ni, repo_node=None): + return dependency.changed_content(target, prev_ni, repo_node) - def _changed_source(self, dependency, target, prev_ni): + def _changed_source(self, dependency, target, prev_ni, repo_node=None): target_env = dependency.get_build_env() type = target_env.get_tgt_sig_type() if type == 'source': - return target_env.decide_source(dependency, target, prev_ni) + return target_env.decide_source(dependency, target, prev_ni, repo_node) else: - return target_env.decide_target(dependency, target, prev_ni) + return target_env.decide_target(dependency, target, prev_ni, repo_node) - def _changed_timestamp_then_content(self, dependency, target, prev_ni): - return dependency.changed_timestamp_then_content(target, prev_ni) + def _changed_timestamp_then_content(self, dependency, target, prev_ni, repo_node=None): + return dependency.changed_timestamp_then_content(target, prev_ni, repo_node) - def _changed_timestamp_newer(self, dependency, target, prev_ni): - return dependency.changed_timestamp_newer(target, prev_ni) + def _changed_timestamp_newer(self, dependency, target, prev_ni, repo_node=None): + return dependency.changed_timestamp_newer(target, prev_ni, repo_node) - def _changed_timestamp_match(self, dependency, target, prev_ni): - return dependency.changed_timestamp_match(target, prev_ni) + def _changed_timestamp_match(self, dependency, target, prev_ni, repo_node=None): + return dependency.changed_timestamp_match(target, prev_ni, repo_node) def _copy_from_cache(self, src, dst): return self.fs.copy(src, dst) @@ -1722,7 +1731,7 @@ class Base(SubstitutionEnvironment): dk = [x for x in dk if x not in val] self._dict[key] = [val] + dk else: - if not val in dk: + if val not in dk: self._dict[key] = [val] + dk else: if delete_existing: @@ -2299,7 +2308,20 @@ class OverrideEnvironment(Base): # Methods that make this class act like a proxy. def __getattr__(self, name): - return getattr(self.__dict__['__subject'], name) + attr = getattr(self.__dict__['__subject'], name) + # Here we check if attr is one of the Wrapper classes. For + # example when a pseudo-builder is being called from an + # OverrideEnvironment. + # + # These wrappers when they're constructed capture the + # Environment they are being constructed with and so will not + # have access to overrided values. So we rebuild them with the + # OverrideEnvironment so they have access to overrided values. + if isinstance(attr, (MethodWrapper, BuilderWrapper)): + return attr.clone(self) + else: + return attr + def __setattr__(self, name, value): setattr(self.__dict__['__subject'], name, value) diff --git a/engine/SCons/Errors.py b/engine/SCons/Errors.py index 4f1403d..28f58be 100644 --- a/engine/SCons/Errors.py +++ b/engine/SCons/Errors.py @@ -28,7 +28,7 @@ and user errors in SCons. """ -__revision__ = "src/engine/SCons/Errors.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Errors.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import shutil import SCons.Util @@ -124,7 +124,7 @@ class UserError(Exception): class StopError(Exception): pass -class EnvironmentError(Exception): +class SConsEnvironmentError(Exception): pass class MSVCError(IOError): @@ -184,7 +184,7 @@ def convert_to_BuildError(status, exc_info=None): filename=filename, exc_info=exc_info) - elif isinstance(status, (EnvironmentError, OSError, IOError)): + elif isinstance(status, (SConsEnvironmentError, OSError, IOError)): # If an IOError/OSError happens, raise a BuildError. # Report the name of the file or directory that caused the # error, which might be different from the target being built diff --git a/engine/SCons/Executor.py b/engine/SCons/Executor.py index cc3813c..c6ffe81 100644 --- a/engine/SCons/Executor.py +++ b/engine/SCons/Executor.py @@ -28,7 +28,7 @@ Nodes. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function -__revision__ = "src/engine/SCons/Executor.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Executor.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import collections @@ -36,15 +36,16 @@ import SCons.Debug from SCons.Debug import logInstanceCreation import SCons.Errors import SCons.Memoize +import SCons.Util from SCons.compat import with_metaclass, NoSlotsPyPy class Batch(object): """Remembers exact association between targets and sources of executor.""" - + __slots__ = ('targets', 'sources') - + def __init__(self, targets=[], sources=[]): self.targets = targets self.sources = sources @@ -71,7 +72,7 @@ class TSList(collections.UserList): return nl[i] def __getslice__(self, i, j): nl = self.func() - i = max(i, 0); j = max(j, 0) + i, j = max(i, 0), max(j, 0) return nl[i:j] def __str__(self): nl = self.func() @@ -127,13 +128,13 @@ def execute_action_list(obj, target, kw): status = act(*args, **kw) if isinstance(status, SCons.Errors.BuildError): status.executor = obj - raise status + raise status # TODO pylint E0702: raising int not allowed elif status: msg = "Error %s" % status raise SCons.Errors.BuildError( - errstr=msg, + errstr=msg, node=obj.batches[0].targets, - executor=obj, + executor=obj, action=act) return status @@ -572,7 +573,6 @@ def AddBatchExecutor(key, executor): nullenv = None -import SCons.Util class NullEnvironment(SCons.Util.Null): import SCons.CacheDir _CacheDir_path = None @@ -597,7 +597,7 @@ class Null(object, with_metaclass(NoSlotsPyPy)): disassociate Builders from Nodes entirely, so we're not going to worry about unit tests for this--at least for now. """ - + __slots__ = ('pre_actions', 'post_actions', 'env', @@ -613,9 +613,10 @@ class Null(object, with_metaclass(NoSlotsPyPy)): 'action_list', '_do_execute', '_execute_str') - + def __init__(self, *args, **kw): - if SCons.Debug.track_instances: logInstanceCreation(self, 'Executor.Null') + if SCons.Debug.track_instances: + logInstanceCreation(self, 'Executor.Null') self.batches = [Batch(kw['targets'][:], [])] def get_build_env(self): return get_NullEnvironment() @@ -649,7 +650,7 @@ class Null(object, with_metaclass(NoSlotsPyPy)): """Morph this Null executor to a real Executor object.""" batches = self.batches self.__class__ = Executor - self.__init__([]) + self.__init__([]) self.batches = batches # The following methods require morphing this Null Executor to a diff --git a/engine/SCons/Job.py b/engine/SCons/Job.py index e049142..12ba19f 100644 --- a/engine/SCons/Job.py +++ b/engine/SCons/Job.py @@ -29,7 +29,7 @@ stop, and wait on jobs. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Job.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Job.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.compat @@ -53,14 +53,14 @@ interrupt_msg = 'Build interrupted.' class InterruptState(object): - def __init__(self): - self.interrupted = False + def __init__(self): + self.interrupted = False - def set(self): - self.interrupted = True + def set(self): + self.interrupted = True - def __call__(self): - return self.interrupted + def __call__(self): + return self.interrupted class Jobs(object): @@ -87,7 +87,7 @@ class Jobs(object): stack_size = explicit_stack_size if stack_size is None: stack_size = default_stack_size - + try: self.job = Parallel(taskmaster, num, stack_size) self.num_jobs = num @@ -172,14 +172,14 @@ class Serial(object): """ def __init__(self, taskmaster): - """Create a new serial job given a taskmaster. + """Create a new serial job given a taskmaster. The taskmaster's next_task() method should return the next task that needs to be executed, or None if there are no more tasks. The taskmaster's executed() method will be called for each task when it is successfully executed, or failed() will be called if it failed to execute (e.g. execute() raised an exception).""" - + self.taskmaster = taskmaster self.interrupted = InterruptState() @@ -188,7 +188,7 @@ class Serial(object): and executing them, and return when there are no more tasks. If a task fails to execute (i.e. execute() raises an exception), then the job will stop.""" - + while True: task = self.taskmaster.next_task() @@ -199,7 +199,7 @@ class Serial(object): task.prepare() if task.needs_execute(): task.execute() - except Exception as e: + except Exception: if self.interrupted(): try: raise SCons.Errors.BuildError( @@ -269,7 +269,7 @@ else: def __init__(self, num, stack_size, interrupted): """Create the request and reply queues, and 'num' worker threads. - + One must specify the stack size of the worker threads. The stack size is specified in kilobytes. """ @@ -277,11 +277,11 @@ else: self.resultsQueue = queue.Queue(0) try: - prev_size = threading.stack_size(stack_size*1024) + prev_size = threading.stack_size(stack_size*1024) except AttributeError as e: # Only print a warning if the stack size has been # explicitly set. - if not explicit_stack_size is None: + if explicit_stack_size is not None: msg = "Setting stack size is unsupported by this version of Python:\n " + \ e.args[0] SCons.Warnings.warn(SCons.Warnings.StackSizeWarning, msg) @@ -322,7 +322,7 @@ else: self.requestQueue.put(None) # Wait for all of the workers to terminate. - # + # # If we don't do this, later Python versions (2.4, 2.5) often # seem to raise exceptions during shutdown. This happens # in requestQueue.get(), as an assertion failure that @@ -339,7 +339,7 @@ else: self.workers = [] class Parallel(object): - """This class is used to execute tasks in parallel, and is somewhat + """This class is used to execute tasks in parallel, and is somewhat less efficient than Serial, but is appropriate for parallel builds. This class is thread safe. @@ -373,7 +373,7 @@ else: an exception), then the job will stop.""" jobs = 0 - + while True: # Start up as many available tasks as we're # allowed to. diff --git a/engine/SCons/Memoize.py b/engine/SCons/Memoize.py index 12fe043..f7b45bf 100644 --- a/engine/SCons/Memoize.py +++ b/engine/SCons/Memoize.py @@ -22,7 +22,7 @@ # from __future__ import print_function -__revision__ = "src/engine/SCons/Memoize.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Memoize.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __doc__ = """Memoizer diff --git a/engine/SCons/Node/Alias.py b/engine/SCons/Node/Alias.py index 8fbeef7..a9defb6 100644 --- a/engine/SCons/Node/Alias.py +++ b/engine/SCons/Node/Alias.py @@ -30,7 +30,7 @@ This creates a hash of global Aliases (dummy targets). # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Node/Alias.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Node/Alias.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import collections diff --git a/engine/SCons/Node/FS.py b/engine/SCons/Node/FS.py index be9f7fd..21ccecc 100644 --- a/engine/SCons/Node/FS.py +++ b/engine/SCons/Node/FS.py @@ -33,7 +33,7 @@ that can be used by scripts or modules looking for the canonical default. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function -__revision__ = "src/engine/SCons/Node/FS.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Node/FS.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import fnmatch import os @@ -57,7 +57,6 @@ import SCons.Util import SCons.Warnings from SCons.Debug import Trace -from . import DeciderNeedsNode print_duplicate = 0 @@ -282,7 +281,7 @@ def set_duplicate(duplicate): 'copy' : _copy_func } - if not duplicate in Valid_Duplicates: + if duplicate not in Valid_Duplicates: raise SCons.Errors.InternalError("The argument of set_duplicate " "should be in Valid_Duplicates") global Link_Funcs @@ -480,7 +479,7 @@ class EntryProxy(SCons.Util.Proxy): return SCons.Subst.SpecialAttrWrapper(r, entry.name + "_posix") def __get_windows_path(self): - """Return the path with \ as the path separator, + r"""Return the path with \ as the path separator, regardless of platform.""" if OS_SEP == '\\': return self @@ -531,7 +530,7 @@ class EntryProxy(SCons.Util.Proxy): except KeyError: try: attr = SCons.Util.Proxy.__getattr__(self, name) - except AttributeError as e: + except AttributeError: # Raise our own AttributeError subclass with an # overridden __str__() method that identifies the # name of the entry that caused the exception. @@ -699,13 +698,13 @@ class Base(SCons.Node.Node): @SCons.Memoize.CountMethodCall def stat(self): - try: + try: return self._memo['stat'] - except KeyError: + except KeyError: pass - try: + try: result = self.fs.stat(self.get_abspath()) - except os.error: + except os.error: result = None self._memo['stat'] = result @@ -719,16 +718,16 @@ class Base(SCons.Node.Node): def getmtime(self): st = self.stat() - if st: + if st: return st[stat.ST_MTIME] - else: + else: return None def getsize(self): st = self.stat() - if st: + if st: return st[stat.ST_SIZE] - else: + else: return None def isdir(self): @@ -1418,7 +1417,7 @@ class FS(LocalFS): self.Top.addRepository(d) def PyPackageDir(self, modulename): - """Locate the directory of a given python module name + r"""Locate the directory of a given python module name For example scons might resolve to Windows: C:\Python27\Lib\site-packages\scons-2.5.1 @@ -1689,7 +1688,7 @@ class Dir(Base): return result def addRepository(self, dir): - if dir != self and not dir in self.repositories: + if dir != self and dir not in self.repositories: self.repositories.append(dir) dir._tpath = '.' self.__clearRepositoryCache() @@ -1729,7 +1728,7 @@ class Dir(Base): if self is other: result = '.' - elif not other in self._path_elements: + elif other not in self._path_elements: try: other_dir = other.get_dir() except AttributeError: @@ -2261,7 +2260,7 @@ class RootDir(Dir): this directory. """ - __slots__ = ['_lookupDict'] + __slots__ = ('_lookupDict', ) def __init__(self, drive, fs): if SCons.Debug.track_instances: logInstanceCreation(self, 'Node.FS.RootDir') @@ -2467,7 +2466,7 @@ class FileNodeInfo(SCons.Node.NodeInfoBase): """ state = getattr(self, '__dict__', {}).copy() for obj in type(self).mro(): - for name in getattr(obj,'__slots__',()): + for name in getattr(obj, '__slots__', ()): if hasattr(self, name): state[name] = getattr(self, name) @@ -2511,7 +2510,7 @@ class FileBuildInfo(SCons.Node.BuildInfoBase): or count of any of these could yield writing wrong csig, and then false positive rebuilds """ - __slots__ = ('dependency_map') + __slots__ = ['dependency_map', ] current_version_id = 2 def __setattr__(self, key, value): @@ -3283,14 +3282,14 @@ class File(Base): self._memo['changed'] = has_changed return has_changed - def changed_content(self, target, prev_ni): + def changed_content(self, target, prev_ni, repo_node=None): cur_csig = self.get_csig() try: return cur_csig != prev_ni.csig except AttributeError: return 1 - def changed_state(self, target, prev_ni): + def changed_state(self, target, prev_ni, repo_node=None): return self.state != SCons.Node.up_to_date @@ -3317,13 +3316,26 @@ class File(Base): len(binfo.bimplicitsigs)) == 0: return {} - - # store this info so we can avoid regenerating it. - binfo.dependency_map = { str(child):signature for child, signature in zip(chain(binfo.bsources, binfo.bdepends, binfo.bimplicit), + binfo.dependency_map = { child:signature for child, signature in zip(chain(binfo.bsources, binfo.bdepends, binfo.bimplicit), chain(binfo.bsourcesigs, binfo.bdependsigs, binfo.bimplicitsigs))} return binfo.dependency_map + # @profile + def _add_strings_to_dependency_map(self, dmap): + """ + In the case comparing node objects isn't sufficient, we'll add the strings for the nodes to the dependency map + :return: + """ + + first_string = str(next(iter(dmap))) + + # print("DMAP:%s"%id(dmap)) + if first_string not in dmap: + string_dict = {str(child): signature for child, signature in dmap.items()} + dmap.update(string_dict) + return dmap + def _get_previous_signatures(self, dmap): """ Return a list of corresponding csigs from previous @@ -3342,37 +3354,62 @@ class File(Base): if len(dmap) == 0: if MD5_TIMESTAMP_DEBUG: print("Nothing dmap shortcutting") return None + elif MD5_TIMESTAMP_DEBUG: print("len(dmap):%d"%len(dmap)) + - if MD5_TIMESTAMP_DEBUG: print("len(dmap):%d"%len(dmap)) - # First try the simple name for node - c_str = str(self) - if MD5_TIMESTAMP_DEBUG: print("Checking :%s"%c_str) - df = dmap.get(c_str, None) + # First try retrieving via Node + if MD5_TIMESTAMP_DEBUG: print("Checking if self is in map:%s id:%s type:%s"%(str(self), id(self), type(self))) + df = dmap.get(self, False) if df: return df - + + # Now check if self's repository file is in map. + rf = self.rfile() + if MD5_TIMESTAMP_DEBUG: print("Checking if self.rfile is in map:%s id:%s type:%s"%(str(rf), id(rf), type(rf))) + rfm = dmap.get(rf, False) + if rfm: + return rfm + + # get default string for node and then also string swapping os.altsep for os.sep (/ for \) + c_strs = [str(self)] + 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) + c_strs.append(c_strs[0].replace(os.sep, os.altsep)) + + # In some cases the dependency_maps' keys are already strings check. + # Check if either string is now in dmap. + for s in c_strs: + if MD5_TIMESTAMP_DEBUG: print("Checking if str(self) is in map :%s" % s) + df = dmap.get(s, False) + if df: + return df + + # Strings don't exist in map, add them and try again + # If there are no strings in this dmap, then add them. + # This may not be necessary, we could walk the nodes in the dmap and check each string + # rather than adding ALL the strings to dmap. In theory that would be n/2 vs 2n str() calls on node + # if not dmap.has_strings: + dmap = self._add_strings_to_dependency_map(dmap) + + # In some cases the dependency_maps' keys are already strings check. + # Check if either string is now in dmap. + for s in c_strs: + if MD5_TIMESTAMP_DEBUG: print("Checking if str(self) is in map (now with strings) :%s" % s) + df = dmap.get(s, False) if df: return df + # Lastly use nodes get_path() to generate string and see if that's in dmap 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 + + if MD5_TIMESTAMP_DEBUG: print("Checking if self.get_path is in map (now with strings) :%s" % s) + + df = dmap.get(c_str, None) except AttributeError as e: raise FileBuildInfoFileToCsigMappingError("No mapping from file name to content signature for :%s"%c_str) @@ -3387,21 +3424,17 @@ class File(Base): 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. + node - Node instance. Check this node for file existence/timestamp + if specified. - Returns: + 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 @@ -3433,7 +3466,6 @@ class File(Base): 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: # NOTE: We're modifying the current node's csig in a query. @@ -3443,13 +3475,13 @@ class File(Base): return False return self.changed_content(target, new_prev_ni) - def changed_timestamp_newer(self, target, prev_ni): + def changed_timestamp_newer(self, target, prev_ni, repo_node=None): try: return self.get_timestamp() > target.get_timestamp() except AttributeError: return 1 - def changed_timestamp_match(self, target, prev_ni): + def changed_timestamp_match(self, target, prev_ni, repo_node=None): """ Return True if the timestamps don't match or if there is no previous timestamp :param target: @@ -3462,14 +3494,18 @@ class File(Base): return 1 def is_up_to_date(self): + """Check for whether the Node is current + In all cases self is the target we're checking to see if it's up to date + """ + T = 0 if T: Trace('is_up_to_date(%s):' % self) if not self.exists(): if T: Trace(' not self.exists():') - # The file doesn't exist locally... + # The file (always a target) doesn't exist locally... r = self.rfile() if r != self: - # ...but there is one in a Repository... + # ...but there is one (always a target) in a Repository... if not self.changed(r): if T: Trace(' changed(%s):' % r) # ...and it's even up-to-date... diff --git a/engine/SCons/Node/Python.py b/engine/SCons/Node/Python.py index d235de8..d338051 100644 --- a/engine/SCons/Node/Python.py +++ b/engine/SCons/Node/Python.py @@ -27,7 +27,7 @@ Python nodes. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Node/Python.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Node/Python.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Node diff --git a/engine/SCons/Node/__init__.py b/engine/SCons/Node/__init__.py index 889e7a4..5455bd6 100644 --- a/engine/SCons/Node/__init__.py +++ b/engine/SCons/Node/__init__.py @@ -43,13 +43,18 @@ from __future__ import print_function # 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/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Node/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import collections import copy from itertools import chain +try: + from itertools import zip_longest +except ImportError: + from itertools import izip_longest as zip_longest + import SCons.Debug from SCons.Debug import logInstanceCreation import SCons.Executor @@ -103,9 +108,9 @@ implicit_deps_changed = 0 # A variable that can be set to an interface-specific function be called # to annotate a Node with information about its creation. -def do_nothing(node): pass +def do_nothing_node(node): pass -Annotate = do_nothing +Annotate = do_nothing_node # Gets set to 'True' if we're running in interactive mode. Is # currently used to release parts of a target's info during @@ -248,25 +253,10 @@ _target_from_source_map = {0 : target_from_source_none, # used by it. # - -class DeciderNeedsNode(Exception): - """ - Indicate that the decider needs the node as well as the target and the dependency. - Normally the node and the target are the same, but in the case of repository - They may be different. Also the NodeInfo is retrieved from the node - """ - def __init__(self, call_this_decider): - """ - :param call_this_decider: to return the decider to call directly since deciders - are called through several levels of indirection - """ - self.decider = call_this_decider - - # # First, the single decider functions # -def changed_since_last_build_node(node, target, prev_ni): +def changed_since_last_build_node(node, target, prev_ni, repo_node=None): """ Must be overridden in a specific subclass to return True if this @@ -287,7 +277,7 @@ def changed_since_last_build_node(node, target, prev_ni): raise NotImplementedError -def changed_since_last_build_alias(node, target, prev_ni): +def changed_since_last_build_alias(node, target, prev_ni, repo_node=None): cur_csig = node.get_csig() try: return cur_csig != prev_ni.csig @@ -295,24 +285,24 @@ def changed_since_last_build_alias(node, target, prev_ni): return 1 -def changed_since_last_build_entry(node, target, prev_ni): +def changed_since_last_build_entry(node, target, prev_ni, repo_node=None): node.disambiguate() - return _decider_map[node.changed_since_last_build](node, target, prev_ni) + return _decider_map[node.changed_since_last_build](node, target, prev_ni, repo_node) -def changed_since_last_build_state_changed(node, target, prev_ni): +def changed_since_last_build_state_changed(node, target, prev_ni, repo_node=None): return node.state != SCons.Node.up_to_date -def decide_source(node, target, prev_ni): - return target.get_build_env().decide_source(node, target, prev_ni) +def decide_source(node, target, prev_ni, repo_node=None): + return target.get_build_env().decide_source(node, target, prev_ni, repo_node) -def decide_target(node, target, prev_ni): - return target.get_build_env().decide_target(node, target, prev_ni) +def decide_target(node, target, prev_ni, repo_node=None): + return target.get_build_env().decide_target(node, target, prev_ni, repo_node) -def changed_since_last_build_python(node, target, prev_ni): +def changed_since_last_build_python(node, target, prev_ni, repo_node=None): cur_csig = node.get_csig() try: return cur_csig != prev_ni.csig @@ -529,6 +519,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): __slots__ = ['sources', 'sources_set', + 'target_peers', '_specific_sources', 'depends', 'depends_set', @@ -784,6 +775,25 @@ class Node(object, with_metaclass(NoSlotsPyPy)): for parent in self.waiting_parents: parent.implicit = None + # Handle issue where builder emits more than one target and + # the source file for the builder is generated. + # in that case only the first target was getting it's .implicit + # cleared when the source file is built (second scan). + # leaving only partial implicits from scan before source file is generated + # typically the compiler only. Then scanned files are appended + # This is persisted to sconsign and rebuild causes false rebuilds + # because the ordering of the implicit list then changes to what it + # should have been. + # This is at least the following bugs + # https://github.com/SCons/scons/issues/2811 + # https://jira.mongodb.org/browse/SERVER-33111 + try: + for peer in parent.target_peers: + peer.implicit = None + except AttributeError: + pass + + self.clear() if self.pseudo: @@ -1160,7 +1170,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): binfo.bactsig = SCons.Util.MD5signature(executor.get_contents()) if self._specific_sources: - sources = [s for s in self.sources if not s in ignore_set] + sources = [s for s in self.sources if s not in ignore_set] else: sources = executor.get_unignored_sources(self, self.ignore) @@ -1480,17 +1490,11 @@ class Node(object, with_metaclass(NoSlotsPyPy)): result = True for child, prev_ni in zip(children, then): - try: - if _decider_map[child.changed_since_last_build](child, self, prev_ni): - if t: Trace(': %s changed' % child) - result = True - except DeciderNeedsNode as e: - if e.decider(self, prev_ni, node=node): - if t: Trace(': %s changed' % child) - result = True + if _decider_map[child.changed_since_last_build](child, self, prev_ni, node): + if t: Trace(': %s changed' % child) + result = True if self.has_builder(): - import SCons.Util contents = self.get_executor().get_contents() newsig = SCons.Util.MD5signature(contents) if bi.bactsig != newsig: @@ -1647,14 +1651,14 @@ class Node(object, with_metaclass(NoSlotsPyPy)): lines = [] - removed = [x for x in old_bkids if not x in new_bkids] + removed = [x for x in old_bkids if x not in new_bkids] if removed: removed = [stringify(r) for r in removed] fmt = "`%s' is no longer a dependency\n" lines.extend([fmt % s for s in removed]) for k in new_bkids: - if not k in old_bkids: + if k not in old_bkids: lines.append("`%s' is a new dependency\n" % stringify(k)) else: try: @@ -1666,9 +1670,16 @@ class Node(object, with_metaclass(NoSlotsPyPy)): lines.append("`%s' changed\n" % stringify(k)) if len(lines) == 0 and old_bkids != new_bkids: - lines.append("the dependency order changed:\n" + - "%sold: %s\n" % (' '*15, list(map(stringify, old_bkids))) + - "%snew: %s\n" % (' '*15, list(map(stringify, new_bkids)))) + lines.append("the dependency order changed:\n") + lines.append("->Sources\n") + for (o,n) in zip_longest(old.bsources, new.bsources, fillvalue=None): + lines.append("Old:%s\tNew:%s\n"%(o,n)) + lines.append("->Depends\n") + for (o,n) in zip_longest(old.bdepends, new.bdepends, fillvalue=None): + lines.append("Old:%s\tNew:%s\n"%(o,n)) + lines.append("->Implicit\n") + for (o,n) in zip_longest(old.bimplicit, new.bimplicit, fillvalue=None): + lines.append("Old:%s\tNew:%s\n"%(o,n)) if len(lines) == 0: def fmt_with_title(title, strlines): @@ -1711,7 +1722,6 @@ class Walker(object): This is depth-first, children are visited before the parent. The Walker object can be initialized with any node, and returns the next node on the descent with each get_next() call. - 'kids_func' is an optional function that will be called to get the children of a node instead of calling 'children'. 'cycle_func' is an optional function that will be called when a cycle is detected. diff --git a/engine/SCons/PathList.py b/engine/SCons/PathList.py index fa73a9d..d6a01e7 100644 --- a/engine/SCons/PathList.py +++ b/engine/SCons/PathList.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/PathList.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/PathList.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __doc__ = """SCons.PathList diff --git a/engine/SCons/Platform/__init__.py b/engine/SCons/Platform/__init__.py index e1cc941..8da1e9d 100644 --- a/engine/SCons/Platform/__init__.py +++ b/engine/SCons/Platform/__init__.py @@ -43,11 +43,11 @@ their own platform definition. # from __future__ import print_function -__revision__ = "src/engine/SCons/Platform/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.compat -import imp +import importlib import os import sys import tempfile @@ -101,13 +101,8 @@ def platform_module(name = platform_default()): eval(full_name) else: try: - file, path, desc = imp.find_module(name, - sys.modules['SCons.Platform'].__path__) - try: - mod = imp.load_module(full_name, file, path, desc) - finally: - if file: - file.close() + # the specific platform module is a relative import + mod = importlib.import_module("." + name, __name__) except ImportError: try: import zipimport @@ -231,8 +226,10 @@ class TempFileMunge(object): prefix = '@' args = list(map(SCons.Subst.quote_spaces, cmd[1:])) - os.write(fd, bytearray(" ".join(args) + "\n",'utf-8')) + join_char = env.get('TEMPFILEARGJOIN',' ') + os.write(fd, bytearray(join_char.join(args) + "\n",'utf-8')) os.close(fd) + # XXX Using the SCons.Action.print_actions value directly # like this is bogus, but expedient. This class should # really be rewritten as an Action that defines the diff --git a/engine/SCons/Platform/aix.py b/engine/SCons/Platform/aix.py index 7faddd9..70fbb35 100644 --- a/engine/SCons/Platform/aix.py +++ b/engine/SCons/Platform/aix.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/aix.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/aix.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import subprocess diff --git a/engine/SCons/Platform/cygwin.py b/engine/SCons/Platform/cygwin.py index 434d125..70b6443 100644 --- a/engine/SCons/Platform/cygwin.py +++ b/engine/SCons/Platform/cygwin.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/cygwin.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/cygwin.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import sys diff --git a/engine/SCons/Platform/darwin.py b/engine/SCons/Platform/darwin.py index 7f4b468..d5861d9 100644 --- a/engine/SCons/Platform/darwin.py +++ b/engine/SCons/Platform/darwin.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/darwin.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/darwin.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import posix import os @@ -56,12 +56,11 @@ def generate(env): for file in filelist: if os.path.isfile(file): - f = open(file, 'r') - lines = f.readlines() - for line in lines: - if line: - env.AppendENVPath('PATHOSX', line.strip('\n')) - f.close() + with open(file, 'r') as f: + lines = f.readlines() + for line in lines: + if line: + env.AppendENVPath('PATHOSX', line.strip('\n')) # Not sure why this wasn't the case all along? if env['ENV'].get('PATHOSX', False) and os.environ.get('SCONS_USE_MAC_PATHS', False): diff --git a/engine/SCons/Platform/hpux.py b/engine/SCons/Platform/hpux.py index cc97d39..6867212 100644 --- a/engine/SCons/Platform/hpux.py +++ b/engine/SCons/Platform/hpux.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/hpux.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/hpux.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import posix diff --git a/engine/SCons/Platform/irix.py b/engine/SCons/Platform/irix.py index 5df080a..a382e71 100644 --- a/engine/SCons/Platform/irix.py +++ b/engine/SCons/Platform/irix.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/irix.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/irix.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import posix diff --git a/engine/SCons/Platform/mingw.py b/engine/SCons/Platform/mingw.py index f3f7e44..c03c9c8 100644 --- a/engine/SCons/Platform/mingw.py +++ b/engine/SCons/Platform/mingw.py @@ -27,7 +27,7 @@ Platform-specific initialization for the MinGW system. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/mingw.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/mingw.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import sys diff --git a/engine/SCons/Platform/os2.py b/engine/SCons/Platform/os2.py index a680f94..ebabe3d 100644 --- a/engine/SCons/Platform/os2.py +++ b/engine/SCons/Platform/os2.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/os2.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/os2.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import win32 def generate(env): diff --git a/engine/SCons/Platform/posix.py b/engine/SCons/Platform/posix.py index aa43f51..780c764 100644 --- a/engine/SCons/Platform/posix.py +++ b/engine/SCons/Platform/posix.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/posix.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/posix.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import errno import os diff --git a/engine/SCons/Platform/sunos.py b/engine/SCons/Platform/sunos.py index 2ec4c99..6aa54aa 100644 --- a/engine/SCons/Platform/sunos.py +++ b/engine/SCons/Platform/sunos.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/sunos.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/sunos.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import posix diff --git a/engine/SCons/Platform/virtualenv.py b/engine/SCons/Platform/virtualenv.py index 4cfb6e1..9fb3e45 100644 --- a/engine/SCons/Platform/virtualenv.py +++ b/engine/SCons/Platform/virtualenv.py @@ -26,7 +26,7 @@ Support for virtualenv. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/virtualenv.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/virtualenv.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import sys diff --git a/engine/SCons/Platform/win32.py b/engine/SCons/Platform/win32.py index 756f6d6..ea567a2 100644 --- a/engine/SCons/Platform/win32.py +++ b/engine/SCons/Platform/win32.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/win32.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Platform/win32.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import os.path @@ -193,7 +193,7 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr): # actually do the spawn try: - args = [sh, '/C', escape(' '.join(args)) ] + args = [sh, '/C', escape(' '.join(args))] ret = spawnve(os.P_WAIT, sh, args, env) except OSError as e: # catch any error @@ -207,15 +207,17 @@ def piped_spawn(sh, escape, cmd, args, env, stdout, stderr): # and do clean up stuff if stdout is not None and stdoutRedirected == 0: try: - stdout.write(open( tmpFileStdout, "r" ).read()) - os.remove( tmpFileStdout ) + with open(tmpFileStdout, "r" ) as tmp: + stdout.write(tmp.read()) + os.remove(tmpFileStdout) except (IOError, OSError): pass if stderr is not None and stderrRedirected == 0: try: - stderr.write(open( tmpFileStderr, "r" ).read()) - os.remove( tmpFileStderr ) + with open(tmpFileStderr, "r" ) as tmp: + stderr.write(tmp.read()) + os.remove(tmpFileStderr) except (IOError, OSError): pass return ret diff --git a/engine/SCons/SConf.py b/engine/SCons/SConf.py index 66592d4..7409c50 100644 --- a/engine/SCons/SConf.py +++ b/engine/SCons/SConf.py @@ -35,7 +35,7 @@ libraries are installed, if some command line options are supported etc. # from __future__ import print_function -__revision__ = "src/engine/SCons/SConf.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/SConf.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.compat @@ -56,7 +56,6 @@ import SCons.Warnings import SCons.Conftest from SCons.Debug import Trace -from SCons.Node import DeciderNeedsNode # Turn off the Conftest error logging SCons.Conftest.LogInputFiles = 0 @@ -247,6 +246,7 @@ class SConfBuildTask(SCons.Taskmaster.AlwaysTask): # ConfigureCacheError and if yes, reraise the exception exc_type = self.exc_info()[0] if issubclass(exc_type, SConfError): + # TODO pylint E0704: bare raise not inside except raise elif issubclass(exc_type, SCons.Errors.BuildError): # we ignore Build Errors (occurs, when a test doesn't pass) @@ -406,12 +406,10 @@ class SConfBase(object): # that the correct .sconsign info will get calculated # and keep the build state consistent. def force_build(dependency, target, prev_ni, - env_decider=env.decide_source, - node=None): + repo_node=None, + env_decider=env.decide_source): try: - env_decider(dependency, target, prev_ni) - except DeciderNeedsNode as e: - e.decider(target, prev_ni, node=target) + env_decider(dependency, target, prev_ni, repo_node) except Exception as e: raise e return True @@ -787,7 +785,7 @@ class SConfBase(object): self.active = 0 sconf_global = None - if not self.config_h is None: + if self.config_h is not None: _ac_config_hs[self.config_h] = self.config_h_text self.env.fs = self.lastEnvFs diff --git a/engine/SCons/SConsign.py b/engine/SCons/SConsign.py index 1fec6a0..e003933 100644 --- a/engine/SCons/SConsign.py +++ b/engine/SCons/SConsign.py @@ -29,7 +29,7 @@ Writing and reading information to the .sconsign file or files. from __future__ import print_function -__revision__ = "src/engine/SCons/SConsign.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/SConsign.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.compat @@ -76,7 +76,8 @@ def Get_DataBase(dir): except KeyError: path = d.entry_abspath(DB_Name) try: db = DataBase[d] = DB_Module.open(path, mode) - except (IOError, OSError): pass + except (IOError, OSError): + pass else: if mode != "r": DB_sync_list.append(db) @@ -334,10 +335,15 @@ class DirFile(Dir): Dir.__init__(self, fp, dir) except KeyboardInterrupt: raise - except: + except Exception: SCons.Warnings.warn(SCons.Warnings.CorruptSConsignWarning, "Ignoring corrupt .sconsign file: %s"%self.sconsign) + try: + fp.close() + except AttributeError: + pass + global sig_files sig_files.append(self) @@ -417,7 +423,7 @@ def File(name, dbm_module=None): else: ForDirectory = DB DB_Name = name - if not dbm_module is None: + if dbm_module is not None: DB_Module = dbm_module # Local Variables: diff --git a/engine/SCons/Scanner/C.py b/engine/SCons/Scanner/C.py index 6f59edb..206de5f 100644 --- a/engine/SCons/Scanner/C.py +++ b/engine/SCons/Scanner/C.py @@ -27,7 +27,7 @@ This module implements the dependency scanner for C/C++ code. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/C.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Scanner/C.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Node.FS import SCons.Scanner diff --git a/engine/SCons/Scanner/D.py b/engine/SCons/Scanner/D.py index 543cc3c..1ad9e89 100644 --- a/engine/SCons/Scanner/D.py +++ b/engine/SCons/Scanner/D.py @@ -30,7 +30,7 @@ Coded by Andy Friesen # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/D.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Scanner/D.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Scanner @@ -46,7 +46,7 @@ class D(SCons.Scanner.Classic): name = "DScanner", suffixes = '$DSUFFIXES', path_variable = 'DPATH', - regex = '(?:import\s+)([\w\s=,.]+)(?:\s*:[\s\w,=]+)?(?:;)' + regex = r'(?:import\s+)([\w\s=,.]+)(?:\s*:[\s\w,=]+)?(?:;)' ) def find_include(self, include, source_dir, path): diff --git a/engine/SCons/Scanner/Dir.py b/engine/SCons/Scanner/Dir.py index 1b82046..be8ae6c 100644 --- a/engine/SCons/Scanner/Dir.py +++ b/engine/SCons/Scanner/Dir.py @@ -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/Scanner/Dir.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Scanner/Dir.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Node.FS import SCons.Scanner diff --git a/engine/SCons/Scanner/Fortran.py b/engine/SCons/Scanner/Fortran.py index b52269f..d315bc9 100644 --- a/engine/SCons/Scanner/Fortran.py +++ b/engine/SCons/Scanner/Fortran.py @@ -26,7 +26,7 @@ This module implements the dependency scanner for Fortran code. # 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/Scanner/Fortran.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Scanner/Fortran.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import re @@ -187,7 +187,7 @@ def FortranScan(path_variable="FORTRANPATH"): # (\w+) : match the module name that is being USE'd # # - use_regex = "(?i)(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)" + use_regex = r"(?i)(?:^|;)\s*USE(?:\s+|(?:(?:\s*,\s*(?:NON_)?INTRINSIC)?\s*::))\s*(\w+)" # The INCLUDE statement regex matches the following: @@ -275,7 +275,7 @@ def FortranScan(path_variable="FORTRANPATH"): # set of semicolon-separated INCLUDE statements # (as allowed by the F2003 standard) - include_regex = """(?i)(?:^|['">]\s*;)\s*INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])""" + include_regex = r"""(?i)(?:^|['">]\s*;)\s*INCLUDE\s+(?:\w+_)?[<"'](.+?)(?=["'>])""" # The MODULE statement regex finds module definitions by matching # the following: @@ -285,21 +285,29 @@ def FortranScan(path_variable="FORTRANPATH"): # but *not* the following: # # MODULE PROCEDURE procedure_name +# MODULE SUBROUTINE subroutine_name +# MODULE FUNCTION function_name +# MODULE PURE SUBROUTINE|FUNCTION subroutine_name|function_name +# MODULE ELEMENTAL SUBROUTINE|FUNCTION subroutine_name|function_name # # Here is a breakdown of the regex: # -# (?i) : regex is case insensitive -# ^\s* : any amount of white space -# MODULE : match the string MODULE, case insensitive -# \s+ : match one or more white space characters -# (?!PROCEDURE) : but *don't* match if the next word matches -# PROCEDURE (negative lookahead assertion), -# case insensitive -# (\w+) : match one or more alphanumeric characters -# that make up the defined module name and -# save it in a group - - def_regex = """(?i)^\s*MODULE\s+(?!PROCEDURE)(\w+)""" +# (?i) : regex is case insensitive +# ^\s* : any amount of white space +# MODULE : match the string MODULE, case +# insensitive +# \s+ : match one or more white space +# characters +# (?!PROCEDURE|SUBROUTINE|FUNCTION|PURE|ELEMENTAL) +# : but *don't* match if the next word +# matches PROCEDURE, SUBROUTINE, +# FUNCTION, PURE or ELEMENTAL (negative +# lookahead assertion), case insensitive +# (\w+) : match one or more alphanumeric +# characters that make up the defined +# module name and save it in a group + + def_regex = r"""(?i)^\s*MODULE\s+(?!PROCEDURE|SUBROUTINE|FUNCTION|PURE|ELEMENTAL)(\w+)""" scanner = F90Scanner("FortranScan", "$FORTRANSUFFIXES", diff --git a/engine/SCons/Scanner/IDL.py b/engine/SCons/Scanner/IDL.py index 843a147..88226e6 100644 --- a/engine/SCons/Scanner/IDL.py +++ b/engine/SCons/Scanner/IDL.py @@ -28,7 +28,7 @@ Definition Language) files. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/IDL.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Scanner/IDL.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Node.FS import SCons.Scanner diff --git a/engine/SCons/Scanner/LaTeX.py b/engine/SCons/Scanner/LaTeX.py index d9e3692..8afe5b0 100644 --- a/engine/SCons/Scanner/LaTeX.py +++ b/engine/SCons/Scanner/LaTeX.py @@ -27,7 +27,7 @@ This module implements the dependency scanner for LaTeX code. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/LaTeX.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Scanner/LaTeX.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path import re @@ -179,15 +179,7 @@ class LaTeX(SCons.Scanner.Base): 'inputfrom', 'subinputfrom'] def __init__(self, name, suffixes, graphics_extensions, *args, **kw): - - # We have to include \n with the % we exclude from the first part - # part of the regex because the expression is compiled with re.M. - # Without the \n, the ^ could match the beginning of a *previous* - # line followed by one or more newline characters (i.e. blank - # lines), interfering with a match on the next line. - # add option for whitespace before the '[options]' or the '{filename}' regex = r''' - ^[^%\n]* \\( include | includegraphics(?:\s*\[[^\]]+\])? @@ -348,7 +340,7 @@ class LaTeX(SCons.Scanner.Base): # Cache the includes list in node so we only scan it once: # path_dict = dict(list(path)) # add option for whitespace (\s) before the '[' - noopt_cre = re.compile('\s*\[.*$') + noopt_cre = re.compile(r'\s*\[.*$') if node.includes is not None: includes = node.includes else: @@ -372,9 +364,9 @@ class LaTeX(SCons.Scanner.Base): inc_list = include[2].split(',') else: inc_list = include[1].split(',') - for j in range(len(inc_list)): - split_includes.append( (inc_type, inc_subdir, inc_list[j]) ) - # + for inc in inc_list: + split_includes.append((inc_type, inc_subdir, inc)) + includes = split_includes node.includes = includes diff --git a/engine/SCons/Scanner/Prog.py b/engine/SCons/Scanner/Prog.py index 78deb18..2ae3c68 100644 --- a/engine/SCons/Scanner/Prog.py +++ b/engine/SCons/Scanner/Prog.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/Prog.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Scanner/Prog.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Node import SCons.Node.FS diff --git a/engine/SCons/Scanner/RC.py b/engine/SCons/Scanner/RC.py index cf970c5..4f0cee2 100644 --- a/engine/SCons/Scanner/RC.py +++ b/engine/SCons/Scanner/RC.py @@ -28,7 +28,7 @@ Definition Language) files. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/RC.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Scanner/RC.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import re @@ -48,9 +48,9 @@ def RCScan(): """Return a prototype Scanner instance for scanning RC source files""" res_re= r'^(?:\s*#\s*(?:include)|' \ - '.*?\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)' \ - '\s*.*?)' \ - '\s*(<|"| )([^>"\s]+)(?:[>"\s])*$' + r'.*?\s+(?:ICON|BITMAP|CURSOR|HTML|FONT|MESSAGETABLE|TYPELIB|REGISTRY|D3DFX)' \ + r'\s*.*?)' \ + r'\s*(<|"| )([^>"\s]+)(?:[>"\s])*$' resScanner = SCons.Scanner.ClassicCPP("ResourceScanner", "$RCSUFFIXES", "CPPPATH", diff --git a/engine/SCons/Scanner/SWIG.py b/engine/SCons/Scanner/SWIG.py index 6bffbe3..5f2a3e3 100644 --- a/engine/SCons/Scanner/SWIG.py +++ b/engine/SCons/Scanner/SWIG.py @@ -27,14 +27,14 @@ This module implements the dependency scanner for SWIG code. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/SWIG.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Scanner/SWIG.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Scanner SWIGSuffixes = [ '.i' ] def SWIGScanner(): - expr = '^[ \t]*%[ \t]*(?:include|import|extern)[ \t]*(<|"?)([^>\s"]+)(?:>|"?)' + expr = r'^[ \t]*%[ \t]*(?:include|import|extern)[ \t]*(<|"?)([^>\s"]+)(?:>|"?)' scanner = SCons.Scanner.ClassicCPP("SWIGScanner", ".i", "SWIGPATH", expr) return scanner diff --git a/engine/SCons/Scanner/__init__.py b/engine/SCons/Scanner/__init__.py index b5df1cc..feff12a 100644 --- a/engine/SCons/Scanner/__init__.py +++ b/engine/SCons/Scanner/__init__.py @@ -27,7 +27,7 @@ The Scanner package for the SCons software construction utility. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Scanner/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import re @@ -207,7 +207,7 @@ class Base(object): self = self.select(node) - if not self.argument is _null: + if self.argument is not _null: node_list = self.function(node, env, path, self.argument) else: node_list = self.function(node, env, path) diff --git a/engine/SCons/Script/Interactive.py b/engine/SCons/Script/Interactive.py index 0e73204..3d70728 100644 --- a/engine/SCons/Script/Interactive.py +++ b/engine/SCons/Script/Interactive.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function -__revision__ = "src/engine/SCons/Script/Interactive.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Script/Interactive.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __doc__ = """ SCons interactive mode diff --git a/engine/SCons/Script/Main.py b/engine/SCons/Script/Main.py index c677937..878f824 100644 --- a/engine/SCons/Script/Main.py +++ b/engine/SCons/Script/Main.py @@ -38,7 +38,7 @@ deprecated_python_version = (2, 7, 0) # 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/Script/Main.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Script/Main.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.compat @@ -68,6 +68,20 @@ import SCons.Warnings import SCons.Script.Interactive +# Global variables +first_command_start = None +last_command_end = None +print_objects = 0 +print_memoizer = 0 +print_stacktrace = 0 +print_time = 0 +sconscript_time = 0 +cumulative_command_time = 0 +exit_status = 0 # final exit status, assume success by default +this_build_status = 0 # "exit status" of an individual build +num_jobs = None +delayed_warnings = [] + def fetch_win32_parallel_msg(): # A subsidiary function that exists solely to isolate this import @@ -87,15 +101,14 @@ def revert_io(): sys.stderr = sys.__stderr__ sys.stdout = sys.__stdout__ + class SConsPrintHelpException(Exception): pass + display = SCons.Util.display progress_display = SCons.Util.DisplayEngine() -first_command_start = None -last_command_end = None - class Progressor(object): prev = '' @@ -443,19 +456,6 @@ def python_version_deprecated(version=sys.version_info): return version < deprecated_python_version -# Global variables - -print_objects = 0 -print_memoizer = 0 -print_stacktrace = 0 -print_time = 0 -sconscript_time = 0 -cumulative_command_time = 0 -exit_status = 0 # final exit status, assume success by default -this_build_status = 0 # "exit status" of an individual build -num_jobs = None -delayed_warnings = [] - class FakeOptionParser(object): """ A do-nothing option parser, used for the initial OptionsParser variable. @@ -1170,7 +1170,7 @@ def _build_targets(fs, options, targets, target_top): # -U, local SConscript Default() targets target_top = fs.Dir(target_top) def check_dir(x, target_top=target_top): - if hasattr(x, 'cwd') and not x.cwd is None: + if hasattr(x, 'cwd') and x.cwd is not None: cwd = x.cwd.srcnode() return cwd == target_top else: diff --git a/engine/SCons/Script/SConsOptions.py b/engine/SCons/Script/SConsOptions.py index 65e1868..5651c96 100644 --- a/engine/SCons/Script/SConsOptions.py +++ b/engine/SCons/Script/SConsOptions.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Script/SConsOptions.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Script/SConsOptions.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import optparse import re @@ -147,7 +147,7 @@ class SConsValues(optparse.Values): """ Sets an option from an SConscript file. """ - if not name in self.settable: + if name not in self.settable: raise SCons.Errors.UserError("This option is not settable from a SConscript file: %s"%name) if name == 'num_jobs': @@ -167,7 +167,7 @@ class SConsValues(optparse.Values): value = str(value) except ValueError: raise SCons.Errors.UserError("A string is required: %s"%repr(value)) - if not value in SCons.Node.FS.Valid_Duplicates: + if value not in SCons.Node.FS.Valid_Duplicates: raise SCons.Errors.UserError("Not a valid duplication style: %s" % value) # Set the duplicate style right away so it can affect linking # of SConscript files. @@ -226,39 +226,8 @@ class SConsOption(optparse.Option): fmt = "option %s: nargs='?' is incompatible with short options" raise SCons.Errors.UserError(fmt % self._short_opts[0]) - try: - _orig_CONST_ACTIONS = optparse.Option.CONST_ACTIONS - - _orig_CHECK_METHODS = optparse.Option.CHECK_METHODS - - except AttributeError: - # optparse.Option had no CONST_ACTIONS before Python 2.5. - - _orig_CONST_ACTIONS = ("store_const",) - - def _check_const(self): - if self.action not in self.CONST_ACTIONS and self.const is not None: - raise OptionError( - "'const' must not be supplied for action %r" % self.action, - self) - - # optparse.Option collects its list of unbound check functions - # up front. This sucks because it means we can't just override - # the _check_const() function like a normal method, we have to - # actually replace it in the list. This seems to be the most - # straightforward way to do that. - - _orig_CHECK_METHODS = [optparse.Option._check_action, - optparse.Option._check_type, - optparse.Option._check_choice, - optparse.Option._check_dest, - _check_const, - optparse.Option._check_nargs, - optparse.Option._check_callback] - - CHECK_METHODS = _orig_CHECK_METHODS + [_check_nargs_optional] - - CONST_ACTIONS = _orig_CONST_ACTIONS + optparse.Option.TYPED_ACTIONS + CHECK_METHODS = optparse.Option.CHECK_METHODS + [_check_nargs_optional] + CONST_ACTIONS = optparse.Option.CONST_ACTIONS + optparse.Option.TYPED_ACTIONS class SConsOptionGroup(optparse.OptionGroup): """ @@ -364,7 +333,7 @@ class SConsOptionParser(optparse.OptionParser): in self.largs, so that any value overridden on the command line is immediately available if the user turns around and does a GetOption() right away. - + We mimic the processing of the single args in the original OptionParser._process_args(), but here we allow exact matches for long-opts only (no partial @@ -375,7 +344,7 @@ class SConsOptionParser(optparse.OptionParser): command-line arguments that 1. haven't been processed so far (self.largs), but 2. are possibly not added to the list of options yet. - + So, when we only have a value for "--myargument" yet, a command-line argument of "--myarg=test" would set it. Responsible for this behaviour is the method @@ -384,7 +353,7 @@ class SConsOptionParser(optparse.OptionParser): be unique. This would lead to further confusion, because we might want to add another option "--myarg" later on (see issue #2929). - + """ rargs = [] largs_restore = [] @@ -401,7 +370,7 @@ class SConsOptionParser(optparse.OptionParser): if "=" in l: # Split into option and value lopt = l.split("=", 1) - + if lopt[0] in self._long_opt: # Argument is already known rargs.append('='.join(lopt)) @@ -416,7 +385,7 @@ class SConsOptionParser(optparse.OptionParser): skip = True else: rargs.append(l) - + # Parse the filtered list self.parse_args(rargs, self.values) # Restore the list of remaining arguments for the @@ -690,7 +659,7 @@ def Parser(version): metavar="TYPE") def opt_duplicate(option, opt, value, parser): - if not value in SCons.Node.FS.Valid_Duplicates: + if value not in SCons.Node.FS.Valid_Duplicates: raise OptionValueError(opt_invalid('duplication', value, SCons.Node.FS.Valid_Duplicates)) setattr(parser.values, option.dest, value) diff --git a/engine/SCons/Script/SConscript.py b/engine/SCons/Script/SConscript.py index 8377a54..9687c29 100644 --- a/engine/SCons/Script/SConscript.py +++ b/engine/SCons/Script/SConscript.py @@ -27,7 +27,7 @@ files. # 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/Script/SConscript.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Script/SConscript.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons import SCons.Action diff --git a/engine/SCons/Script/__init__.py b/engine/SCons/Script/__init__.py index d78e746..cf2e472 100644 --- a/engine/SCons/Script/__init__.py +++ b/engine/SCons/Script/__init__.py @@ -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 a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Script/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import time start_time = time.time() diff --git a/engine/SCons/Subst.py b/engine/SCons/Subst.py index 5fae669..1e0d423 100644 --- a/engine/SCons/Subst.py +++ b/engine/SCons/Subst.py @@ -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 a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Subst.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import collections import re @@ -350,7 +350,7 @@ _rm_split = re.compile(r'(?|' + r'/\*|\*/|\[\])') + class OuterState(object): """The initial state for parsing a Java file for classes, interfaces, and anonymous inner classes.""" - def __init__(self, version=default_java_version): - if not version in ('1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', - '1.8', '5', '6', '9.0', '10.0', '11.0'): + def __init__(self, version=default_java_version): + if version not in ('1.1', '1.2', '1.3', '1.4', '1.5', '1.6', '1.7', + '1.8', '5', '6', '9.0', '10.0', '11.0', '12.0'): msg = "Java version %s not supported" % version raise NotImplementedError(msg) @@ -131,15 +159,15 @@ if java_parsing: def closeBracket(self): self.brackets = self.brackets - 1 if len(self.stackBrackets) and \ - self.brackets == self.stackBrackets[-1]: + self.brackets == self.stackBrackets[-1]: self.listOutputs.append('$'.join(self.listClasses)) self.localClasses.pop() self.listClasses.pop() self.anonStacksStack.pop() self.stackBrackets.pop() if len(self.stackAnonClassBrackets) and \ - self.brackets == self.stackAnonClassBrackets[-1] and \ - self.version not in scopeStateVersions: + self.brackets == self.stackAnonClassBrackets[-1] and \ + self.version not in scopeStateVersions: self._getAnonStack().pop() self.stackAnonClassBrackets.pop() @@ -152,13 +180,13 @@ if java_parsing: self.openBracket() elif token == '}': self.closeBracket() - elif token in [ '"', "'" ]: + elif token in ['"', "'"]: return IgnoreState(token, self) elif token == "new": # anonymous inner class if len(self.listClasses) > 0: return self.__getAnonClassState() - return self.__getSkipState() # Skip the class name + return self.__getSkipState() # Skip the class name elif token in ['class', 'interface', 'enum']: if len(self.listClasses) == 0: self.nextAnon = 1 @@ -178,7 +206,7 @@ if java_parsing: if self.version in ('1.1', '1.2', '1.3', '1.4'): clazz = self.listClasses[0] self.listOutputs.append('%s$%d' % (clazz, self.nextAnon)) - elif self.version in ('1.5', '1.6', '1.7', '1.8', '5', '6', '9.0', '10.0', '11.0'): + elif self.version in ('1.5', '1.6', '1.7', '1.8', '5', '6', '9.0', '10.0', '11.0', '12.0'): self.stackAnonClassBrackets.append(self.brackets) className = [] className.extend(self.listClasses) @@ -193,11 +221,13 @@ if java_parsing: def setPackage(self, package): self.package = package + class ScopeState(object): """ A state that parses code within a scope normally, within the confines of a scope. """ + def __init__(self, old_state): self.outer_state = old_state.outer_state self.old_state = old_state @@ -259,13 +289,16 @@ if java_parsing: return self.__getSkipState() return self + class AnonClassState(object): """A state that looks for anonymous inner classes.""" + def __init__(self, old_state): # outer_state is always an instance of OuterState self.outer_state = old_state.outer_state self.old_state = old_state self.brace_level = 0 + def parseToken(self, token): # This is an anonymous class if and only if the next # non-whitespace token is a bracket. Everything between @@ -293,26 +326,32 @@ if java_parsing: if token == '{': self.outer_state.addAnonClass() if self.outer_state.version in scopeStateVersions: - return ScopeState(old_state = self.old_state).parseToken(token) + return ScopeState(old_state=self.old_state).parseToken(token) return self.old_state.parseToken(token) + class SkipState(object): """A state that will skip a specified number of tokens before reverting to the previous state.""" + def __init__(self, tokens_to_skip, old_state): self.tokens_to_skip = tokens_to_skip self.old_state = old_state + def parseToken(self, token): self.tokens_to_skip = self.tokens_to_skip - 1 if self.tokens_to_skip < 1: return self.old_state return self + class ClassState(object): """A state we go into when we hit a class or interface keyword.""" + def __init__(self, outer_state): # outer_state is always an instance of OuterState self.outer_state = outer_state + def parseToken(self, token): # the next non-whitespace token should be the name of the class if token == '\n': @@ -322,12 +361,12 @@ if java_parsing: # 'Foo$1Inner' # https://github.com/SCons/scons/issues/2087 if self.outer_state.localClasses and \ - self.outer_state.stackBrackets[-1] > \ - self.outer_state.stackBrackets[-2]+1: + self.outer_state.stackBrackets[-1] > \ + self.outer_state.stackBrackets[-2] + 1: locals = self.outer_state.localClasses[-1] try: idx = locals[token] - locals[token] = locals[token]+1 + locals[token] = locals[token] + 1 except KeyError: locals[token] = 1 token = str(locals[token]) + token @@ -336,32 +375,40 @@ if java_parsing: self.outer_state.anonStacksStack.append([0]) return self.outer_state + class IgnoreState(object): """A state that will ignore all tokens until it gets to a specified token.""" + def __init__(self, ignore_until, old_state): self.ignore_until = ignore_until self.old_state = old_state + def parseToken(self, token): if self.ignore_until == token: return self.old_state return self + class PackageState(object): """The state we enter when we encounter the package keyword. We assume the next token will be the package name.""" + def __init__(self, outer_state): # outer_state is always an instance of OuterState self.outer_state = outer_state + def parseToken(self, token): self.outer_state.setPackage(token) return self.outer_state + def parse_java_file(fn, version=default_java_version): with open(fn, 'r') as f: data = f.read() return parse_java(data, version) + def parse_java(contents, version=default_java_version, trace=None): """Parse a .java file and return a double of package directory, plus a list of .class files that compiling that .java file will @@ -395,81 +442,68 @@ else: return os.path.split(fn) - -java_win32_version_dir_glob = 'C:/Program Files*/Java/jdk%s*/bin' -java_win32_dir_glob = 'C:/Program Files*/Java/jdk*/bin' - -java_macos_include_dir = '/System/Library/Frameworks/JavaVM.framework/Headers/' -java_macos_version_include_dir = '/System/Library/Frameworks/JavaVM.framework/Versions/%s*/Headers/' - -java_linux_include_dirs = ['/usr/lib/jvm/default-java/include', - '/usr/lib/jvm/java-*/include'] -# Need to match path like below (from Centos 7) -# /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64/include/ -java_linux_version_include_dirs = ['/usr/lib/jvm/java-*-sun-%s*/include', - '/usr/lib/jvm/java-%s*-openjdk*/include', - '/usr/java/jdk%s*/include'] - - - def get_java_install_dirs(platform, version=None): """ - Using patterns above find the java jdk install dir - :param platform: + Find the java jdk installation directories. + + This list is intended to supply as "default paths" for use when looking + up actual java binaries. + + :param platform: selector for search algorithm. :param version: If specified, only look for java sdk's of this version :return: list of default paths for java. """ + paths = [] if platform == 'win32': if version: - paths = glob.glob(java_win32_version_dir_glob%version) + paths = glob.glob(java_win32_version_dir_glob % version) else: paths = glob.glob(java_win32_dir_glob) else: - # do nothing for now + # other platforms, do nothing for now pass - paths=sorted(paths) + return sorted(paths) - return paths def get_java_include_paths(env, javac, version): """ - Return java include paths - :param platform: - :param javac: - :return: + Find java include paths for JNI building. + + :param env: construction environment, used to extract platform. + :param javac: path to detected javac. + :return: list of paths. """ + paths = [] if not javac: # there are no paths if we've not detected javac. pass elif env['PLATFORM'] == 'win32': + # on Windows, we have the right path to javac, so look locally javac_bin_dir = os.path.dirname(javac) java_inc_dir = os.path.normpath(os.path.join(javac_bin_dir, '..', 'include')) paths = [java_inc_dir, os.path.join(java_inc_dir, 'win32')] elif env['PLATFORM'] == 'darwin': if not version: - paths = [java_macos_include_dir] + paths = [java_macos_include_dir_glob] else: - paths = sorted(glob.glob(java_macos_version_include_dir%version)) + paths = sorted(glob.glob(java_macos_version_include_dir_glob % version)) else: - base_paths=[] + base_paths = [] if not version: - for p in java_linux_include_dirs: + for p in java_linux_include_dirs_glob: base_paths.extend(glob.glob(p)) else: - for p in java_linux_version_include_dirs: - base_paths.extend(glob.glob(p%version)) + for p in java_linux_version_include_dirs_glob: + base_paths.extend(glob.glob(p % version)) for p in base_paths: - paths.extend([p, os.path.join(p,'linux')]) - - #print("PATHS:%s"%paths) - return paths - - + paths.extend([p, os.path.join(p, 'linux')]) + # print("PATHS:%s"%paths) + return paths # Local Variables: # tab-width:4 diff --git a/engine/SCons/Tool/MSCommon/__init__.py b/engine/SCons/Tool/MSCommon/__init__.py index 2fb9c99..e3c4471 100644 --- a/engine/SCons/Tool/MSCommon/__init__.py +++ b/engine/SCons/Tool/MSCommon/__init__.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __doc__ = """ Common functions for Microsoft Visual Studio and Visual C/C++. diff --git a/engine/SCons/Tool/MSCommon/arch.py b/engine/SCons/Tool/MSCommon/arch.py index 12ff1f9..6312541 100644 --- a/engine/SCons/Tool/MSCommon/arch.py +++ b/engine/SCons/Tool/MSCommon/arch.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __doc__ = """Module to define supported Windows chip architectures. """ diff --git a/engine/SCons/Tool/MSCommon/common.py b/engine/SCons/Tool/MSCommon/common.py index 041c394..8353944 100644 --- a/engine/SCons/Tool/MSCommon/common.py +++ b/engine/SCons/Tool/MSCommon/common.py @@ -25,7 +25,7 @@ Common helper functions for working with the Microsoft tool chain. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/MSCommon/common.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/common.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import copy import os @@ -34,7 +34,6 @@ import re import SCons.Util - LOGFILE = os.environ.get('SCONS_MSCOMMON_DEBUG') if LOGFILE == '-': def debug(message): @@ -117,7 +116,7 @@ def normalize_env(env, keys, force=False): normenv[k] = copy.deepcopy(env[k]) for k in keys: - if k in os.environ and (force or not k in normenv): + if k in os.environ and (force or k not in normenv): normenv[k] = os.environ[k] # This shouldn't be necessary, since the default environment should include system32, diff --git a/engine/SCons/Tool/MSCommon/netframework.py b/engine/SCons/Tool/MSCommon/netframework.py index a32a05d..edd9fd9 100644 --- a/engine/SCons/Tool/MSCommon/netframework.py +++ b/engine/SCons/Tool/MSCommon/netframework.py @@ -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/Tool/MSCommon/netframework.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __doc__ = """ """ @@ -68,7 +68,7 @@ def query_versions(): # sequence comparison in python is lexicographical # which is exactly what we want. # Note we sort backwards so the highest version is first. - return cmp(bbl,aal) + return (aal > bbl) - (aal < bbl) versions.sort(versrt) else: diff --git a/engine/SCons/Tool/MSCommon/sdk.py b/engine/SCons/Tool/MSCommon/sdk.py index aa89f2a..e664a30 100644 --- a/engine/SCons/Tool/MSCommon/sdk.py +++ b/engine/SCons/Tool/MSCommon/sdk.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __doc__ = """Module to detect the Platform/Windows SDK diff --git a/engine/SCons/Tool/MSCommon/vc.py b/engine/SCons/Tool/MSCommon/vc.py index 1f1332e..fa7be96 100644 --- a/engine/SCons/Tool/MSCommon/vc.py +++ b/engine/SCons/Tool/MSCommon/vc.py @@ -30,7 +30,7 @@ # * test on 64 bits XP + VS 2005 (and VS 6 if possible) # * SDK # * Assembly -__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __doc__ = """Module for Visual C/C++ detection and configuration. """ @@ -60,7 +60,10 @@ class VisualCException(Exception): class UnsupportedVersion(VisualCException): pass -class UnsupportedArch(VisualCException): +class MSVCUnsupportedHostArch(VisualCException): + pass + +class MSVCUnsupportedTargetArch(VisualCException): pass class MissingConfiguration(VisualCException): @@ -89,17 +92,15 @@ _ARCH_TO_CANONICAL = { "aarch64" : "arm64", } -# get path to the cl.exe dir for newer VS versions -# based off a tuple of (host, target) platforms _HOST_TARGET_TO_CL_DIR_GREATER_THAN_14 = { - ("amd64","amd64") : "Hostx64\\x64", - ("amd64","x86") : "Hostx64\\x86", - ("amd64","arm") : "Hostx64\\arm", - ("amd64","arm64") : "Hostx64\\arm64", - ("x86","amd64") : "Hostx86\\x64", - ("x86","x86") : "Hostx86\\x86", - ("x86","arm") : "Hostx86\\arm", - ("x86","arm64") : "Hostx86\\arm64", + ("amd64","amd64") : ("Hostx64","x64"), + ("amd64","x86") : ("Hostx64","x86"), + ("amd64","arm") : ("Hostx64","arm"), + ("amd64","arm64") : ("Hostx64","arm64"), + ("x86","amd64") : ("Hostx86","x64"), + ("x86","x86") : ("Hostx86","x86"), + ("x86","arm") : ("Hostx86","arm"), + ("x86","arm64") : ("Hostx86","arm64"), } # get path to the cl.exe dir for older VS versions @@ -174,25 +175,33 @@ def get_host_target(env): try: host = _ARCH_TO_CANONICAL[host_platform.lower()] - except KeyError as e: + except KeyError: msg = "Unrecognized host architecture %s" - raise ValueError(msg % repr(host_platform)) + raise MSVCUnsupportedHostArch(msg % repr(host_platform)) try: target = _ARCH_TO_CANONICAL[target_platform.lower()] - except KeyError as e: + except KeyError: all_archs = str(list(_ARCH_TO_CANONICAL.keys())) - raise ValueError("Unrecognized target architecture %s\n\tValid architectures: %s" % (target_platform, all_archs)) + raise MSVCUnsupportedTargetArch("Unrecognized target architecture %s\n\tValid architectures: %s" % (target_platform, all_archs)) return (host, target,req_target_platform) # If you update this, update SupportedVSList in Tool/MSCommon/vs.py, and the # MSVC_VERSION documentation in Tool/msvc.xml. -_VCVER = ["14.1", "14.0", "14.0Exp", "12.0", "12.0Exp", "11.0", "11.0Exp", "10.0", "10.0Exp", "9.0", "9.0Exp","8.0", "8.0Exp","7.1", "7.0", "6.0"] +_VCVER = ["14.2", "14.1", "14.0", "14.0Exp", "12.0", "12.0Exp", "11.0", "11.0Exp", "10.0", "10.0Exp", "9.0", "9.0Exp","8.0", "8.0Exp","7.1", "7.0", "6.0"] + +# if using vswhere, a further mapping is needed +_VCVER_TO_VSWHERE_VER = { + '14.2' : '[16.0, 17.0)', + '14.1' : '[15.0, 16.0)', +} _VCVER_TO_PRODUCT_DIR = { + '14.2' : [ + (SCons.Util.HKEY_LOCAL_MACHINE, r'')], # VS 2019 doesn't set this key '14.1' : [ - (SCons.Util.HKEY_LOCAL_MACHINE, r'')], # Visual Studio 2017 doesn't set this registry key anymore + (SCons.Util.HKEY_LOCAL_MACHINE, r'')], # VS 2017 doesn't set this key '14.0' : [ (SCons.Util.HKEY_LOCAL_MACHINE, r'Microsoft\VisualStudio\14.0\Setup\VC\ProductDir')], '14.0Exp' : [ @@ -253,42 +262,40 @@ def msvc_version_to_maj_min(msvc_version): raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric)) def is_host_target_supported(host_target, msvc_version): - """Check if the given (host, target) tuple is supported for given version. + """Check if (host, target) pair is supported for a VC version. - Args: - host_target: tuple - tuple of (canonalized) host-targets, e.g. ("x86", "amd64") - for cross compilation from 32 bit Windows to 64 bits. - msvc_version: str - msvc version (major.minor, e.g. 10.0) - - Returns: - bool: - - Note: - This only checks whether a given version *may* support the given (host, + :note: only checks whether a given version *may* support the given (host, target), not that the toolchain is actually present on the machine. + :param tuple host_target: canonalized host-targets pair, e.g. + ("x86", "amd64") for cross compilation from 32 bit Windows to 64 bits. + :param str msvc_version: Visual C++ version (major.minor), e.g. "10.0" + :returns: True or False """ # We assume that any Visual Studio version supports x86 as a target if host_target[1] != "x86": maj, min = msvc_version_to_maj_min(msvc_version) if maj < 8: return False - return True def find_vc_pdir_vswhere(msvc_version): """ - Find the MSVC product directory using vswhere.exe. + Find the MSVC product directory using the vswhere program. - Run it asking for specified version and get MSVS install location - :param msvc_version: + :param msvc_version: MSVC version to search for :return: MSVC install dir or None + :raises UnsupportedVersion: if the version is not known by this file """ + try: + vswhere_version = _VCVER_TO_VSWHERE_VER[msvc_version] + except KeyError: + debug("Unknown version of MSVC: %s" % msvc_version) + raise UnsupportedVersion("Unknown version %s" % msvc_version) + # For bug 3333 - support default location of vswhere for both 64 and 32 bit windows - # installs. + # installs. for pf in ['Program Files (x86)', 'Program Files']: vswhere_path = os.path.join( 'C:\\', @@ -300,31 +307,36 @@ def find_vc_pdir_vswhere(msvc_version): if os.path.exists(vswhere_path): # If we found vswhere, then use it. break + else: + # No vswhere on system, no install info available + return None - vswhere_cmd = [vswhere_path, '-products', '*', '-version', msvc_version, '-property', 'installationPath'] - - if os.path.exists(vswhere_path): - #TODO PY27 cannot use Popen as context manager - # try putting it back to the old way for now - sp = subprocess.Popen(vswhere_cmd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - vsdir, err = sp.communicate() - if vsdir: - vsdir = vsdir.decode("mbcs").splitlines() - # vswhere could easily return multiple lines - # we could define a way to pick the one we prefer, but since - # this data is currently only used to make a check for existence, - # returning the first hit should be good enough for now. - vc_pdir = os.path.join(vsdir[0], 'VC') - return vc_pdir + vswhere_cmd = [vswhere_path, + '-products', '*', + '-version', vswhere_version, + '-property', 'installationPath'] + + #TODO PY27 cannot use Popen as context manager + # try putting it back to the old way for now + sp = subprocess.Popen(vswhere_cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + vsdir, err = sp.communicate() + if vsdir: + vsdir = vsdir.decode("mbcs").splitlines() + # vswhere could easily return multiple lines + # we could define a way to pick the one we prefer, but since + # this data is currently only used to make a check for existence, + # returning the first hit should be good enough for now. + vc_pdir = os.path.join(vsdir[0], 'VC') + return vc_pdir else: # No vswhere on system, no install info available return None def find_vc_pdir(msvc_version): - """Find the product directory for the given version. + """Find the MSVC product directory for the given version. Tries to look up the path using a registry key from the table _VCVER_TO_PRODUCT_DIR; if there is no key, calls find_vc_pdir_wshere @@ -425,6 +437,8 @@ def find_batch_file(env,msvc_version,host_arch,target_arch): __INSTALLED_VCS_RUN = None +_VC_TOOLS_VERSION_FILE_PATH = ['Auxiliary', 'Build', 'Microsoft.VCToolsVersion.default.txt'] +_VC_TOOLS_VERSION_FILE = os.sep.join(_VC_TOOLS_VERSION_FILE_PATH) def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): """Find the cl.exe on the filesystem in the vc_dir depending on @@ -459,7 +473,7 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): host_platform = _ARCH_TO_CANONICAL[host_platform] target_platform = _ARCH_TO_CANONICAL[target_platform] - debug('_check_cl_exists_in_vc_dir(): host platform %s, target platform %s' % (host_platform, target_platform)) + debug('_check_cl_exists_in_vc_dir(): host platform %s, target platform %s for version %s' % (host_platform, target_platform, msvc_version)) ver_num = float(get_msvc_version_numeric(msvc_version)) @@ -468,7 +482,7 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): # 2017 and newer allowed multiple versions of the VC toolset to be installed at the same time. # Just get the default tool version for now #TODO: support setting a specific minor VC version - default_toolset_file = os.path.join(vc_dir, r'Auxiliary\Build\Microsoft.VCToolsVersion.default.txt') + default_toolset_file = os.path.join(vc_dir, _VC_TOOLS_VERSION_FILE) try: with open(default_toolset_file) as f: vc_specific_version = f.readlines()[0].strip() @@ -480,11 +494,11 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): return False host_trgt_dir = _HOST_TARGET_TO_CL_DIR_GREATER_THAN_14.get((host_platform, target_platform), None) - if not host_trgt_dir: - debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo') + if host_trgt_dir is None: + debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo: (%s,%s)'%(host_platform, target_platform)) return False - cl_path = os.path.join(vc_dir, r'Tools\MSVC', vc_specific_version, 'bin', host_trgt_dir, _CL_EXE_NAME) + cl_path = os.path.join(vc_dir, 'Tools','MSVC', vc_specific_version, 'bin', host_trgt_dir[0], host_trgt_dir[1], _CL_EXE_NAME) debug('_check_cl_exists_in_vc_dir(): checking for ' + _CL_EXE_NAME + ' at ' + cl_path) if os.path.exists(cl_path): debug('_check_cl_exists_in_vc_dir(): found ' + _CL_EXE_NAME + '!') @@ -492,8 +506,10 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): elif ver_num <= 14 and ver_num >= 8: + # Set default value to be -1 as "" which is the value for x86/x86 yields true when tested + # if not host_trgt_dir host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get((host_platform, target_platform), None) - if not host_trgt_dir: + if host_trgt_dir is None: debug('_check_cl_exists_in_vc_dir(): unsupported host/target platform combo') return False @@ -505,8 +521,11 @@ def _check_cl_exists_in_vc_dir(env, vc_dir, msvc_version): # older versions of visual studio only had x86 binaries, # so if the host platform is amd64, we need to check cross # compile options (x86 binary compiles some other target on a 64 bit os) + + # Set default value to be -1 as "" which is the value for x86/x86 yields true when tested + # if not host_trgt_dir host_trgt_dir = _HOST_TARGET_TO_CL_DIR.get(('x86', target_platform), None) - if not host_trgt_dir: + if host_trgt_dir is None: return False cl_path = os.path.join(vc_dir, 'bin', host_trgt_dir, _CL_EXE_NAME) @@ -554,6 +573,10 @@ def get_installed_vcs(env=None): debug('find_vc_pdir no compiler found %s' % ver) else: debug('find_vc_pdir return None for ver %s' % ver) + except (MSVCUnsupportedTargetArch, MSVCUnsupportedHostArch): + # Allow this exception to propagate further as it should cause + # SCons to exit with an error code + raise except VisualCException as e: debug('did not find VC %s: caught exception %s' % (ver, str(e))) return installed_versions diff --git a/engine/SCons/Tool/MSCommon/vs.py b/engine/SCons/Tool/MSCommon/vs.py index f7f3de2..731f328 100644 --- a/engine/SCons/Tool/MSCommon/vs.py +++ b/engine/SCons/Tool/MSCommon/vs.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __doc__ = """Module to detect Visual Studio and/or Visual C/C++ """ @@ -198,6 +198,17 @@ class VisualStudio(object): # Tool/MSCommon/vc.py, and the MSVC_VERSION documentation in Tool/msvc.xml. SupportedVSList = [ + # Visual Studio 2019 + VisualStudio('14.2', + vc_version='14.2', + sdk_version='10.0A', + hkeys=[], + common_tools_var='VS160COMNTOOLS', + executable_path=r'Common7\IDE\devenv.com', + batch_file_path=r'VC\Auxiliary\Build\vsvars32.bat', + supported_arch=['x86', 'amd64', "arm"], + ), + # Visual Studio 2017 VisualStudio('14.1', vc_version='14.1', @@ -520,7 +531,7 @@ def get_default_arch(env): if not msvs: arch = 'x86' - elif not arch in msvs.get_supported_arch(): + elif arch not in msvs.get_supported_arch(): fmt = "Visual Studio version %s does not support architecture %s" raise SCons.Errors.UserError(fmt % (env['MSVS_VERSION'], arch)) diff --git a/engine/SCons/Tool/PharLapCommon.py b/engine/SCons/Tool/PharLapCommon.py index b78dc2a..623f2a8 100644 --- a/engine/SCons/Tool/PharLapCommon.py +++ b/engine/SCons/Tool/PharLapCommon.py @@ -29,7 +29,7 @@ Phar Lap ETS tool chain. Right now, this is linkloc and # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/PharLapCommon.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/PharLapCommon.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import os.path @@ -79,7 +79,8 @@ def getPharLapVersion(): include_path = os.path.join(getPharLapPath(), os.path.normpath("include/embkern.h")) if not os.path.exists(include_path): raise SCons.Errors.UserError("Cannot find embkern.h in ETS include directory.\nIs Phar Lap ETS installed properly?") - mo = REGEX_ETS_VER.search(open(include_path, 'r').read()) + with open(include_path, 'r') as f: + mo = REGEX_ETS_VER.search(f.read()) if mo: return int(mo.group(1)) # Default return for Phar Lap 9.1 diff --git a/engine/SCons/Tool/__init__.py b/engine/SCons/Tool/__init__.py index fcd9bca..271f214 100644 --- a/engine/SCons/Tool/__init__.py +++ b/engine/SCons/Tool/__init__.py @@ -35,10 +35,8 @@ tool definition. # 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/Tool/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" -import imp -import importlib import sys import re import os @@ -53,7 +51,12 @@ import SCons.Scanner.D import SCons.Scanner.LaTeX import SCons.Scanner.Prog import SCons.Scanner.SWIG -import collections +try: + # Python 3 + from collections.abc import Callable +except ImportError: + # Python 2.7 + from collections import Callable DefaultToolpath = [] @@ -106,7 +109,9 @@ TOOL_ALIASES = { class Tool(object): - def __init__(self, name, toolpath=[], **kw): + def __init__(self, name, toolpath=None, **kw): + if toolpath is None: + toolpath = [] # Rename if there's a TOOL_ALIAS for this tool self.name = TOOL_ALIASES.get(name, name) @@ -121,6 +126,8 @@ class Tool(object): self.options = module.options def _load_dotted_module_py2(self, short_name, full_name, searchpaths=None): + import imp + splitname = short_name.split('.') index = 0 srchpths = searchpaths @@ -149,7 +156,7 @@ class Tool(object): except ImportError as e: splitname = self.name.split('.') if str(e) != "No module named %s" % splitname[0]: - raise SCons.Errors.EnvironmentError(e) + raise SCons.Errors.SConsEnvironmentError(e) try: import zipimport except ImportError: @@ -211,13 +218,13 @@ class Tool(object): if spec is None: error_string = "No module named %s" % self.name - raise SCons.Errors.EnvironmentError(error_string) + raise SCons.Errors.SConsEnvironmentError(error_string) module = importlib.util.module_from_spec(spec) if module is None: if debug: print("MODULE IS NONE:%s" % self.name) error_string = "No module named %s" % self.name - raise SCons.Errors.EnvironmentError(error_string) + raise SCons.Errors.SConsEnvironmentError(error_string) # Don't reload a tool we already loaded. sys_modules_value = sys.modules.get(found_name, False) @@ -258,7 +265,7 @@ class Tool(object): return module except ImportError as e: if str(e) != "No module named %s" % self.name: - raise SCons.Errors.EnvironmentError(e) + raise SCons.Errors.SConsEnvironmentError(e) try: import zipimport importer = zipimport.zipimporter(sys.modules['SCons.Tool'].__path__[0]) @@ -267,10 +274,10 @@ class Tool(object): return module except ImportError as e: m = "No tool named '%s': %s" % (self.name, e) - raise SCons.Errors.EnvironmentError(m) + raise SCons.Errors.SConsEnvironmentError(m) except ImportError as e: m = "No tool named '%s': %s" % (self.name, e) - raise SCons.Errors.EnvironmentError(m) + raise SCons.Errors.SConsEnvironmentError(m) def __call__(self, env, *args, **kw): if self.init_kw is not None: @@ -376,7 +383,7 @@ def _call_linker_cb(env, callback, args, result=None): if Verbose: print('_call_linker_cb: env["LINKCALLBACKS"][%r] found' % callback) print('_call_linker_cb: env["LINKCALLBACKS"][%r]=%r' % (callback, cbfun)) - if isinstance(cbfun, collections.Callable): + if isinstance(cbfun, Callable): if Verbose: print('_call_linker_cb: env["LINKCALLBACKS"][%r] is callable' % callback) result = cbfun(env, *args) @@ -394,7 +401,8 @@ def _call_env_subst(env, string, *args, **kw): class _ShLibInfoSupport(object): - def get_libtype(self): + @property + def libtype(self): return 'ShLib' def get_lib_prefix(self, env, *args, **kw): @@ -411,7 +419,8 @@ class _ShLibInfoSupport(object): class _LdModInfoSupport(object): - def get_libtype(self): + @property + def libtype(self): return 'LdMod' def get_lib_prefix(self, env, *args, **kw): @@ -428,7 +437,8 @@ class _LdModInfoSupport(object): class _ImpLibInfoSupport(object): - def get_libtype(self): + @property + def libtype(self): return 'ImpLib' def get_lib_prefix(self, env, *args, **kw): @@ -480,25 +490,21 @@ class _LibInfoGeneratorBase(object): 'ImpLib': _ImpLibInfoSupport} def __init__(self, libtype, infoname): - self.set_libtype(libtype) - self.set_infoname(infoname) + self.libtype = libtype + self.infoname = infoname + + @property + def libtype(self): + return self._support.libtype - def set_libtype(self, libtype): + @libtype.setter + def libtype(self, libtype): try: support_class = self._support_classes[libtype] except KeyError: raise ValueError('unsupported libtype %r' % libtype) self._support = support_class() - def get_libtype(self): - return self._support.get_libtype() - - def set_infoname(self, infoname): - self.infoname = infoname - - def get_infoname(self): - return self.infoname - def get_lib_prefix(self, env, *args, **kw): return self._support.get_lib_prefix(env, *args, **kw) @@ -518,9 +524,8 @@ class _LibInfoGeneratorBase(object): try: libtype = kw['generator_libtype'] except KeyError: - libtype = self.get_libtype() - infoname = self.get_infoname() - return 'Versioned%s%s' % (libtype, infoname) + libtype = self.libtype + return 'Versioned%s%s' % (libtype, self.infoname) def generate_versioned_lib_info(self, env, args, result=None, **kw): callback = self.get_versioned_lib_info_generator(**kw) @@ -730,7 +735,7 @@ class _LibSonameGenerator(_LibInfoGeneratorBase): if not soname: # fallback to library name (as returned by appropriate _LibNameGenerator) - soname = _LibNameGenerator(self.get_libtype())(env, libnode) + soname = _LibNameGenerator(self.libtype)(env, libnode) if Verbose: print("_LibSonameGenerator: FALLBACK: soname=%r" % soname) @@ -1316,30 +1321,35 @@ def tool_list(platform, env): return [x for x in tools if x] -def find_program_path(env, key_program, default_paths=[]): +def find_program_path(env, key_program, default_paths=None): """ - Find the location of key_program and then return the path it was located at. - Checking the default install locations. - Mainly for windows where tools aren't all installed in /usr/bin,etc - :param env: Current Environment() - :param key_program: Program we're using to locate the directory to add to PATH. + Find the location of a tool using various means. + + Mainly for windows where tools aren't all installed in /usr/bin, etc. + + :param env: Current Construction Environment. + :param key_program: Tool to locate. + :param default_paths: List of additional paths this tool might be found in. """ # First search in the SCons path path = env.WhereIs(key_program) - if (path): + if path: return path - # then the OS path: + + # Then in the OS path path = SCons.Util.WhereIs(key_program) - if (path): + if path: return path - # If that doesn't work try default location for mingw + # Finally, add the defaults and check again. Do not change + # ['ENV']['PATH'] permananetly, the caller can do that if needed. + if default_paths is None: + return path save_path = env['ENV']['PATH'] for p in default_paths: env.AppendENVPath('PATH', p) path = env.WhereIs(key_program) - if not path: - env['ENV']['PATH'] = save_path + env['ENV']['PATH'] = save_path return path # Local Variables: diff --git a/engine/SCons/Tool/aixc++.py b/engine/SCons/Tool/aixc++.py index 5ededea..bafaea4 100644 --- a/engine/SCons/Tool/aixc++.py +++ b/engine/SCons/Tool/aixc++.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixc++.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/aixc++.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" #forward proxy to the preffered cxx version from SCons.Tool.aixcxx import * diff --git a/engine/SCons/Tool/aixcc.py b/engine/SCons/Tool/aixcc.py index d58184b..349a40a 100644 --- a/engine/SCons/Tool/aixcc.py +++ b/engine/SCons/Tool/aixcc.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixcc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/aixcc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path diff --git a/engine/SCons/Tool/aixcxx.py b/engine/SCons/Tool/aixcxx.py index c568366..0830e33 100644 --- a/engine/SCons/Tool/aixcxx.py +++ b/engine/SCons/Tool/aixcxx.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixcxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/aixcxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path diff --git a/engine/SCons/Tool/aixf77.py b/engine/SCons/Tool/aixf77.py index 54f196f..d2c619a 100644 --- a/engine/SCons/Tool/aixf77.py +++ b/engine/SCons/Tool/aixf77.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixf77.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/aixf77.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path diff --git a/engine/SCons/Tool/aixlink.py b/engine/SCons/Tool/aixlink.py index 0d808be..ea2949f 100644 --- a/engine/SCons/Tool/aixlink.py +++ b/engine/SCons/Tool/aixlink.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixlink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/aixlink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/applelink.py b/engine/SCons/Tool/applelink.py index dfb9d9d..011b29d 100644 --- a/engine/SCons/Tool/applelink.py +++ b/engine/SCons/Tool/applelink.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/applelink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/applelink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/ar.py b/engine/SCons/Tool/ar.py index aee2426..459fb55 100644 --- a/engine/SCons/Tool/ar.py +++ b/engine/SCons/Tool/ar.py @@ -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 a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/ar.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/as.py b/engine/SCons/Tool/as.py index e0d0239..02139c5 100644 --- a/engine/SCons/Tool/as.py +++ b/engine/SCons/Tool/as.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/as.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/as.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/bcc32.py b/engine/SCons/Tool/bcc32.py index 17cd4fc..e8ffbbf 100644 --- a/engine/SCons/Tool/bcc32.py +++ b/engine/SCons/Tool/bcc32.py @@ -27,7 +27,7 @@ XXX # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/bcc32.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/bcc32.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/c++.py b/engine/SCons/Tool/c++.py index bdd067c..8819f82 100644 --- a/engine/SCons/Tool/c++.py +++ b/engine/SCons/Tool/c++.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/c++.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/c++.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" #forward proxy to the preffered cxx version diff --git a/engine/SCons/Tool/cc.py b/engine/SCons/Tool/cc.py index e00df46..698d725 100644 --- a/engine/SCons/Tool/cc.py +++ b/engine/SCons/Tool/cc.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/cc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/cc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Tool import SCons.Defaults diff --git a/engine/SCons/Tool/clang.py b/engine/SCons/Tool/clang.py index 83311eb..f48afbf 100644 --- a/engine/SCons/Tool/clang.py +++ b/engine/SCons/Tool/clang.py @@ -33,7 +33,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# __revision__ = "src/engine/SCons/Tool/clang.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +# __revision__ = "src/engine/SCons/Tool/clang.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" # Based on SCons/Tool/gcc.py by Paweł Tomulik 2014 as a separate tool. # Brought into the SCons mainline by Russel Winder 2017. @@ -77,7 +77,8 @@ def generate(env): stdout=subprocess.PIPE) if pipe.wait() != 0: return # clang -dumpversion is of no use - line = pipe.stdout.readline() + with pipe.stdout: + line = pipe.stdout.readline() if sys.version_info[0] > 2: line = line.decode() match = re.search(r'clang +version +([0-9]+(?:\.[0-9]+)+)', line) diff --git a/engine/SCons/Tool/clangxx.py b/engine/SCons/Tool/clangxx.py index 6e4199e..d88874e 100644 --- a/engine/SCons/Tool/clangxx.py +++ b/engine/SCons/Tool/clangxx.py @@ -33,7 +33,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# __revision__ = "src/engine/SCons/Tool/clangxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +# __revision__ = "src/engine/SCons/Tool/clangxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" # Based on SCons/Tool/g++.py by Paweł Tomulik 2014 as a separate tool. # Brought into the SCons mainline by Russel Winder 2017. @@ -85,7 +85,8 @@ def generate(env): return # clang -dumpversion is of no use - line = pipe.stdout.readline() + with pipe.stdout: + line = pipe.stdout.readline() if sys.version_info[0] > 2: line = line.decode() match = re.search(r'clang +version +([0-9]+(?:\.[0-9]+)+)', line) diff --git a/engine/SCons/Tool/cvf.py b/engine/SCons/Tool/cvf.py index dde3a3e..aa24d69 100644 --- a/engine/SCons/Tool/cvf.py +++ b/engine/SCons/Tool/cvf.py @@ -27,7 +27,7 @@ Tool-specific initialization for the Compaq Visual Fortran compiler. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/cvf.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/cvf.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import fortran diff --git a/engine/SCons/Tool/cxx.py b/engine/SCons/Tool/cxx.py index 85fb2fb..2ac278e 100644 --- a/engine/SCons/Tool/cxx.py +++ b/engine/SCons/Tool/cxx.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/cxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/cxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path diff --git a/engine/SCons/Tool/cyglink.py b/engine/SCons/Tool/cyglink.py index f69b886..c3d78de 100644 --- a/engine/SCons/Tool/cyglink.py +++ b/engine/SCons/Tool/cyglink.py @@ -133,7 +133,7 @@ def _versioned_lib_suffix(env, suffix, version): if Verbose: print("_versioned_lib_suffix: suffix= ", suffix) print("_versioned_lib_suffix: version= ", version) - cygversion = re.sub('\.', '-', version) + cygversion = re.sub(r'\.', '-', version) if not suffix.startswith('-' + cygversion): suffix = '-' + cygversion + suffix if Verbose: diff --git a/engine/SCons/Tool/default.py b/engine/SCons/Tool/default.py index 928e365..866b823 100644 --- a/engine/SCons/Tool/default.py +++ b/engine/SCons/Tool/default.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/default.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/default.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Tool diff --git a/engine/SCons/Tool/dmd.py b/engine/SCons/Tool/dmd.py index d9bed9c..befcd22 100644 --- a/engine/SCons/Tool/dmd.py +++ b/engine/SCons/Tool/dmd.py @@ -53,7 +53,7 @@ Lib tool variables: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/dmd.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/dmd.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import subprocess diff --git a/engine/SCons/Tool/docbook/__init__.py b/engine/SCons/Tool/docbook/__init__.py index d7d10c0..147556d 100644 --- a/engine/SCons/Tool/docbook/__init__.py +++ b/engine/SCons/Tool/docbook/__init__.py @@ -84,7 +84,7 @@ def __extend_targets_sources(target, source): source = [source] if len(target) < len(source): target.extend(source[len(target):]) - + return target, source def __init_xsl_stylesheet(kw, env, user_xsl_var, default_path): @@ -94,12 +94,12 @@ def __init_xsl_stylesheet(kw, env, user_xsl_var, default_path): path_args = [scriptpath, db_xsl_folder] + default_path xsl_style = os.path.join(*path_args) kw['DOCBOOK_XSL'] = xsl_style - + def __select_builder(lxml_builder, libxml2_builder, cmdline_builder): """ Selects a builder, based on which Python modules are present. """ if prefer_xsltproc: return cmdline_builder - + if not has_libxml2: # At the moment we prefer libxml2 over lxml, the latter can lead # to conflicts when installed together with libxml2. @@ -115,7 +115,7 @@ def __ensure_suffix(t, suffix): tpath = str(t) if not tpath.endswith(suffix): return tpath+suffix - + return t def __ensure_suffix_stem(t, suffix): @@ -124,11 +124,11 @@ def __ensure_suffix_stem(t, suffix): if not tpath.endswith(suffix): stem = tpath tpath += suffix - + return tpath, stem else: stem, ext = os.path.splitext(tpath) - + return t, stem def __get_xml_text(root): @@ -151,7 +151,7 @@ def __create_output_dir(base_dir): else: if base_dir.endswith('/'): dir = base_dir - + if dir and not os.path.isdir(dir): os.makedirs(dir) @@ -203,10 +203,10 @@ def _detect(env): the requested output formats. """ global prefer_xsltproc - + if env.get('DOCBOOK_PREFER_XSLTPROC',''): prefer_xsltproc = True - + if ((not has_libxml2 and not has_lxml) or (prefer_xsltproc)): # Try to find the XSLT processors __detect_cl_tool(env, 'DOCBOOK_XSLTPROC', xsltproc_com, xsltproc_com_priority) @@ -219,15 +219,15 @@ def _detect(env): # include_re = re.compile('fileref\\s*=\\s*["|\']([^\\n]*)["|\']') sentity_re = re.compile('') - + def __xml_scan(node, env, path, arg): """ Simple XML file scanner, detecting local images and XIncludes as implicit dependencies. """ # Does the node exist yet? if not os.path.isfile(str(node)): return [] - + if env.get('DOCBOOK_SCANENT',''): - # Use simple pattern matching for system entities..., no support + # Use simple pattern matching for system entities..., no support # for recursion yet. contents = node.get_text_contents() return sentity_re.findall(contents) @@ -235,9 +235,9 @@ def __xml_scan(node, env, path, arg): xsl_file = os.path.join(scriptpath,'utils','xmldepend.xsl') if not has_libxml2 or prefer_xsltproc: if has_lxml and not prefer_xsltproc: - + from lxml import etree - + xsl_tree = etree.parse(xsl_file) doc = etree.parse(str(node)) result = doc.xslt(xsl_tree) @@ -266,7 +266,7 @@ def __xml_scan(node, env, path, arg): for x in str(result).splitlines(): if x.strip() != "" and not x.startswith(" 1: env.Clean(outfiles[0], outfiles[1:]) - + return result def DocbookSlidesPdf(env, target, source=None, *args, **kw): @@ -750,7 +746,7 @@ def DocbookSlidesPdf(env, target, source=None, *args, **kw): for t,s in zip(target,source): t, stem = __ensure_suffix_stem(t, '.pdf') xsl = __builder.__call__(env, stem+'.fo', s, **kw) - env.Depends(xsl, kw['DOCBOOK_XSL']) + env.Depends(xsl, kw['DOCBOOK_XSL']) result.extend(xsl) result.extend(__fop_builder.__call__(env, t, xsl, **kw)) @@ -767,7 +763,7 @@ def DocbookSlidesHtml(env, target, source=None, *args, **kw): source = target target = ['index.html'] elif not SCons.Util.is_List(source): - source = [source] + source = [source] # Init XSL stylesheet __init_xsl_stylesheet(kw, env, '$DOCBOOK_DEFAULT_XSL_SLIDESHTML', ['slides','html','plain.xsl']) @@ -800,12 +796,12 @@ def DocbookXInclude(env, target, source, *args, **kw): # Setup builder __builder = __select_builder(__xinclude_lxml_builder,__xinclude_libxml2_builder,__xmllint_builder) - + # Create targets result = [] for t,s in zip(target,source): result.extend(__builder.__call__(env, t, s, **kw)) - + return result def DocbookXslt(env, target, source=None, *args, **kw): @@ -814,13 +810,13 @@ def DocbookXslt(env, target, source=None, *args, **kw): """ # Init list of targets/sources target, source = __extend_targets_sources(target, source) - + # Init XSL stylesheet kw['DOCBOOK_XSL'] = kw.get('xsl', 'transform.xsl') # Setup builder __builder = __select_builder(__lxml_builder, __libxml2_builder, __xsltproc_builder) - + # Create targets result = [] for t,s in zip(target,source): @@ -844,18 +840,18 @@ def generate(env): DOCBOOK_DEFAULT_XSL_MAN = '', DOCBOOK_DEFAULT_XSL_SLIDESPDF = '', DOCBOOK_DEFAULT_XSL_SLIDESHTML = '', - + # Paths to the detected executables DOCBOOK_XSLTPROC = '', DOCBOOK_XMLLINT = '', DOCBOOK_FOP = '', - + # Additional flags for the text processors DOCBOOK_XSLTPROCFLAGS = SCons.Util.CLVar(''), DOCBOOK_XMLLINTFLAGS = SCons.Util.CLVar(''), DOCBOOK_FOPFLAGS = SCons.Util.CLVar(''), DOCBOOK_XSLTPROCPARAMS = SCons.Util.CLVar(''), - + # Default command lines for the detected executables DOCBOOK_XSLTPROCCOM = xsltproc_com['xsltproc'], DOCBOOK_XMLLINTCOM = xmllint_com['xmllint'], @@ -865,7 +861,7 @@ def generate(env): DOCBOOK_XSLTPROCCOMSTR = None, DOCBOOK_XMLLINTCOMSTR = None, DOCBOOK_FOPCOMSTR = None, - + ) _detect(env) diff --git a/engine/SCons/Tool/dvi.py b/engine/SCons/Tool/dvi.py index 7fbca27..5cd85ed 100644 --- a/engine/SCons/Tool/dvi.py +++ b/engine/SCons/Tool/dvi.py @@ -27,7 +27,7 @@ Common DVI Builder definition for various other Tool modules that use it. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/dvi.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/dvi.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Builder import SCons.Tool diff --git a/engine/SCons/Tool/dvipdf.py b/engine/SCons/Tool/dvipdf.py index 340929e..32f57e6 100644 --- a/engine/SCons/Tool/dvipdf.py +++ b/engine/SCons/Tool/dvipdf.py @@ -30,7 +30,7 @@ selection method. # 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/Tool/dvipdf.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/dvipdf.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Action import SCons.Defaults diff --git a/engine/SCons/Tool/dvips.py b/engine/SCons/Tool/dvips.py index 16d409d..988ecd3 100644 --- a/engine/SCons/Tool/dvips.py +++ b/engine/SCons/Tool/dvips.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/dvips.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/dvips.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/f03.py b/engine/SCons/Tool/f03.py index dddc650..541ec88 100644 --- a/engine/SCons/Tool/f03.py +++ b/engine/SCons/Tool/f03.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f03.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/f03.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/f08.py b/engine/SCons/Tool/f08.py index c5209e4..5dc49da 100644 --- a/engine/SCons/Tool/f08.py +++ b/engine/SCons/Tool/f08.py @@ -33,7 +33,7 @@ from __future__ import absolute_import # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f08.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/f08.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/f77.py b/engine/SCons/Tool/f77.py index 2665867..6d60edf 100644 --- a/engine/SCons/Tool/f77.py +++ b/engine/SCons/Tool/f77.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f77.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/f77.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults import SCons.Scanner.Fortran diff --git a/engine/SCons/Tool/f90.py b/engine/SCons/Tool/f90.py index a6f5cff..e0b5fae 100644 --- a/engine/SCons/Tool/f90.py +++ b/engine/SCons/Tool/f90.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f90.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/f90.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults import SCons.Scanner.Fortran diff --git a/engine/SCons/Tool/f95.py b/engine/SCons/Tool/f95.py index 3e611e8..9a1afdf 100644 --- a/engine/SCons/Tool/f95.py +++ b/engine/SCons/Tool/f95.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f95.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/f95.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/filesystem.py b/engine/SCons/Tool/filesystem.py index 312f08c..a625714 100644 --- a/engine/SCons/Tool/filesystem.py +++ b/engine/SCons/Tool/filesystem.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/filesystem.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/filesystem.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons from SCons.Tool.install import copyFunc diff --git a/engine/SCons/Tool/fortran.py b/engine/SCons/Tool/fortran.py index b57a845..1b09880 100644 --- a/engine/SCons/Tool/fortran.py +++ b/engine/SCons/Tool/fortran.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/fortran.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/fortran.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import re diff --git a/engine/SCons/Tool/g++.py b/engine/SCons/Tool/g++.py index b28e39d..8cf881f 100644 --- a/engine/SCons/Tool/g++.py +++ b/engine/SCons/Tool/g++.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/g++.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/g++.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" #forward proxy to the preffered cxx version diff --git a/engine/SCons/Tool/g77.py b/engine/SCons/Tool/g77.py index 1c1f101..fc0bcba 100644 --- a/engine/SCons/Tool/g77.py +++ b/engine/SCons/Tool/g77.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/g77.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/g77.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Util from SCons.Tool.FortranCommon import add_all_to_env, add_f77_to_env diff --git a/engine/SCons/Tool/gas.py b/engine/SCons/Tool/gas.py index 5ad8a76..c104e34 100644 --- a/engine/SCons/Tool/gas.py +++ b/engine/SCons/Tool/gas.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gas.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/gas.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" try: as_module = __import__('as', globals(), locals(), []) diff --git a/engine/SCons/Tool/gcc.py b/engine/SCons/Tool/gcc.py index 880fc80..2532427 100644 --- a/engine/SCons/Tool/gcc.py +++ b/engine/SCons/Tool/gcc.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gcc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/gcc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import cc import os diff --git a/engine/SCons/Tool/gdc.py b/engine/SCons/Tool/gdc.py index 2e5f03b..46a910c 100644 --- a/engine/SCons/Tool/gdc.py +++ b/engine/SCons/Tool/gdc.py @@ -48,7 +48,7 @@ Lib tool variables: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gdc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/gdc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Action import SCons.Defaults diff --git a/engine/SCons/Tool/gettext_tool.py b/engine/SCons/Tool/gettext_tool.py index 504ec46..5fc0158 100644 --- a/engine/SCons/Tool/gettext_tool.py +++ b/engine/SCons/Tool/gettext_tool.py @@ -23,7 +23,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/Tool/gettext_tool.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/gettext_tool.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" ############################################################################# def generate(env,**kw): diff --git a/engine/SCons/Tool/gfortran.py b/engine/SCons/Tool/gfortran.py index e543efd..8d02daa 100644 --- a/engine/SCons/Tool/gfortran.py +++ b/engine/SCons/Tool/gfortran.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gfortran.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/gfortran.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/gnulink.py b/engine/SCons/Tool/gnulink.py index cf8a65d..53f5081 100644 --- a/engine/SCons/Tool/gnulink.py +++ b/engine/SCons/Tool/gnulink.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gnulink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/gnulink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Util import SCons.Tool diff --git a/engine/SCons/Tool/gs.py b/engine/SCons/Tool/gs.py index a1e0bd9..371b810 100644 --- a/engine/SCons/Tool/gs.py +++ b/engine/SCons/Tool/gs.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gs.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/gs.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/gxx.py b/engine/SCons/Tool/gxx.py index b98ae07..d956c9f 100644 --- a/engine/SCons/Tool/gxx.py +++ b/engine/SCons/Tool/gxx.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/gxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path import re diff --git a/engine/SCons/Tool/hpc++.py b/engine/SCons/Tool/hpc++.py index 5cbe20e..4ec2fe3 100644 --- a/engine/SCons/Tool/hpc++.py +++ b/engine/SCons/Tool/hpc++.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/hpc++.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/hpc++.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" #forward proxy to the preffered cxx version diff --git a/engine/SCons/Tool/hpcc.py b/engine/SCons/Tool/hpcc.py index 27bdfa6..6a564b9 100644 --- a/engine/SCons/Tool/hpcc.py +++ b/engine/SCons/Tool/hpcc.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/hpcc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/hpcc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/hpcxx.py b/engine/SCons/Tool/hpcxx.py index 6bfb600..8ee888f 100644 --- a/engine/SCons/Tool/hpcxx.py +++ b/engine/SCons/Tool/hpcxx.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/hpcxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/hpcxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path @@ -68,7 +68,8 @@ def generate(env): env['CXX'] = acc or 'aCC' env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS +Z') # determine version of aCC - line = os.popen(acc + ' -V 2>&1').readline().rstrip() + with os.popen(acc + ' -V 2>&1') as p: + line = p.readline().rstrip() if line.find('aCC: HP ANSI C++') == 0: env['CXXVERSION'] = line.split()[-1] diff --git a/engine/SCons/Tool/hplink.py b/engine/SCons/Tool/hplink.py index 502b945..1afa95e 100644 --- a/engine/SCons/Tool/hplink.py +++ b/engine/SCons/Tool/hplink.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/hplink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/hplink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/icc.py b/engine/SCons/Tool/icc.py index f16e79a..8110a60 100644 --- a/engine/SCons/Tool/icc.py +++ b/engine/SCons/Tool/icc.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/icc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/icc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import cc diff --git a/engine/SCons/Tool/icl.py b/engine/SCons/Tool/icl.py index 7a7b21b..29d5862 100644 --- a/engine/SCons/Tool/icl.py +++ b/engine/SCons/Tool/icl.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/icl.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/icl.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Tool.intelc diff --git a/engine/SCons/Tool/ifl.py b/engine/SCons/Tool/ifl.py index d351e4e..0eb7cda 100644 --- a/engine/SCons/Tool/ifl.py +++ b/engine/SCons/Tool/ifl.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ifl.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/ifl.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults from SCons.Scanner.Fortran import FortranScan diff --git a/engine/SCons/Tool/ifort.py b/engine/SCons/Tool/ifort.py index 7a3128e..730e778 100644 --- a/engine/SCons/Tool/ifort.py +++ b/engine/SCons/Tool/ifort.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ifort.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/ifort.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults from SCons.Scanner.Fortran import FortranScan diff --git a/engine/SCons/Tool/ilink.py b/engine/SCons/Tool/ilink.py index c27443a..7c69e72 100644 --- a/engine/SCons/Tool/ilink.py +++ b/engine/SCons/Tool/ilink.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ilink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/ilink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/ilink32.py b/engine/SCons/Tool/ilink32.py index 69430ec..a1e12a6 100644 --- a/engine/SCons/Tool/ilink32.py +++ b/engine/SCons/Tool/ilink32.py @@ -27,7 +27,7 @@ XXX # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ilink32.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/ilink32.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Tool import SCons.Tool.bcc32 diff --git a/engine/SCons/Tool/install.py b/engine/SCons/Tool/install.py index c388b2a..c0a8917 100644 --- a/engine/SCons/Tool/install.py +++ b/engine/SCons/Tool/install.py @@ -31,7 +31,7 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/install.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/install.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import re diff --git a/engine/SCons/Tool/intelc.py b/engine/SCons/Tool/intelc.py index 63df411..fdd9730 100644 --- a/engine/SCons/Tool/intelc.py +++ b/engine/SCons/Tool/intelc.py @@ -32,12 +32,12 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import division, print_function -__revision__ = "src/engine/SCons/Tool/intelc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/intelc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import math, sys, os.path, glob, string, re is_windows = sys.platform == 'win32' -is_win64 = is_windows and (os.environ['PROCESSOR_ARCHITECTURE'] == 'AMD64' or +is_win64 = is_windows and (os.environ['PROCESSOR_ARCHITECTURE'] == 'AMD64' or ('PROCESSOR_ARCHITEW6432' in os.environ and os.environ['PROCESSOR_ARCHITEW6432'] == 'AMD64')) is_linux = sys.platform.startswith('linux') @@ -113,11 +113,6 @@ def check_abi(abi): (abi, list(valid_abis.keys()))) return abi -def vercmp(a, b): - """Compare strings as floats, - but Intel changed Linux naming convention at 9.0""" - return cmp(linux_ver_normalize(b), linux_ver_normalize(a)) - def get_version_from_list(v, vlist): """See if we can match v (string) in vlist (list of strings) Linux has to match in a fuzzy way.""" @@ -221,7 +216,7 @@ def get_all_compiler_versions(): versions = [] try: while i < 100: - subkey = SCons.Util.RegEnumKey(k, i) # raises EnvironmentError + subkey = SCons.Util.RegEnumKey(k, i) # raises SConsEnvironmentError # Check that this refers to an existing dir. # This is not 100% perfect but should catch common # installation issues like when the compiler was installed @@ -293,7 +288,7 @@ def get_all_compiler_versions(): m = re.search(r'([0-9]{0,4})(?:_sp\d*)?\.([0-9][0-9.]*)$', d) if m: versions.append("%s.%s"%(m.group(1), m.group(2))) - + def keyfunc(str): """Given a dot-separated version string, return a tuple of ints representing it.""" return [int(x) for x in str.split('.')] @@ -383,7 +378,7 @@ def get_intel_compiler_top(version, abi): top = d break return top - + top = find_in_2016style_dir(version) or find_in_2011style_dir(version) or find_in_2010style_dir(version) or find_in_2008style_dir(version) # print "INTELC: top=",top if not top: diff --git a/engine/SCons/Tool/ipkg.py b/engine/SCons/Tool/ipkg.py index 0027781..664c3a6 100644 --- a/engine/SCons/Tool/ipkg.py +++ b/engine/SCons/Tool/ipkg.py @@ -33,7 +33,7 @@ packages fake_root. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ipkg.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/ipkg.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os @@ -55,8 +55,10 @@ def generate(env): env['IPKGCOM'] = '$IPKG $IPKGFLAGS ${SOURCE}' if env.WhereIs('id'): - env['IPKGUSER'] = os.popen('id -un').read().strip() - env['IPKGGROUP'] = os.popen('id -gn').read().strip() + with os.popen('id -un') as p: + env['IPKGUSER'] = p.read().strip() + with os.popen('id -gn') as p: + env['IPKGGROUP'] = p.read().strip() env['IPKGFLAGS'] = SCons.Util.CLVar('-o $IPKGUSER -g $IPKGGROUP') env['IPKGSUFFIX'] = '.ipk' diff --git a/engine/SCons/Tool/jar.py b/engine/SCons/Tool/jar.py index 4d686af..98be08f 100644 --- a/engine/SCons/Tool/jar.py +++ b/engine/SCons/Tool/jar.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/jar.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/jar.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import SCons.Subst @@ -86,7 +86,7 @@ def jarFlags(target, source, env, for_signature): for src in source: contents = src.get_text_contents() if contents.startswith("Manifest-Version"): - if not 'm' in jarflags: + if 'm' not in jarflags: return jarflags + 'm' break return jarflags @@ -106,7 +106,7 @@ def Jar(env, target = None, source = [], *args, **kw): source = target target = None - # mutiple targets pass so build each target the same from the + # mutiple targets pass so build each target the same from the # same source #TODO Maybe this should only be done once, and the result copied # for each target since it should result in the same? @@ -184,7 +184,7 @@ def Jar(env, target = None, source = [], *args, **kw): continue except: pass - + try: # source is string try to covnert it to dir target_nodes.extend(dir_to_class(env.fs.Dir(s))) @@ -193,7 +193,7 @@ def Jar(env, target = None, source = [], *args, **kw): pass SCons.Warnings.Warning("File: " + str(s) + " could not be identified as File or Directory, skipping.") - + # at this point all our sources have been converted to classes or directories of class # so pass it to the Jar builder return env.JarFile(target = target, source = target_nodes, *args, **kw) @@ -209,9 +209,9 @@ def generate(env): env.AddMethod(Jar) if env['PLATFORM'] == 'win32': - # Ensure that we have a proper path for clang - jar = SCons.Tool.find_program_path(env, 'jar', - default_paths=get_java_install_dirs(env['PLATFORM'])) + # Ensure that we have a proper path for jar + paths = get_java_install_dirs('win32') + jar = SCons.Tool.find_program_path(env, 'jar', default_paths=paths) if jar: jar_bin_dir = os.path.dirname(jar) env.AppendENVPath('PATH', jar_bin_dir) diff --git a/engine/SCons/Tool/javac.py b/engine/SCons/Tool/javac.py index a295bfe..387afdb 100644 --- a/engine/SCons/Tool/javac.py +++ b/engine/SCons/Tool/javac.py @@ -30,7 +30,7 @@ selection method. # 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/Tool/javac.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/javac.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import os.path @@ -210,15 +210,15 @@ def generate(env): version = env.get('JAVAVERSION', None) - javac = SCons.Tool.find_program_path(env, 'javac') if env['PLATFORM'] == 'win32': # Ensure that we have a proper path for javac - paths=get_java_install_dirs(env['PLATFORM'], version=version) - javac = SCons.Tool.find_program_path(env, 'javac', - default_paths=paths) + paths = get_java_install_dirs('win32', version=version) + javac = SCons.Tool.find_program_path(env, 'javac', default_paths=paths) if javac: javac_bin_dir = os.path.dirname(javac) env.AppendENVPath('PATH', javac_bin_dir) + else: + javac = SCons.Tool.find_program_path(env, 'javac') env['JAVAINCLUDES'] = get_java_include_paths(env, javac, version) diff --git a/engine/SCons/Tool/javah.py b/engine/SCons/Tool/javah.py index 791c7ab..251778d 100644 --- a/engine/SCons/Tool/javah.py +++ b/engine/SCons/Tool/javah.py @@ -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 a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/javah.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path @@ -123,9 +123,9 @@ def generate(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'])) + # Ensure that we have a proper path for javah + paths = get_java_install_dirs('win32') + javah = SCons.Tool.find_program_path(env, 'javah', default_paths=paths) if javah: javah_bin_dir = os.path.dirname(javah) env.AppendENVPath('PATH', javah_bin_dir) diff --git a/engine/SCons/Tool/latex.py b/engine/SCons/Tool/latex.py index 008a98a..3f1af08 100644 --- a/engine/SCons/Tool/latex.py +++ b/engine/SCons/Tool/latex.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/latex.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/latex.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Action import SCons.Defaults diff --git a/engine/SCons/Tool/ldc.py b/engine/SCons/Tool/ldc.py index c2e9a8f..dda1a5e 100644 --- a/engine/SCons/Tool/ldc.py +++ b/engine/SCons/Tool/ldc.py @@ -48,7 +48,7 @@ Lib tool variables: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ldc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/ldc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import subprocess diff --git a/engine/SCons/Tool/lex.py b/engine/SCons/Tool/lex.py index fc6322f..4831776 100644 --- a/engine/SCons/Tool/lex.py +++ b/engine/SCons/Tool/lex.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/lex.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/lex.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path import sys @@ -45,6 +45,11 @@ from SCons.Platform.win32 import CHOCO_DEFAULT_PATH LexAction = SCons.Action.Action("$LEXCOM", "$LEXCOMSTR") +if sys.platform == 'win32': + BINS = ['flex', 'lex', 'win_flex'] +else: + BINS = ["flex", "lex"] + def lexEmitter(target, source, env): sourceBase, sourceExt = os.path.splitext(SCons.Util.to_String(source[0])) @@ -70,22 +75,22 @@ def lexEmitter(target, source, env): def get_lex_path(env, append_paths=False): """ - Find the a path containing the lex or flex binaries. If a construction - environment is passed in then append the path to the ENV PATH. - """ - # save existing path to reset if we don't want to append any paths - envPath = env['ENV']['PATH'] - bins = ['flex', 'lex', 'win_flex'] + Find the path to the lex tool, searching several possible names - for prog in bins: + Only called in the Windows case, so the default_path + can be Windows-specific + + :param env: current construction environment + :param append_paths: if set, add the path to the tool to PATH + :return: path to lex tool, if found + """ + for prog in BINS: bin_path = SCons.Tool.find_program_path( - env, - prog, + env, + prog, default_paths=CHOCO_DEFAULT_PATH + MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) if bin_path: - if not append_paths: - env['ENV']['PATH'] = envPath - else: + if append_paths: env.AppendENVPath('PATH', os.path.dirname(bin_path)) return bin_path SCons.Warnings.Warning('lex tool requested, but lex or flex binary not found in ENV PATH') @@ -113,20 +118,21 @@ def generate(env): env["LEXFLAGS"] = SCons.Util.CLVar("") if sys.platform == 'win32': - get_lex_path(env, append_paths=True) - env["LEX"] = env.Detect(['flex', 'lex', 'win_flex']) + # ignore the return - we do not need the full path here + _ = get_lex_path(env, append_paths=True) + env["LEX"] = env.Detect(BINS) if not env.get("LEXUNISTD"): env["LEXUNISTD"] = SCons.Util.CLVar("") env["LEXCOM"] = "$LEX $LEXUNISTD $LEXFLAGS -t $SOURCES > $TARGET" else: - env["LEX"] = env.Detect(["flex", "lex"]) + env["LEX"] = env.Detect(BINS) env["LEXCOM"] = "$LEX $LEXFLAGS -t $SOURCES > $TARGET" def exists(env): if sys.platform == 'win32': return get_lex_path(env) else: - return env.Detect(["flex", "lex"]) + return env.Detect(BINS) # Local Variables: # tab-width:4 diff --git a/engine/SCons/Tool/link.py b/engine/SCons/Tool/link.py index 95a00cc..dcaf91f 100644 --- a/engine/SCons/Tool/link.py +++ b/engine/SCons/Tool/link.py @@ -32,7 +32,7 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/link.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/link.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import sys import re diff --git a/engine/SCons/Tool/linkloc.py b/engine/SCons/Tool/linkloc.py index 42c180e..42d010d 100644 --- a/engine/SCons/Tool/linkloc.py +++ b/engine/SCons/Tool/linkloc.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/linkloc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/linkloc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path import re diff --git a/engine/SCons/Tool/m4.py b/engine/SCons/Tool/m4.py index bb27b53..0ecc82a 100644 --- a/engine/SCons/Tool/m4.py +++ b/engine/SCons/Tool/m4.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/m4.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/m4.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/masm.py b/engine/SCons/Tool/masm.py index 092f5dc..cf147a7 100644 --- a/engine/SCons/Tool/masm.py +++ b/engine/SCons/Tool/masm.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/masm.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/masm.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/midl.py b/engine/SCons/Tool/midl.py index 2dfd347..f75204a 100644 --- a/engine/SCons/Tool/midl.py +++ b/engine/SCons/Tool/midl.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/midl.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/midl.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/mingw.py b/engine/SCons/Tool/mingw.py index cb9bc3c..8410d2f 100644 --- a/engine/SCons/Tool/mingw.py +++ b/engine/SCons/Tool/mingw.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mingw.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/mingw.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import os.path @@ -65,7 +65,7 @@ def shlib_generator(target, source, env, for_signature): def_target = env.FindIxes(target, 'WINDOWSDEFPREFIX', 'WINDOWSDEFSUFFIX') insert_def = env.subst("$WINDOWS_INSERT_DEF") - if not insert_def in ['', '0', 0] and def_target: \ + if insert_def not in ['', '0', 0] and def_target: \ cmd.append('-Wl,--output-def,' + def_target.get_string(for_signature)) return [cmd] @@ -123,7 +123,7 @@ key_program = 'mingw32-make' def find_version_specific_mingw_paths(): - """ + r""" One example of default mingw install paths is: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev2\mingw64\bin diff --git a/engine/SCons/Tool/msgfmt.py b/engine/SCons/Tool/msgfmt.py index 3a73abd..c8141a0 100644 --- a/engine/SCons/Tool/msgfmt.py +++ b/engine/SCons/Tool/msgfmt.py @@ -21,7 +21,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/Tool/msgfmt.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/msgfmt.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from SCons.Builder import BuilderBase ############################################################################# diff --git a/engine/SCons/Tool/msginit.py b/engine/SCons/Tool/msginit.py index 5b3dc0b..69e803a 100644 --- a/engine/SCons/Tool/msginit.py +++ b/engine/SCons/Tool/msginit.py @@ -24,7 +24,7 @@ Tool specific initialization of msginit tool. # 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/Tool/msginit.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/msginit.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Warnings import SCons.Builder diff --git a/engine/SCons/Tool/msgmerge.py b/engine/SCons/Tool/msgmerge.py index c8b7688..4254fa6 100644 --- a/engine/SCons/Tool/msgmerge.py +++ b/engine/SCons/Tool/msgmerge.py @@ -24,7 +24,7 @@ Tool specific initialization for `msgmerge` tool. # 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/Tool/msgmerge.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/msgmerge.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" ############################################################################# def _update_or_init_po_files(target, source, env): diff --git a/engine/SCons/Tool/mslib.py b/engine/SCons/Tool/mslib.py index 1434773..cecdbdc 100644 --- a/engine/SCons/Tool/mslib.py +++ b/engine/SCons/Tool/mslib.py @@ -31,7 +31,9 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mslib.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/mslib.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" + +import os import SCons.Defaults import SCons.Tool @@ -54,6 +56,13 @@ def generate(env): env['LIBPREFIX'] = '' env['LIBSUFFIX'] = '.lib' + # Issue #3350 + # Change tempfile argument joining character from a space to a newline + # mslink will fail if any single line is too long, but is fine with many lines + # in a tempfile + env['TEMPFILEARGJOIN'] = os.linesep + + def exists(env): return msvc_exists(env) diff --git a/engine/SCons/Tool/mslink.py b/engine/SCons/Tool/mslink.py index 9fd84c7..9fbce4b 100644 --- a/engine/SCons/Tool/mslink.py +++ b/engine/SCons/Tool/mslink.py @@ -32,8 +32,9 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/mslink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/mslink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +import os import os.path import SCons.Action @@ -107,7 +108,7 @@ def _dllEmitter(target, source, env, paramtp): raise SCons.Errors.UserError('A shared library should have exactly one target with the suffix: %s' % env.subst('$%sSUFFIX' % paramtp)) insert_def = env.subst("$WINDOWS_INSERT_DEF") - if not insert_def in ['', '0', 0] and \ + if insert_def not in ['', '0', 0] and \ not env.FindIxes(source, "WINDOWSDEFPREFIX", "WINDOWSDEFSUFFIX"): # append a def file to the list of sources @@ -158,7 +159,7 @@ def windowsLibEmitter(target, source, env): def ldmodEmitter(target, source, env): """Emitter for loadable modules. - + Loadable modules are identical to shared libraries on Windows, but building them is subject to different parameters (LDMODULE*). """ @@ -219,7 +220,7 @@ def embedManifestDllCheck(target, source, env): if env.get('WINDOWS_EMBED_MANIFEST', 0): manifestSrc = target[0].get_abspath() + '.manifest' if os.path.exists(manifestSrc): - ret = (embedManifestDllAction) ([target[0]],None,env) + ret = (embedManifestDllAction) ([target[0]],None,env) if ret: raise SCons.Errors.UserError("Unable to embed manifest into %s" % (target[0])) return ret @@ -327,6 +328,12 @@ def generate(env): env['LDMODULEEMITTER'] = [ldmodEmitter] env['LDMODULECOM'] = compositeLdmodAction + # Issue #3350 + # Change tempfile argument joining character from a space to a newline + # mslink will fail if any single line is too long, but is fine with many lines + # in a tempfile + env['TEMPFILEARGJOIN'] = os.linesep + def exists(env): return msvc_exists(env) diff --git a/engine/SCons/Tool/mssdk.py b/engine/SCons/Tool/mssdk.py index 1372e87..7a38c6a 100644 --- a/engine/SCons/Tool/mssdk.py +++ b/engine/SCons/Tool/mssdk.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mssdk.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/mssdk.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" """engine.SCons.Tool.mssdk diff --git a/engine/SCons/Tool/msvc.py b/engine/SCons/Tool/msvc.py index 4649963..052a0b0 100644 --- a/engine/SCons/Tool/msvc.py +++ b/engine/SCons/Tool/msvc.py @@ -31,9 +31,10 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/msvc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/msvc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path +import os import re import sys @@ -161,7 +162,7 @@ def msvc_batch_key(action, env, target, source): # Note we need to do the env.subst so $MSVC_BATCH can be a reference to # another construction variable, which is why we test for False and 0 # as strings. - if not 'MSVC_BATCH' in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None): + if 'MSVC_BATCH' not in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None): # We're not using batching; return no key. return None t = target[0] @@ -187,7 +188,7 @@ def msvc_output_flag(target, source, env, for_signature): # len(source)==1 as batch mode can compile only one file # (and it also fixed problem with compiling only one changed file # with batch mode enabled) - if not 'MSVC_BATCH' in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None): + if 'MSVC_BATCH' not in env or env.subst('$MSVC_BATCH') in ('0', 'False', '', None): return '/Fo$TARGET' else: # The Visual C/C++ compiler requires a \ at the end of the /Fo @@ -283,6 +284,12 @@ def generate(env): msvc_set_PCHPDBFLAGS(env) + # Issue #3350 + # Change tempfile argument joining character from a space to a newline + # mslink will fail if any single line is too long, but is fine with many lines + # in a tempfile + env['TEMPFILEARGJOIN'] = os.linesep + env['PCHCOM'] = '$CXX /Fo${TARGETS[1]} $CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS $PCHPDBFLAGS' env['BUILDERS']['PCH'] = pch_builder diff --git a/engine/SCons/Tool/msvs.py b/engine/SCons/Tool/msvs.py index afe4bef..38965e3 100644 --- a/engine/SCons/Tool/msvs.py +++ b/engine/SCons/Tool/msvs.py @@ -32,7 +32,7 @@ selection method. from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/msvs.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/msvs.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.compat @@ -70,10 +70,14 @@ def xmlify(s): s = s.replace('\n', ' ') return s -# Process a CPPPATH list in includes, given the env, target and source. -# Returns a tuple of nodes. def processIncludes(includes, env, target, source): - return SCons.PathList.PathList(includes).subst_path(env, target, source) + """ + Process a CPPPATH list in includes, given the env, target and source. + Returns a list of directory paths. These paths are absolute so we avoid + putting pound-prefixed paths in a Visual Studio project file. + """ + return [env.Dir(i).abspath for i in + SCons.PathList.PathList(includes).subst_path(env, target, source)] external_makefile_guid = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}' @@ -348,10 +352,20 @@ V10DebugSettings = { } class _GenerateV10User(_UserGenerator): - """Generates a Project'user file for MSVS 2010""" + """Generates a Project'user file for MSVS 2010 or later""" def __init__(self, dspfile, source, env): - self.versionstr = '4.0' + version_num, suite = msvs_parse_version(env['MSVS_VERSION']) + if version_num >= 14.2: + # Visual Studio 2019 is considered to be version 16. + self.versionstr = '16.0' + elif version_num >= 14.1: + # Visual Studio 2017 is considered to be version 15. + self.versionstr = '15.0' + elif version_num == 14.0: + self.versionstr = '14.0' + else: + self.versionstr = '4.0' self.usrhead = V10UserHeader self.usrconf = V10UserConfiguration self.usrdebg = V10DebugSettings @@ -397,7 +411,7 @@ class _DSPGenerator(object): elif SCons.Util.is_List(env['variant']): variants = env['variant'] - if 'buildtarget' not in env or env['buildtarget'] == None: + if 'buildtarget' not in env or env['buildtarget'] is None: buildtarget = [''] elif SCons.Util.is_String(env['buildtarget']): buildtarget = [env['buildtarget']] @@ -418,7 +432,7 @@ class _DSPGenerator(object): for _ in variants: buildtarget.append(bt) - if 'outdir' not in env or env['outdir'] == None: + if 'outdir' not in env or env['outdir'] is None: outdir = [''] elif SCons.Util.is_String(env['outdir']): outdir = [env['outdir']] @@ -439,7 +453,7 @@ class _DSPGenerator(object): for v in variants: outdir.append(s) - if 'runfile' not in env or env['runfile'] == None: + if 'runfile' not in env or env['runfile'] is None: runfile = buildtarget[-1:] elif SCons.Util.is_String(env['runfile']): runfile = [env['runfile']] @@ -462,15 +476,41 @@ class _DSPGenerator(object): self.sconscript = env['MSVSSCONSCRIPT'] - if 'cmdargs' not in env or env['cmdargs'] == None: - cmdargs = [''] * len(variants) - elif SCons.Util.is_String(env['cmdargs']): - cmdargs = [env['cmdargs']] * len(variants) - elif SCons.Util.is_List(env['cmdargs']): - if len(env['cmdargs']) != len(variants): - raise SCons.Errors.InternalError("Sizes of 'cmdargs' and 'variant' lists must be the same.") + def GetKeyFromEnv(env, key, variants): + """ + Retrieves a specific key from the environment. If the key is + present, it is expected to either be a string or a list with length + equal to the number of variants. The function returns a list of + the desired value (e.g. cpp include paths) guaranteed to be of + length equal to the length of the variants list. + """ + if key not in env or env[key] is None: + return [''] * len(variants) + elif SCons.Util.is_String(env[key]): + return [env[key]] * len(variants) + elif SCons.Util.is_List(env[key]): + if len(env[key]) != len(variants): + raise SCons.Errors.InternalError("Sizes of '%s' and 'variant' lists must be the same." % key) + else: + return env[key] else: - cmdargs = env['cmdargs'] + raise SCons.Errors.InternalError("Unsupported type for key '%s' in environment: %s" % + (key, type(env[key]))) + + cmdargs = GetKeyFromEnv(env, 'cmdargs', variants) + + # The caller is allowed to put 'cppdefines' and/or 'cpppaths' in the + # environment, which is useful if they want to provide per-variant + # values for these. Otherwise, we fall back to using the global + # 'CPPDEFINES' and 'CPPPATH' functions. + if 'cppdefines' in env: + cppdefines = GetKeyFromEnv(env, 'cppdefines', variants) + else: + cppdefines = [env.get('CPPDEFINES', [])] * len(variants) + if 'cpppaths' in env: + cpppaths = GetKeyFromEnv(env, 'cpppaths', variants) + else: + cpppaths = [env.get('CPPPATH', [])] * len(variants) self.env = env @@ -513,13 +553,17 @@ class _DSPGenerator(object): for n in sourcenames: self.sources[n].sort(key=lambda a: a.lower()) - def AddConfig(self, variant, buildtarget, outdir, runfile, cmdargs, dspfile=dspfile): + def AddConfig(self, variant, buildtarget, outdir, runfile, cmdargs, cppdefines, cpppaths, dspfile=dspfile, env=env): config = Config() config.buildtarget = buildtarget config.outdir = outdir config.cmdargs = cmdargs + config.cppdefines = cppdefines config.runfile = runfile + # Dir objects can't be pickled, so we need an absolute path here. + config.cpppaths = processIncludes(cpppaths, env, None, None) + match = re.match(r'(.*)\|(.*)', variant) if match: config.variant = match.group(1) @@ -532,12 +576,12 @@ class _DSPGenerator(object): print("Adding '" + self.name + ' - ' + config.variant + '|' + config.platform + "' to '" + str(dspfile) + "'") for i in range(len(variants)): - AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs[i]) + AddConfig(self, variants[i], buildtarget[i], outdir[i], runfile[i], cmdargs[i], cppdefines[i], cpppaths[i]) self.platforms = [] for key in list(self.configs.keys()): platform = self.configs[key].platform - if not platform in self.platforms: + if platform not in self.platforms: self.platforms.append(platform) def Build(self): @@ -553,16 +597,16 @@ V6DSPHeader = """\ CFG=%(name)s - Win32 %(confkey)s !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "%(name)s.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "%(name)s.mak" CFG="%(name)s - Win32 %(confkey)s" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE """ class _GenerateV6DSP(_DSPGenerator): @@ -580,7 +624,7 @@ class _GenerateV6DSP(_DSPGenerator): for kind in confkeys: self.file.write('!MESSAGE "%s - Win32 %s" (based on "Win32 (x86) External Target")\n' % (name, kind)) - self.file.write('!MESSAGE \n\n') + self.file.write('!MESSAGE\n\n') def PrintProject(self): name = self.name @@ -637,7 +681,7 @@ class _GenerateV6DSP(_DSPGenerator): first = 1 else: self.file.write('!ELSEIF "$(CFG)" == "%s - Win32 %s"\n\n' % (name,kind)) - self.file.write('!ENDIF \n\n') + self.file.write('!ENDIF\n\n') self.PrintSourceFiles() self.file.write('# End Target\n' '# End Project\n') @@ -645,10 +689,10 @@ class _GenerateV6DSP(_DSPGenerator): if self.nokeep == 0: # now we pickle some data and add it to the file -- MSDEV will ignore it. pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL) - pdata = base64.encodestring(pdata).decode() + pdata = base64.b64encode(pdata).decode() self.file.write(pdata + '\n') pdata = pickle.dumps(self.sources,PICKLE_PROTOCOL) - pdata = base64.encodestring(pdata).decode() + pdata = base64.b64encode(pdata).decode() self.file.write(pdata + '\n') def PrintSourceFiles(self): @@ -685,11 +729,13 @@ class _GenerateV6DSP(_DSPGenerator): return # doesn't exist yet, so can't add anything to configs. line = dspfile.readline() + # skip until marker while line: if line.find("# End Project") > -1: break line = dspfile.readline() + # read to get configs line = dspfile.readline() datas = line while line and line != '\n': @@ -707,12 +753,14 @@ class _GenerateV6DSP(_DSPGenerator): self.configs.update(data) + # keep reading to get sources data = None line = dspfile.readline() datas = line while line and line != '\n': line = dspfile.readline() datas = datas + line + dspfile.close() # OK, we've found our little pickled cache of data. # it has a "# " in front of it, so we strip that. @@ -878,6 +926,8 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): buildtarget = self.configs[kind].buildtarget runfile = self.configs[kind].runfile cmdargs = self.configs[kind].cmdargs + cpppaths = self.configs[kind].cpppaths + cppdefines = self.configs[kind].cppdefines env_has_buildtarget = 'MSVSBUILDTARGET' in self.env if not env_has_buildtarget: @@ -895,9 +945,8 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): # This isn't perfect; CPPDEFINES and CPPPATH can contain $TARGET and $SOURCE, # so they could vary depending on the command being generated. This code # assumes they don't. - preprocdefs = xmlify(';'.join(processDefines(self.env.get('CPPDEFINES', [])))) - includepath_Dirs = processIncludes(self.env.get('CPPPATH', []), self.env, None, None) - includepath = xmlify(';'.join([str(x) for x in includepath_Dirs])) + preprocdefs = xmlify(';'.join(processDefines(cppdefines))) + includepath = xmlify(';'.join(processIncludes(cpppaths, self.env, None, None))) if not env_has_buildtarget: del self.env['MSVSBUILDTARGET'] @@ -917,10 +966,10 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): if self.nokeep == 0: # now we pickle some data and add it to the file -- MSDEV will ignore it. pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL) - pdata = base64.encodestring(pdata).decode() + pdata = base64.b64encode(pdata).decode() self.file.write('\n') def printSources(self, hierarchy, commonprefix): @@ -998,11 +1047,13 @@ class _GenerateV7DSP(_DSPGenerator, _GenerateV7User): return # doesn't exist yet, so can't add anything to configs. line = dspfile.readline() + # skip until marker while line: if line.find('\n') def printFilters(self, hierarchy, name): @@ -1451,13 +1508,16 @@ class _GenerateV7DSW(_DSWGenerator): self.platforms = [] for key in list(self.configs.keys()): platform = self.configs[key].platform - if not platform in self.platforms: + if platform not in self.platforms: self.platforms.append(platform) def GenerateProjectFilesInfo(self): for dspfile in self.dspfiles: dsp_folder_path, name = os.path.split(dspfile) dsp_folder_path = os.path.abspath(dsp_folder_path) + if SCons.Util.splitext(name)[1] == '.filters': + # Ignore .filters project files + continue dsp_relative_folder_path = os.path.relpath(dsp_folder_path, self.dsw_folder_path) if dsp_relative_folder_path == os.curdir: dsp_relative_file_path = name @@ -1491,6 +1551,7 @@ class _GenerateV7DSW(_DSWGenerator): while line: line = dswfile.readline() datas = datas + line + dswfile.close() # OK, we've found our little pickled cache of data. try: @@ -1506,7 +1567,11 @@ class _GenerateV7DSW(_DSWGenerator): def PrintSolution(self): """Writes a solution file""" self.file.write('Microsoft Visual Studio Solution File, Format Version %s\n' % self.versionstr) - if self.version_num > 14.0: + if self.version_num >= 14.2: + # Visual Studio 2019 is considered to be version 16. + self.file.write('# Visual Studio 16\n') + elif self.version_num > 14.0: + # Visual Studio 2015 and 2017 are both considered to be version 15. self.file.write('# Visual Studio 15\n') elif self.version_num >= 12.0: self.file.write('# Visual Studio 14\n') @@ -1617,7 +1682,7 @@ class _GenerateV7DSW(_DSWGenerator): self.file.write('EndGlobal\n') if self.nokeep == 0: pdata = pickle.dumps(self.configs,PICKLE_PROTOCOL) - pdata = base64.encodestring(pdata).decode() + pdata = base64.b64encode(pdata).decode() self.file.write(pdata) self.file.write('\n') @@ -1686,11 +1751,8 @@ def GenerateDSP(dspfile, source, env): version_num = 6.0 if 'MSVS_VERSION' in env: version_num, suite = msvs_parse_version(env['MSVS_VERSION']) - if version_num > 14.0: - g = _GenerateV10DSP(dspfile, V15DSPHeader, source, env) - g.Build() - elif version_num >= 10.0: - g = _GenerateV10DSP(dspfile, V10DSPHeader, source, env) + if version_num >= 10.0: + g = _GenerateV10DSP(dspfile, source, env) g.Build() elif version_num >= 7.0: g = _GenerateV7DSP(dspfile, source, env) @@ -1730,7 +1792,7 @@ def GenerateProject(target, source, env): dspfile = builddspfile.srcnode() # this detects whether or not we're using a VariantDir - if not dspfile is builddspfile: + if dspfile is not builddspfile: try: bdsp = open(str(builddspfile), "w+") except IOError as detail: @@ -1738,6 +1800,7 @@ def GenerateProject(target, source, env): raise bdsp.write("This is just a placeholder file.\nThe real project file is here:\n%s\n" % dspfile.get_abspath()) + bdsp.close() GenerateDSP(dspfile, source, env) @@ -1745,7 +1808,7 @@ def GenerateProject(target, source, env): builddswfile = target[1] dswfile = builddswfile.srcnode() - if not dswfile is builddswfile: + if dswfile is not builddswfile: try: bdsw = open(str(builddswfile), "w+") @@ -1754,6 +1817,7 @@ def GenerateProject(target, source, env): raise bdsw.write("This is just a placeholder file.\nThe real workspace file is here:\n%s\n" % dswfile.get_abspath()) + bdsw.close() GenerateDSW(dswfile, source, env) @@ -1781,11 +1845,10 @@ def projectEmitter(target, source, env): # Project file depends on CPPDEFINES and CPPPATH preprocdefs = xmlify(';'.join(processDefines(env.get('CPPDEFINES', [])))) - includepath_Dirs = processIncludes(env.get('CPPPATH', []), env, None, None) - includepath = xmlify(';'.join([str(x) for x in includepath_Dirs])) + includepath = xmlify(';'.join(processIncludes(env.get('CPPPATH', []), env, None, None))) source = source + "; ppdefs:%s incpath:%s"%(preprocdefs, includepath) - if 'buildtarget' in env and env['buildtarget'] != None: + if 'buildtarget' in env and env['buildtarget'] is not None: if SCons.Util.is_String(env['buildtarget']): source = source + ' "%s"' % env['buildtarget'] elif SCons.Util.is_List(env['buildtarget']): @@ -1799,7 +1862,7 @@ def projectEmitter(target, source, env): try: source = source + ' "%s"' % env['buildtarget'].get_abspath() except AttributeError: raise SCons.Errors.InternalError("buildtarget can be a string, a node, a list of strings or nodes, or None") - if 'outdir' in env and env['outdir'] != None: + if 'outdir' in env and env['outdir'] is not None: if SCons.Util.is_String(env['outdir']): source = source + ' "%s"' % env['outdir'] elif SCons.Util.is_List(env['outdir']): @@ -1962,8 +2025,14 @@ def generate(env): default_MSVS_SConscript = env.File('SConstruct') env['MSVSSCONSCRIPT'] = default_MSVS_SConscript - env['MSVSSCONS'] = '"%s" -c "%s"' % (python_executable, getExecScriptMain(env)) - env['MSVSSCONSFLAGS'] = '-C "${MSVSSCONSCRIPT.dir.get_abspath()}" -f ${MSVSSCONSCRIPT.name}' + # Allow consumers to provide their own versions of MSVSSCONS and + # MSVSSCONSFLAGS. This helps support consumers who use wrapper scripts to + # invoke scons. + if 'MSVSSCONS' not in env: + env['MSVSSCONS'] = '"%s" -c "%s"' % (python_executable, getExecScriptMain(env)) + if 'MSVSSCONSFLAGS' not in env: + env['MSVSSCONSFLAGS'] = '-C "${MSVSSCONSCRIPT.dir.get_abspath()}" -f ${MSVSSCONSCRIPT.name}' + env['MSVSSCONSCOM'] = '$MSVSSCONS $MSVSSCONSFLAGS' env['MSVSBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"' env['MSVSREBUILDCOM'] = '$MSVSSCONSCOM "$MSVSBUILDTARGET"' diff --git a/engine/SCons/Tool/mwcc.py b/engine/SCons/Tool/mwcc.py index bc1e62c..b2b2f5b 100644 --- a/engine/SCons/Tool/mwcc.py +++ b/engine/SCons/Tool/mwcc.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mwcc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/mwcc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/mwld.py b/engine/SCons/Tool/mwld.py index f671319..5049c55 100644 --- a/engine/SCons/Tool/mwld.py +++ b/engine/SCons/Tool/mwld.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mwld.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/mwld.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Tool diff --git a/engine/SCons/Tool/nasm.py b/engine/SCons/Tool/nasm.py index 1615b6b..d4d0a1b 100644 --- a/engine/SCons/Tool/nasm.py +++ b/engine/SCons/Tool/nasm.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/nasm.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/nasm.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/packaging/__init__.py b/engine/SCons/Tool/packaging/__init__.py index af60e8b..72b9eef 100644 --- a/engine/SCons/Tool/packaging/__init__.py +++ b/engine/SCons/Tool/packaging/__init__.py @@ -25,7 +25,7 @@ SCons Packaging Tool. # 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/Tool/packaging/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults import SCons.Environment @@ -35,11 +35,11 @@ from SCons.Util import is_List, make_path_relative from SCons.Warnings import warn, Warning import os -import imp +import importlib __all__ = [ - 'src_targz', 'src_tarbz2', 'src_xz', 'src_zip', - 'targz', 'tarbz2', 'xz', 'zip', + 'src_targz', 'src_tarbz2', 'src_tarxz', 'src_zip', + 'targz', 'tarbz2', 'tarxz', 'zip', 'rpm', 'msi', 'ipk', ] @@ -122,12 +122,12 @@ def Package(env, target=None, source=None, **kw): # load the needed packagers. def load_packager(type): try: - file,path,desc=imp.find_module(type, __path__) - return imp.load_module(type, file, path, desc) + # the specific packager is a relative import + return importlib.import_module("." + type, __name__) except ImportError as e: - raise EnvironmentError("packager %s not available: %s"%(type,str(e))) + raise SConsEnvironmentError("packager %s not available: %s" % (type, str(e))) - packagers=list(map(load_packager, PACKAGETYPE)) + packagers = list(map(load_packager, PACKAGETYPE)) # set up targets and the PACKAGEROOT try: diff --git a/engine/SCons/Tool/packaging/ipk.py b/engine/SCons/Tool/packaging/ipk.py index 2ebc168..dbf5be8 100644 --- a/engine/SCons/Tool/packaging/ipk.py +++ b/engine/SCons/Tool/packaging/ipk.py @@ -3,7 +3,7 @@ # # 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 # "Software"), to deal in the Software without restriction, including @@ -24,7 +24,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/ipk.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/ipk.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os @@ -117,17 +117,17 @@ def build_specfiles(source, target, env): # # opened_files={} - def open_file(needle, haystack): + def open_file(needle, haystack=None): try: return opened_files[needle] except KeyError: files = filter(lambda x: x.get_path().rfind(needle) != -1, haystack) # Py3: filter returns an iterable, not a list file = list(files)[0] - opened_files[needle]=open(file.get_abspath(), 'w') + opened_files[needle] = open(file.get_abspath(), 'w') return opened_files[needle] - control_file=open_file('control', target) + control_file = open_file('control', target) if 'X_IPK_DESCRIPTION' not in env: env['X_IPK_DESCRIPTION']="%s\n %s"%(env['SUMMARY'], @@ -149,7 +149,7 @@ Description: $X_IPK_DESCRIPTION control_file.write(env.subst(content)) # - # now handle the various other files, which purpose it is to set post-, + # now handle the various other files, which purpose it is to set post-, # pre-scripts and mark files as config files. # # We do so by filtering the source files for files which are marked with @@ -161,14 +161,14 @@ Description: $X_IPK_DESCRIPTION # into the same named file. # for f in [x for x in source if 'PACKAGING_CONFIG' in dir(x)]: - config=open_file('conffiles') + config = open_file('conffiles') config.write(f.PACKAGING_INSTALL_LOCATION) config.write('\n') for str in 'POSTRM PRERM POSTINST PREINST'.split(): name="PACKAGING_X_IPK_%s"%str for f in [x for x in source if name in dir(x)]: - file=open_file(name) + file = open_file(name) file.write(env[str]) # diff --git a/engine/SCons/Tool/packaging/msi.py b/engine/SCons/Tool/packaging/msi.py index fbb8b21..4a48b47 100644 --- a/engine/SCons/Tool/packaging/msi.py +++ b/engine/SCons/Tool/packaging/msi.py @@ -25,7 +25,7 @@ The msi packager. # 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/Tool/packaging/msi.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/msi.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import SCons @@ -188,7 +188,7 @@ def build_wxsfile(target, source, env): """ Compiles a .wxs file from the keywords given in env['msi_spec'] and by analyzing the tree of source nodes and their tags. """ - file = open(target[0].get_abspath(), 'w') + f = open(target[0].get_abspath(), 'w') try: # Create a document with the Wix root tag @@ -209,7 +209,7 @@ def build_wxsfile(target, source, env): build_license_file(target[0].get_dir(), env) # write the xml to a file - file.write( doc.toprettyxml() ) + f.write( doc.toprettyxml() ) # call a user specified function if 'CHANGE_SPECFILE' in env: @@ -217,6 +217,8 @@ def build_wxsfile(target, source, env): except KeyError as e: raise SCons.Errors.UserError( '"%s" package field for MSI is missing.' % e.args[0] ) + finally: + f.close() # # setup function @@ -440,14 +442,13 @@ def build_license_file(directory, spec): pass # ignore this as X_MSI_LICENSE_TEXT is optional if name!='' or text!='': - file = open( os.path.join(directory.get_path(), 'License.rtf'), 'w' ) - file.write('{\\rtf') - if text!='': - file.write(text.replace('\n', '\\par ')) - else: - file.write(name+'\\par\\par') - file.write('}') - file.close() + with open(os.path.join(directory.get_path(), 'License.rtf'), 'w') as f: + f.write('{\\rtf') + if text!='': + f.write(text.replace('\n', '\\par ')) + else: + f.write(name+'\\par\\par') + f.write('}') # # mandatory and optional package tags diff --git a/engine/SCons/Tool/packaging/rpm.py b/engine/SCons/Tool/packaging/rpm.py index 3f44d83..a948e29 100644 --- a/engine/SCons/Tool/packaging/rpm.py +++ b/engine/SCons/Tool/packaging/rpm.py @@ -25,7 +25,7 @@ The rpm packager. # 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/Tool/packaging/rpm.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/rpm.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os @@ -125,11 +125,11 @@ def build_specfile(target, source, env): """ Builds a RPM specfile from a dictionary with string metadata and by analyzing a tree of nodes. """ - with open(target[0].get_abspath(), 'w') as file: + with open(target[0].get_abspath(), 'w') as ofp: try: - file.write(build_specfile_header(env)) - file.write(build_specfile_sections(env)) - file.write(build_specfile_filesection(env, source)) + ofp.write(build_specfile_header(env)) + ofp.write(build_specfile_sections(env)) + ofp.write(build_specfile_filesection(env, source)) # call a user specified function if 'CHANGE_SPECFILE' in env: diff --git a/engine/SCons/Tool/packaging/src_tarbz2.py b/engine/SCons/Tool/packaging/src_tarbz2.py index eea29cb..b628ccd 100644 --- a/engine/SCons/Tool/packaging/src_tarbz2.py +++ b/engine/SCons/Tool/packaging/src_tarbz2.py @@ -26,7 +26,7 @@ The tarbz2 SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/engine/SCons/Tool/packaging/src_targz.py b/engine/SCons/Tool/packaging/src_targz.py index 94ebea4..4c7469c 100644 --- a/engine/SCons/Tool/packaging/src_targz.py +++ b/engine/SCons/Tool/packaging/src_targz.py @@ -26,7 +26,7 @@ The targz SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_targz.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/src_targz.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/engine/SCons/Tool/packaging/src_tarxz.py b/engine/SCons/Tool/packaging/src_tarxz.py index 62db2e2..6688c46 100644 --- a/engine/SCons/Tool/packaging/src_tarxz.py +++ b/engine/SCons/Tool/packaging/src_tarxz.py @@ -26,7 +26,7 @@ The tarxz SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_tarxz.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/src_tarxz.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/engine/SCons/Tool/packaging/src_zip.py b/engine/SCons/Tool/packaging/src_zip.py index b1f63fb..d56f3aa 100644 --- a/engine/SCons/Tool/packaging/src_zip.py +++ b/engine/SCons/Tool/packaging/src_zip.py @@ -26,7 +26,7 @@ The zip SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_zip.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/src_zip.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/engine/SCons/Tool/packaging/tarbz2.py b/engine/SCons/Tool/packaging/tarbz2.py index 70e7ee4..e371f1b 100644 --- a/engine/SCons/Tool/packaging/tarbz2.py +++ b/engine/SCons/Tool/packaging/tarbz2.py @@ -26,7 +26,7 @@ The tarbz2 packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot diff --git a/engine/SCons/Tool/packaging/targz.py b/engine/SCons/Tool/packaging/targz.py index fa8800d..121e4a4 100644 --- a/engine/SCons/Tool/packaging/targz.py +++ b/engine/SCons/Tool/packaging/targz.py @@ -26,7 +26,7 @@ The targz packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/targz.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/targz.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot diff --git a/engine/SCons/Tool/packaging/tarxz.py b/engine/SCons/Tool/packaging/tarxz.py index bad495b..3ec9822 100644 --- a/engine/SCons/Tool/packaging/tarxz.py +++ b/engine/SCons/Tool/packaging/tarxz.py @@ -26,7 +26,7 @@ The tarxz packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/tarxz.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/tarxz.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot diff --git a/engine/SCons/Tool/packaging/zip.py b/engine/SCons/Tool/packaging/zip.py index c5dd7cc..11ab3b5 100644 --- a/engine/SCons/Tool/packaging/zip.py +++ b/engine/SCons/Tool/packaging/zip.py @@ -26,7 +26,7 @@ The zip SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/zip.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/zip.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot diff --git a/engine/SCons/Tool/pdf.py b/engine/SCons/Tool/pdf.py index 792c4ca..50988b6 100644 --- a/engine/SCons/Tool/pdf.py +++ b/engine/SCons/Tool/pdf.py @@ -28,7 +28,7 @@ Add an explicit action to run epstopdf to convert .eps files to .pdf # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/pdf.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/pdf.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Builder import SCons.Tool diff --git a/engine/SCons/Tool/pdflatex.py b/engine/SCons/Tool/pdflatex.py index 8d4a1a7..2c559f7 100644 --- a/engine/SCons/Tool/pdflatex.py +++ b/engine/SCons/Tool/pdflatex.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/pdflatex.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/pdflatex.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Action import SCons.Util diff --git a/engine/SCons/Tool/pdftex.py b/engine/SCons/Tool/pdftex.py index c30066d..c658aa0 100644 --- a/engine/SCons/Tool/pdftex.py +++ b/engine/SCons/Tool/pdftex.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/pdftex.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/pdftex.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import SCons.Action diff --git a/engine/SCons/Tool/qt.py b/engine/SCons/Tool/qt.py index 1b1925c..a582e6f 100644 --- a/engine/SCons/Tool/qt.py +++ b/engine/SCons/Tool/qt.py @@ -33,7 +33,7 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/qt.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/qt.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path import re @@ -66,11 +66,17 @@ if SCons.Util.case_sensitive_suffixes('.h', '.H'): cxx_suffixes = cplusplus.CXXSuffixes -# def find_platform_specific_qt_paths(): """ - If the platform has non-standard paths which it installs QT in,return the likely default path - :return: + find non-standard QT paths + + If the platform does not put QT tools in standard search paths, + the path is expected to be set using QTDIR. SCons violates + the normal rule of not pulling from the user's environment + in this case. However, some test cases try to validate what + happens when QTDIR is unset, so we need to try to make a guess. + + :return: a guess at a path """ # qt_bin_dirs = [] @@ -83,6 +89,7 @@ def find_platform_specific_qt_paths(): # Centos installs QT under /usr/{lib,lib64}/qt{4,5,-3.3}/bin # so we need to handle this differently # qt_bin_dirs = glob.glob('/usr/lib64/qt*/bin') + # TODO: all current Fedoras do the same, need to look deeper here. qt_bin_dir = '/usr/lib64/qt-3.3/bin' return qt_bin_dir @@ -97,7 +104,7 @@ def checkMocIncluded(target, source, env): # not really sure about the path transformations (moc.cwd? cpp.cwd?) :-/ path = SCons.Defaults.CScan.path(env, moc.cwd) includes = SCons.Defaults.CScan(cpp, env, path) - if not moc in includes: + if moc not in includes: SCons.Warnings.warn( GeneratedMocFileNotIncluded, "Generated moc file '%s' is not included by '%s'" % @@ -118,7 +125,7 @@ class _Automoc(object): def __init__(self, objBuilderName): self.objBuilderName = objBuilderName - + def __call__(self, target, source, env): """ Smart autoscan function. Gets the list of objects for the Program @@ -133,25 +140,25 @@ class _Automoc(object): debug = int(env.subst('$QT_DEBUG')) except ValueError: debug = 0 - + # some shortcuts used in the scanner splitext = SCons.Util.splitext objBuilder = getattr(env, self.objBuilderName) - + # some regular expressions: # Q_OBJECT detection - q_object_search = re.compile(r'[^A-Za-z0-9]Q_OBJECT[^A-Za-z0-9]') + q_object_search = re.compile(r'[^A-Za-z0-9]Q_OBJECT[^A-Za-z0-9]') # cxx and c comment 'eater' #comment = re.compile(r'(//.*)|(/\*(([^*])|(\*[^/]))*\*/)') # CW: something must be wrong with the regexp. See also bug #998222 # CURRENTLY THERE IS NO TEST CASE FOR THAT - + # The following is kind of hacky to get builders working properly (FIXME) objBuilderEnv = objBuilder.env objBuilder.env = env mocBuilderEnv = env.Moc.env env.Moc.env = env - + # make a deep copy for the result; MocH objects will be appended out_sources = source[:] @@ -164,7 +171,7 @@ class _Automoc(object): cpp = obj.sources[0] if not splitext(str(cpp))[1] in cxx_suffixes: if debug: - print("scons: qt: '%s' is no cxx file. Discarded." % str(cpp)) + print("scons: qt: '%s' is no cxx file. Discarded." % str(cpp)) # c or fortran source continue #cpp_contents = comment.sub('', cpp.get_text_contents()) @@ -260,7 +267,7 @@ def uicScannerFunc(node, env, path): return result uicScanner = SCons.Scanner.Base(uicScannerFunc, - name = "UicScanner", + name = "UicScanner", node_class = SCons.Node.FS.File, node_factory = SCons.Node.FS.File, recursive = 0) @@ -336,7 +343,7 @@ def generate(env): mocBld.prefix[cxx] = '$QT_MOCCXXPREFIX' mocBld.suffix[cxx] = '$QT_MOCCXXSUFFIX' - # register the builders + # register the builders env['BUILDERS']['Uic'] = uicBld env['BUILDERS']['Moc'] = mocBld static_obj, shared_obj = SCons.Tool.createObjBuilders(env) diff --git a/engine/SCons/Tool/rmic.py b/engine/SCons/Tool/rmic.py index b2df405..d6f7b2b 100644 --- a/engine/SCons/Tool/rmic.py +++ b/engine/SCons/Tool/rmic.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/rmic.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/rmic.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path @@ -110,11 +110,9 @@ def generate(env): if env['PLATFORM'] == 'win32': version = env.get('JAVAVERSION', None) - default_paths=get_java_install_dirs(env['PLATFORM'], version=version) - # Ensure that we have a proper path for rmic - rmic = SCons.Tool.find_program_path(env, 'rmic', default_paths=default_paths) - + paths = get_java_install_dirs('win32', version=version) + rmic = SCons.Tool.find_program_path(env, 'rmic', default_paths=paths) # print("RMIC: %s"%rmic) if rmic: rmic_bin_dir = os.path.dirname(rmic) diff --git a/engine/SCons/Tool/rpcgen.py b/engine/SCons/Tool/rpcgen.py index a495fdd..b9f8ca6 100644 --- a/engine/SCons/Tool/rpcgen.py +++ b/engine/SCons/Tool/rpcgen.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/rpcgen.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/rpcgen.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from SCons.Builder import Builder import SCons.Util diff --git a/engine/SCons/Tool/rpm.py b/engine/SCons/Tool/rpm.py index 9531431..0253365 100644 --- a/engine/SCons/Tool/rpm.py +++ b/engine/SCons/Tool/rpm.py @@ -33,7 +33,7 @@ tar.gz consisting of the source file and a specfile. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/rpm.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/rpm.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import re @@ -51,43 +51,44 @@ def get_cmd(source, env): if SCons.Util.is_List(source): tar_file_with_included_specfile = source[0] return "%s %s %s"%(env['RPM'], env['RPMFLAGS'], - tar_file_with_included_specfile.get_abspath() ) + tar_file_with_included_specfile.get_abspath()) def build_rpm(target, source, env): # create a temporary rpm build root. - tmpdir = os.path.join( os.path.dirname( target[0].get_abspath() ), 'rpmtemp' ) + tmpdir = os.path.join(os.path.dirname(target[0].get_abspath()), 'rpmtemp') if os.path.exists(tmpdir): shutil.rmtree(tmpdir) # now create the mandatory rpm directory structure. for d in ['RPMS', 'SRPMS', 'SPECS', 'BUILD']: - os.makedirs( os.path.join( tmpdir, d ) ) + os.makedirs(os.path.join(tmpdir, d)) # set the topdir as an rpmflag. - env.Prepend( RPMFLAGS = '--define \'_topdir %s\'' % tmpdir ) + env.Prepend(RPMFLAGS = '--define \'_topdir %s\'' % tmpdir) # now call rpmbuild to create the rpm package. handle = subprocess.Popen(get_cmd(source, env), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True) - output = SCons.Util.to_str(handle.stdout.read()) + with handle.stdout: + output = SCons.Util.to_str(handle.stdout.read()) status = handle.wait() if status: - raise SCons.Errors.BuildError( node=target[0], - errstr=output, - filename=str(target[0]) ) + raise SCons.Errors.BuildError(node=target[0], + errstr=output, + filename=str(target[0])) else: # XXX: assume that LC_ALL=C is set while running rpmbuild - output_files = re.compile( 'Wrote: (.*)' ).findall( output ) + output_files = re.compile('Wrote: (.*)').findall(output) - for output, input in zip( output_files, target ): + for output, input in zip(output_files, target): rpm_output = os.path.basename(output) expected = os.path.basename(input.get_path()) assert expected == rpm_output, "got %s but expected %s" % (rpm_output, expected) - shutil.copy( output, input.get_abspath() ) + shutil.copy(output, input.get_abspath()) # cleanup before leaving. diff --git a/engine/SCons/Tool/rpmutils.py b/engine/SCons/Tool/rpmutils.py index 6c87f73..a2400ff 100644 --- a/engine/SCons/Tool/rpmutils.py +++ b/engine/SCons/Tool/rpmutils.py @@ -36,7 +36,7 @@ exact syntax. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/rpmutils.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/rpmutils.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import platform @@ -482,9 +482,11 @@ def updateRpmDicts(rpmrc, pyfile): """ try: # Read old rpmutils.py file - oldpy = open(pyfile,"r").readlines() + with open(pyfile,"r") as f: + oldpy = f.readlines() # Read current rpmrc.in file - rpm = open(rpmrc,"r").readlines() + with open(rpmrc,"r") as f: + rpm = f.readlines() # Parse for data data = {} # Allowed section names that get parsed @@ -511,24 +513,23 @@ def updateRpmDicts(rpmrc, pyfile): # Insert data data[key][tokens[1]] = tokens[2:] # Write new rpmutils.py file - out = open(pyfile,"w") - pm = 0 - for l in oldpy: - if pm: - if l.startswith('# End of rpmrc dictionaries'): - pm = 0 + with open(pyfile,"w") as out: + pm = 0 + for l in oldpy: + if pm: + if l.startswith('# End of rpmrc dictionaries'): + pm = 0 + out.write(l) + else: out.write(l) - else: - out.write(l) - if l.startswith('# Start of rpmrc dictionaries'): - pm = 1 - # Write data sections to single dictionaries - for key, entries in data.items(): - out.write("%s = {\n" % key) - for arch in sorted(entries.keys()): - out.write(" '%s' : ['%s'],\n" % (arch, "','".join(entries[arch]))) - out.write("}\n\n") - out.close() + if l.startswith('# Start of rpmrc dictionaries'): + pm = 1 + # Write data sections to single dictionaries + for key, entries in data.items(): + out.write("%s = {\n" % key) + for arch in sorted(entries.keys()): + out.write(" '%s' : ['%s'],\n" % (arch, "','".join(entries[arch]))) + out.write("}\n\n") except: pass diff --git a/engine/SCons/Tool/sgiar.py b/engine/SCons/Tool/sgiar.py index feab04f..d82ec89 100644 --- a/engine/SCons/Tool/sgiar.py +++ b/engine/SCons/Tool/sgiar.py @@ -33,7 +33,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgiar.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/sgiar.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/sgic++.py b/engine/SCons/Tool/sgic++.py index 9d5fc96..84d775a 100644 --- a/engine/SCons/Tool/sgic++.py +++ b/engine/SCons/Tool/sgic++.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgic++.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/sgic++.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" #forward proxy to the preffered cxx version from SCons.Tool.sgicxx import * diff --git a/engine/SCons/Tool/sgicc.py b/engine/SCons/Tool/sgicc.py index f957534..537f1a3 100644 --- a/engine/SCons/Tool/sgicc.py +++ b/engine/SCons/Tool/sgicc.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgicc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/sgicc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" from . import cc diff --git a/engine/SCons/Tool/sgicxx.py b/engine/SCons/Tool/sgicxx.py index f4bfb8d..d44ec26 100644 --- a/engine/SCons/Tool/sgicxx.py +++ b/engine/SCons/Tool/sgicxx.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgicxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/sgicxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sgilink.py b/engine/SCons/Tool/sgilink.py index fa64736..ca9e69c 100644 --- a/engine/SCons/Tool/sgilink.py +++ b/engine/SCons/Tool/sgilink.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgilink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/sgilink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sunar.py b/engine/SCons/Tool/sunar.py index abce0a4..07d45b2 100644 --- a/engine/SCons/Tool/sunar.py +++ b/engine/SCons/Tool/sunar.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunar.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/sunar.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/sunc++.py b/engine/SCons/Tool/sunc++.py index ef915f6..1611fe9 100644 --- a/engine/SCons/Tool/sunc++.py +++ b/engine/SCons/Tool/sunc++.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunc++.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/sunc++.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" #forward proxy to the preffered cxx version diff --git a/engine/SCons/Tool/suncc.py b/engine/SCons/Tool/suncc.py index 5b01402..da6ca6e 100644 --- a/engine/SCons/Tool/suncc.py +++ b/engine/SCons/Tool/suncc.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/suncc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/suncc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/suncxx.py b/engine/SCons/Tool/suncxx.py index d421946..1ee1c6a 100644 --- a/engine/SCons/Tool/suncxx.py +++ b/engine/SCons/Tool/suncxx.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/suncxx.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/suncxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons @@ -52,11 +52,17 @@ def get_package_info(package_name, pkginfo, pkgchk): version = None pathname = None try: - sadm_contents = open('/var/sadm/install/contents', 'r').read() + from subprocess import DEVNULL # py3k + except ImportError: + DEVNULL = open(os.devnull, 'wb') + + try: + with open('/var/sadm/install/contents', 'r') as f: + sadm_contents = f.read() except EnvironmentError: pass else: - sadm_re = re.compile('^(\S*/bin/CC)(=\S*)? %s$' % package_name, re.M) + sadm_re = re.compile(r'^(\S*/bin/CC)(=\S*)? %s$' % package_name, re.M) sadm_match = sadm_re.search(sadm_contents) if sadm_match: pathname = os.path.dirname(sadm_match.group(1)) @@ -64,12 +70,12 @@ def get_package_info(package_name, pkginfo, pkgchk): try: p = subprocess.Popen([pkginfo, '-l', package_name], stdout=subprocess.PIPE, - stderr=open('/dev/null', 'w')) + stderr=DEVNULL) except EnvironmentError: pass else: pkginfo_contents = p.communicate()[0] - version_re = re.compile('^ *VERSION:\s*(.*)$', re.M) + version_re = re.compile(r'^ *VERSION:\s*(.*)$', re.M) version_match = version_re.search(pkginfo_contents) if version_match: version = version_match.group(1) @@ -78,7 +84,7 @@ def get_package_info(package_name, pkginfo, pkgchk): try: p = subprocess.Popen([pkgchk, '-l', package_name], stdout=subprocess.PIPE, - stderr=open('/dev/null', 'w')) + stderr=DEVNULL) except EnvironmentError: pass else: diff --git a/engine/SCons/Tool/sunf77.py b/engine/SCons/Tool/sunf77.py index 9938d91..c1c216f 100644 --- a/engine/SCons/Tool/sunf77.py +++ b/engine/SCons/Tool/sunf77.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunf77.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/sunf77.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sunf90.py b/engine/SCons/Tool/sunf90.py index 2f6ef97..4cabee8 100644 --- a/engine/SCons/Tool/sunf90.py +++ b/engine/SCons/Tool/sunf90.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunf90.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/sunf90.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sunf95.py b/engine/SCons/Tool/sunf95.py index 1854165..077b1bc 100644 --- a/engine/SCons/Tool/sunf95.py +++ b/engine/SCons/Tool/sunf95.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunf95.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/sunf95.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sunlink.py b/engine/SCons/Tool/sunlink.py index 28ec971..8d965fa 100644 --- a/engine/SCons/Tool/sunlink.py +++ b/engine/SCons/Tool/sunlink.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunlink.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/sunlink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/swig.py b/engine/SCons/Tool/swig.py index a8d6400..2e61b91 100644 --- a/engine/SCons/Tool/swig.py +++ b/engine/SCons/Tool/swig.py @@ -32,7 +32,7 @@ from __future__ import print_function # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/swig.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/swig.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path import sys @@ -184,9 +184,10 @@ def generate(env): from SCons.Platform.mingw import MINGW_DEFAULT_PATHS from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS + from SCons.Platform.win32 import CHOCO_DEFAULT_PATH if sys.platform == 'win32': - swig = SCons.Tool.find_program_path(env, 'swig', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS + [r'C:\ProgramData\chocolatey\bin'] ) + swig = SCons.Tool.find_program_path(env, 'swig', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS + CHOCO_DEFAULT_PATH) if swig: swig_bin_dir = os.path.dirname(swig) env.AppendENVPath('PATH', swig_bin_dir) diff --git a/engine/SCons/Tool/tar.py b/engine/SCons/Tool/tar.py index 05a7c70..08c80f2 100644 --- a/engine/SCons/Tool/tar.py +++ b/engine/SCons/Tool/tar.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/tar.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/tar.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/tex.py b/engine/SCons/Tool/tex.py index 4607d2f..9beb557 100644 --- a/engine/SCons/Tool/tex.py +++ b/engine/SCons/Tool/tex.py @@ -33,7 +33,7 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/tex.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/tex.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path import re @@ -781,7 +781,7 @@ def tex_emitter_core(target, source, env, graphics_extensions): # add side effects if feature is present.If file is to be generated,add all side effects if Verbose and theSearch: print("check side effects for ",suffix_list[-1]) - if (theSearch != None) or (not source[0].exists() ): + if theSearch is not None or not source[0].exists(): file_list = [targetbase,] # for bibunit we need a list of files if suffix_list[-1] == 'bibunit': diff --git a/engine/SCons/Tool/textfile.py b/engine/SCons/Tool/textfile.py index 2cfa906..58a5007 100644 --- a/engine/SCons/Tool/textfile.py +++ b/engine/SCons/Tool/textfile.py @@ -44,7 +44,7 @@ Textfile/Substfile builder for SCons. is unpredictable whether the expansion will occur. """ -__revision__ = "src/engine/SCons/Tool/textfile.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/textfile.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons diff --git a/engine/SCons/Tool/tlib.py b/engine/SCons/Tool/tlib.py index 70dd18a..4d8101b 100644 --- a/engine/SCons/Tool/tlib.py +++ b/engine/SCons/Tool/tlib.py @@ -27,7 +27,7 @@ XXX # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/tlib.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/tlib.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Tool import SCons.Tool.bcc32 diff --git a/engine/SCons/Tool/wix.py b/engine/SCons/Tool/wix.py index b4f63ad..e79e4a1 100644 --- a/engine/SCons/Tool/wix.py +++ b/engine/SCons/Tool/wix.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/wix.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/wix.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import SCons.Builder import SCons.Action diff --git a/engine/SCons/Tool/xgettext.py b/engine/SCons/Tool/xgettext.py index 8925a9d..185558e 100644 --- a/engine/SCons/Tool/xgettext.py +++ b/engine/SCons/Tool/xgettext.py @@ -24,7 +24,24 @@ Tool specific initialization of `xgettext` tool. # 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/Tool/xgettext.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/xgettext.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" + +import os +import re +import subprocess +import sys + +import SCons.Action +import SCons.Node.FS +import SCons.Tool +import SCons.Util +from SCons.Builder import BuilderBase +from SCons.Environment import _null +from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS +from SCons.Platform.mingw import MINGW_DEFAULT_PATHS +from SCons.Tool.GettextCommon import _POTargetFactory +from SCons.Tool.GettextCommon import RPaths, _detect_xgettext +from SCons.Tool.GettextCommon import _xgettext_exists ############################################################################# @@ -41,10 +58,6 @@ class _CmdRunner(object): self.commandstr = commandstr def __call__(self, target, source, env): - import SCons.Action - import subprocess - import os - import sys kw = { 'stdin': 'devnull', 'stdout': subprocess.PIPE, @@ -57,11 +70,10 @@ class _CmdRunner(object): self.out, self.err = proc.communicate() self.status = proc.wait() if self.err: - sys.stderr.write(unicode(self.err)) + sys.stderr.write(SCons.Util.UnicodeType(self.err)) return self.status def strfunction(self, target, source, env): - import os comstr = self.commandstr if env.subst(comstr, target=target, source=source) == "": comstr = self.command @@ -74,9 +86,6 @@ class _CmdRunner(object): ############################################################################# def _update_pot_file(target, source, env): """ Action function for `POTUpdate` builder """ - import re - import os - import SCons.Action nop = lambda target, source, env: 0 # Save scons cwd and os cwd (NOTE: they may be different. After the job, we @@ -153,10 +162,6 @@ def _update_pot_file(target, source, env): ############################################################################# -############################################################################# -from SCons.Builder import BuilderBase - - ############################################################################# class _POTBuilder(BuilderBase): def _execute(self, env, target, source, *args): @@ -175,10 +180,6 @@ class _POTBuilder(BuilderBase): def _scan_xgettext_from_files(target, source, env, files=None, path=None): """ Parses `POTFILES.in`-like file and returns list of extracted file names. """ - import re - import SCons.Util - import SCons.Node.FS - if files is None: return 0 if not SCons.Util.is_List(files): @@ -230,10 +231,6 @@ def _scan_xgettext_from_files(target, source, env, files=None, path=None): ############################################################################# def _pot_update_emitter(target, source, env): """ Emitter function for `POTUpdate` builder """ - from SCons.Tool.GettextCommon import _POTargetFactory - import SCons.Util - import SCons.Node.FS - if 'XGETTEXTFROM' in env: xfrom = env['XGETTEXTFROM'] else: @@ -260,10 +257,6 @@ def _pot_update_emitter(target, source, env): ############################################################################# -############################################################################# -from SCons.Environment import _null - - ############################################################################# def _POTUpdateBuilderWrapper(env, target=None, source=_null, **kw): return env._POTUpdateBuilder(target, source, **kw) @@ -274,8 +267,6 @@ def _POTUpdateBuilderWrapper(env, target=None, source=_null, **kw): ############################################################################# def _POTUpdateBuilder(env, **kw): """ Creates `POTUpdate` builder object """ - import SCons.Action - from SCons.Tool.GettextCommon import _POTargetFactory kw['action'] = SCons.Action.Action(_update_pot_file, None) kw['suffix'] = '$POTSUFFIX' kw['target_factory'] = _POTargetFactory(env, alias='$POTUPDATE_ALIAS').File @@ -288,13 +279,6 @@ def _POTUpdateBuilder(env, **kw): ############################################################################# def generate(env, **kw): """ Generate `xgettext` tool """ - import sys - import os - import SCons.Util - import SCons.Tool - from SCons.Tool.GettextCommon import RPaths, _detect_xgettext - from SCons.Platform.mingw import MINGW_DEFAULT_PATHS - from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS if sys.platform == 'win32': xgettext = SCons.Tool.find_program_path(env, 'xgettext', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) @@ -359,7 +343,6 @@ def generate(env, **kw): ############################################################################# def exists(env): """ Check, whether the tool exists """ - from SCons.Tool.GettextCommon import _xgettext_exists try: return _xgettext_exists(env) except: diff --git a/engine/SCons/Tool/yacc.py b/engine/SCons/Tool/yacc.py index d328d20..6857574 100644 --- a/engine/SCons/Tool/yacc.py +++ b/engine/SCons/Tool/yacc.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/yacc.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/yacc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path import sys @@ -45,6 +45,11 @@ from SCons.Platform.win32 import CHOCO_DEFAULT_PATH YaccAction = SCons.Action.Action("$YACCCOM", "$YACCCOMSTR") +if sys.platform == 'win32': + BINS = ['bison', 'yacc', 'win_bison'] +else: + BINS = ["bison", "yacc"] + def _yaccEmitter(target, source, env, ysuf, hsuf): yaccflags = env.subst("$YACCFLAGS", target=target, source=source) flags = SCons.Util.CLVar(yaccflags) @@ -100,25 +105,26 @@ def yyEmitter(target, source, env): def get_yacc_path(env, append_paths=False): """ - Find the a path containing the lex or flex binaries. If a construction - environment is passed in then append the path to the ENV PATH. - """ - # save existing path to reset if we don't want to append any paths - envPath = env['ENV']['PATH'] - bins = ['bison', 'yacc', 'win_bison'] + Find the path to the yacc tool, searching several possible names + + Only called in the Windows case, so the default_path + can be Windows-specific - for prog in bins: + :param env: current construction environment + :param append_paths: if set, add the path to the tool to PATH + :return: path to yacc tool, if found + """ + for prog in BINS: bin_path = SCons.Tool.find_program_path( - env, - prog, + env, + prog, default_paths=CHOCO_DEFAULT_PATH + MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) if bin_path: - if not append_paths: - env['ENV']['PATH'] = envPath - else: + if append_paths: env.AppendENVPath('PATH', os.path.dirname(bin_path)) return bin_path - SCons.Warnings.Warning('lex tool requested, but lex or flex binary not found in ENV PATH') + SCons.Warnings.Warning('yacc tool requested, but yacc or bison binary not found in ENV PATH') + def generate(env): """Add Builders and construction variables for yacc to an Environment.""" @@ -140,29 +146,21 @@ def generate(env): cxx_file.add_emitter('.yy', yyEmitter) if sys.platform == 'win32': - bison = SCons.Tool.find_program_path(env, 'bison', default_paths=MINGW_DEFAULT_PATHS + CYGWIN_DEFAULT_PATHS ) - if bison: - bison_bin_dir = os.path.dirname(bison) - env.AppendENVPath('PATH', bison_bin_dir) - else: - SCons.Warnings.Warning('yacc tool requested, but bison binary not found in ENV PATH') + # ignore the return, all we need is for the path to be added + _ = get_yacc_path(env, append_paths=True) - if sys.platform == 'win32': - get_yacc_path(env, append_paths=True) - env["YACC"] = env.Detect(['bison', 'yacc', 'win_bison']) - else: - env["YACC"] = env.Detect(["bison", "yacc"]) - + env["YACC"] = env.Detect(BINS) env['YACCFLAGS'] = SCons.Util.CLVar('') env['YACCCOM'] = '$YACC $YACCFLAGS -o $TARGET $SOURCES' env['YACCHFILESUFFIX'] = '.h' - env['YACCHXXFILESUFFIX'] = '.hpp' - env['YACCVCGFILESUFFIX'] = '.vcg' def exists(env): - return env.Detect(['bison', 'yacc']) + if sys.platform == 'win32': + return get_yacc_path(env) + else: + return env.Detect(BINS) # Local Variables: # tab-width:4 diff --git a/engine/SCons/Tool/zip.py b/engine/SCons/Tool/zip.py index 2689634..b7efdc7 100644 --- a/engine/SCons/Tool/zip.py +++ b/engine/SCons/Tool/zip.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/zip.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Tool/zip.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path diff --git a/engine/SCons/Util.py b/engine/SCons/Util.py index 476f5d8..5b4c225 100644 --- a/engine/SCons/Util.py +++ b/engine/SCons/Util.py @@ -24,7 +24,7 @@ Various utility functions go here. # 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/Util.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Util.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import sys @@ -33,6 +33,7 @@ import re import types import codecs import pprint +import hashlib PY3 = sys.version_info[0] == 3 @@ -656,13 +657,15 @@ except ImportError: pass RegError = _NoError -WinError = None + # Make sure we have a definition of WindowsError so we can # run platform-independent tests of Windows functionality on # platforms other than Windows. (WindowsError is, in fact, an # OSError subclass on Windows.) + class PlainWindowsError(OSError): pass + try: WinError = WindowsError except NameError: @@ -676,7 +679,7 @@ if can_read_reg: HKEY_USERS = hkey_mod.HKEY_USERS def RegGetValue(root, key): - """This utility function returns a value in the registry + r"""This utility function returns a value in the registry without having to open the key first. Only available on Windows platforms with a version of Python that can read the registry. Returns the same thing as @@ -883,7 +886,7 @@ def PrependPath(oldpath, newpath, sep = os.pathsep, # now we add them only if they are unique for path in newpaths: normpath = os.path.normpath(os.path.normcase(path)) - if path and not normpath in normpaths: + if path and normpath not in normpaths: paths.append(path) normpaths.append(normpath) @@ -963,7 +966,7 @@ def AppendPath(oldpath, newpath, sep = os.pathsep, # now we add them only if they are unique for path in newpaths: normpath = os.path.normpath(os.path.normcase(path)) - if path and not normpath in normpaths: + if path and normpath not in normpaths: paths.append(path) normpaths.append(normpath) paths.reverse() @@ -999,7 +1002,9 @@ if sys.platform == 'cygwin': def get_native_path(path): """Transforms an absolute path into a native path for the system. In Cygwin, this converts from a Cygwin path to a Windows one.""" - return os.popen('cygpath -w ' + path).read().replace('\n', '') + with os.popen('cygpath -w ' + path) as p: + npath = p.read().replace('\n', '') + return npath else: def get_native_path(path): """Transforms an absolute path into a native path for the system. @@ -1176,10 +1181,13 @@ def unique(s): # ASPN: Python Cookbook: Remove duplicates from a sequence # First comment, dated 2001/10/13. # (Also in the printed Python Cookbook.) +# This not currently used, in favor of the next function... def uniquer(seq, idfun=None): - if idfun is None: - def idfun(x): return x + def default_idfun(x): + return x + if not idfun: + idfun = default_idfun seen = {} result = [] for item in seq: @@ -1444,56 +1452,53 @@ def RenameFunction(function, name): function.__defaults__) -md5 = False - +if hasattr(hashlib, 'md5'): + md5 = True -def MD5signature(s): - return str(s) + def MD5signature(s): + """ + Generate md5 signature of a string + :param s: either string or bytes. Normally should be bytes + :return: String of hex digits representing the signature + """ + m = hashlib.md5() -def MD5filesignature(fname, chunksize=65536): - with open(fname, "rb") as f: - result = f.read() - return result + try: + m.update(to_bytes(s)) + except TypeError as e: + m.update(to_bytes(str(s))) -try: - import hashlib -except ImportError: - pass -else: - if hasattr(hashlib, 'md5'): - md5 = True + return m.hexdigest() - def MD5signature(s): - """ - Generate a String of Hex digits representing the md5 signature of the string - :param s: either string or bytes. Normally should be bytes - :return: String of hex digits - """ - m = hashlib.md5() + def MD5filesignature(fname, chunksize=65536): + """ + Generate the md5 signature of a file - try: - m.update(to_bytes(s)) - except TypeError as e: - m.update(to_bytes(str(s))) - - return m.hexdigest() - - def MD5filesignature(fname, chunksize=65536): - """ - :param fname: - :param chunksize: - :return: String of Hex digits - """ - m = hashlib.md5() - f = open(fname, "rb") + :param fname: file to hash + :param chunksize: chunk size to read + :return: String of Hex digits representing the signature + """ + m = hashlib.md5() + with open(fname, "rb") as f: while True: blck = f.read(chunksize) if not blck: break m.update(to_bytes(blck)) - f.close() - return m.hexdigest() + return m.hexdigest() +else: + # if md5 algorithm not available, just return data unmodified + # could add alternative signature scheme here + md5 = False + + def MD5signature(s): + return str(s) + + def MD5filesignature(fname, chunksize=65536): + with open(fname, "rb") as f: + result = f.read() + return result def MD5collect(signatures): @@ -1509,7 +1514,6 @@ def MD5collect(signatures): return MD5signature(', '.join(signatures)) - def silent_intern(x): """ Perform sys.intern() on the passed argument and return the result. @@ -1533,7 +1537,7 @@ def silent_intern(x): class Null(object): """ Null objects always and reliably "do nothing." """ def __new__(cls, *args, **kwargs): - if not '_instance' in vars(cls): + if '_instance' not in vars(cls): cls._instance = super(Null, cls).__new__(cls, *args, **kwargs) return cls._instance def __init__(self, *args, **kwargs): diff --git a/engine/SCons/Variables/BoolVariable.py b/engine/SCons/Variables/BoolVariable.py index 71b554a..4cb9f35 100644 --- a/engine/SCons/Variables/BoolVariable.py +++ b/engine/SCons/Variables/BoolVariable.py @@ -34,7 +34,7 @@ Usage example:: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/BoolVariable.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Variables/BoolVariable.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __all__ = ['BoolVariable',] diff --git a/engine/SCons/Variables/EnumVariable.py b/engine/SCons/Variables/EnumVariable.py index 4995bb1..ba9f972 100644 --- a/engine/SCons/Variables/EnumVariable.py +++ b/engine/SCons/Variables/EnumVariable.py @@ -37,7 +37,7 @@ Usage example:: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/EnumVariable.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Variables/EnumVariable.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __all__ = ['EnumVariable',] @@ -45,7 +45,7 @@ __all__ = ['EnumVariable',] import SCons.Errors def _validator(key, val, env, vals): - if not val in vals: + if val not in vals: raise SCons.Errors.UserError( 'Invalid value for option %s: %s. Valid values are: %s' % (key, val, vals)) diff --git a/engine/SCons/Variables/ListVariable.py b/engine/SCons/Variables/ListVariable.py index 4995382..a30f265 100644 --- a/engine/SCons/Variables/ListVariable.py +++ b/engine/SCons/Variables/ListVariable.py @@ -46,7 +46,7 @@ Usage example:: # 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/Variables/ListVariable.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Variables/ListVariable.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" # Known Bug: This should behave like a Set-Type, but does not really, # since elements can occur twice. @@ -96,7 +96,7 @@ def _converter(val, allowedElems, mapdict): else: val = [_f for _f in val.split(',') if _f] val = [mapdict.get(v, v) for v in val] - notAllowed = [v for v in val if not v in allowedElems] + notAllowed = [v for v in val if v not in allowedElems] if notAllowed: raise ValueError("Invalid value(s) for option: %s" % ','.join(notAllowed)) diff --git a/engine/SCons/Variables/PackageVariable.py b/engine/SCons/Variables/PackageVariable.py index e1d2e3d..7c23cca 100644 --- a/engine/SCons/Variables/PackageVariable.py +++ b/engine/SCons/Variables/PackageVariable.py @@ -50,7 +50,7 @@ Usage example: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/PackageVariable.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Variables/PackageVariable.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __all__ = ['PackageVariable',] diff --git a/engine/SCons/Variables/PathVariable.py b/engine/SCons/Variables/PathVariable.py index 8003ba6..bf123fb 100644 --- a/engine/SCons/Variables/PathVariable.py +++ b/engine/SCons/Variables/PathVariable.py @@ -67,7 +67,7 @@ Usage example:: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/PathVariable.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Variables/PathVariable.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __all__ = ['PathVariable',] diff --git a/engine/SCons/Variables/__init__.py b/engine/SCons/Variables/__init__.py index c218e18..5b4b3af 100644 --- a/engine/SCons/Variables/__init__.py +++ b/engine/SCons/Variables/__init__.py @@ -26,7 +26,7 @@ customizable variables to an SCons build. # 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/Variables/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Variables/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os.path import sys @@ -99,7 +99,7 @@ class Variables(object): option.converter = converter self.options.append(option) - + # options might be added after the 'unknown' dict has been set up, # so we remove the key and all its aliases from that dict for alias in list(option.aliases) + [ option.key ]: @@ -168,7 +168,7 @@ class Variables(object): # first set the defaults: for option in self.options: - if not option.default is None: + if option.default is not None: values[option.key] = option.default # next set the value specified in the options file @@ -288,7 +288,7 @@ class Variables(object): env - an environment that is used to get the current values of the options. - cmp - Either a function as follows: The specific sort function should take two arguments and return -1, 0 or 1 + cmp - Either a function as follows: The specific sort function should take two arguments and return -1, 0 or 1 or a boolean to indicate if it should be sorted. """ diff --git a/engine/SCons/Warnings.py b/engine/SCons/Warnings.py index d3143fd..1c84d57 100644 --- a/engine/SCons/Warnings.py +++ b/engine/SCons/Warnings.py @@ -27,7 +27,7 @@ This file implements the warnings framework for SCons. """ -__revision__ = "src/engine/SCons/Warnings.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/Warnings.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import sys @@ -193,9 +193,10 @@ def warn(clazz, *args): break def process_warn_strings(arguments): - """Process string specifications of enabling/disabling warnings, - as passed to the --warn option or the SetOption('warn') function. - + """Process requests to enable/disable warnings. + + The requests are strings passed to the --warn option or the + SetOption('warn') function. An argument to this option should be of the form or no-. The warning class is munged in order @@ -210,7 +211,6 @@ def process_warn_strings(arguments): As a special case, --warn=all and --warn=no-all will enable or disable (respectively) the base Warning class of all warnings. - """ def _capitalize(s): diff --git a/engine/SCons/__init__.py b/engine/SCons/__init__.py index 27c37eb..1f52e1f 100644 --- a/engine/SCons/__init__.py +++ b/engine/SCons/__init__.py @@ -27,15 +27,15 @@ The main package for the SCons software construction utility. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/__init__.py ae4de9ab2249be220b6658a514eef8c3a57afc04 2019-07-21 02:32:15 bdeegan" -__version__ = "3.0.5" +__version__ = "3.1.0" -__build__ = "a56bbd8c09fb219ab8a9673330ffcd55279219d0" +__build__ = "ae4de9ab2249be220b6658a514eef8c3a57afc04" __buildsys__ = "kufra" -__date__ = "2019-03-26 23:16:31" +__date__ = "2019-07-21 02:32:15" __developer__ = "bdeegan" diff --git a/engine/SCons/__main__.py b/engine/SCons/__main__.py new file mode 100644 index 0000000..0dfbb9d --- /dev/null +++ b/engine/SCons/__main__.py @@ -0,0 +1,4 @@ +import SCons.Script +# this does all the work, and calls sys.exit +# with the proper exit status when done. +SCons.Script.main() diff --git a/engine/SCons/compat/__init__.py b/engine/SCons/compat/__init__.py index 7846577..dcbd8e8 100644 --- a/engine/SCons/compat/__init__.py +++ b/engine/SCons/compat/__init__.py @@ -57,31 +57,22 @@ function defined below loads the module as the "real" name (without the rest of our code will find our pre-loaded compatibility module. """ -__revision__ = "src/engine/SCons/compat/__init__.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/compat/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import sys -import imp # Use the "imp" module to protect imports from fixers. +import importlib PYPY = hasattr(sys, 'pypy_translation_info') -def import_as(module, name): - """ - Imports the specified module (from our local directory) as the - specified name, returning the loaded module object. - """ - dir = os.path.split(__file__)[0] - return imp.load_module(name, *imp.find_module(module, [dir])) - - def rename_module(new, old): """ - Attempts to import the old module and load it under the new name. + Attempt to import the old module and load it under the new name. Used for purely cosmetic name changes in Python 3.x. """ try: - sys.modules[new] = imp.load_module(old, *imp.find_module(old)) + sys.modules[new] = importlib.import_module(old) return True except ImportError: return False @@ -122,28 +113,28 @@ except AttributeError: # intern into the sys package sys.intern = intern -# Preparing for 3.x. UserDict, UserList, UserString are in -# collections for 3.x, but standalone in 2.7.x +# UserDict, UserList, UserString are in # collections for 3.x, +# but standalone in 2.7.x. Monkey-patch into collections for 2.7. import collections try: collections.UserDict except AttributeError: - exec ('from UserDict import UserDict as _UserDict') + from UserDict import UserDict as _UserDict collections.UserDict = _UserDict del _UserDict try: collections.UserList except AttributeError: - exec ('from UserList import UserList as _UserList') + from UserList import UserList as _UserList collections.UserList = _UserList del _UserList try: collections.UserString except AttributeError: - exec ('from UserString import UserString as _UserString') + from UserString import UserString as _UserString collections.UserString = _UserString del _UserString diff --git a/engine/SCons/compat/_scons_dbm.py b/engine/SCons/compat/_scons_dbm.py index a57f105..ec5e261 100644 --- a/engine/SCons/compat/_scons_dbm.py +++ b/engine/SCons/compat/_scons_dbm.py @@ -30,7 +30,7 @@ that the whichdb.whichdb() implementstation in the various 2.X versions of Python won't blow up even if dbm wasn't compiled in. """ -__revision__ = "src/engine/SCons/compat/_scons_dbm.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/compat/_scons_dbm.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" class error(Exception): pass diff --git a/engine/SCons/cpp.py b/engine/SCons/cpp.py index eb537e2..7c4ac92 100644 --- a/engine/SCons/cpp.py +++ b/engine/SCons/cpp.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/cpp.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/cpp.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" __doc__ = """ SCons C Pre-Processor module @@ -165,7 +165,7 @@ def CPP_to_Python(s): """ s = CPP_to_Python_Ops_Expression.sub(CPP_to_Python_Ops_Sub, s) for expr, repl in CPP_to_Python_Eval_List: - s = expr.sub(repl, s) + s = re.sub(expr, repl, s) return s @@ -210,7 +210,7 @@ class FunctionEvaluator(object): parts = [] for s in self.expansion: - if not s in self.args: + if s not in self.args: s = repr(s) parts.append(s) statement = ' + '.join(parts) diff --git a/engine/SCons/exitfuncs.py b/engine/SCons/exitfuncs.py index e1b9382..c5414a2 100644 --- a/engine/SCons/exitfuncs.py +++ b/engine/SCons/exitfuncs.py @@ -27,7 +27,7 @@ Register functions which are executed when SCons exits for any reason. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/exitfuncs.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/engine/SCons/exitfuncs.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import atexit diff --git a/scons-time.1 b/scons-time.1 index d9e9bae..8ea1da3 100644 --- a/scons-time.1 +++ b/scons-time.1 @@ -2,12 +2,12 @@ .\" Title: SCONS-TIME .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 03/26/2019 -.\" Manual: SCons 3.0.5 -.\" Source: SCons 3.0.5 +.\" Date: 07/20/2019 +.\" Manual: SCons 3.1.0 +.\" Source: SCons 3.1.0 .\" Language: English .\" -.TH "SCONS\-TIME" "1" "03/26/2019" "SCons 3\&.0\&.5" "SCons 3\&.0\&.5" +.TH "SCONS\-TIME" "1" "07/20/2019" "SCons 3\&.1\&.0" "SCons 3\&.1\&.0" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/scons.1 b/scons.1 index b9e2594..4e75215 100644 --- a/scons.1 +++ b/scons.1 @@ -3,11 +3,11 @@ .\" Author: Steven Knight .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 2004 - 2019 -.\" Manual: SCons 3.0.5 -.\" Source: SCons 3.0.5 version 3.0.5 +.\" Manual: SCons 3.1.0 +.\" Source: SCons 3.1.0 version 3.1.0 .\" Language: English .\" -.TH "SCONS" "1" "2004 - 2019" "SCons 3\&.0\&.5 version 3.0.5" "SCons 3\&.0\&.5" +.TH "SCONS" "1" "2004 - 2019" "SCons 3\&.1\&.0 version 3.1.0" "SCons 3\&.1\&.0" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -1413,14 +1413,14 @@ env[\*(AqBAR\*(Aq] = \*(Aqbar\*(Aq As a convenience, construction variables may also be set or modified by the \fIparse_flags\fR keyword argument, which applies the -\fBParseFlags\fR +\fBenv\&.MergeFlags\fR method (described below) to the argument value after all other processing is completed\&. This is useful either if the exact content of the flags is unknown (for example, read from a control file) or if the flags are distributed to a number of construction variables\&. .sp .if n \{\ .RS 4 .\} .nf -env = Environment(parse_flags = \*(Aq\-Iinclude \-DEBUG \-lm\*(Aq) +env = Environment(parse_flags=\*(Aq\-Iinclude \-DEBUG \-lm\*(Aq) .fi .if n \{\ .RE @@ -3875,13 +3875,14 @@ env\&.SharedLibrary(\*(Aqword\*(Aq, \*(Aqword\&.cpp\*(Aq, .PP It is also possible to use the \fIparse_flags\fR -keyword argument in an override: +keyword argument in an override, to merge command\-line style arguments into the appropriate construction variables (see +\fBenv\&.MergeFlags\fR)\&. .sp .if n \{\ .RS 4 .\} .nf -env = Program(\*(Aqhello\*(Aq, \*(Aqhello\&.c\*(Aq, parse_flags = \*(Aq\-Iinclude \-DEBUG \-lm\*(Aq) +env = Program(\*(Aqhello\*(Aq, \*(Aqhello\&.c\*(Aq, parse_flags=\*(Aq\-Iinclude \-DEBUG \-lm\*(Aq) .fi .if n \{\ .RE @@ -4891,15 +4892,17 @@ This builds a Visual Studio project file, based on the version of Visual Studio \fB$MSVS_VERSION\fR in the Environment constructor)\&. For Visual Studio 6, it will generate a \&.dsp -file\&. For Visual Studio 7 (\&.NET) and later versions, it will generate a +file\&. For Visual Studio 7, 8, and 9, it will generate a \&.vcproj +file\&. For Visual Studio 10 and later, it will generate a +\&.vcxproj file\&. .sp By default, this also generates a solution file for the specified project, a \&.dsw file for Visual Studio 6 or a \&.sln -file for Visual Studio 7 (\&.NET)\&. This behavior may be disabled by specifying +file for Visual Studio 7 and later\&. This behavior may be disabled by specifying auto_build_solution=0 when you call \fBMSVSProject\fR, in which case you presumably want to build the solution file(s) by calling the @@ -4951,6 +4954,28 @@ variant entries, or be empty (not specified)\&. If you give only one, it will automatically be propagated to all variants\&. .RE .PP +cppdefines +.RS 4 +Preprocessor definitions for the different variants\&. The number of +cppdefines +entries must match the number of +variant +entries, or be empty (not specified)\&. If you give only one, it will automatically be propagated to all variants\&. If you don\*(Aqt give this parameter, SCons will use the invoking environment\*(Aqs +CPPDEFINES +entry for all variants\&. +.RE +.PP +cpppaths +.RS 4 +Compiler include paths for the different variants\&. The number of +cpppaths +entries must match the number of +variant +entries, or be empty (not specified)\&. If you give only one, it will automatically be propagated to all variants\&. If you don\*(Aqt give this parameter, SCons will use the invoking environment\*(Aqs +CPPPATH +entry for all variants\&. +.RE +.PP buildtarget .RS 4 An optional string, node, or list of strings or nodes (one per build variant), to tell the Visual Studio debugger what output target to use in what build variant\&. The number of @@ -7524,14 +7549,15 @@ env4 = env\&.Clone(tools = [\*(Aqmsvc\*(Aq, MyTool]) .sp The \fIparse_flags\fR -keyword argument is also recognized: +keyword argument is also recognized to allow merging command\-line style arguments into the appropriate construction variables (see +\fBenv\&.MergeFlags\fR)\&. .sp .if n \{\ .RS 4 .\} .nf # create an environment for compiling programs that use wxWidgets -wx_env = env\&.Clone(parse_flags = \*(Aq!wx\-config \-\-cflags \-\-cxxflags\*(Aq) +wx_env = env\&.Clone(parse_flags=\*(Aq!wx\-config \-\-cflags \-\-cxxflags\*(Aq) .fi .if n \{\ .RE @@ -7704,6 +7730,13 @@ the last time the \fItarget\fR was built\&. This can be consulted to match various file characteristics such as the timestamp, size, or content signature\&. .RE +.PP +\fIrepo_node\fR +.RS 4 +Use this node instead of the one specified by +\fIdependency\fR +to determine if the dependency has changed\&. +.RE .sp The \fIfunction\fR @@ -7727,7 +7760,7 @@ Example: .RS 4 .\} .nf -def my_decider(dependency, target, prev_ni): +def my_decider(dependency, target, prev_ni, repo_node=None): return not os\&.path\&.exists(str(target)) env\&.Decider(my_decider) @@ -8868,6 +8901,9 @@ Flag values are translated accordig to the prefix found, and added to the follow \-frameworkdir= FRAMEWORKPATH \-include CCFLAGS \-isysroot CCFLAGS, LINKFLAGS +\-isystem CCFLAGS +\-iquote CCFLAGS +\-idirafter CCFLAGS \-I CPPPATH \-l LIBS \-L LIBPATH @@ -13925,6 +13961,7 @@ If is not set, SCons will (by default) select the latest version of Visual C/C++ installed on your system\&. If the specified version isn\*(Aqt installed, tool initialization will fail\&. This variable must be passed as an argument to the Environment() constructor; setting it later has no effect\&. .sp Valid values for Windows are +14\&.2, 14\&.1, 14\&.0, 14\&.0Exp, @@ -16011,6 +16048,12 @@ TARSUFFIX The suffix used for tar file names\&. .RE .PP +TEMPFILEARGJOIN +.RS 4 +The string (or character) to be used to join the arguments passed to TEMPFILE when command line exceeds the limit set by +\fB$MAXLINELENGTH\fR\&. The default value is a space\&. However for MSVC, MSLINK the default is a line seperator characters as defined by os\&.linesep\&. Note this value is used literally and not expanded by the subst logic\&. +.RE +.PP TEMPFILEPREFIX .RS 4 The prefix for a temporary file used to store lines lines longer than $MAXLINELENGTH as operations which call out to a shell will fail if the line is too long, which particularly impacts linking\&. The default is \*(Aq@\*(Aq, which works for the Microsoft and GNU toolchains on Windows\&. Set this appropriately for other toolchains, for example \*(Aq\-@\*(Aq for the diab compiler or \*(Aq\-via\*(Aq for ARM toolchain\&. diff --git a/sconsign.1 b/sconsign.1 index 34d417b..596da26 100644 --- a/sconsign.1 +++ b/sconsign.1 @@ -2,12 +2,12 @@ .\" Title: SCONSIGN .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 03/26/2019 -.\" Manual: SCons 3.0.5 -.\" Source: SCons 3.0.5 +.\" Date: 07/20/2019 +.\" Manual: SCons 3.1.0 +.\" Source: SCons 3.1.0 .\" Language: English .\" -.TH "SCONSIGN" "1" "03/26/2019" "SCons 3\&.0\&.5" "SCons 3\&.0\&.5" +.TH "SCONSIGN" "1" "07/20/2019" "SCons 3\&.1\&.0" "SCons 3\&.1\&.0" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -28,26 +28,36 @@ .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" -sconsign \- print SCons \&.sconsign file information +sconsign \- print SCons signature file information .SH "SYNOPSIS" .HP \w'\fBsconsign\fR\ 'u -\fBsconsign\fR [\fIoptions\fR...] \fIfile\fR [\fI\&.\&.\&.\fR] +\fBsconsign\fR [\fIoptions\fR...] [\fIfile\fR...] .SH "DESCRIPTION" .PP The \fBsconsign\fR -command displays the contents of one or more -\fB\&.sconsign\fR -files specified by the user\&. +command displays the contents of one or more signature ("\fBsconsign\fR") files specified by the user\&. .PP By default, \fBsconsign\fR -dumps the entire contents of the specified file(s)\&. Each entry is printed in the following format: -.PP -file: signature timestamp length implicit_dependency_1: signature timestamp length implicit_dependency_2: signature timestamp length action_signature [action string] +dumps the entire contents of the specified file(s)\&. Without the verbose option, each entry is printed in the following format: +.sp +.if n \{\ +.RS 4 +.\} +.nf +file: signature timestamp length + implicit_dependency_1: signature timestamp length + implicit_dependency_2: signature timestamp length + \&.\&.\&. + action_signature [action string] +.fi +.if n \{\ +.RE +.\} .PP \fBNone\fR -is printed in place of any missing timestamp, bsig, or csig values for any entry or any of its dependencies\&. If the entry has no implicit dependencies, or no build action, the lines are simply omitted\&. +is printed in place of any missing timestamp, build signature ("bsig"), or content signature ("csig") values for any entry or any of its dependencies\&. If the entry has no implicit dependencies, or no build action, the lines are simply omitted\&. The verbose option expands the display into a more human readable format\&. .PP By default, \fBsconsign\fR @@ -56,7 +66,7 @@ assumes that any arguments that end with a \fB\&.dbm\fR suffix contains signature entries for more than one directory (that is, was specified by the -\fBSConsignFile ()\fR +\fBSConsignFile\fR function)\&. Any \fIfile\fR argument that ends in @@ -70,6 +80,12 @@ attempts to guess the format\&. If that does not work, an explicit format may be or \fB\-\-format=\fR options\&. +.PP +If there are no +\fIfile\fR +arguments, the name +\&.sconsign\&.dblite +is assumed\&. .SH "OPTIONS" .PP Various options control what information is printed and the format: @@ -110,7 +126,8 @@ The file(s) to be printed are in the specified \fIFORMAT\fR\&. Legal values are \fBdbm\fR (the DBM format used when the -\fBSConsignFile\fR() function is used) or +\fBSConsignFile\fR +function is used) or \fBsconsign\fR (the default format used for an individual \fB\&.sconsign\fR @@ -124,12 +141,12 @@ Prints a help message and exits\&. .PP \-i, \-\-implicit .RS 4 -Prints the list of cached implicit dependencies for all entries or the the specified entries\&. +Prints the list of cached implicit dependencies for all entries or for the specified entries\&. .RE .PP \-\-raw .RS 4 -Prints a pretty\-printed representation of the raw Python dictionary that holds build information about individual entry (both the entry itself or its implicit dependencies)\&. An entry\*(Aqs build action is still printed in its usual format\&. +Prints a pretty\-printed representation of the raw Python dictionary that holds build information about individual entries (both the entry itself and its implicit dependencies)\&. An entry\*(Aqs build action is still printed in its usual format\&. .RE .PP \-r, \-\-readable @@ -150,7 +167,8 @@ Prints labels identifying each field being printed\&. .PP SCONS_LIB_DIR .RS 4 -Specifies the directory that contains the SCons Python module directory (e\&.g\&. /home/aroach/scons\-src\-0\&.01/src/engine)\&. on the command line\&. +Specifies the directory that contains the SCons Python module directory (e\&.g\&. +/home/aroach/scons\-src\-0\&.01/src/engine)\&. on the command line\&. .RE .SH "SEE ALSO" .PP diff --git a/script/scons b/script/scons index c0fe872..98f4e62 100755 --- a/script/scons +++ b/script/scons @@ -25,15 +25,15 @@ from __future__ import print_function -__revision__ = "src/script/scons.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/script/scons.py ae4de9ab2249be220b6658a514eef8c3a57afc04 2019-07-21 02:32:15 bdeegan" -__version__ = "3.0.5" +__version__ = "3.1.0" -__build__ = "a56bbd8c09fb219ab8a9673330ffcd55279219d0" +__build__ = "ae4de9ab2249be220b6658a514eef8c3a57afc04" __buildsys__ = "kufra" -__date__ = "2019-03-26 23:16:31" +__date__ = "2019-07-21 02:32:15" __developer__ = "bdeegan" diff --git a/script/scons-configure-cache b/script/scons-configure-cache index 798b8fa..757a79f 100644 --- a/script/scons-configure-cache +++ b/script/scons-configure-cache @@ -37,15 +37,15 @@ import glob import json import os -__revision__ = "src/script/scons-configure-cache.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/script/scons-configure-cache.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" -__version__ = "3.0.5" +__version__ = "3.1.0" -__build__ = "a56bbd8c09fb219ab8a9673330ffcd55279219d0" +__build__ = "e724ae812eb96f4858a132f5b8c769724744faf6" __buildsys__ = "kufra" -__date__ = "2019-03-26 23:16:31" +__date__ = "2019-07-21 00:04:47" __developer__ = "bdeegan" diff --git a/script/scons-time b/script/scons-time index 26ddd77..975ff64 100644 --- a/script/scons-time +++ b/script/scons-time @@ -31,7 +31,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import division, print_function -__revision__ = "src/script/scons-time.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/script/scons-time.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import getopt import glob @@ -41,21 +41,7 @@ import shutil import sys import tempfile import time - -def make_temp_file(**kw): - try: - result = tempfile.mktemp(**kw) - result = os.path.realpath(result) - except TypeError: - try: - save_template = tempfile.template - prefix = kw['prefix'] - del kw['prefix'] - tempfile.template = prefix - result = tempfile.mktemp(**kw) - finally: - tempfile.template = save_template - return result +import subprocess def HACK_for_exec(cmd, *args): """ @@ -121,7 +107,7 @@ class Line(object): # in the line's index number. We might want to represent # this some way rather than just drawing the line straight # between the two points on either side. - if not y is None: + if y is not None: print(fmt % (x, y)) print('e') @@ -155,13 +141,13 @@ class Gnuplotter(Plotter): result = [] for line in self.lines: result.extend(line.get_x_values()) - return [r for r in result if not r is None] + return [r for r in result if r is not None] def get_all_y_values(self): result = [] for line in self.lines: result.extend(line.get_y_values()) - return [r for r in result if not r is None] + return [r for r in result if r is not None] def get_min_x(self): try: @@ -248,14 +234,16 @@ def unzip(fname): os.makedirs(dir) except: pass - open(name, 'wb').write(zf.read(name)) + with open(name, 'wb') as f: + f.write(zf.read(name)) def read_tree(dir): for dirpath, dirnames, filenames in os.walk(dir): for fn in filenames: fn = os.path.join(dirpath, fn) if os.path.isfile(fn): - open(fn, 'rb').read() + with open(fn, 'rb') as f: + f.read() def redirect_to_file(command, log): return '%s > %s 2>&1' % (command, log) @@ -264,7 +252,7 @@ def tee_to_file(command, log): return '%s 2>&1 | tee %s' % (command, log) - + class SConsTimer(object): """ Usage: scons-time SUBCOMMAND [ARGUMENTS] @@ -360,7 +348,7 @@ class SConsTimer(object): 'SCons' : 'Total SCons execution time', 'commands' : 'Total command execution time', } - + time_string_all = 'Total .* time' # @@ -456,14 +444,20 @@ class SConsTimer(object): def log_execute(self, command, log): command = self.subst(command, self.__dict__) - output = os.popen(command).read() + p = os.popen(command) + output = p.read() + p.close() + #TODO: convert to subrocess, os.popen is obsolete. This didn't work: + #process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) + #output = process.stdout.read() + #process.stdout.close() + #process.wait() if self.verbose: sys.stdout.write(output) # TODO: Figure out # Not sure we need to write binary here - open(log, 'w').write(output) - - # + with open(log, 'w') as f: + f.write(str(output)) def archive_splitext(self, path): """ @@ -628,13 +622,14 @@ class SConsTimer(object): search_string = self.time_string_all else: search_string = time_string - contents = open(file).read() + with open(file) as f: + contents = f.read() if not contents: sys.stderr.write('file %s has no contents!\n' % repr(file)) return None result = re.findall(r'%s: ([\d\.]*)' % search_string, contents)[-4:] result = [ float(r) for r in result ] - if not time_string is None: + if time_string is not None: try: result = result[0] except IndexError: @@ -673,7 +668,8 @@ class SConsTimer(object): search_string = self.memory_string_all else: search_string = memory_string - lines = open(file).readlines() + with open(file) as f: + lines = f.readlines() lines = [ l for l in lines if l.startswith(search_string) ][-4:] result = [ int(l.split()[-1]) for l in lines[-4:] ] if len(result) == 1: @@ -685,14 +681,14 @@ class SConsTimer(object): Returns the counts of the specified object_name. """ object_string = ' ' + object_name + '\n' - lines = open(file).readlines() + with open(file) as f: + lines = f.readlines() line = [ l for l in lines if l.endswith(object_string) ][0] result = [ int(field) for field in line.split()[:4] ] if index is not None: result = result[index] return result - # command_alias = {} @@ -925,7 +921,7 @@ class SConsTimer(object): elif o in ('-p', '--prefix'): self.prefix = a elif o in ('--stage',): - if not a in self.stages: + if a not in self.stages: sys.stderr.write('%s: mem: Unrecognized stage "%s".\n' % (self.name, a)) sys.exit(1) stage = a @@ -1039,7 +1035,7 @@ class SConsTimer(object): elif o in ('-p', '--prefix'): self.prefix = a elif o in ('--stage',): - if not a in self.stages: + if a not in self.stages: sys.stderr.write('%s: obj: Unrecognized stage "%s".\n' % (self.name, a)) sys.stderr.write('%s Type "%s help obj" for help.\n' % (self.name_spaces, self.name)) sys.exit(1) @@ -1239,7 +1235,7 @@ class SConsTimer(object): return os.path.join(dir, 'src', 'engine') def prep_aegis_run(self, commands, removals): - self.aegis_tmpdir = make_temp_file(prefix = self.name + '-aegis-') + self.aegis_tmpdir = tempfile.mkdtemp(prefix=self.name + '-aegis-') removals.append((shutil.rmtree, 'rm -rf %%s', self.aegis_tmpdir)) self.aegis_parent_project = os.path.splitext(self.aegis_project)[0] @@ -1247,21 +1243,19 @@ class SConsTimer(object): self.scons_lib_dir = self.scons_lib_dir_path(self.aegis_tmpdir) commands.extend([ - 'mkdir %(aegis_tmpdir)s', (lambda: os.chdir(self.aegis_tmpdir), 'cd %(aegis_tmpdir)s'), '%(aegis)s -cp -ind -p %(aegis_parent_project)s .', '%(aegis)s -cp -ind -p %(aegis_project)s -delta %(run_number)s .', ]) def prep_subversion_run(self, commands, removals): - self.svn_tmpdir = make_temp_file(prefix = self.name + '-svn-') + self.svn_tmpdir = tempfile.mkdtemp(prefix=self.name + '-svn-') removals.append((shutil.rmtree, 'rm -rf %%s', self.svn_tmpdir)) self.scons = self.scons_path(self.svn_tmpdir) self.scons_lib_dir = self.scons_lib_dir_path(self.svn_tmpdir) commands.extend([ - 'mkdir %(svn_tmpdir)s', '%(svn)s co %(svn_co_flag)s -r %(run_number)s %(subversion_url)s %(svn_tmpdir)s', ]) @@ -1308,11 +1302,9 @@ class SConsTimer(object): if self.targets2 is None: self.targets2 = self.targets - self.tmpdir = make_temp_file(prefix = self.name + '-') + self.tmpdir = tempfile.mkdtemp(prefix=self.name + '-') commands.extend([ - 'mkdir %(tmpdir)s', - (os.chdir, 'cd %%s', self.tmpdir), ]) @@ -1365,7 +1357,6 @@ class SConsTimer(object): if not os.environ.get('PRESERVE'): commands.extend(removals) - commands.append((shutil.rmtree, 'rm -rf %%s', self.tmpdir)) self.run_command_list(commands, self.__dict__) @@ -1432,14 +1423,16 @@ class SConsTimer(object): elif o in ('--title',): self.title = a elif o in ('--which',): - if not a in list(self.time_strings.keys()): + if a not in list(self.time_strings.keys()): sys.stderr.write('%s: time: Unrecognized timer "%s".\n' % (self.name, a)) sys.stderr.write('%s Type "%s help time" for help.\n' % (self.name_spaces, self.name)) sys.exit(1) which = a if self.config_file: - HACK_for_exec(open(self.config_file, 'r').read(), self.__dict__) + with open(self.config_file, 'r') as f: + config = f.read() + HACK_for_exec(config, self.__dict__) if self.chdir: os.chdir(self.chdir) diff --git a/script/scons.bat b/script/scons.bat index 45c77ab..75e2a49 100644 --- a/script/scons.bat +++ b/script/scons.bat @@ -1,11 +1,11 @@ @REM Copyright (c) 2001 - 2019 The SCons Foundation -@REM src/script/scons.bat a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan +@REM src/script/scons.bat e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan @echo off set SCONS_ERRORLEVEL= if "%OS%" == "Windows_NT" goto WinNT @REM for 9x/Me you better not have more than 9 args -python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-3.0.5'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-3.0.5'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9 +python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-3.1.0'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-3.1.0'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9 @REM no way to set exit status of this script for 9x/Me goto endscons diff --git a/script/sconsign b/script/sconsign index 3b1e52d..3e8d4cf 100644 --- a/script/sconsign +++ b/script/sconsign @@ -25,15 +25,15 @@ from __future__ import print_function -__revision__ = "src/script/sconsign.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/script/sconsign.py ae4de9ab2249be220b6658a514eef8c3a57afc04 2019-07-21 02:32:15 bdeegan" -__version__ = "3.0.5" +__version__ = "3.1.0" -__build__ = "a56bbd8c09fb219ab8a9673330ffcd55279219d0" +__build__ = "ae4de9ab2249be220b6658a514eef8c3a57afc04" __buildsys__ = "kufra" -__date__ = "2019-03-26 23:16:31" +__date__ = "2019-07-21 02:32:15" __developer__ = "bdeegan" @@ -117,7 +117,7 @@ else: # check `pwd`/lib/scons*. temp.append(os.getcwd()) else: - if script_dir == '.' or script_dir == '': + if script_dir in ('.', ''): script_dir = os.getcwd() head, tail = os.path.split(script_dir) if tail == "bin": @@ -185,13 +185,13 @@ import SCons.compat try: import whichdb + whichdb = whichdb.whichdb except ImportError as e: from dbm import whichdb import time import pickle -import imp import SCons.SConsign @@ -200,9 +200,8 @@ def my_whichdb(filename): if filename[-7:] == ".dblite": return "SCons.dblite" try: - f = open(filename + ".dblite", "rb") - f.close() - return "SCons.dblite" + with open(filename + ".dblite", "rb"): + return "SCons.dblite" except IOError: pass return _orig_whichdb(filename) @@ -217,6 +216,8 @@ whichdb = my_whichdb #dbm.whichdb = my_whichdb def my_import(mname): + import imp + if '.' in mname: i = mname.rfind('.') parent = my_import(mname[:i]) @@ -247,9 +248,8 @@ Readable = 0 Warns = 0 - def default_mapper(entry, name): - ''' + """ Stringify an entry that doesn't have an explicit mapping. Args: @@ -258,10 +258,10 @@ def default_mapper(entry, name): Returns: str - ''' + """ try: val = eval("entry." + name) - except: + except AttributeError: val = None if sys.version_info.major >= 3 and isinstance(val, bytes): # This is a dirty hack for py 2/3 compatibility. csig is a bytes object @@ -272,7 +272,7 @@ def default_mapper(entry, name): def map_action(entry, _): - ''' + """ Stringify an action entry and signature. Args: @@ -281,7 +281,7 @@ def map_action(entry, _): Returns: str - ''' + """ try: bact = entry.bact bactsig = entry.bactsig @@ -289,8 +289,9 @@ def map_action(entry, _): return None return '%s [%s]' % (bactsig, bact) + def map_timestamp(entry, _): - ''' + """ Stringify a timestamp entry. Args: @@ -299,7 +300,7 @@ def map_timestamp(entry, _): Returns: str - ''' + """ try: timestamp = entry.timestamp except AttributeError: @@ -309,8 +310,9 @@ def map_timestamp(entry, _): else: return str(timestamp) + def map_bkids(entry, _): - ''' + """ Stringify an implicit entry. Args: @@ -319,7 +321,7 @@ def map_bkids(entry, _): Returns: str - ''' + """ try: bkids = entry.bsources + entry.bdepends + entry.bimplicit bkidsigs = entry.bsourcesigs + entry.bdependsigs + entry.bimplicitsigs @@ -448,8 +450,8 @@ class Do_SConsignDB(object): def __call__(self, fname): # The *dbm modules stick their own file suffixes on the names - # that are passed in. This is causes us to jump through some - # hoops here to be able to allow the user + # that are passed in. This causes us to jump through some + # hoops here. try: # Try opening the specified file name. Example: # SPECIFIED OPENED BY self.dbm.open() @@ -461,16 +463,17 @@ class Do_SConsignDB(object): print_e = e try: # That didn't work, so try opening the base name, - # so that if the actually passed in 'sconsign.dblite' + # so that if they actually passed in 'sconsign.dblite' # (for example), the dbm module will put the suffix back # on for us and open it anyway. db = self.dbm.open(os.path.splitext(fname)[0], "r") except (IOError, OSError): # That didn't work either. See if the file name - # they specified just exists (independent of the dbm + # they specified even exists (independent of the dbm # suffix-mangling). try: - open(fname, "r") + with open(fname, "rb"): + pass # this is a touch only, we don't use it here. except (IOError, OSError) as e: # Nope, that file doesn't even exist, so report that # fact back. @@ -486,6 +489,9 @@ class Do_SConsignDB(object): except Exception as e: sys.stderr.write("sconsign: ignoring invalid `%s' file `%s': %s\n" % (self.dbm_name, fname, e)) + exc_type, _, _ = sys.exc_info() + if exc_type.__name__ == "ValueError" and sys.version_info < (3,0,0): + sys.stderr.write("Python 2 only supports pickle protocols 0-2.\n") return if Print_Directories: @@ -512,23 +518,23 @@ class Do_SConsignDB(object): def Do_SConsignDir(name): try: - fp = open(name, 'rb') + with open(name, 'rb') as fp: + try: + sconsign = SCons.SConsign.Dir(fp) + except KeyboardInterrupt: + raise + except pickle.UnpicklingError: + err = "sconsign: ignoring invalid .sconsign file `%s'\n" % (name) + sys.stderr.write(err) + return + except Exception as e: + err = "sconsign: ignoring invalid .sconsign file `%s': %s\n" % (name, e) + sys.stderr.write(err) + return + printentries(sconsign.entries, args[0]) except (IOError, OSError) as e: sys.stderr.write("sconsign: %s\n" % e) return - try: - sconsign = SCons.SConsign.Dir(fp) - except KeyboardInterrupt: - raise - except pickle.UnpicklingError: - err = "sconsign: ignoring invalid .sconsign file `%s'\n" % (name) - sys.stderr.write(err) - return - except Exception as e: - err = "sconsign: ignoring invalid .sconsign file `%s': %s\n" % (name, e) - sys.stderr.write(err) - return - printentries(sconsign.entries, args[0]) ############################################################################## @@ -536,7 +542,7 @@ def Do_SConsignDir(name): import getopt helpstr = """\ -Usage: sconsign [OPTIONS] FILE [...] +Usage: sconsign [OPTIONS] [FILE ...] Options: -a, --act, --action Print build action information. -c, --csig Print content signature information. @@ -552,13 +558,17 @@ Options: -v, --verbose Verbose, describe each field. """ -opts, args = getopt.getopt(sys.argv[1:], "acd:e:f:hirstv", - ['act', 'action', - 'csig', 'dir=', 'entry=', - 'format=', 'help', 'implicit', - 'raw', 'readable', - 'size', 'timestamp', 'verbose']) - +try: + opts, args = getopt.getopt(sys.argv[1:], "acd:e:f:hirstv", + ['act', 'action', + 'csig', 'dir=', 'entry=', + 'format=', 'help', 'implicit', + 'raw', 'readable', + 'size', 'timestamp', 'verbose']) +except getopt.GetoptError as err: + sys.stderr.write(str(err) + '\n') + print(helpstr) + sys.exit(2) for o, a in opts: if o in ('-a', '--act', '--action'): @@ -586,7 +596,7 @@ for o, a in opts: # this was handled by calling my_import('SCons.dblite') # again in earlier versions... SCons.dblite.ignore_corrupt_dbfiles = 0 - except: + except ImportError: sys.stderr.write("sconsign: illegal file format `%s'\n" % a) print(helpstr) sys.exit(2) @@ -613,6 +623,8 @@ if Do_Call: for a in args: Do_Call(a) else: + if not args: + args = [".sconsign.dblite"] for a in args: dbm_name = whichdb(a) if dbm_name: diff --git a/setup.py b/setup.py index cea0d37..790b1ea 100755 --- a/setup.py +++ b/setup.py @@ -44,13 +44,13 @@ NOTE: Installed SCons is not importable like usual Python packages. It is """ -__revision__ = "src/setup.py a56bbd8c09fb219ab8a9673330ffcd55279219d0 2019-03-26 23:16:31 bdeegan" +__revision__ = "src/setup.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" import os import stat import sys -Version = "3.0.5" +Version = "3.1.0" man_pages = [ 'scons.1', -- cgit v1.2.3 From 10171dd6571470b5cb1986d2a18a9737b37e4fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 23 Jul 2019 13:35:49 +0200 Subject: New upstream release 3.1.0 --- debian/changelog | 2 +- debian/patches/0600-manpage-spelling.patch | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index 4f67f4b..aecd027 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -scons (3.0.5-1) unstable; urgency=medium +scons (3.1.0-1) unstable; urgency=medium [ Jörg Frings-Fürst ] * New upstream release: diff --git a/debian/patches/0600-manpage-spelling.patch b/debian/patches/0600-manpage-spelling.patch index 1b7e99d..f0389ba 100644 --- a/debian/patches/0600-manpage-spelling.patch +++ b/debian/patches/0600-manpage-spelling.patch @@ -25,7 +25,7 @@ Index: trunk/scons.1 .sp .if n \{\ .RS 4 -@@ -6484,7 +6484,7 @@ env\&.Substfile(\*(Aqfoo\&.in\*(Aq, SUBS +@@ -6509,7 +6509,7 @@ env\&.Substfile(\*(Aqfoo\&.in\*(Aq, SUBS good_foo = [(\*(Aq$foobar\*(Aq, \*(Aq$foobar\*(Aq), (\*(Aq$foo\*(Aq, \*(Aq$foo\*(Aq)] env\&.Substfile(\*(Aqfoo\&.in\*(Aq, SUBST_DICT = good_foo) @@ -34,7 +34,7 @@ Index: trunk/scons.1 bad_bar = {\*(Aq@bar@\*(Aq: \*(Aq@soap@\*(Aq, \*(Aq@soap@\*(Aq: \*(Aqlye\*(Aq} env\&.Substfile(\*(Aqbar\&.in\*(Aq, SUBST_DICT = bad_bar) -@@ -6633,7 +6633,7 @@ files will be automatically created (i\& +@@ -6658,7 +6658,7 @@ files will be automatically created (i\& \fB$LINGUAS_FILE\fR and \fB$POTDOMAIN\fR @@ -43,7 +43,7 @@ Index: trunk/scons.1 \fBPOTUpdate\fR, and \fBPOUpdate\fR work here too\&. -@@ -6716,7 +6716,7 @@ file\&. Note, that the updated +@@ -6741,7 +6741,7 @@ file\&. Note, that the updated POT and PO @@ -52,7 +52,7 @@ Index: trunk/scons.1 po/ directory contains LINGUAS -@@ -7256,7 +7256,7 @@ Example: +@@ -7281,7 +7281,7 @@ Example: AllowSubstExceptions() # Also allow a string containing a zero\-division expansion @@ -61,7 +61,7 @@ Index: trunk/scons.1 AllowSubstExceptions(IndexError, NameError, ZeroDivisionError) .fi .if n \{\ -@@ -9231,7 +9231,7 @@ Return([vars\&.\&.\&., stop=]) +@@ -9267,7 +9267,7 @@ Return([vars\&.\&.\&., stop=]) .RS 4 By default, this stops processing the current SConscript file and returns to the calling SConscript file the values of the variables named in the \fIvars\fR @@ -70,7 +70,7 @@ Index: trunk/scons.1 \fBReturn\fR\&. Any strings that contain white space .sp The optional -@@ -10139,7 +10139,7 @@ function to create a copy of your source +@@ -10175,7 +10175,7 @@ function to create a copy of your source \fIvariant_dir\fR is not found but exists under \fIsrc_dir\fR, the file or directory is copied to @@ -79,7 +79,7 @@ Index: trunk/scons.1 .sp \fBVariantDir\fR -@@ -11479,7 +11479,7 @@ is used to create PDF output from an XML +@@ -11515,7 +11515,7 @@ is used to create PDF output from an XML .PP DOCBOOK_FOPFLAGS .RS 4 @@ -88,7 +88,7 @@ Index: trunk/scons.1 fop or xep\&. -@@ -11506,7 +11506,7 @@ is used to resolve XIncludes for a given +@@ -11542,7 +11542,7 @@ is used to resolve XIncludes for a given .PP DOCBOOK_XMLLINTFLAGS .RS 4 @@ -97,7 +97,7 @@ Index: trunk/scons.1 xmllint\&. .RE .PP -@@ -11537,7 +11537,7 @@ is used to transform an XML file via a g +@@ -11573,7 +11573,7 @@ is used to transform an XML file via a g .PP DOCBOOK_XSLTPROCFLAGS .RS 4 @@ -106,7 +106,7 @@ Index: trunk/scons.1 xsltproc (or saxon, -@@ -11546,7 +11546,7 @@ xalan)\&. +@@ -11582,7 +11582,7 @@ xalan)\&. .PP DOCBOOK_XSLTPROCPARAMS .RS 4 @@ -115,7 +115,7 @@ Index: trunk/scons.1 saxon and saxon\-xslt, respectively\&. -@@ -14216,7 +14216,7 @@ A list of installed versions of the Metr +@@ -14253,7 +14253,7 @@ A list of installed versions of the Metr .PP NAME .RS 4 @@ -124,7 +124,7 @@ Index: trunk/scons.1 .RE .PP no_import_lib -@@ -16584,7 +16584,7 @@ builder\&. +@@ -16627,7 +16627,7 @@ builder\&. .PP _XGETTEXTFROMFLAGS .RS 4 @@ -133,7 +133,7 @@ Index: trunk/scons.1 \-D flags from the \fB$XGETTEXTPATH\fR -@@ -18526,7 +18526,7 @@ a = Action("build < ${SOURCE\&.file} > $ +@@ -18569,7 +18569,7 @@ a = Action("build < ${SOURCE\&.file} > $ The \fBAction\fR() global function also takes an \fBexitstatfunc\fR -- cgit v1.2.3 From 43cacb94bedb48f949db55500b9d131baf971696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 23 Jul 2019 16:36:49 +0200 Subject: d/changelog: change date and time; refresh d/patches/0600-manpage-spelling.patch --- debian/changelog | 3 +-- debian/patches/0600-manpage-spelling.patch | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index aecd027..a835cbb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,7 +13,6 @@ scons (3.1.0-1) unstable; urgency=medium * debian/control: - Remove trailing whitespaces. - Add python3 support. - - Change VCS-* to point to the new repository. - Use secure URI for homepage. * debian/rules: - Remove trailing whitespaces. @@ -22,7 +21,7 @@ scons (3.1.0-1) unstable; urgency=medium - Add year 2019. - Use secure URI. - -- Jörg Frings-Fürst Sat, 13 Jul 2019 10:54:17 +0200 + -- Jörg Frings-Fürst Tue, 23 Jul 2019 16:33:56 +0200 scons (3.0.1-2) unstable; urgency=medium diff --git a/debian/patches/0600-manpage-spelling.patch b/debian/patches/0600-manpage-spelling.patch index f0389ba..63f1a47 100644 --- a/debian/patches/0600-manpage-spelling.patch +++ b/debian/patches/0600-manpage-spelling.patch @@ -1,6 +1,6 @@ Description: Correct manpage spelling errors Author: Jörg Frings-Fürst -Last-Update: 2016-09-11 +Last-Update: 2019-07-23 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ Index: trunk/scons.1 @@ -124,6 +124,24 @@ Index: trunk/scons.1 .RE .PP no_import_lib +@@ -16051,7 +16051,7 @@ The suffix used for tar file names\&. + TEMPFILEARGJOIN + .RS 4 + The string (or character) to be used to join the arguments passed to TEMPFILE when command line exceeds the limit set by +-\fB$MAXLINELENGTH\fR\&. The default value is a space\&. However for MSVC, MSLINK the default is a line seperator characters as defined by os\&.linesep\&. Note this value is used literally and not expanded by the subst logic\&. ++\fB$MAXLINELENGTH\fR\&. The default value is a space\&. However for MSVC, MSLINK the default is a line separator characters as defined by os\&.linesep\&. Note this value is used literally and not expanded by the subst logic\&. + .RE + .PP + TEMPFILEPREFIX +@@ -16403,7 +16403,7 @@ file\&. + .PP + X_RPM_EXTRADEFS + .RS 4 +-A list used to supply extra defintions or flags to be added to the RPM ++A list used to supply extra definitions or flags to be added to the RPM + \&.spec + file\&. Each item is added as\-is with a carriage return appended\&. This is useful if some specific RPM feature not otherwise anticipated by SCons needs to be turned on or off\&. Note if this variable is omitted, SCons will by default supply the value + \*(Aq%global debug_package %{nil}\*(Aq @@ -16627,7 +16627,7 @@ builder\&. .PP _XGETTEXTFROMFLAGS -- cgit v1.2.3 From ab14b61a609791de18fa6d191ec2971ebe691986 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Thu, 25 Jul 2019 07:37:35 +0200 Subject: Remove pythone2 support --- debian/changelog | 4 +++- debian/control | 2 -- debian/rules | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index a835cbb..6d3ffd0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -13,15 +13,17 @@ scons (3.1.0-1) unstable; urgency=medium * debian/control: - Remove trailing whitespaces. - Add python3 support. + - Remove python2 support. - Use secure URI for homepage. * debian/rules: - Remove trailing whitespaces. - Add python3 support. + - Remove python2 support. * debian/copyright: - Add year 2019. - Use secure URI. - -- Jörg Frings-Fürst Tue, 23 Jul 2019 16:33:56 +0200 + -- Jörg Frings-Fürst Thu, 25 Jul 2019 07:36:16 +0200 scons (3.0.1-2) unstable; urgency=medium diff --git a/debian/control b/debian/control index 5c6305c..280a6dd 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,6 @@ Uploaders: Laszlo Boszormenyi (GCS) Build-Depends: debhelper (>= 12), dh-python, - python-all, python3-all Standards-Version: 4.4.0 Homepage: https://www.scons.org/ @@ -16,7 +15,6 @@ Vcs-Browser: https://salsa.debian.org/debian/scons Package: scons Architecture: all Depends: - ${python2:Depends}, ${python3:Depends}, ${misc:Depends} Description: replacement for make diff --git a/debian/rules b/debian/rules index a6576fe..e759c42 100755 --- a/debian/rules +++ b/debian/rules @@ -3,4 +3,4 @@ export PYBUILD_INSTALL_ARGS=--no-version-script --standalone-lib --no-install-man --no-install-bat %: - dh $@ --with python2,python3 --buildsystem=pybuild + dh $@ --with python3 --buildsystem=pybuild -- cgit v1.2.3 From 81d95371129a9b7a5a6b79046972ab52b480aa86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Thu, 25 Jul 2019 07:45:27 +0200 Subject: Add version >= 3.5 to python3 --- debian/changelog | 4 ++-- debian/control | 2 +- debian/files | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 debian/files diff --git a/debian/changelog b/debian/changelog index 6d3ffd0..c9a36cf 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,7 +12,7 @@ scons (3.1.0-1) unstable; urgency=medium * Declare compliance with Debian Policy 4.4.0 (No changes needed). * debian/control: - Remove trailing whitespaces. - - Add python3 support. + - Add python3 (>= 3.5) support. - Remove python2 support. - Use secure URI for homepage. * debian/rules: @@ -23,7 +23,7 @@ scons (3.1.0-1) unstable; urgency=medium - Add year 2019. - Use secure URI. - -- Jörg Frings-Fürst Thu, 25 Jul 2019 07:36:16 +0200 + -- Jörg Frings-Fürst Thu, 25 Jul 2019 07:44:50 +0200 scons (3.0.1-2) unstable; urgency=medium diff --git a/debian/control b/debian/control index 280a6dd..8bcdffe 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Uploaders: Laszlo Boszormenyi (GCS) Build-Depends: debhelper (>= 12), dh-python, - python3-all + python3-all (>= 3.5) Standards-Version: 4.4.0 Homepage: https://www.scons.org/ Vcs-Git: https://salsa.debian.org/debian/scons.git diff --git a/debian/files b/debian/files new file mode 100644 index 0000000..b6685a8 --- /dev/null +++ b/debian/files @@ -0,0 +1 @@ +scons_3.1.0-1_source.buildinfo devel optional -- cgit v1.2.3 From 5dc21474e640669052b60f6cc3ee9a38a8e4d17b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Thu, 25 Jul 2019 07:46:25 +0200 Subject: remove d/files --- debian/files | 1 - 1 file changed, 1 deletion(-) delete mode 100644 debian/files diff --git a/debian/files b/debian/files deleted file mode 100644 index b6685a8..0000000 --- a/debian/files +++ /dev/null @@ -1 +0,0 @@ -scons_3.1.0-1_source.buildinfo devel optional -- cgit v1.2.3 From a0a7e6a528813424826ab447a0a01e61ee47a546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 6 Aug 2019 09:49:52 +0200 Subject: New debian/patches/0130-python3.patch --- debian/changelog | 4 +++- debian/patches/0130-python3.patch | 46 +++++++++++++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 debian/patches/0130-python3.patch diff --git a/debian/changelog b/debian/changelog index c9a36cf..052bc3b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,8 +22,10 @@ scons (3.1.0-1) unstable; urgency=medium * debian/copyright: - Add year 2019. - Use secure URI. + * New debian/patches/0130-python3.patch: + - Switch shebang to python3. - -- Jörg Frings-Fürst Thu, 25 Jul 2019 07:44:50 +0200 + -- Jörg Frings-Fürst Tue, 06 Aug 2019 09:49:22 +0200 scons (3.0.1-2) unstable; urgency=medium diff --git a/debian/patches/0130-python3.patch b/debian/patches/0130-python3.patch new file mode 100644 index 0000000..9c13592 --- /dev/null +++ b/debian/patches/0130-python3.patch @@ -0,0 +1,46 @@ +Description: Use shebang python3 +Author: Jörg Fring-Fürst +Forwarded: not-needed +Last-Update: 2019-08-06 +--- +This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ +Index: trunk/script/scons +=================================================================== +--- trunk.orig/script/scons ++++ trunk/script/scons +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#! /usr/bin/env python3 + # + # SCons - a Software Constructor + # +Index: trunk/script/scons-configure-cache +=================================================================== +--- trunk.orig/script/scons-configure-cache ++++ trunk/script/scons-configure-cache +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#! /usr/bin/env python3 + # + # SCons - a Software Constructor + # +Index: trunk/script/scons-time +=================================================================== +--- trunk.orig/script/scons-time ++++ trunk/script/scons-time +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + # scons-time - run SCons timings and collect statistics + # +Index: trunk/script/sconsign +=================================================================== +--- trunk.orig/script/sconsign ++++ trunk/script/sconsign +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#! /usr/bin/env python3 + # + # SCons - a Software Constructor + # diff --git a/debian/patches/series b/debian/patches/series index 20ca14e..5325217 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -5,3 +5,4 @@ 0100-parallel_build.patch 0120-fix-bibtex-call.patch #0125-printf_regression.patch +0130-python3.patch -- cgit v1.2.3 From 3af57a8e6a18986c41351da2447363ede8565402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 10 Aug 2019 08:40:22 +0200 Subject: New upstream version 3.1.1 --- CHANGES.txt | 40 +++++++--- PKG-INFO | 2 +- RELEASE.txt | 124 ++++++++++++++--------------- engine/SCons/Action.py | 2 +- engine/SCons/Builder.py | 2 +- engine/SCons/CacheDir.py | 9 ++- engine/SCons/Debug.py | 2 +- engine/SCons/Defaults.py | 2 +- engine/SCons/Environment.py | 3 +- engine/SCons/Errors.py | 2 +- engine/SCons/Executor.py | 2 +- engine/SCons/Job.py | 2 +- engine/SCons/Memoize.py | 2 +- engine/SCons/Node/Alias.py | 2 +- engine/SCons/Node/FS.py | 4 +- engine/SCons/Node/Python.py | 2 +- engine/SCons/Node/__init__.py | 7 +- engine/SCons/PathList.py | 2 +- engine/SCons/Platform/__init__.py | 2 +- engine/SCons/Platform/aix.py | 2 +- engine/SCons/Platform/cygwin.py | 2 +- engine/SCons/Platform/darwin.py | 2 +- engine/SCons/Platform/hpux.py | 2 +- engine/SCons/Platform/irix.py | 2 +- engine/SCons/Platform/mingw.py | 2 +- engine/SCons/Platform/os2.py | 2 +- engine/SCons/Platform/posix.py | 2 +- engine/SCons/Platform/sunos.py | 2 +- engine/SCons/Platform/virtualenv.py | 2 +- engine/SCons/Platform/win32.py | 2 +- engine/SCons/SConf.py | 2 +- engine/SCons/SConsign.py | 2 +- engine/SCons/Scanner/C.py | 2 +- engine/SCons/Scanner/D.py | 2 +- engine/SCons/Scanner/Dir.py | 2 +- engine/SCons/Scanner/Fortran.py | 2 +- engine/SCons/Scanner/IDL.py | 2 +- engine/SCons/Scanner/LaTeX.py | 2 +- engine/SCons/Scanner/Prog.py | 2 +- engine/SCons/Scanner/RC.py | 2 +- engine/SCons/Scanner/SWIG.py | 2 +- engine/SCons/Scanner/__init__.py | 2 +- engine/SCons/Script/Interactive.py | 2 +- engine/SCons/Script/Main.py | 2 +- engine/SCons/Script/SConsOptions.py | 2 +- engine/SCons/Script/SConscript.py | 2 +- engine/SCons/Script/__init__.py | 2 +- engine/SCons/Subst.py | 2 +- engine/SCons/Taskmaster.py | 2 +- engine/SCons/Tool/386asm.py | 2 +- engine/SCons/Tool/DCommon.py | 2 +- engine/SCons/Tool/FortranCommon.py | 2 +- engine/SCons/Tool/GettextCommon.py | 2 +- engine/SCons/Tool/JavaCommon.py | 2 +- engine/SCons/Tool/MSCommon/__init__.py | 2 +- engine/SCons/Tool/MSCommon/arch.py | 2 +- engine/SCons/Tool/MSCommon/common.py | 2 +- engine/SCons/Tool/MSCommon/netframework.py | 2 +- engine/SCons/Tool/MSCommon/sdk.py | 2 +- engine/SCons/Tool/MSCommon/vc.py | 2 +- engine/SCons/Tool/MSCommon/vs.py | 2 +- engine/SCons/Tool/PharLapCommon.py | 2 +- engine/SCons/Tool/__init__.py | 2 +- engine/SCons/Tool/aixc++.py | 2 +- engine/SCons/Tool/aixcc.py | 2 +- engine/SCons/Tool/aixcxx.py | 2 +- engine/SCons/Tool/aixf77.py | 2 +- engine/SCons/Tool/aixlink.py | 2 +- engine/SCons/Tool/applelink.py | 2 +- engine/SCons/Tool/ar.py | 2 +- engine/SCons/Tool/as.py | 2 +- engine/SCons/Tool/bcc32.py | 2 +- engine/SCons/Tool/c++.py | 2 +- engine/SCons/Tool/cc.py | 2 +- engine/SCons/Tool/clang.py | 2 +- engine/SCons/Tool/clangxx.py | 2 +- engine/SCons/Tool/cvf.py | 2 +- engine/SCons/Tool/cxx.py | 2 +- engine/SCons/Tool/default.py | 2 +- engine/SCons/Tool/dmd.py | 2 +- engine/SCons/Tool/dvi.py | 2 +- engine/SCons/Tool/dvipdf.py | 2 +- engine/SCons/Tool/dvips.py | 2 +- engine/SCons/Tool/f03.py | 2 +- engine/SCons/Tool/f08.py | 2 +- engine/SCons/Tool/f77.py | 2 +- engine/SCons/Tool/f90.py | 2 +- engine/SCons/Tool/f95.py | 2 +- engine/SCons/Tool/filesystem.py | 2 +- engine/SCons/Tool/fortran.py | 2 +- engine/SCons/Tool/g++.py | 2 +- engine/SCons/Tool/g77.py | 2 +- engine/SCons/Tool/gas.py | 2 +- engine/SCons/Tool/gcc.py | 2 +- engine/SCons/Tool/gdc.py | 2 +- engine/SCons/Tool/gettext_tool.py | 2 +- engine/SCons/Tool/gfortran.py | 2 +- engine/SCons/Tool/gnulink.py | 2 +- engine/SCons/Tool/gs.py | 2 +- engine/SCons/Tool/gxx.py | 2 +- engine/SCons/Tool/hpc++.py | 2 +- engine/SCons/Tool/hpcc.py | 2 +- engine/SCons/Tool/hpcxx.py | 2 +- engine/SCons/Tool/hplink.py | 2 +- engine/SCons/Tool/icc.py | 2 +- engine/SCons/Tool/icl.py | 2 +- engine/SCons/Tool/ifl.py | 2 +- engine/SCons/Tool/ifort.py | 2 +- engine/SCons/Tool/ilink.py | 2 +- engine/SCons/Tool/ilink32.py | 2 +- engine/SCons/Tool/install.py | 2 +- engine/SCons/Tool/intelc.py | 2 +- engine/SCons/Tool/ipkg.py | 2 +- engine/SCons/Tool/jar.py | 2 +- engine/SCons/Tool/javac.py | 2 +- engine/SCons/Tool/javah.py | 2 +- engine/SCons/Tool/latex.py | 2 +- engine/SCons/Tool/ldc.py | 2 +- engine/SCons/Tool/lex.py | 2 +- engine/SCons/Tool/link.py | 2 +- engine/SCons/Tool/linkloc.py | 2 +- engine/SCons/Tool/m4.py | 2 +- engine/SCons/Tool/masm.py | 2 +- engine/SCons/Tool/midl.py | 2 +- engine/SCons/Tool/mingw.py | 2 +- engine/SCons/Tool/msgfmt.py | 2 +- engine/SCons/Tool/msginit.py | 2 +- engine/SCons/Tool/msgmerge.py | 2 +- engine/SCons/Tool/mslib.py | 2 +- engine/SCons/Tool/mslink.py | 2 +- engine/SCons/Tool/mssdk.py | 2 +- engine/SCons/Tool/msvc.py | 2 +- engine/SCons/Tool/msvs.py | 2 +- engine/SCons/Tool/mwcc.py | 2 +- engine/SCons/Tool/mwld.py | 2 +- engine/SCons/Tool/nasm.py | 2 +- engine/SCons/Tool/packaging/__init__.py | 2 +- engine/SCons/Tool/packaging/ipk.py | 2 +- engine/SCons/Tool/packaging/msi.py | 2 +- engine/SCons/Tool/packaging/rpm.py | 2 +- engine/SCons/Tool/packaging/src_tarbz2.py | 2 +- engine/SCons/Tool/packaging/src_targz.py | 2 +- engine/SCons/Tool/packaging/src_tarxz.py | 2 +- engine/SCons/Tool/packaging/src_zip.py | 2 +- engine/SCons/Tool/packaging/tarbz2.py | 2 +- engine/SCons/Tool/packaging/targz.py | 2 +- engine/SCons/Tool/packaging/tarxz.py | 2 +- engine/SCons/Tool/packaging/zip.py | 2 +- engine/SCons/Tool/pdf.py | 2 +- engine/SCons/Tool/pdflatex.py | 2 +- engine/SCons/Tool/pdftex.py | 2 +- engine/SCons/Tool/qt.py | 2 +- engine/SCons/Tool/rmic.py | 2 +- engine/SCons/Tool/rpcgen.py | 2 +- engine/SCons/Tool/rpm.py | 2 +- engine/SCons/Tool/rpmutils.py | 2 +- engine/SCons/Tool/sgiar.py | 2 +- engine/SCons/Tool/sgic++.py | 2 +- engine/SCons/Tool/sgicc.py | 2 +- engine/SCons/Tool/sgicxx.py | 2 +- engine/SCons/Tool/sgilink.py | 2 +- engine/SCons/Tool/sunar.py | 2 +- engine/SCons/Tool/sunc++.py | 2 +- engine/SCons/Tool/suncc.py | 2 +- engine/SCons/Tool/suncxx.py | 2 +- engine/SCons/Tool/sunf77.py | 2 +- engine/SCons/Tool/sunf90.py | 2 +- engine/SCons/Tool/sunf95.py | 2 +- engine/SCons/Tool/sunlink.py | 2 +- engine/SCons/Tool/swig.py | 2 +- engine/SCons/Tool/tar.py | 2 +- engine/SCons/Tool/tex.py | 2 +- engine/SCons/Tool/textfile.py | 2 +- engine/SCons/Tool/tlib.py | 2 +- engine/SCons/Tool/wix.py | 2 +- engine/SCons/Tool/xgettext.py | 2 +- engine/SCons/Tool/yacc.py | 2 +- engine/SCons/Tool/zip.py | 2 +- engine/SCons/Util.py | 2 +- engine/SCons/Variables/BoolVariable.py | 2 +- engine/SCons/Variables/EnumVariable.py | 2 +- engine/SCons/Variables/ListVariable.py | 2 +- engine/SCons/Variables/PackageVariable.py | 2 +- engine/SCons/Variables/PathVariable.py | 2 +- engine/SCons/Variables/__init__.py | 2 +- engine/SCons/Warnings.py | 2 +- engine/SCons/__init__.py | 10 +-- engine/SCons/compat/__init__.py | 2 +- engine/SCons/compat/_scons_dbm.py | 2 +- engine/SCons/cpp.py | 2 +- engine/SCons/exitfuncs.py | 2 +- scons-time.1 | 8 +- scons.1 | 87 ++++++++++---------- sconsign.1 | 8 +- script/scons | 10 +-- script/scons-configure-cache | 10 +-- script/scons-time | 2 +- script/scons.bat | 4 +- script/sconsign | 10 +-- setup.py | 4 +- 200 files changed, 362 insertions(+), 346 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index a23140c..953931b 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -4,6 +4,26 @@ Change Log +RELEASE 3.1.1 - Mon, 07 Aug 2019 20:09:12 -0500 + + From William Deegan: + - Remove obsoleted references to DeciderNeedsNode which could cause crash when using --debug=explain + + From Jason Kenny + - Add Fix and test for crash in 3.1.0 when using Decider('MD5-timestamp') and --debug=explain + + From Ben Reed: + - Added -fmerge-all-constants to flags that get included in both CCFLAGS and LINKFLAGS. + + From Mathew Robinson: + - Fix issue #3415 - Update remaining usages of EnvironmentError to SConsEnvironmentError + this patch fixes issues introduced in 3.1.0 where any of the + following would cause SCons to error and exit: + - CacheDir not write-able + - JSON encoding errors for CacheDir config + - JSON decoding errors for CacheDir config + + RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 From Joseph Brill: @@ -13,7 +33,7 @@ RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 From William Deegan: - Enhanced --debug=explain output. Now the separate components of the dependency list are split up as follows: - + scons: rebuilding `file3' because: the dependency order changed: ->Sources @@ -84,7 +104,7 @@ RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 - More fixes for newer Java versions (since 9): handle new jdk directory naming (jdk-X.Y instead of jdkX.Y) on Windows; handle two-digit major version. Docstrings improved. - - Fixups for pylint: exception types, redefined functions, + - Fixups for pylint: exception types, redefined functions, globals, etc. Some old code removed to resolve issues (hashlib is always present on modern Pythons; no longer need the code for 2.5-and-earlier optparse). cmp is not a builtin function in Py3, @@ -94,7 +114,7 @@ RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 - Add a PY3-only function for setting up the cachedir that should be less prone to races. Add a hack to the PY2 version (from Issue #3351) to be less prone to a race in the check for old-style cache. - - Fix coding error in docbook tool only exercised when using python lxml + - Fix coding error in docbook tool only exercised when using python lxml - Recognize two additional GNU compiler header directory options in ParseFlags: -iquote and -idirafter. - Fix more re patterns that contain \ but not specified as raw strings @@ -141,7 +161,7 @@ From Daniel Moody: 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 @@ -209,9 +229,9 @@ RELEASE 3.0.2 - Mon, 31 Dec 2018 16:00:12 -0700 - 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 + 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. @@ -247,7 +267,7 @@ RELEASE 3.0.2 - Mon, 31 Dec 2018 16:00:12 -0700 - 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 + - 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 @@ -258,7 +278,7 @@ RELEASE 3.0.2 - Mon, 31 Dec 2018 16:00:12 -0700 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 @@ -379,7 +399,7 @@ RELEASE 3.0.2 - Mon, 31 Dec 2018 16:00:12 -0700 filter type -> list in ipk From Bernhard M. Wiedemann: - - Update SCons' internal scons build logic to allow overriding build date + - 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 diff --git a/PKG-INFO b/PKG-INFO index 57bd341..fc3f83e 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: scons -Version: 3.1.0 +Version: 3.1.1 Summary: Open Source next-generation build tool. Home-page: http://www.scons.org/ Author: William Deegan diff --git a/RELEASE.txt b/RELEASE.txt index 5927ef8..db86a71 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -1,81 +1,73 @@ - A new SCons checkpoint release, 3.1.0, is now available + A new SCons checkpoint release, 3.1.1, is now available on the SCons download page: https://scons.org/pages/download.html - Here is a summary of the changes since 3.0.5: + XXX The primary purpose of this release ... XXX + + A SCons "checkpoint release" is intended to provide early access to + new features so they can be tested in the field before being released + for adoption by other software distributions. + + Note that a checkpoint release is developed using the same test-driven + development methodology as all SCons releases. Existing SCons + functionality should all work as it does in previous releases (except + for any changes identified in the release notes) and early adopters + should be able to use a checkpoint release safely for production work + with existing SConscript files. If not, it represents not only a bug + in SCons but also a hole in the regression test suite, and we want to + hear about it. + + New features may be more lightly tested than in past releases, + especially as concerns their interaction with all of the other + functionality in SCons. We are especially interested in hearing bug + reports about new functionality. + + We do not recommend that downstream distributions (Debian, Fedora, + etc.) package a checkpoint release, mainly to avoid confusing the + "public" release numbering with the long checkpoint release names. + + Here is a summary of the changes since 1.3.0: NEW FUNCTIONALITY - - Added variable TEMPFILEARGJOIN to specify how to join arguments written - to temp files used when command lines exceed MAXLINELENGTH when the - command uses $TEMPFILE{...} - - Support for MSVC 2019 - - Upgraded and improved Visual Studio solution/project generation code using the MSVSProject builder. - - Added support for Visual Studio 2017 and 2019. - - Added support for the following per-variant parameters to the builder: - - cpppaths: Provides per-variant include paths. - - cppdefines: Provides per-variant preprocessor definitions. + - List new features (presumably why a checkpoint is being released) + + DEPRECATED FUNCTIONALITY + - List anything that's been deprecated since the last release CHANGED/ENHANCED EXISTING FUNCTIONALITY - - Fix performance degradation for MD5-timestamp decider. NOTE: This changes the Decider() function arguments. - From: - def my_decider(dependency, target, prev_ni): - To: - def my_decider(dependency, target, prev_ni, repo_node): - Where repo_node is the repository (or other) node to use to check if the node is out of date instead of dependency. - - - Enhanced --debug=explain output. Now the separate components of the dependency list are split up - as follows: - - scons: rebuilding `file3' because: - the dependency order changed: - ->Sources - Old:xxx New:zzz - Old:yyy New:yyy - Old:zzz New:xxx - ->Depends - ->Implicit - Old:/usr/bin/python New:/usr/bin/python - - - Changed: Pseudo-builders now inherit OverrideEnvironments. For - example when calling a pseudo-builder from another - pseudo-builder the override variables passed to the first - pseudo-builder call had to be explicitly passed on to the - internal pseudo-builder call. Now the second pseudo-builder call - will automatically inherit these override values. + - List modifications to existing features, where the previous behavior + wouldn't actually be considered a bug FIXES - - Fix Issue #3350 - SCons Exception EnvironmentError is conflicting with Python's EnvironmentError. - - Fix spurious rebuilds on second build for cases where builder has > 1 target and the source file - is generated. This was causing the > 1th target to not have it's implicit list cleared when the source - file was actually built, leaving an implicit list similar to follows for 2nd and higher target - ['/usr/bin/python', 'xxx', 'yyy', 'zzz'] - This was getting persisted to SConsign and on rebuild it would be corrected to be similar to this - ['zzz', 'yyy', 'xxx', '/usr/bin/python'] - Which would trigger a rebuild because the order changed. - The fix involved added logic to mark all shared targets as peers and then ensure they're implicit - list is all cleared together. - - Fix Issue #3349 - SCons Exception EnvironmentError is conflicting with Python's EnvironmentError. - Renamed to SConsEnvironmentError - - Fix Issue #3350 - mslink failing when too many objects. This is resolved by adding TEMPFILEARGJOIN variable - which specifies what character to join all the argements output into the tempfile. The default remains a space - when mslink, msvc, or mslib tools are loaded they change the TEMPFILEARGJOIN to be a line separator (\r\n on win32) - - Additional fix to issue #3135 - Also handle 'pure' and 'elemental' type bound procedures - - - Fix handling of Visual Studio Compilers to properly reject any unknown HOST_PLATFORM or TARGET_PLATFORM - - Enable LaTeX scanner to find more than one include per line - + + - 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 -git shortlog --no-merges -ns 3.0.5..HEAD - 64 William Deegan - 56 Mats Wichmann - 10 Adam Gross - 4 Mathew Robinson - 4 Peter Diener - 3 Lukas Schrangl - 1 Daniel Holth - 1 bdbaddog + 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 - 2019 The SCons Foundation +src/RELEASE.txt 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan diff --git a/engine/SCons/Action.py b/engine/SCons/Action.py index b541256..be4a5ff 100644 --- a/engine/SCons/Action.py +++ b/engine/SCons/Action.py @@ -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 e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Action.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import pickle diff --git a/engine/SCons/Builder.py b/engine/SCons/Builder.py index 7777436..c3bdf5c 100644 --- a/engine/SCons/Builder.py +++ b/engine/SCons/Builder.py @@ -98,7 +98,7 @@ There are the following methods for internal use within this module: # 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/Builder.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Builder.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import collections diff --git a/engine/SCons/CacheDir.py b/engine/SCons/CacheDir.py index c9e8ea7..a1133ae 100644 --- a/engine/SCons/CacheDir.py +++ b/engine/SCons/CacheDir.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/CacheDir.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/CacheDir.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __doc__ = """ CacheDir support @@ -33,6 +33,7 @@ import os import stat import sys +import SCons import SCons.Action import SCons.Warnings from SCons.Util import PY3 @@ -185,7 +186,7 @@ class CacheDir(object): pass except OSError: msg = "Failed to create cache directory " + path - raise SCons.Errors.EnvironmentError(msg) + raise SCons.Errors.SConsEnvironmentError(msg) try: with open(config_file, 'x') as config: @@ -194,14 +195,14 @@ class CacheDir(object): json.dump(self.config, config) except Exception: msg = "Failed to write cache configuration for " + path - raise SCons.Errors.EnvironmentError(msg) + raise SCons.Errors.SConsEnvironmentError(msg) except FileExistsError: try: with open(config_file) as config: self.config = json.load(config) except ValueError: msg = "Failed to read cache configuration for " + path - raise SCons.Errors.EnvironmentError(msg) + raise SCons.Errors.SConsEnvironmentError(msg) def _readconfig2(self, path): diff --git a/engine/SCons/Debug.py b/engine/SCons/Debug.py index c19862a..12d07fd 100644 --- a/engine/SCons/Debug.py +++ b/engine/SCons/Debug.py @@ -31,7 +31,7 @@ caller_trace() # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Debug.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Debug.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import sys diff --git a/engine/SCons/Defaults.py b/engine/SCons/Defaults.py index 30c0052..63ba450 100644 --- a/engine/SCons/Defaults.py +++ b/engine/SCons/Defaults.py @@ -33,7 +33,7 @@ from distutils.msvccompiler. # from __future__ import division -__revision__ = "src/engine/SCons/Defaults.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Defaults.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os diff --git a/engine/SCons/Environment.py b/engine/SCons/Environment.py index 31a4721..7a0954d 100644 --- a/engine/SCons/Environment.py +++ b/engine/SCons/Environment.py @@ -31,7 +31,7 @@ Environment # 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/Environment.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Environment.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import copy @@ -783,6 +783,7 @@ class SubstitutionEnvironment(object): elif arg in ['-mno-cygwin', '-pthread', '-openmp', + '-fmerge-all-constants', '-fopenmp']: dict['CCFLAGS'].append(arg) dict['LINKFLAGS'].append(arg) diff --git a/engine/SCons/Errors.py b/engine/SCons/Errors.py index 28f58be..d6e1d4a 100644 --- a/engine/SCons/Errors.py +++ b/engine/SCons/Errors.py @@ -28,7 +28,7 @@ and user errors in SCons. """ -__revision__ = "src/engine/SCons/Errors.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Errors.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import shutil import SCons.Util diff --git a/engine/SCons/Executor.py b/engine/SCons/Executor.py index c6ffe81..c3e22f5 100644 --- a/engine/SCons/Executor.py +++ b/engine/SCons/Executor.py @@ -28,7 +28,7 @@ Nodes. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function -__revision__ = "src/engine/SCons/Executor.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Executor.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import collections diff --git a/engine/SCons/Job.py b/engine/SCons/Job.py index 12ba19f..a126d1c 100644 --- a/engine/SCons/Job.py +++ b/engine/SCons/Job.py @@ -29,7 +29,7 @@ stop, and wait on jobs. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Job.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Job.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.compat diff --git a/engine/SCons/Memoize.py b/engine/SCons/Memoize.py index f7b45bf..6bef437 100644 --- a/engine/SCons/Memoize.py +++ b/engine/SCons/Memoize.py @@ -22,7 +22,7 @@ # from __future__ import print_function -__revision__ = "src/engine/SCons/Memoize.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Memoize.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __doc__ = """Memoizer diff --git a/engine/SCons/Node/Alias.py b/engine/SCons/Node/Alias.py index a9defb6..302a704 100644 --- a/engine/SCons/Node/Alias.py +++ b/engine/SCons/Node/Alias.py @@ -30,7 +30,7 @@ This creates a hash of global Aliases (dummy targets). # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Node/Alias.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Node/Alias.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import collections diff --git a/engine/SCons/Node/FS.py b/engine/SCons/Node/FS.py index 21ccecc..0d903de 100644 --- a/engine/SCons/Node/FS.py +++ b/engine/SCons/Node/FS.py @@ -33,7 +33,7 @@ that can be used by scripts or modules looking for the canonical default. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function -__revision__ = "src/engine/SCons/Node/FS.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Node/FS.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import fnmatch import os @@ -3436,6 +3436,8 @@ class File(Base): Boolean - Indicates if node(File) has changed. """ + if node is None: + node = self # Now get sconsign name -> csig map and then get proper prev_ni if possible bi = node.get_stored_info().binfo rebuilt = False diff --git a/engine/SCons/Node/Python.py b/engine/SCons/Node/Python.py index d338051..8726332 100644 --- a/engine/SCons/Node/Python.py +++ b/engine/SCons/Node/Python.py @@ -27,7 +27,7 @@ Python nodes. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Node/Python.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Node/Python.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Node diff --git a/engine/SCons/Node/__init__.py b/engine/SCons/Node/__init__.py index 5455bd6..c1f8d89 100644 --- a/engine/SCons/Node/__init__.py +++ b/engine/SCons/Node/__init__.py @@ -43,7 +43,7 @@ from __future__ import print_function # 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/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Node/__init__.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import collections @@ -1661,10 +1661,7 @@ class Node(object, with_metaclass(NoSlotsPyPy)): if k not in old_bkids: lines.append("`%s' is a new dependency\n" % stringify(k)) else: - try: - changed = _decider_map[k.changed_since_last_build](k, self, osig[k]) - except DeciderNeedsNode as e: - changed = e.decider(self, osig[k], node=self) + changed = _decider_map[k.changed_since_last_build](k, self, osig[k]) if changed: lines.append("`%s' changed\n" % stringify(k)) diff --git a/engine/SCons/PathList.py b/engine/SCons/PathList.py index d6a01e7..8de79df 100644 --- a/engine/SCons/PathList.py +++ b/engine/SCons/PathList.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/PathList.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/PathList.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __doc__ = """SCons.PathList diff --git a/engine/SCons/Platform/__init__.py b/engine/SCons/Platform/__init__.py index 8da1e9d..66bff49 100644 --- a/engine/SCons/Platform/__init__.py +++ b/engine/SCons/Platform/__init__.py @@ -43,7 +43,7 @@ their own platform definition. # from __future__ import print_function -__revision__ = "src/engine/SCons/Platform/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Platform/__init__.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.compat diff --git a/engine/SCons/Platform/aix.py b/engine/SCons/Platform/aix.py index 70fbb35..de61c16 100644 --- a/engine/SCons/Platform/aix.py +++ b/engine/SCons/Platform/aix.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/aix.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Platform/aix.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import subprocess diff --git a/engine/SCons/Platform/cygwin.py b/engine/SCons/Platform/cygwin.py index 70b6443..d630be3 100644 --- a/engine/SCons/Platform/cygwin.py +++ b/engine/SCons/Platform/cygwin.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/cygwin.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Platform/cygwin.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import sys diff --git a/engine/SCons/Platform/darwin.py b/engine/SCons/Platform/darwin.py index d5861d9..a5bfc52 100644 --- a/engine/SCons/Platform/darwin.py +++ b/engine/SCons/Platform/darwin.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/darwin.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Platform/darwin.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from . import posix import os diff --git a/engine/SCons/Platform/hpux.py b/engine/SCons/Platform/hpux.py index 6867212..d49d1a8 100644 --- a/engine/SCons/Platform/hpux.py +++ b/engine/SCons/Platform/hpux.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/hpux.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Platform/hpux.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from . import posix diff --git a/engine/SCons/Platform/irix.py b/engine/SCons/Platform/irix.py index a382e71..687f3e1 100644 --- a/engine/SCons/Platform/irix.py +++ b/engine/SCons/Platform/irix.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/irix.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Platform/irix.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from . import posix diff --git a/engine/SCons/Platform/mingw.py b/engine/SCons/Platform/mingw.py index c03c9c8..010e72a 100644 --- a/engine/SCons/Platform/mingw.py +++ b/engine/SCons/Platform/mingw.py @@ -27,7 +27,7 @@ Platform-specific initialization for the MinGW system. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/mingw.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Platform/mingw.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import sys diff --git a/engine/SCons/Platform/os2.py b/engine/SCons/Platform/os2.py index ebabe3d..bd414cf 100644 --- a/engine/SCons/Platform/os2.py +++ b/engine/SCons/Platform/os2.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/os2.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Platform/os2.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from . import win32 def generate(env): diff --git a/engine/SCons/Platform/posix.py b/engine/SCons/Platform/posix.py index 780c764..c1e43ca 100644 --- a/engine/SCons/Platform/posix.py +++ b/engine/SCons/Platform/posix.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/posix.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Platform/posix.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import errno import os diff --git a/engine/SCons/Platform/sunos.py b/engine/SCons/Platform/sunos.py index 6aa54aa..a9a7d97 100644 --- a/engine/SCons/Platform/sunos.py +++ b/engine/SCons/Platform/sunos.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/sunos.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Platform/sunos.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from . import posix diff --git a/engine/SCons/Platform/virtualenv.py b/engine/SCons/Platform/virtualenv.py index 9fb3e45..ae3068d 100644 --- a/engine/SCons/Platform/virtualenv.py +++ b/engine/SCons/Platform/virtualenv.py @@ -26,7 +26,7 @@ Support for virtualenv. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/virtualenv.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Platform/virtualenv.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import sys diff --git a/engine/SCons/Platform/win32.py b/engine/SCons/Platform/win32.py index ea567a2..3eff40f 100644 --- a/engine/SCons/Platform/win32.py +++ b/engine/SCons/Platform/win32.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Platform/win32.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Platform/win32.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import os.path diff --git a/engine/SCons/SConf.py b/engine/SCons/SConf.py index 7409c50..c6bbda6 100644 --- a/engine/SCons/SConf.py +++ b/engine/SCons/SConf.py @@ -35,7 +35,7 @@ libraries are installed, if some command line options are supported etc. # from __future__ import print_function -__revision__ = "src/engine/SCons/SConf.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/SConf.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.compat diff --git a/engine/SCons/SConsign.py b/engine/SCons/SConsign.py index e003933..157468f 100644 --- a/engine/SCons/SConsign.py +++ b/engine/SCons/SConsign.py @@ -29,7 +29,7 @@ Writing and reading information to the .sconsign file or files. from __future__ import print_function -__revision__ = "src/engine/SCons/SConsign.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/SConsign.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.compat diff --git a/engine/SCons/Scanner/C.py b/engine/SCons/Scanner/C.py index 206de5f..d3df545 100644 --- a/engine/SCons/Scanner/C.py +++ b/engine/SCons/Scanner/C.py @@ -27,7 +27,7 @@ This module implements the dependency scanner for C/C++ code. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/C.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Scanner/C.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Node.FS import SCons.Scanner diff --git a/engine/SCons/Scanner/D.py b/engine/SCons/Scanner/D.py index 1ad9e89..aa018d6 100644 --- a/engine/SCons/Scanner/D.py +++ b/engine/SCons/Scanner/D.py @@ -30,7 +30,7 @@ Coded by Andy Friesen # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/D.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Scanner/D.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Scanner diff --git a/engine/SCons/Scanner/Dir.py b/engine/SCons/Scanner/Dir.py index be8ae6c..0c08820 100644 --- a/engine/SCons/Scanner/Dir.py +++ b/engine/SCons/Scanner/Dir.py @@ -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/Scanner/Dir.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Scanner/Dir.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Node.FS import SCons.Scanner diff --git a/engine/SCons/Scanner/Fortran.py b/engine/SCons/Scanner/Fortran.py index d315bc9..50cc16e 100644 --- a/engine/SCons/Scanner/Fortran.py +++ b/engine/SCons/Scanner/Fortran.py @@ -26,7 +26,7 @@ This module implements the dependency scanner for Fortran code. # 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/Scanner/Fortran.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Scanner/Fortran.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import re diff --git a/engine/SCons/Scanner/IDL.py b/engine/SCons/Scanner/IDL.py index 88226e6..65704d8 100644 --- a/engine/SCons/Scanner/IDL.py +++ b/engine/SCons/Scanner/IDL.py @@ -28,7 +28,7 @@ Definition Language) files. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/IDL.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Scanner/IDL.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Node.FS import SCons.Scanner diff --git a/engine/SCons/Scanner/LaTeX.py b/engine/SCons/Scanner/LaTeX.py index 8afe5b0..37970d0 100644 --- a/engine/SCons/Scanner/LaTeX.py +++ b/engine/SCons/Scanner/LaTeX.py @@ -27,7 +27,7 @@ This module implements the dependency scanner for LaTeX code. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/LaTeX.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Scanner/LaTeX.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path import re diff --git a/engine/SCons/Scanner/Prog.py b/engine/SCons/Scanner/Prog.py index 2ae3c68..4a5e478 100644 --- a/engine/SCons/Scanner/Prog.py +++ b/engine/SCons/Scanner/Prog.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/Prog.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Scanner/Prog.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Node import SCons.Node.FS diff --git a/engine/SCons/Scanner/RC.py b/engine/SCons/Scanner/RC.py index 4f0cee2..2bfdfc9 100644 --- a/engine/SCons/Scanner/RC.py +++ b/engine/SCons/Scanner/RC.py @@ -28,7 +28,7 @@ Definition Language) files. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/RC.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Scanner/RC.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import re diff --git a/engine/SCons/Scanner/SWIG.py b/engine/SCons/Scanner/SWIG.py index 5f2a3e3..26f5080 100644 --- a/engine/SCons/Scanner/SWIG.py +++ b/engine/SCons/Scanner/SWIG.py @@ -27,7 +27,7 @@ This module implements the dependency scanner for SWIG code. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/SWIG.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Scanner/SWIG.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Scanner diff --git a/engine/SCons/Scanner/__init__.py b/engine/SCons/Scanner/__init__.py index feff12a..f2fa418 100644 --- a/engine/SCons/Scanner/__init__.py +++ b/engine/SCons/Scanner/__init__.py @@ -27,7 +27,7 @@ The Scanner package for the SCons software construction utility. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Scanner/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Scanner/__init__.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import re diff --git a/engine/SCons/Script/Interactive.py b/engine/SCons/Script/Interactive.py index 3d70728..c756461 100644 --- a/engine/SCons/Script/Interactive.py +++ b/engine/SCons/Script/Interactive.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function -__revision__ = "src/engine/SCons/Script/Interactive.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Script/Interactive.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __doc__ = """ SCons interactive mode diff --git a/engine/SCons/Script/Main.py b/engine/SCons/Script/Main.py index 878f824..663e337 100644 --- a/engine/SCons/Script/Main.py +++ b/engine/SCons/Script/Main.py @@ -38,7 +38,7 @@ deprecated_python_version = (2, 7, 0) # 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/Script/Main.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Script/Main.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.compat diff --git a/engine/SCons/Script/SConsOptions.py b/engine/SCons/Script/SConsOptions.py index 5651c96..ae08d41 100644 --- a/engine/SCons/Script/SConsOptions.py +++ b/engine/SCons/Script/SConsOptions.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Script/SConsOptions.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Script/SConsOptions.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import optparse import re diff --git a/engine/SCons/Script/SConscript.py b/engine/SCons/Script/SConscript.py index 9687c29..c0a75f2 100644 --- a/engine/SCons/Script/SConscript.py +++ b/engine/SCons/Script/SConscript.py @@ -27,7 +27,7 @@ files. # 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/Script/SConscript.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Script/SConscript.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons import SCons.Action diff --git a/engine/SCons/Script/__init__.py b/engine/SCons/Script/__init__.py index cf2e472..cb44f2b 100644 --- a/engine/SCons/Script/__init__.py +++ b/engine/SCons/Script/__init__.py @@ -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 e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Script/__init__.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import time start_time = time.time() diff --git a/engine/SCons/Subst.py b/engine/SCons/Subst.py index 1e0d423..618adf5 100644 --- a/engine/SCons/Subst.py +++ b/engine/SCons/Subst.py @@ -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 e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Subst.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import collections import re diff --git a/engine/SCons/Taskmaster.py b/engine/SCons/Taskmaster.py index 29e48ac..421e2b2 100644 --- a/engine/SCons/Taskmaster.py +++ b/engine/SCons/Taskmaster.py @@ -54,7 +54,7 @@ __doc__ = """ target(s) that it decides need to be evaluated and/or built. """ -__revision__ = "src/engine/SCons/Taskmaster.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Taskmaster.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from itertools import chain import operator diff --git a/engine/SCons/Tool/386asm.py b/engine/SCons/Tool/386asm.py index 1121c3d..16f5beb 100644 --- a/engine/SCons/Tool/386asm.py +++ b/engine/SCons/Tool/386asm.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/386asm.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/386asm.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from SCons.Tool.PharLapCommon import addPharLapPaths import SCons.Util diff --git a/engine/SCons/Tool/DCommon.py b/engine/SCons/Tool/DCommon.py index f6b6000..fca89a1 100644 --- a/engine/SCons/Tool/DCommon.py +++ b/engine/SCons/Tool/DCommon.py @@ -31,7 +31,7 @@ Coded by Russel Winder (russel@winder.org.uk) # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/DCommon.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/DCommon.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path diff --git a/engine/SCons/Tool/FortranCommon.py b/engine/SCons/Tool/FortranCommon.py index 11f1eb7..a5201bb 100644 --- a/engine/SCons/Tool/FortranCommon.py +++ b/engine/SCons/Tool/FortranCommon.py @@ -28,7 +28,7 @@ Stuff for processing Fortran, common to all fortran dialects. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/FortranCommon.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/FortranCommon.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import re import os.path diff --git a/engine/SCons/Tool/GettextCommon.py b/engine/SCons/Tool/GettextCommon.py index 79912b6..0578108 100644 --- a/engine/SCons/Tool/GettextCommon.py +++ b/engine/SCons/Tool/GettextCommon.py @@ -24,7 +24,7 @@ Used by several tools of `gettext` toolset. # 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/Tool/GettextCommon.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/GettextCommon.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Warnings import re diff --git a/engine/SCons/Tool/JavaCommon.py b/engine/SCons/Tool/JavaCommon.py index 1e58af6..6091fdf 100644 --- a/engine/SCons/Tool/JavaCommon.py +++ b/engine/SCons/Tool/JavaCommon.py @@ -27,7 +27,7 @@ Stuff for processing Java. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/JavaCommon.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/JavaCommon.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/MSCommon/__init__.py b/engine/SCons/Tool/MSCommon/__init__.py index e3c4471..67b5be8 100644 --- a/engine/SCons/Tool/MSCommon/__init__.py +++ b/engine/SCons/Tool/MSCommon/__init__.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/__init__.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __doc__ = """ Common functions for Microsoft Visual Studio and Visual C/C++. diff --git a/engine/SCons/Tool/MSCommon/arch.py b/engine/SCons/Tool/MSCommon/arch.py index 6312541..4475af1 100644 --- a/engine/SCons/Tool/MSCommon/arch.py +++ b/engine/SCons/Tool/MSCommon/arch.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/arch.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __doc__ = """Module to define supported Windows chip architectures. """ diff --git a/engine/SCons/Tool/MSCommon/common.py b/engine/SCons/Tool/MSCommon/common.py index 8353944..428eaba 100644 --- a/engine/SCons/Tool/MSCommon/common.py +++ b/engine/SCons/Tool/MSCommon/common.py @@ -25,7 +25,7 @@ Common helper functions for working with the Microsoft tool chain. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/MSCommon/common.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/common.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import copy import os diff --git a/engine/SCons/Tool/MSCommon/netframework.py b/engine/SCons/Tool/MSCommon/netframework.py index edd9fd9..0ba84a5 100644 --- a/engine/SCons/Tool/MSCommon/netframework.py +++ b/engine/SCons/Tool/MSCommon/netframework.py @@ -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/Tool/MSCommon/netframework.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/netframework.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __doc__ = """ """ diff --git a/engine/SCons/Tool/MSCommon/sdk.py b/engine/SCons/Tool/MSCommon/sdk.py index e664a30..a2adf3d 100644 --- a/engine/SCons/Tool/MSCommon/sdk.py +++ b/engine/SCons/Tool/MSCommon/sdk.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/sdk.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __doc__ = """Module to detect the Platform/Windows SDK diff --git a/engine/SCons/Tool/MSCommon/vc.py b/engine/SCons/Tool/MSCommon/vc.py index fa7be96..f0ae946 100644 --- a/engine/SCons/Tool/MSCommon/vc.py +++ b/engine/SCons/Tool/MSCommon/vc.py @@ -30,7 +30,7 @@ # * test on 64 bits XP + VS 2005 (and VS 6 if possible) # * SDK # * Assembly -__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/vc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __doc__ = """Module for Visual C/C++ detection and configuration. """ diff --git a/engine/SCons/Tool/MSCommon/vs.py b/engine/SCons/Tool/MSCommon/vs.py index 731f328..d719301 100644 --- a/engine/SCons/Tool/MSCommon/vs.py +++ b/engine/SCons/Tool/MSCommon/vs.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/MSCommon/vs.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __doc__ = """Module to detect Visual Studio and/or Visual C/C++ """ diff --git a/engine/SCons/Tool/PharLapCommon.py b/engine/SCons/Tool/PharLapCommon.py index 623f2a8..d699b7e 100644 --- a/engine/SCons/Tool/PharLapCommon.py +++ b/engine/SCons/Tool/PharLapCommon.py @@ -29,7 +29,7 @@ Phar Lap ETS tool chain. Right now, this is linkloc and # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/PharLapCommon.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/PharLapCommon.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/__init__.py b/engine/SCons/Tool/__init__.py index 271f214..ea64b78 100644 --- a/engine/SCons/Tool/__init__.py +++ b/engine/SCons/Tool/__init__.py @@ -35,7 +35,7 @@ tool definition. # 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/Tool/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/__init__.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import sys import re diff --git a/engine/SCons/Tool/aixc++.py b/engine/SCons/Tool/aixc++.py index bafaea4..90a3e01 100644 --- a/engine/SCons/Tool/aixc++.py +++ b/engine/SCons/Tool/aixc++.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixc++.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/aixc++.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" #forward proxy to the preffered cxx version from SCons.Tool.aixcxx import * diff --git a/engine/SCons/Tool/aixcc.py b/engine/SCons/Tool/aixcc.py index 349a40a..2cc35bc 100644 --- a/engine/SCons/Tool/aixcc.py +++ b/engine/SCons/Tool/aixcc.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixcc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/aixcc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path diff --git a/engine/SCons/Tool/aixcxx.py b/engine/SCons/Tool/aixcxx.py index 0830e33..7e7ff3a 100644 --- a/engine/SCons/Tool/aixcxx.py +++ b/engine/SCons/Tool/aixcxx.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixcxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/aixcxx.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path diff --git a/engine/SCons/Tool/aixf77.py b/engine/SCons/Tool/aixf77.py index d2c619a..c7129e5 100644 --- a/engine/SCons/Tool/aixf77.py +++ b/engine/SCons/Tool/aixf77.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixf77.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/aixf77.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path diff --git a/engine/SCons/Tool/aixlink.py b/engine/SCons/Tool/aixlink.py index ea2949f..a82f570 100644 --- a/engine/SCons/Tool/aixlink.py +++ b/engine/SCons/Tool/aixlink.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/aixlink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/aixlink.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/applelink.py b/engine/SCons/Tool/applelink.py index 011b29d..2c165ee 100644 --- a/engine/SCons/Tool/applelink.py +++ b/engine/SCons/Tool/applelink.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/applelink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/applelink.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/ar.py b/engine/SCons/Tool/ar.py index 459fb55..e0e89a7 100644 --- a/engine/SCons/Tool/ar.py +++ b/engine/SCons/Tool/ar.py @@ -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 e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/ar.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/as.py b/engine/SCons/Tool/as.py index 02139c5..37186d7 100644 --- a/engine/SCons/Tool/as.py +++ b/engine/SCons/Tool/as.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/as.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/as.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/bcc32.py b/engine/SCons/Tool/bcc32.py index e8ffbbf..bb74d4d 100644 --- a/engine/SCons/Tool/bcc32.py +++ b/engine/SCons/Tool/bcc32.py @@ -27,7 +27,7 @@ XXX # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/bcc32.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/bcc32.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/c++.py b/engine/SCons/Tool/c++.py index 8819f82..9cd420b 100644 --- a/engine/SCons/Tool/c++.py +++ b/engine/SCons/Tool/c++.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/c++.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/c++.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" #forward proxy to the preffered cxx version diff --git a/engine/SCons/Tool/cc.py b/engine/SCons/Tool/cc.py index 698d725..12e2b68 100644 --- a/engine/SCons/Tool/cc.py +++ b/engine/SCons/Tool/cc.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/cc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/cc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Tool import SCons.Defaults diff --git a/engine/SCons/Tool/clang.py b/engine/SCons/Tool/clang.py index f48afbf..8d913d1 100644 --- a/engine/SCons/Tool/clang.py +++ b/engine/SCons/Tool/clang.py @@ -33,7 +33,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# __revision__ = "src/engine/SCons/Tool/clang.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +# __revision__ = "src/engine/SCons/Tool/clang.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" # Based on SCons/Tool/gcc.py by Paweł Tomulik 2014 as a separate tool. # Brought into the SCons mainline by Russel Winder 2017. diff --git a/engine/SCons/Tool/clangxx.py b/engine/SCons/Tool/clangxx.py index d88874e..8afda08 100644 --- a/engine/SCons/Tool/clangxx.py +++ b/engine/SCons/Tool/clangxx.py @@ -33,7 +33,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -# __revision__ = "src/engine/SCons/Tool/clangxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +# __revision__ = "src/engine/SCons/Tool/clangxx.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" # Based on SCons/Tool/g++.py by Paweł Tomulik 2014 as a separate tool. # Brought into the SCons mainline by Russel Winder 2017. diff --git a/engine/SCons/Tool/cvf.py b/engine/SCons/Tool/cvf.py index aa24d69..22ec02f 100644 --- a/engine/SCons/Tool/cvf.py +++ b/engine/SCons/Tool/cvf.py @@ -27,7 +27,7 @@ Tool-specific initialization for the Compaq Visual Fortran compiler. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/cvf.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/cvf.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from . import fortran diff --git a/engine/SCons/Tool/cxx.py b/engine/SCons/Tool/cxx.py index 2ac278e..7e34850 100644 --- a/engine/SCons/Tool/cxx.py +++ b/engine/SCons/Tool/cxx.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/cxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/cxx.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path diff --git a/engine/SCons/Tool/default.py b/engine/SCons/Tool/default.py index 866b823..a401d25 100644 --- a/engine/SCons/Tool/default.py +++ b/engine/SCons/Tool/default.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/default.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/default.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Tool diff --git a/engine/SCons/Tool/dmd.py b/engine/SCons/Tool/dmd.py index befcd22..e87d791 100644 --- a/engine/SCons/Tool/dmd.py +++ b/engine/SCons/Tool/dmd.py @@ -53,7 +53,7 @@ Lib tool variables: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/dmd.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/dmd.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import subprocess diff --git a/engine/SCons/Tool/dvi.py b/engine/SCons/Tool/dvi.py index 5cd85ed..2152817 100644 --- a/engine/SCons/Tool/dvi.py +++ b/engine/SCons/Tool/dvi.py @@ -27,7 +27,7 @@ Common DVI Builder definition for various other Tool modules that use it. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/dvi.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/dvi.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Builder import SCons.Tool diff --git a/engine/SCons/Tool/dvipdf.py b/engine/SCons/Tool/dvipdf.py index 32f57e6..2b66658 100644 --- a/engine/SCons/Tool/dvipdf.py +++ b/engine/SCons/Tool/dvipdf.py @@ -30,7 +30,7 @@ selection method. # 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/Tool/dvipdf.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/dvipdf.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Action import SCons.Defaults diff --git a/engine/SCons/Tool/dvips.py b/engine/SCons/Tool/dvips.py index 988ecd3..ccc882c 100644 --- a/engine/SCons/Tool/dvips.py +++ b/engine/SCons/Tool/dvips.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/dvips.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/dvips.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/f03.py b/engine/SCons/Tool/f03.py index 541ec88..0a30381 100644 --- a/engine/SCons/Tool/f03.py +++ b/engine/SCons/Tool/f03.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f03.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/f03.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/f08.py b/engine/SCons/Tool/f08.py index 5dc49da..1d2b84d 100644 --- a/engine/SCons/Tool/f08.py +++ b/engine/SCons/Tool/f08.py @@ -33,7 +33,7 @@ from __future__ import absolute_import # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f08.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/f08.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/f77.py b/engine/SCons/Tool/f77.py index 6d60edf..c52904e 100644 --- a/engine/SCons/Tool/f77.py +++ b/engine/SCons/Tool/f77.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f77.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/f77.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults import SCons.Scanner.Fortran diff --git a/engine/SCons/Tool/f90.py b/engine/SCons/Tool/f90.py index e0b5fae..1095c1c 100644 --- a/engine/SCons/Tool/f90.py +++ b/engine/SCons/Tool/f90.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f90.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/f90.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults import SCons.Scanner.Fortran diff --git a/engine/SCons/Tool/f95.py b/engine/SCons/Tool/f95.py index 9a1afdf..44e9e39 100644 --- a/engine/SCons/Tool/f95.py +++ b/engine/SCons/Tool/f95.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/f95.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/f95.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/filesystem.py b/engine/SCons/Tool/filesystem.py index a625714..b004782 100644 --- a/engine/SCons/Tool/filesystem.py +++ b/engine/SCons/Tool/filesystem.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/filesystem.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/filesystem.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons from SCons.Tool.install import copyFunc diff --git a/engine/SCons/Tool/fortran.py b/engine/SCons/Tool/fortran.py index 1b09880..2e84e49 100644 --- a/engine/SCons/Tool/fortran.py +++ b/engine/SCons/Tool/fortran.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/fortran.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/fortran.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import re diff --git a/engine/SCons/Tool/g++.py b/engine/SCons/Tool/g++.py index 8cf881f..ecaf0ab 100644 --- a/engine/SCons/Tool/g++.py +++ b/engine/SCons/Tool/g++.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/g++.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/g++.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" #forward proxy to the preffered cxx version diff --git a/engine/SCons/Tool/g77.py b/engine/SCons/Tool/g77.py index fc0bcba..6d7d4ed 100644 --- a/engine/SCons/Tool/g77.py +++ b/engine/SCons/Tool/g77.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/g77.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/g77.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Util from SCons.Tool.FortranCommon import add_all_to_env, add_f77_to_env diff --git a/engine/SCons/Tool/gas.py b/engine/SCons/Tool/gas.py index c104e34..add6f7c 100644 --- a/engine/SCons/Tool/gas.py +++ b/engine/SCons/Tool/gas.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gas.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/gas.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" try: as_module = __import__('as', globals(), locals(), []) diff --git a/engine/SCons/Tool/gcc.py b/engine/SCons/Tool/gcc.py index 2532427..4f70be5 100644 --- a/engine/SCons/Tool/gcc.py +++ b/engine/SCons/Tool/gcc.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gcc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/gcc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from . import cc import os diff --git a/engine/SCons/Tool/gdc.py b/engine/SCons/Tool/gdc.py index 46a910c..ebb9b06 100644 --- a/engine/SCons/Tool/gdc.py +++ b/engine/SCons/Tool/gdc.py @@ -48,7 +48,7 @@ Lib tool variables: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gdc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/gdc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Action import SCons.Defaults diff --git a/engine/SCons/Tool/gettext_tool.py b/engine/SCons/Tool/gettext_tool.py index 5fc0158..9f20a6f 100644 --- a/engine/SCons/Tool/gettext_tool.py +++ b/engine/SCons/Tool/gettext_tool.py @@ -23,7 +23,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/Tool/gettext_tool.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/gettext_tool.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" ############################################################################# def generate(env,**kw): diff --git a/engine/SCons/Tool/gfortran.py b/engine/SCons/Tool/gfortran.py index 8d02daa..ca143c5 100644 --- a/engine/SCons/Tool/gfortran.py +++ b/engine/SCons/Tool/gfortran.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gfortran.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/gfortran.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/gnulink.py b/engine/SCons/Tool/gnulink.py index 53f5081..2ed5d34 100644 --- a/engine/SCons/Tool/gnulink.py +++ b/engine/SCons/Tool/gnulink.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gnulink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/gnulink.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Util import SCons.Tool diff --git a/engine/SCons/Tool/gs.py b/engine/SCons/Tool/gs.py index 371b810..ca85585 100644 --- a/engine/SCons/Tool/gs.py +++ b/engine/SCons/Tool/gs.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gs.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/gs.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/gxx.py b/engine/SCons/Tool/gxx.py index d956c9f..b9c35f7 100644 --- a/engine/SCons/Tool/gxx.py +++ b/engine/SCons/Tool/gxx.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/gxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/gxx.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path import re diff --git a/engine/SCons/Tool/hpc++.py b/engine/SCons/Tool/hpc++.py index 4ec2fe3..6da62ae 100644 --- a/engine/SCons/Tool/hpc++.py +++ b/engine/SCons/Tool/hpc++.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/hpc++.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/hpc++.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" #forward proxy to the preffered cxx version diff --git a/engine/SCons/Tool/hpcc.py b/engine/SCons/Tool/hpcc.py index 6a564b9..7e2d748 100644 --- a/engine/SCons/Tool/hpcc.py +++ b/engine/SCons/Tool/hpcc.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/hpcc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/hpcc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/hpcxx.py b/engine/SCons/Tool/hpcxx.py index 8ee888f..ccda329 100644 --- a/engine/SCons/Tool/hpcxx.py +++ b/engine/SCons/Tool/hpcxx.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/hpcxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/hpcxx.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path diff --git a/engine/SCons/Tool/hplink.py b/engine/SCons/Tool/hplink.py index 1afa95e..be83074 100644 --- a/engine/SCons/Tool/hplink.py +++ b/engine/SCons/Tool/hplink.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/hplink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/hplink.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/icc.py b/engine/SCons/Tool/icc.py index 8110a60..97f30bd 100644 --- a/engine/SCons/Tool/icc.py +++ b/engine/SCons/Tool/icc.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/icc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/icc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from . import cc diff --git a/engine/SCons/Tool/icl.py b/engine/SCons/Tool/icl.py index 29d5862..ad9305a 100644 --- a/engine/SCons/Tool/icl.py +++ b/engine/SCons/Tool/icl.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/icl.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/icl.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Tool.intelc diff --git a/engine/SCons/Tool/ifl.py b/engine/SCons/Tool/ifl.py index 0eb7cda..1e98df4 100644 --- a/engine/SCons/Tool/ifl.py +++ b/engine/SCons/Tool/ifl.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ifl.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/ifl.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults from SCons.Scanner.Fortran import FortranScan diff --git a/engine/SCons/Tool/ifort.py b/engine/SCons/Tool/ifort.py index 730e778..d1886ce 100644 --- a/engine/SCons/Tool/ifort.py +++ b/engine/SCons/Tool/ifort.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ifort.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/ifort.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults from SCons.Scanner.Fortran import FortranScan diff --git a/engine/SCons/Tool/ilink.py b/engine/SCons/Tool/ilink.py index 7c69e72..4e848dc 100644 --- a/engine/SCons/Tool/ilink.py +++ b/engine/SCons/Tool/ilink.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ilink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/ilink.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/ilink32.py b/engine/SCons/Tool/ilink32.py index a1e12a6..ecb6e7b 100644 --- a/engine/SCons/Tool/ilink32.py +++ b/engine/SCons/Tool/ilink32.py @@ -27,7 +27,7 @@ XXX # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ilink32.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/ilink32.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Tool import SCons.Tool.bcc32 diff --git a/engine/SCons/Tool/install.py b/engine/SCons/Tool/install.py index c0a8917..8f80bc2 100644 --- a/engine/SCons/Tool/install.py +++ b/engine/SCons/Tool/install.py @@ -31,7 +31,7 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/install.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/install.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import re diff --git a/engine/SCons/Tool/intelc.py b/engine/SCons/Tool/intelc.py index fdd9730..ee8b4f4 100644 --- a/engine/SCons/Tool/intelc.py +++ b/engine/SCons/Tool/intelc.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import division, print_function -__revision__ = "src/engine/SCons/Tool/intelc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/intelc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import math, sys, os.path, glob, string, re diff --git a/engine/SCons/Tool/ipkg.py b/engine/SCons/Tool/ipkg.py index 664c3a6..60096af 100644 --- a/engine/SCons/Tool/ipkg.py +++ b/engine/SCons/Tool/ipkg.py @@ -33,7 +33,7 @@ packages fake_root. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ipkg.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/ipkg.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os diff --git a/engine/SCons/Tool/jar.py b/engine/SCons/Tool/jar.py index 98be08f..212a105 100644 --- a/engine/SCons/Tool/jar.py +++ b/engine/SCons/Tool/jar.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/jar.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/jar.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import SCons.Subst diff --git a/engine/SCons/Tool/javac.py b/engine/SCons/Tool/javac.py index 387afdb..849ac09 100644 --- a/engine/SCons/Tool/javac.py +++ b/engine/SCons/Tool/javac.py @@ -30,7 +30,7 @@ selection method. # 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/Tool/javac.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/javac.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/javah.py b/engine/SCons/Tool/javah.py index 251778d..8ec3cf8 100644 --- a/engine/SCons/Tool/javah.py +++ b/engine/SCons/Tool/javah.py @@ -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 e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/javah.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path diff --git a/engine/SCons/Tool/latex.py b/engine/SCons/Tool/latex.py index 3f1af08..242aa62 100644 --- a/engine/SCons/Tool/latex.py +++ b/engine/SCons/Tool/latex.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/latex.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/latex.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Action import SCons.Defaults diff --git a/engine/SCons/Tool/ldc.py b/engine/SCons/Tool/ldc.py index dda1a5e..6f6a899 100644 --- a/engine/SCons/Tool/ldc.py +++ b/engine/SCons/Tool/ldc.py @@ -48,7 +48,7 @@ Lib tool variables: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/ldc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/ldc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import subprocess diff --git a/engine/SCons/Tool/lex.py b/engine/SCons/Tool/lex.py index 4831776..155e2d9 100644 --- a/engine/SCons/Tool/lex.py +++ b/engine/SCons/Tool/lex.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/lex.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/lex.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path import sys diff --git a/engine/SCons/Tool/link.py b/engine/SCons/Tool/link.py index dcaf91f..2347c94 100644 --- a/engine/SCons/Tool/link.py +++ b/engine/SCons/Tool/link.py @@ -32,7 +32,7 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/link.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/link.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import sys import re diff --git a/engine/SCons/Tool/linkloc.py b/engine/SCons/Tool/linkloc.py index 42d010d..e3b16fc 100644 --- a/engine/SCons/Tool/linkloc.py +++ b/engine/SCons/Tool/linkloc.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/linkloc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/linkloc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path import re diff --git a/engine/SCons/Tool/m4.py b/engine/SCons/Tool/m4.py index 0ecc82a..0c345f3 100644 --- a/engine/SCons/Tool/m4.py +++ b/engine/SCons/Tool/m4.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/m4.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/m4.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/masm.py b/engine/SCons/Tool/masm.py index cf147a7..26e2e0a 100644 --- a/engine/SCons/Tool/masm.py +++ b/engine/SCons/Tool/masm.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/masm.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/masm.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/midl.py b/engine/SCons/Tool/midl.py index f75204a..b2120c6 100644 --- a/engine/SCons/Tool/midl.py +++ b/engine/SCons/Tool/midl.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/midl.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/midl.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/mingw.py b/engine/SCons/Tool/mingw.py index 8410d2f..4d6533b 100644 --- a/engine/SCons/Tool/mingw.py +++ b/engine/SCons/Tool/mingw.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mingw.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/mingw.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/msgfmt.py b/engine/SCons/Tool/msgfmt.py index c8141a0..a66af36 100644 --- a/engine/SCons/Tool/msgfmt.py +++ b/engine/SCons/Tool/msgfmt.py @@ -21,7 +21,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/Tool/msgfmt.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/msgfmt.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from SCons.Builder import BuilderBase ############################################################################# diff --git a/engine/SCons/Tool/msginit.py b/engine/SCons/Tool/msginit.py index 69e803a..96c2732 100644 --- a/engine/SCons/Tool/msginit.py +++ b/engine/SCons/Tool/msginit.py @@ -24,7 +24,7 @@ Tool specific initialization of msginit tool. # 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/Tool/msginit.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/msginit.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Warnings import SCons.Builder diff --git a/engine/SCons/Tool/msgmerge.py b/engine/SCons/Tool/msgmerge.py index 4254fa6..42cb18a 100644 --- a/engine/SCons/Tool/msgmerge.py +++ b/engine/SCons/Tool/msgmerge.py @@ -24,7 +24,7 @@ Tool specific initialization for `msgmerge` tool. # 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/Tool/msgmerge.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/msgmerge.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" ############################################################################# def _update_or_init_po_files(target, source, env): diff --git a/engine/SCons/Tool/mslib.py b/engine/SCons/Tool/mslib.py index cecdbdc..01ea3ff 100644 --- a/engine/SCons/Tool/mslib.py +++ b/engine/SCons/Tool/mslib.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mslib.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/mslib.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os diff --git a/engine/SCons/Tool/mslink.py b/engine/SCons/Tool/mslink.py index 9fbce4b..43bcb3d 100644 --- a/engine/SCons/Tool/mslink.py +++ b/engine/SCons/Tool/mslink.py @@ -32,7 +32,7 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/mslink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/mslink.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/mssdk.py b/engine/SCons/Tool/mssdk.py index 7a38c6a..8dfdbeb 100644 --- a/engine/SCons/Tool/mssdk.py +++ b/engine/SCons/Tool/mssdk.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mssdk.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/mssdk.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" """engine.SCons.Tool.mssdk diff --git a/engine/SCons/Tool/msvc.py b/engine/SCons/Tool/msvc.py index 052a0b0..d94a037 100644 --- a/engine/SCons/Tool/msvc.py +++ b/engine/SCons/Tool/msvc.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/msvc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/msvc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path import os diff --git a/engine/SCons/Tool/msvs.py b/engine/SCons/Tool/msvs.py index 38965e3..7d60097 100644 --- a/engine/SCons/Tool/msvs.py +++ b/engine/SCons/Tool/msvs.py @@ -32,7 +32,7 @@ selection method. from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/msvs.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/msvs.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.compat diff --git a/engine/SCons/Tool/mwcc.py b/engine/SCons/Tool/mwcc.py index b2b2f5b..1820ddb 100644 --- a/engine/SCons/Tool/mwcc.py +++ b/engine/SCons/Tool/mwcc.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mwcc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/mwcc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/mwld.py b/engine/SCons/Tool/mwld.py index 5049c55..3792b16 100644 --- a/engine/SCons/Tool/mwld.py +++ b/engine/SCons/Tool/mwld.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/mwld.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/mwld.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Tool diff --git a/engine/SCons/Tool/nasm.py b/engine/SCons/Tool/nasm.py index d4d0a1b..bc1e446 100644 --- a/engine/SCons/Tool/nasm.py +++ b/engine/SCons/Tool/nasm.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/nasm.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/nasm.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/packaging/__init__.py b/engine/SCons/Tool/packaging/__init__.py index 72b9eef..02f1acd 100644 --- a/engine/SCons/Tool/packaging/__init__.py +++ b/engine/SCons/Tool/packaging/__init__.py @@ -25,7 +25,7 @@ SCons Packaging Tool. # 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/Tool/packaging/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/__init__.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults import SCons.Environment diff --git a/engine/SCons/Tool/packaging/ipk.py b/engine/SCons/Tool/packaging/ipk.py index dbf5be8..27657eb 100644 --- a/engine/SCons/Tool/packaging/ipk.py +++ b/engine/SCons/Tool/packaging/ipk.py @@ -24,7 +24,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/ipk.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/ipk.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os diff --git a/engine/SCons/Tool/packaging/msi.py b/engine/SCons/Tool/packaging/msi.py index 4a48b47..1038a95 100644 --- a/engine/SCons/Tool/packaging/msi.py +++ b/engine/SCons/Tool/packaging/msi.py @@ -25,7 +25,7 @@ The msi packager. # 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/Tool/packaging/msi.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/msi.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import SCons diff --git a/engine/SCons/Tool/packaging/rpm.py b/engine/SCons/Tool/packaging/rpm.py index a948e29..aa15061 100644 --- a/engine/SCons/Tool/packaging/rpm.py +++ b/engine/SCons/Tool/packaging/rpm.py @@ -25,7 +25,7 @@ The rpm packager. # 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/Tool/packaging/rpm.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/rpm.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os diff --git a/engine/SCons/Tool/packaging/src_tarbz2.py b/engine/SCons/Tool/packaging/src_tarbz2.py index b628ccd..2089142 100644 --- a/engine/SCons/Tool/packaging/src_tarbz2.py +++ b/engine/SCons/Tool/packaging/src_tarbz2.py @@ -26,7 +26,7 @@ The tarbz2 SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/src_tarbz2.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/engine/SCons/Tool/packaging/src_targz.py b/engine/SCons/Tool/packaging/src_targz.py index 4c7469c..f7be89c 100644 --- a/engine/SCons/Tool/packaging/src_targz.py +++ b/engine/SCons/Tool/packaging/src_targz.py @@ -26,7 +26,7 @@ The targz SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_targz.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/src_targz.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/engine/SCons/Tool/packaging/src_tarxz.py b/engine/SCons/Tool/packaging/src_tarxz.py index 6688c46..9093d27 100644 --- a/engine/SCons/Tool/packaging/src_tarxz.py +++ b/engine/SCons/Tool/packaging/src_tarxz.py @@ -26,7 +26,7 @@ The tarxz SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_tarxz.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/src_tarxz.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/engine/SCons/Tool/packaging/src_zip.py b/engine/SCons/Tool/packaging/src_zip.py index d56f3aa..51859ec 100644 --- a/engine/SCons/Tool/packaging/src_zip.py +++ b/engine/SCons/Tool/packaging/src_zip.py @@ -26,7 +26,7 @@ The zip SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/src_zip.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/src_zip.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from SCons.Tool.packaging import putintopackageroot diff --git a/engine/SCons/Tool/packaging/tarbz2.py b/engine/SCons/Tool/packaging/tarbz2.py index e371f1b..6adae3b 100644 --- a/engine/SCons/Tool/packaging/tarbz2.py +++ b/engine/SCons/Tool/packaging/tarbz2.py @@ -26,7 +26,7 @@ The tarbz2 packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/tarbz2.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot diff --git a/engine/SCons/Tool/packaging/targz.py b/engine/SCons/Tool/packaging/targz.py index 121e4a4..402063f 100644 --- a/engine/SCons/Tool/packaging/targz.py +++ b/engine/SCons/Tool/packaging/targz.py @@ -26,7 +26,7 @@ The targz packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/targz.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/targz.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot diff --git a/engine/SCons/Tool/packaging/tarxz.py b/engine/SCons/Tool/packaging/tarxz.py index 3ec9822..0e3e44d 100644 --- a/engine/SCons/Tool/packaging/tarxz.py +++ b/engine/SCons/Tool/packaging/tarxz.py @@ -26,7 +26,7 @@ The tarxz packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/tarxz.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/tarxz.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot diff --git a/engine/SCons/Tool/packaging/zip.py b/engine/SCons/Tool/packaging/zip.py index 11ab3b5..04bb246 100644 --- a/engine/SCons/Tool/packaging/zip.py +++ b/engine/SCons/Tool/packaging/zip.py @@ -26,7 +26,7 @@ The zip SRC packager. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/packaging/zip.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/packaging/zip.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot diff --git a/engine/SCons/Tool/pdf.py b/engine/SCons/Tool/pdf.py index 50988b6..c2b8d72 100644 --- a/engine/SCons/Tool/pdf.py +++ b/engine/SCons/Tool/pdf.py @@ -28,7 +28,7 @@ Add an explicit action to run epstopdf to convert .eps files to .pdf # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/pdf.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/pdf.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Builder import SCons.Tool diff --git a/engine/SCons/Tool/pdflatex.py b/engine/SCons/Tool/pdflatex.py index 2c559f7..92edf6a 100644 --- a/engine/SCons/Tool/pdflatex.py +++ b/engine/SCons/Tool/pdflatex.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/pdflatex.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/pdflatex.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Action import SCons.Util diff --git a/engine/SCons/Tool/pdftex.py b/engine/SCons/Tool/pdftex.py index c658aa0..3a4c8e1 100644 --- a/engine/SCons/Tool/pdftex.py +++ b/engine/SCons/Tool/pdftex.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/pdftex.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/pdftex.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import SCons.Action diff --git a/engine/SCons/Tool/qt.py b/engine/SCons/Tool/qt.py index a582e6f..0829224 100644 --- a/engine/SCons/Tool/qt.py +++ b/engine/SCons/Tool/qt.py @@ -33,7 +33,7 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/qt.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/qt.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path import re diff --git a/engine/SCons/Tool/rmic.py b/engine/SCons/Tool/rmic.py index d6f7b2b..ddf12e2 100644 --- a/engine/SCons/Tool/rmic.py +++ b/engine/SCons/Tool/rmic.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/rmic.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/rmic.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path diff --git a/engine/SCons/Tool/rpcgen.py b/engine/SCons/Tool/rpcgen.py index b9f8ca6..f1eebea 100644 --- a/engine/SCons/Tool/rpcgen.py +++ b/engine/SCons/Tool/rpcgen.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/rpcgen.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/rpcgen.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from SCons.Builder import Builder import SCons.Util diff --git a/engine/SCons/Tool/rpm.py b/engine/SCons/Tool/rpm.py index 0253365..7de20cc 100644 --- a/engine/SCons/Tool/rpm.py +++ b/engine/SCons/Tool/rpm.py @@ -33,7 +33,7 @@ tar.gz consisting of the source file and a specfile. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/rpm.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/rpm.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import re diff --git a/engine/SCons/Tool/rpmutils.py b/engine/SCons/Tool/rpmutils.py index a2400ff..bacfe50 100644 --- a/engine/SCons/Tool/rpmutils.py +++ b/engine/SCons/Tool/rpmutils.py @@ -36,7 +36,7 @@ exact syntax. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/rpmutils.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/rpmutils.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import platform diff --git a/engine/SCons/Tool/sgiar.py b/engine/SCons/Tool/sgiar.py index d82ec89..a2f86cb 100644 --- a/engine/SCons/Tool/sgiar.py +++ b/engine/SCons/Tool/sgiar.py @@ -33,7 +33,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgiar.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/sgiar.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/sgic++.py b/engine/SCons/Tool/sgic++.py index 84d775a..9d7da76 100644 --- a/engine/SCons/Tool/sgic++.py +++ b/engine/SCons/Tool/sgic++.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgic++.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/sgic++.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" #forward proxy to the preffered cxx version from SCons.Tool.sgicxx import * diff --git a/engine/SCons/Tool/sgicc.py b/engine/SCons/Tool/sgicc.py index 537f1a3..df4cf2c 100644 --- a/engine/SCons/Tool/sgicc.py +++ b/engine/SCons/Tool/sgicc.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgicc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/sgicc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" from . import cc diff --git a/engine/SCons/Tool/sgicxx.py b/engine/SCons/Tool/sgicxx.py index d44ec26..3270faa 100644 --- a/engine/SCons/Tool/sgicxx.py +++ b/engine/SCons/Tool/sgicxx.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgicxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/sgicxx.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sgilink.py b/engine/SCons/Tool/sgilink.py index ca9e69c..402c28b 100644 --- a/engine/SCons/Tool/sgilink.py +++ b/engine/SCons/Tool/sgilink.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sgilink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/sgilink.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sunar.py b/engine/SCons/Tool/sunar.py index 07d45b2..2fab888 100644 --- a/engine/SCons/Tool/sunar.py +++ b/engine/SCons/Tool/sunar.py @@ -32,7 +32,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunar.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/sunar.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Defaults import SCons.Tool diff --git a/engine/SCons/Tool/sunc++.py b/engine/SCons/Tool/sunc++.py index 1611fe9..d33fcdf 100644 --- a/engine/SCons/Tool/sunc++.py +++ b/engine/SCons/Tool/sunc++.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunc++.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/sunc++.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" #forward proxy to the preffered cxx version diff --git a/engine/SCons/Tool/suncc.py b/engine/SCons/Tool/suncc.py index da6ca6e..bc6bc9a 100644 --- a/engine/SCons/Tool/suncc.py +++ b/engine/SCons/Tool/suncc.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/suncc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/suncc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/suncxx.py b/engine/SCons/Tool/suncxx.py index 1ee1c6a..b0e343b 100644 --- a/engine/SCons/Tool/suncxx.py +++ b/engine/SCons/Tool/suncxx.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/suncxx.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/suncxx.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons diff --git a/engine/SCons/Tool/sunf77.py b/engine/SCons/Tool/sunf77.py index c1c216f..0bbb52f 100644 --- a/engine/SCons/Tool/sunf77.py +++ b/engine/SCons/Tool/sunf77.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunf77.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/sunf77.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sunf90.py b/engine/SCons/Tool/sunf90.py index 4cabee8..5c34a08 100644 --- a/engine/SCons/Tool/sunf90.py +++ b/engine/SCons/Tool/sunf90.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunf90.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/sunf90.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sunf95.py b/engine/SCons/Tool/sunf95.py index 077b1bc..71a6840 100644 --- a/engine/SCons/Tool/sunf95.py +++ b/engine/SCons/Tool/sunf95.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunf95.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/sunf95.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Util diff --git a/engine/SCons/Tool/sunlink.py b/engine/SCons/Tool/sunlink.py index 8d965fa..39a921a 100644 --- a/engine/SCons/Tool/sunlink.py +++ b/engine/SCons/Tool/sunlink.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/sunlink.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/sunlink.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import os.path diff --git a/engine/SCons/Tool/swig.py b/engine/SCons/Tool/swig.py index 2e61b91..a6ab3de 100644 --- a/engine/SCons/Tool/swig.py +++ b/engine/SCons/Tool/swig.py @@ -32,7 +32,7 @@ from __future__ import print_function # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/swig.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/swig.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path import sys diff --git a/engine/SCons/Tool/tar.py b/engine/SCons/Tool/tar.py index 08c80f2..6a59683 100644 --- a/engine/SCons/Tool/tar.py +++ b/engine/SCons/Tool/tar.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/tar.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/tar.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Action import SCons.Builder diff --git a/engine/SCons/Tool/tex.py b/engine/SCons/Tool/tex.py index 9beb557..8c4ee96 100644 --- a/engine/SCons/Tool/tex.py +++ b/engine/SCons/Tool/tex.py @@ -33,7 +33,7 @@ selection method. # from __future__ import print_function -__revision__ = "src/engine/SCons/Tool/tex.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/tex.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path import re diff --git a/engine/SCons/Tool/textfile.py b/engine/SCons/Tool/textfile.py index 58a5007..8d19649 100644 --- a/engine/SCons/Tool/textfile.py +++ b/engine/SCons/Tool/textfile.py @@ -44,7 +44,7 @@ Textfile/Substfile builder for SCons. is unpredictable whether the expansion will occur. """ -__revision__ = "src/engine/SCons/Tool/textfile.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/textfile.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons diff --git a/engine/SCons/Tool/tlib.py b/engine/SCons/Tool/tlib.py index 4d8101b..0e83c17 100644 --- a/engine/SCons/Tool/tlib.py +++ b/engine/SCons/Tool/tlib.py @@ -27,7 +27,7 @@ XXX # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/tlib.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/tlib.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Tool import SCons.Tool.bcc32 diff --git a/engine/SCons/Tool/wix.py b/engine/SCons/Tool/wix.py index e79e4a1..6ee1784 100644 --- a/engine/SCons/Tool/wix.py +++ b/engine/SCons/Tool/wix.py @@ -30,7 +30,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/wix.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/wix.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import SCons.Builder import SCons.Action diff --git a/engine/SCons/Tool/xgettext.py b/engine/SCons/Tool/xgettext.py index 185558e..920255a 100644 --- a/engine/SCons/Tool/xgettext.py +++ b/engine/SCons/Tool/xgettext.py @@ -24,7 +24,7 @@ Tool specific initialization of `xgettext` tool. # 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/Tool/xgettext.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/xgettext.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import re diff --git a/engine/SCons/Tool/yacc.py b/engine/SCons/Tool/yacc.py index 6857574..aaf9a8a 100644 --- a/engine/SCons/Tool/yacc.py +++ b/engine/SCons/Tool/yacc.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/yacc.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/yacc.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path import sys diff --git a/engine/SCons/Tool/zip.py b/engine/SCons/Tool/zip.py index b7efdc7..1c482eb 100644 --- a/engine/SCons/Tool/zip.py +++ b/engine/SCons/Tool/zip.py @@ -31,7 +31,7 @@ selection method. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/zip.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Tool/zip.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path diff --git a/engine/SCons/Util.py b/engine/SCons/Util.py index 5b4c225..7bb22cd 100644 --- a/engine/SCons/Util.py +++ b/engine/SCons/Util.py @@ -24,7 +24,7 @@ Various utility functions go here. # 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/Util.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Util.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import sys diff --git a/engine/SCons/Variables/BoolVariable.py b/engine/SCons/Variables/BoolVariable.py index 4cb9f35..287a72a 100644 --- a/engine/SCons/Variables/BoolVariable.py +++ b/engine/SCons/Variables/BoolVariable.py @@ -34,7 +34,7 @@ Usage example:: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/BoolVariable.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Variables/BoolVariable.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __all__ = ['BoolVariable',] diff --git a/engine/SCons/Variables/EnumVariable.py b/engine/SCons/Variables/EnumVariable.py index ba9f972..19cd908 100644 --- a/engine/SCons/Variables/EnumVariable.py +++ b/engine/SCons/Variables/EnumVariable.py @@ -37,7 +37,7 @@ Usage example:: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/EnumVariable.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Variables/EnumVariable.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __all__ = ['EnumVariable',] diff --git a/engine/SCons/Variables/ListVariable.py b/engine/SCons/Variables/ListVariable.py index a30f265..89b04d3 100644 --- a/engine/SCons/Variables/ListVariable.py +++ b/engine/SCons/Variables/ListVariable.py @@ -46,7 +46,7 @@ Usage example:: # 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/Variables/ListVariable.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Variables/ListVariable.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" # Known Bug: This should behave like a Set-Type, but does not really, # since elements can occur twice. diff --git a/engine/SCons/Variables/PackageVariable.py b/engine/SCons/Variables/PackageVariable.py index 7c23cca..2100314 100644 --- a/engine/SCons/Variables/PackageVariable.py +++ b/engine/SCons/Variables/PackageVariable.py @@ -50,7 +50,7 @@ Usage example: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/PackageVariable.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Variables/PackageVariable.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __all__ = ['PackageVariable',] diff --git a/engine/SCons/Variables/PathVariable.py b/engine/SCons/Variables/PathVariable.py index bf123fb..88d277e 100644 --- a/engine/SCons/Variables/PathVariable.py +++ b/engine/SCons/Variables/PathVariable.py @@ -67,7 +67,7 @@ Usage example:: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Variables/PathVariable.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Variables/PathVariable.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __all__ = ['PathVariable',] diff --git a/engine/SCons/Variables/__init__.py b/engine/SCons/Variables/__init__.py index 5b4b3af..9daad3f 100644 --- a/engine/SCons/Variables/__init__.py +++ b/engine/SCons/Variables/__init__.py @@ -26,7 +26,7 @@ customizable variables to an SCons build. # 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/Variables/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Variables/__init__.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os.path import sys diff --git a/engine/SCons/Warnings.py b/engine/SCons/Warnings.py index 1c84d57..064076e 100644 --- a/engine/SCons/Warnings.py +++ b/engine/SCons/Warnings.py @@ -27,7 +27,7 @@ This file implements the warnings framework for SCons. """ -__revision__ = "src/engine/SCons/Warnings.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/Warnings.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import sys diff --git a/engine/SCons/__init__.py b/engine/SCons/__init__.py index 1f52e1f..7ffc3bb 100644 --- a/engine/SCons/__init__.py +++ b/engine/SCons/__init__.py @@ -27,15 +27,15 @@ The main package for the SCons software construction utility. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/__init__.py ae4de9ab2249be220b6658a514eef8c3a57afc04 2019-07-21 02:32:15 bdeegan" +__revision__ = "src/engine/SCons/__init__.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" -__version__ = "3.1.0" +__version__ = "3.1.1" -__build__ = "ae4de9ab2249be220b6658a514eef8c3a57afc04" +__build__ = "72ae09dc35ac2626f8ff711d8c4b30b6138e08e3" -__buildsys__ = "kufra" +__buildsys__ = "octodog" -__date__ = "2019-07-21 02:32:15" +__date__ = "2019-08-08 14:50:06" __developer__ = "bdeegan" diff --git a/engine/SCons/compat/__init__.py b/engine/SCons/compat/__init__.py index dcbd8e8..439d3f6 100644 --- a/engine/SCons/compat/__init__.py +++ b/engine/SCons/compat/__init__.py @@ -57,7 +57,7 @@ function defined below loads the module as the "real" name (without the rest of our code will find our pre-loaded compatibility module. """ -__revision__ = "src/engine/SCons/compat/__init__.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/compat/__init__.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import sys diff --git a/engine/SCons/compat/_scons_dbm.py b/engine/SCons/compat/_scons_dbm.py index ec5e261..c9682f8 100644 --- a/engine/SCons/compat/_scons_dbm.py +++ b/engine/SCons/compat/_scons_dbm.py @@ -30,7 +30,7 @@ that the whichdb.whichdb() implementstation in the various 2.X versions of Python won't blow up even if dbm wasn't compiled in. """ -__revision__ = "src/engine/SCons/compat/_scons_dbm.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/compat/_scons_dbm.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" class error(Exception): pass diff --git a/engine/SCons/cpp.py b/engine/SCons/cpp.py index 7c4ac92..d9b3a2c 100644 --- a/engine/SCons/cpp.py +++ b/engine/SCons/cpp.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/cpp.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/cpp.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" __doc__ = """ SCons C Pre-Processor module diff --git a/engine/SCons/exitfuncs.py b/engine/SCons/exitfuncs.py index c5414a2..8f5207d 100644 --- a/engine/SCons/exitfuncs.py +++ b/engine/SCons/exitfuncs.py @@ -27,7 +27,7 @@ Register functions which are executed when SCons exits for any reason. # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/exitfuncs.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/engine/SCons/exitfuncs.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import atexit diff --git a/scons-time.1 b/scons-time.1 index 8ea1da3..2b456e6 100644 --- a/scons-time.1 +++ b/scons-time.1 @@ -2,12 +2,12 @@ .\" Title: SCONS-TIME .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 07/20/2019 -.\" Manual: SCons 3.1.0 -.\" Source: SCons 3.1.0 +.\" Date: 08/08/2019 +.\" Manual: SCons 3.1.1 +.\" Source: SCons 3.1.1 .\" Language: English .\" -.TH "SCONS\-TIME" "1" "07/20/2019" "SCons 3\&.1\&.0" "SCons 3\&.1\&.0" +.TH "SCONS\-TIME" "1" "08/08/2019" "SCons 3\&.1\&.1" "SCons 3\&.1\&.1" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/scons.1 b/scons.1 index 4e75215..255f056 100644 --- a/scons.1 +++ b/scons.1 @@ -3,11 +3,11 @@ .\" Author: Steven Knight .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 2004 - 2019 -.\" Manual: SCons 3.1.0 -.\" Source: SCons 3.1.0 version 3.1.0 +.\" Manual: SCons 3.1.1 +.\" Source: SCons 3.1.1 version 3.1.1 .\" Language: English .\" -.TH "SCONS" "1" "2004 - 2019" "SCons 3\&.1\&.0 version 3.1.0" "SCons 3\&.1\&.0" +.TH "SCONS" "1" "2004 - 2019" "SCons 3\&.1\&.1 version 3.1.1" "SCons 3\&.1\&.1" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -3294,11 +3294,6 @@ Uses: \fB$ASPPCOMSTR\fR\&. .RE .PP -packaging -.RS 4 -A framework for building binary and source packages\&. -.RE -.PP Packaging .RS 4 Sets construction variables for the @@ -3306,6 +3301,11 @@ Sets construction variables for the Builder\&. .RE .PP +packaging +.RS 4 +A framework for building binary and source packages\&. +.RE +.PP pdf .RS 4 Sets construction variables for the Portable Document Format builder\&. @@ -8895,30 +8895,33 @@ Flag values are translated accordig to the prefix found, and added to the follow .RS 4 .\} .nf -\-arch CCFLAGS, LINKFLAGS -\-D CPPDEFINES -\-framework FRAMEWORKS -\-frameworkdir= FRAMEWORKPATH -\-include CCFLAGS -\-isysroot CCFLAGS, LINKFLAGS -\-isystem CCFLAGS -\-iquote CCFLAGS -\-idirafter CCFLAGS -\-I CPPPATH -\-l LIBS -\-L LIBPATH -\-mno\-cygwin CCFLAGS, LINKFLAGS -\-mwindows LINKFLAGS -\-pthread CCFLAGS, LINKFLAGS -\-std= CFLAGS -\-Wa, ASFLAGS, CCFLAGS -\-Wl,\-rpath= RPATH -\-Wl,\-R, RPATH -\-Wl,\-R RPATH -\-Wl, LINKFLAGS -\-Wp, CPPFLAGS -\- CCFLAGS -+ CCFLAGS, LINKFLAGS +\-arch CCFLAGS, LINKFLAGS +\-D CPPDEFINES +\-framework FRAMEWORKS +\-frameworkdir= FRAMEWORKPATH +\-fmerge\-all\-constants CCFLAGS, LINKFLAGS +\-fopenmp CCFLAGS, LINKFLAGS +\-include CCFLAGS +\-isysroot CCFLAGS, LINKFLAGS +\-isystem CCFLAGS +\-iquote CCFLAGS +\-idirafter CCFLAGS +\-I CPPPATH +\-l LIBS +\-L LIBPATH +\-mno\-cygwin CCFLAGS, LINKFLAGS +\-mwindows LINKFLAGS +\-openmp CCFLAGS, LINKFLAGS +\-pthread CCFLAGS, LINKFLAGS +\-std= CFLAGS +\-Wa, ASFLAGS, CCFLAGS +\-Wl,\-rpath= RPATH +\-Wl,\-R, RPATH +\-Wl,\-R RPATH +\-Wl, LINKFLAGS +\-Wp, CPPFLAGS +\- CCFLAGS ++ CCFLAGS, LINKFLAGS .fi .if n \{\ .RE @@ -15637,6 +15640,16 @@ versions should exist as alpha\-numeric, decimal\-delimited values as defined by values include \*(Aq1\*(Aq, \*(Aq1\&.2\&.3\*(Aq, and \*(Aq1\&.2\&.gitaa412c8b\*(Aq\&. .RE .PP +SHLIBVERSIONFLAGS +.RS 4 +Extra flags added to +\fB$SHLINKCOM\fR +when building versioned +\fBSharedLibrary\fR\&. These flags are only used when +\fB$SHLIBVERSION\fR +is set\&. +.RE +.PP _SHLIBVERSIONFLAGS .RS 4 This macro automatically introduces extra flags to @@ -15653,16 +15666,6 @@ and some extra dynamically generated options (such as \-Wl,\-soname=$_SHLIBSONAME\&. It is unused by "plain" (unversioned) shared libraries\&. .RE .PP -SHLIBVERSIONFLAGS -.RS 4 -Extra flags added to -\fB$SHLINKCOM\fR -when building versioned -\fBSharedLibrary\fR\&. These flags are only used when -\fB$SHLIBVERSION\fR -is set\&. -.RE -.PP SHLINK .RS 4 The linker for programs that use shared libraries\&. diff --git a/sconsign.1 b/sconsign.1 index 596da26..e8a3de2 100644 --- a/sconsign.1 +++ b/sconsign.1 @@ -2,12 +2,12 @@ .\" Title: SCONSIGN .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.76.1 -.\" Date: 07/20/2019 -.\" Manual: SCons 3.1.0 -.\" Source: SCons 3.1.0 +.\" Date: 08/08/2019 +.\" Manual: SCons 3.1.1 +.\" Source: SCons 3.1.1 .\" Language: English .\" -.TH "SCONSIGN" "1" "07/20/2019" "SCons 3\&.1\&.0" "SCons 3\&.1\&.0" +.TH "SCONSIGN" "1" "08/08/2019" "SCons 3\&.1\&.1" "SCons 3\&.1\&.1" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/script/scons b/script/scons index 98f4e62..1d9595e 100755 --- a/script/scons +++ b/script/scons @@ -25,15 +25,15 @@ from __future__ import print_function -__revision__ = "src/script/scons.py ae4de9ab2249be220b6658a514eef8c3a57afc04 2019-07-21 02:32:15 bdeegan" +__revision__ = "src/script/scons.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" -__version__ = "3.1.0" +__version__ = "3.1.1" -__build__ = "ae4de9ab2249be220b6658a514eef8c3a57afc04" +__build__ = "72ae09dc35ac2626f8ff711d8c4b30b6138e08e3" -__buildsys__ = "kufra" +__buildsys__ = "octodog" -__date__ = "2019-07-21 02:32:15" +__date__ = "2019-08-08 14:50:06" __developer__ = "bdeegan" diff --git a/script/scons-configure-cache b/script/scons-configure-cache index 757a79f..8bce553 100644 --- a/script/scons-configure-cache +++ b/script/scons-configure-cache @@ -37,15 +37,15 @@ import glob import json import os -__revision__ = "src/script/scons-configure-cache.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/script/scons-configure-cache.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" -__version__ = "3.1.0" +__version__ = "3.1.1" -__build__ = "e724ae812eb96f4858a132f5b8c769724744faf6" +__build__ = "72ae09dc35ac2626f8ff711d8c4b30b6138e08e3" -__buildsys__ = "kufra" +__buildsys__ = "octodog" -__date__ = "2019-07-21 00:04:47" +__date__ = "2019-08-08 14:50:06" __developer__ = "bdeegan" diff --git a/script/scons-time b/script/scons-time index 975ff64..15e3700 100644 --- a/script/scons-time +++ b/script/scons-time @@ -31,7 +31,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import division, print_function -__revision__ = "src/script/scons-time.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/script/scons-time.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import getopt import glob diff --git a/script/scons.bat b/script/scons.bat index 75e2a49..a5b1b6e 100644 --- a/script/scons.bat +++ b/script/scons.bat @@ -1,11 +1,11 @@ @REM Copyright (c) 2001 - 2019 The SCons Foundation -@REM src/script/scons.bat e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan +@REM src/script/scons.bat 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan @echo off set SCONS_ERRORLEVEL= if "%OS%" == "Windows_NT" goto WinNT @REM for 9x/Me you better not have more than 9 args -python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-3.1.0'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-3.1.0'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9 +python -c "from os.path import join; import sys; sys.path = [ join(sys.prefix, 'Lib', 'site-packages', 'scons-3.1.1'), join(sys.prefix, 'Lib', 'site-packages', 'scons'), join(sys.prefix, 'scons-3.1.1'), join(sys.prefix, 'scons')] + sys.path; import SCons.Script; SCons.Script.main()" %1 %2 %3 %4 %5 %6 %7 %8 %9 @REM no way to set exit status of this script for 9x/Me goto endscons diff --git a/script/sconsign b/script/sconsign index 3e8d4cf..7c5dda5 100644 --- a/script/sconsign +++ b/script/sconsign @@ -25,15 +25,15 @@ from __future__ import print_function -__revision__ = "src/script/sconsign.py ae4de9ab2249be220b6658a514eef8c3a57afc04 2019-07-21 02:32:15 bdeegan" +__revision__ = "src/script/sconsign.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" -__version__ = "3.1.0" +__version__ = "3.1.1" -__build__ = "ae4de9ab2249be220b6658a514eef8c3a57afc04" +__build__ = "72ae09dc35ac2626f8ff711d8c4b30b6138e08e3" -__buildsys__ = "kufra" +__buildsys__ = "octodog" -__date__ = "2019-07-21 02:32:15" +__date__ = "2019-08-08 14:50:06" __developer__ = "bdeegan" diff --git a/setup.py b/setup.py index 790b1ea..922aee4 100755 --- a/setup.py +++ b/setup.py @@ -44,13 +44,13 @@ NOTE: Installed SCons is not importable like usual Python packages. It is """ -__revision__ = "src/setup.py e724ae812eb96f4858a132f5b8c769724744faf6 2019-07-21 00:04:47 bdeegan" +__revision__ = "src/setup.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" import os import stat import sys -Version = "3.1.0" +Version = "3.1.1" man_pages = [ 'scons.1', -- cgit v1.2.3 From e5de8c685bad4b129a66a8d7fae451927d5c2ef6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 10 Aug 2019 08:46:17 +0200 Subject: New upstream release 3.1.1 --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 052bc3b..ae90956 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -scons (3.1.0-1) unstable; urgency=medium +scons (3.1.1-1) unstable; urgency=medium [ Jörg Frings-Fürst ] * New upstream release: -- cgit v1.2.3 From f6c9bffb15e04ea412db4df22a3851448221b85a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 10 Aug 2019 09:06:20 +0200 Subject: d/changlog: change date / time --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index ae90956..5a2658c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -25,7 +25,7 @@ scons (3.1.1-1) unstable; urgency=medium * New debian/patches/0130-python3.patch: - Switch shebang to python3. - -- Jörg Frings-Fürst Tue, 06 Aug 2019 09:49:22 +0200 + -- Jörg Frings-Fürst Sat, 10 Aug 2019 09:05:16 +0200 scons (3.0.1-2) unstable; urgency=medium -- cgit v1.2.3