From 56597a6a68e741355b301f91d5913d59cfb34eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 28 Dec 2019 17:12:41 +0100 Subject: New upstream version 3.1.2 --- .appveyor.yml | 125 ++-- .gitattributes | 6 + CONTRIBUTING.md | 13 + LICENSE | 2 + README.rst | 14 +- SConstruct | 6 +- bin/SConsDoc.py | 218 ++++--- bin/SConsExamples.py | 77 ++- bin/calibrate.py | 10 +- bin/docs-update-generated.py | 17 +- bin/import-test.py | 2 +- bin/linecount.py | 2 +- bin/restore.sh | 18 +- bin/rsync-sourceforge | 32 - bin/scons-proc.py | 14 +- bin/scons-review.sh | 24 - bin/scons_dev_master.py | 2 +- bin/sfsum | 148 ----- bin/timebuild | 65 -- bin/update-release-info.py | 2 +- config | 299 --------- doc/generated/builders.gen | 118 ++-- doc/generated/examples/caching_ex-random_1.xml | 6 +- doc/generated/examples/troubleshoot_Dump_1.xml | 30 +- doc/generated/examples/troubleshoot_Dump_2.xml | 40 +- doc/generated/examples/troubleshoot_explain1_3.xml | 2 +- .../examples/troubleshoot_stacktrace_2.xml | 2 +- doc/generated/functions.gen | 489 +++++--------- doc/generated/functions.mod | 12 - doc/generated/tools.gen | 92 ++- doc/generated/variables.gen | 568 +++++------------ doc/generated/variables.mod | 6 +- doc/man/scons-time.xml | 57 +- doc/man/scons.xml | 699 ++++++++++++--------- doc/man/sconsign.xml | 4 +- doc/scons.mod | 4 +- doc/user/README | 2 +- doc/user/builders-writing.xml | 12 +- doc/user/command-line.xml | 63 +- doc/user/depends.xml | 179 +----- doc/user/environments.xml | 93 +-- doc/user/factories.xml | 10 +- doc/user/file-removal.xml | 2 +- doc/user/install.xml | 70 ++- doc/user/mergeflags.xml | 8 +- doc/user/output.xml | 2 +- doc/user/parseconfig.xml | 4 +- doc/user/parseflags.xml | 12 +- doc/user/separate.xml | 6 +- doc/user/sideeffect.xml | 2 +- doc/user/troubleshoot.xml | 4 +- src/Announce.txt | 33 +- src/CHANGES.txt | 66 ++ src/LICENSE.txt | 2 + src/RELEASE.txt | 107 ++-- src/engine/SCons/Action.py | 2 +- src/engine/SCons/Action.xml | 2 +- src/engine/SCons/ActionTests.py | 6 +- src/engine/SCons/Builder.py | 17 +- src/engine/SCons/BuilderTests.py | 2 +- src/engine/SCons/CacheDir.py | 2 +- src/engine/SCons/CacheDirTests.py | 2 +- src/engine/SCons/Conftest.py | 4 + src/engine/SCons/Debug.py | 2 +- src/engine/SCons/Defaults.py | 2 +- src/engine/SCons/Defaults.xml | 18 +- src/engine/SCons/DefaultsTests.py | 2 +- src/engine/SCons/Environment.py | 220 ++++--- src/engine/SCons/Environment.xml | 468 ++++---------- src/engine/SCons/EnvironmentTests.py | 107 +--- src/engine/SCons/Errors.py | 2 +- src/engine/SCons/ErrorsTests.py | 2 +- src/engine/SCons/Executor.py | 2 +- src/engine/SCons/ExecutorTests.py | 2 +- src/engine/SCons/Job.py | 2 +- src/engine/SCons/JobTests.py | 2 +- src/engine/SCons/Memoize.py | 2 +- src/engine/SCons/MemoizeTests.py | 2 +- src/engine/SCons/Node/Alias.py | 2 +- src/engine/SCons/Node/AliasTests.py | 2 +- src/engine/SCons/Node/FS.py | 12 +- src/engine/SCons/Node/FSTests.py | 9 +- src/engine/SCons/Node/NodeTests.py | 2 +- src/engine/SCons/Node/Python.py | 2 +- src/engine/SCons/Node/PythonTests.py | 2 +- src/engine/SCons/Node/__init__.py | 10 +- src/engine/SCons/PathList.py | 2 +- src/engine/SCons/PathListTests.py | 2 +- src/engine/SCons/Platform/PlatformTests.py | 2 +- src/engine/SCons/Platform/__init__.py | 2 +- src/engine/SCons/Platform/__init__.xml | 2 +- src/engine/SCons/Platform/aix.py | 2 +- src/engine/SCons/Platform/cygwin.py | 2 +- src/engine/SCons/Platform/darwin.py | 2 +- src/engine/SCons/Platform/hpux.py | 2 +- src/engine/SCons/Platform/irix.py | 2 +- src/engine/SCons/Platform/mingw.py | 2 +- src/engine/SCons/Platform/os2.py | 2 +- src/engine/SCons/Platform/posix.py | 2 +- src/engine/SCons/Platform/posix.xml | 2 +- src/engine/SCons/Platform/sunos.py | 2 +- src/engine/SCons/Platform/sunos.xml | 2 +- src/engine/SCons/Platform/virtualenv.py | 2 +- src/engine/SCons/Platform/virtualenvTests.py | 2 +- src/engine/SCons/Platform/win32.py | 60 +- src/engine/SCons/Platform/win32.xml | 2 +- src/engine/SCons/SConf.py | 2 +- src/engine/SCons/SConfTests.py | 30 +- src/engine/SCons/SConsign.py | 2 +- src/engine/SCons/SConsignTests.py | 2 +- src/engine/SCons/Scanner/C.py | 2 +- src/engine/SCons/Scanner/CTests.py | 2 +- src/engine/SCons/Scanner/D.py | 2 +- src/engine/SCons/Scanner/DTests.py | 2 +- src/engine/SCons/Scanner/Dir.py | 2 +- src/engine/SCons/Scanner/DirTests.py | 2 +- src/engine/SCons/Scanner/Fortran.py | 2 +- src/engine/SCons/Scanner/FortranTests.py | 2 +- src/engine/SCons/Scanner/IDL.py | 2 +- src/engine/SCons/Scanner/IDLTests.py | 2 +- src/engine/SCons/Scanner/LaTeX.py | 2 +- src/engine/SCons/Scanner/LaTeXTests.py | 2 +- src/engine/SCons/Scanner/Prog.py | 2 +- src/engine/SCons/Scanner/ProgTests.py | 2 +- src/engine/SCons/Scanner/RC.py | 2 +- src/engine/SCons/Scanner/RCTests.py | 2 +- src/engine/SCons/Scanner/SWIG.py | 2 +- src/engine/SCons/Scanner/ScannerTests.py | 2 +- src/engine/SCons/Scanner/__init__.py | 2 +- src/engine/SCons/Scanner/__init__.xml | 2 +- src/engine/SCons/Script/Interactive.py | 2 +- src/engine/SCons/Script/Main.py | 11 +- src/engine/SCons/Script/Main.xml | 39 +- src/engine/SCons/Script/MainTests.py | 2 +- src/engine/SCons/Script/SConsOptions.py | 24 +- src/engine/SCons/Script/SConscript.py | 26 +- src/engine/SCons/Script/SConscript.xml | 2 +- src/engine/SCons/Script/SConscriptTests.py | 2 +- src/engine/SCons/Script/__init__.py | 5 +- src/engine/SCons/Subst.py | 4 +- src/engine/SCons/Subst.xml | 2 +- src/engine/SCons/SubstTests.py | 2 +- src/engine/SCons/Taskmaster.py | 8 +- src/engine/SCons/TaskmasterTests.py | 2 +- src/engine/SCons/Tool/386asm.py | 2 +- src/engine/SCons/Tool/386asm.xml | 2 +- src/engine/SCons/Tool/DCommon.py | 2 +- src/engine/SCons/Tool/DCommon.xml | 370 +++++++++-- src/engine/SCons/Tool/FortranCommon.py | 2 +- src/engine/SCons/Tool/FortranCommonTests.py | 2 +- src/engine/SCons/Tool/GettextCommon.py | 2 +- src/engine/SCons/Tool/JavaCommon.py | 2 +- src/engine/SCons/Tool/JavaCommonTests.py | 2 +- src/engine/SCons/Tool/MSCommon/__init__.py | 2 +- src/engine/SCons/Tool/MSCommon/arch.py | 2 +- src/engine/SCons/Tool/MSCommon/common.py | 60 +- src/engine/SCons/Tool/MSCommon/netframework.py | 2 +- src/engine/SCons/Tool/MSCommon/sdk.py | 32 +- src/engine/SCons/Tool/MSCommon/vc.py | 129 ++-- src/engine/SCons/Tool/MSCommon/vcTests.py | 2 +- src/engine/SCons/Tool/MSCommon/vs.py | 6 +- src/engine/SCons/Tool/PharLapCommon.py | 2 +- src/engine/SCons/Tool/ToolTests.py | 2 +- src/engine/SCons/Tool/__init__.py | 4 +- src/engine/SCons/Tool/__init__.xml | 32 +- src/engine/SCons/Tool/aixc++.py | 2 +- src/engine/SCons/Tool/aixc++.xml | 2 +- src/engine/SCons/Tool/aixcc.py | 2 +- src/engine/SCons/Tool/aixcc.xml | 2 +- src/engine/SCons/Tool/aixcxx.py | 2 +- src/engine/SCons/Tool/aixf77.py | 2 +- src/engine/SCons/Tool/aixf77.xml | 2 +- src/engine/SCons/Tool/aixlink.py | 2 +- src/engine/SCons/Tool/aixlink.xml | 2 +- src/engine/SCons/Tool/applelink.py | 2 +- src/engine/SCons/Tool/applelink.xml | 2 +- src/engine/SCons/Tool/ar.py | 2 +- src/engine/SCons/Tool/ar.xml | 2 +- src/engine/SCons/Tool/as.py | 2 +- src/engine/SCons/Tool/as.xml | 2 +- src/engine/SCons/Tool/bcc32.py | 2 +- src/engine/SCons/Tool/bcc32.xml | 2 +- src/engine/SCons/Tool/c++.py | 2 +- src/engine/SCons/Tool/c++.xml | 2 +- src/engine/SCons/Tool/cc.py | 2 +- src/engine/SCons/Tool/cc.xml | 4 +- src/engine/SCons/Tool/clang.py | 2 +- src/engine/SCons/Tool/clang.xml | 2 +- src/engine/SCons/Tool/clangxx.py | 2 +- src/engine/SCons/Tool/clangxx.xml | 2 +- src/engine/SCons/Tool/cvf.py | 2 +- src/engine/SCons/Tool/cvf.xml | 2 +- src/engine/SCons/Tool/cxx.py | 2 +- src/engine/SCons/Tool/cyglink.xml | 2 +- src/engine/SCons/Tool/default.py | 2 +- src/engine/SCons/Tool/default.xml | 89 ++- src/engine/SCons/Tool/dmd.py | 2 +- src/engine/SCons/Tool/dmd.xml | 297 +-------- src/engine/SCons/Tool/docbook/__init__.xml | 2 +- src/engine/SCons/Tool/dvi.py | 2 +- src/engine/SCons/Tool/dvi.xml | 2 +- src/engine/SCons/Tool/dvipdf.py | 2 +- src/engine/SCons/Tool/dvipdf.xml | 2 +- src/engine/SCons/Tool/dvips.py | 2 +- src/engine/SCons/Tool/dvips.xml | 2 +- src/engine/SCons/Tool/f03.py | 2 +- src/engine/SCons/Tool/f03.xml | 2 +- src/engine/SCons/Tool/f08.py | 2 +- src/engine/SCons/Tool/f08.xml | 2 +- src/engine/SCons/Tool/f77.py | 2 +- src/engine/SCons/Tool/f77.xml | 2 +- src/engine/SCons/Tool/f90.py | 2 +- src/engine/SCons/Tool/f90.xml | 2 +- src/engine/SCons/Tool/f95.py | 2 +- src/engine/SCons/Tool/f95.xml | 2 +- src/engine/SCons/Tool/filesystem.py | 2 +- src/engine/SCons/Tool/fortran.py | 2 +- src/engine/SCons/Tool/fortran.xml | 2 +- src/engine/SCons/Tool/g++.py | 2 +- src/engine/SCons/Tool/g++.xml | 2 +- src/engine/SCons/Tool/g77.py | 2 +- src/engine/SCons/Tool/g77.xml | 2 +- src/engine/SCons/Tool/gas.py | 2 +- src/engine/SCons/Tool/gas.xml | 2 +- src/engine/SCons/Tool/gcc.py | 2 +- src/engine/SCons/Tool/gcc.xml | 2 +- src/engine/SCons/Tool/gdc.py | 2 +- src/engine/SCons/Tool/gdc.xml | 297 +-------- src/engine/SCons/Tool/gettext.xml | 2 +- src/engine/SCons/Tool/gettext_tool.py | 2 +- src/engine/SCons/Tool/gfortran.py | 2 +- src/engine/SCons/Tool/gfortran.xml | 2 +- src/engine/SCons/Tool/gnulink.py | 2 +- src/engine/SCons/Tool/gnulink.xml | 2 +- src/engine/SCons/Tool/gs.py | 2 +- src/engine/SCons/Tool/gs.xml | 2 +- src/engine/SCons/Tool/gxx.py | 2 +- src/engine/SCons/Tool/hpc++.py | 2 +- src/engine/SCons/Tool/hpc++.xml | 2 +- src/engine/SCons/Tool/hpcc.py | 2 +- src/engine/SCons/Tool/hpcc.xml | 2 +- src/engine/SCons/Tool/hpcxx.py | 2 +- src/engine/SCons/Tool/hplink.py | 2 +- src/engine/SCons/Tool/hplink.xml | 2 +- src/engine/SCons/Tool/icc.py | 2 +- src/engine/SCons/Tool/icc.xml | 2 +- src/engine/SCons/Tool/icl.py | 2 +- src/engine/SCons/Tool/icl.xml | 2 +- src/engine/SCons/Tool/ifl.py | 2 +- src/engine/SCons/Tool/ifl.xml | 2 +- src/engine/SCons/Tool/ifort.py | 2 +- src/engine/SCons/Tool/ifort.xml | 2 +- src/engine/SCons/Tool/ilink.py | 2 +- src/engine/SCons/Tool/ilink.xml | 2 +- src/engine/SCons/Tool/ilink32.py | 2 +- src/engine/SCons/Tool/ilink32.xml | 2 +- src/engine/SCons/Tool/install.py | 2 +- src/engine/SCons/Tool/install.xml | 18 +- src/engine/SCons/Tool/intelc.py | 6 +- src/engine/SCons/Tool/intelc.xml | 2 +- src/engine/SCons/Tool/ipkg.py | 2 +- src/engine/SCons/Tool/jar.py | 2 +- src/engine/SCons/Tool/jar.xml | 2 +- src/engine/SCons/Tool/javac.py | 2 +- src/engine/SCons/Tool/javac.xml | 2 +- src/engine/SCons/Tool/javah.py | 2 +- src/engine/SCons/Tool/javah.xml | 2 +- src/engine/SCons/Tool/latex.py | 2 +- src/engine/SCons/Tool/latex.xml | 2 +- src/engine/SCons/Tool/ldc.py | 2 +- src/engine/SCons/Tool/ldc.xml | 297 +-------- src/engine/SCons/Tool/lex.py | 2 +- src/engine/SCons/Tool/lex.xml | 2 +- src/engine/SCons/Tool/link.py | 2 +- src/engine/SCons/Tool/link.xml | 6 +- src/engine/SCons/Tool/linkloc.py | 2 +- src/engine/SCons/Tool/linkloc.xml | 2 +- src/engine/SCons/Tool/m4.py | 2 +- src/engine/SCons/Tool/m4.xml | 2 +- src/engine/SCons/Tool/masm.py | 2 +- src/engine/SCons/Tool/masm.xml | 2 +- src/engine/SCons/Tool/midl.py | 2 +- src/engine/SCons/Tool/midl.xml | 4 +- src/engine/SCons/Tool/mingw.py | 2 +- src/engine/SCons/Tool/mingw.xml | 2 +- src/engine/SCons/Tool/msgfmt.py | 2 +- src/engine/SCons/Tool/msgfmt.xml | 2 +- src/engine/SCons/Tool/msginit.py | 2 +- src/engine/SCons/Tool/msginit.xml | 2 +- src/engine/SCons/Tool/msgmerge.py | 2 +- src/engine/SCons/Tool/msgmerge.xml | 2 +- src/engine/SCons/Tool/mslib.py | 2 +- src/engine/SCons/Tool/mslib.xml | 2 +- src/engine/SCons/Tool/mslink.py | 2 +- src/engine/SCons/Tool/mslink.xml | 2 +- src/engine/SCons/Tool/mssdk.py | 2 +- src/engine/SCons/Tool/mssdk.xml | 2 +- src/engine/SCons/Tool/msvc.py | 2 +- src/engine/SCons/Tool/msvc.xml | 2 +- src/engine/SCons/Tool/msvs.py | 8 +- src/engine/SCons/Tool/msvs.xml | 2 +- src/engine/SCons/Tool/msvsTests.py | 2 +- src/engine/SCons/Tool/mwcc.py | 2 +- src/engine/SCons/Tool/mwcc.xml | 2 +- src/engine/SCons/Tool/mwld.py | 2 +- src/engine/SCons/Tool/mwld.xml | 2 +- src/engine/SCons/Tool/nasm.py | 2 +- src/engine/SCons/Tool/nasm.xml | 2 +- src/engine/SCons/Tool/packaging.xml | 2 +- src/engine/SCons/Tool/packaging/__init__.py | 2 +- src/engine/SCons/Tool/packaging/__init__.xml | 6 +- src/engine/SCons/Tool/packaging/ipk.py | 2 +- src/engine/SCons/Tool/packaging/msi.py | 4 +- src/engine/SCons/Tool/packaging/rpm.py | 2 +- src/engine/SCons/Tool/packaging/src_tarbz2.py | 2 +- src/engine/SCons/Tool/packaging/src_targz.py | 2 +- src/engine/SCons/Tool/packaging/src_tarxz.py | 2 +- src/engine/SCons/Tool/packaging/src_zip.py | 2 +- src/engine/SCons/Tool/packaging/tarbz2.py | 2 +- src/engine/SCons/Tool/packaging/targz.py | 2 +- src/engine/SCons/Tool/packaging/tarxz.py | 2 +- src/engine/SCons/Tool/packaging/zip.py | 2 +- src/engine/SCons/Tool/pdf.py | 2 +- src/engine/SCons/Tool/pdf.xml | 2 +- src/engine/SCons/Tool/pdflatex.py | 2 +- src/engine/SCons/Tool/pdflatex.xml | 2 +- src/engine/SCons/Tool/pdftex.py | 2 +- src/engine/SCons/Tool/pdftex.xml | 2 +- src/engine/SCons/Tool/qt.py | 2 +- src/engine/SCons/Tool/qt.xml | 2 +- src/engine/SCons/Tool/rmic.py | 2 +- src/engine/SCons/Tool/rmic.xml | 2 +- src/engine/SCons/Tool/rpcgen.py | 2 +- src/engine/SCons/Tool/rpcgen.xml | 2 +- src/engine/SCons/Tool/rpm.py | 2 +- src/engine/SCons/Tool/rpmutils.py | 2 +- src/engine/SCons/Tool/sgiar.py | 2 +- src/engine/SCons/Tool/sgiar.xml | 2 +- src/engine/SCons/Tool/sgic++.py | 2 +- src/engine/SCons/Tool/sgic++.xml | 2 +- src/engine/SCons/Tool/sgicc.py | 2 +- src/engine/SCons/Tool/sgicc.xml | 2 +- src/engine/SCons/Tool/sgicxx.py | 2 +- src/engine/SCons/Tool/sgilink.py | 2 +- src/engine/SCons/Tool/sgilink.xml | 2 +- src/engine/SCons/Tool/sunar.py | 2 +- src/engine/SCons/Tool/sunar.xml | 2 +- src/engine/SCons/Tool/sunc++.py | 2 +- src/engine/SCons/Tool/sunc++.xml | 2 +- src/engine/SCons/Tool/suncc.py | 2 +- src/engine/SCons/Tool/suncc.xml | 2 +- src/engine/SCons/Tool/suncxx.py | 39 +- src/engine/SCons/Tool/sunf77.py | 2 +- src/engine/SCons/Tool/sunf77.xml | 2 +- src/engine/SCons/Tool/sunf90.py | 2 +- src/engine/SCons/Tool/sunf90.xml | 2 +- src/engine/SCons/Tool/sunf95.py | 2 +- src/engine/SCons/Tool/sunf95.xml | 2 +- src/engine/SCons/Tool/sunlink.py | 2 +- src/engine/SCons/Tool/sunlink.xml | 2 +- src/engine/SCons/Tool/swig.py | 4 +- src/engine/SCons/Tool/swig.xml | 2 +- src/engine/SCons/Tool/tar.py | 2 +- src/engine/SCons/Tool/tar.xml | 2 +- src/engine/SCons/Tool/tex.py | 6 +- src/engine/SCons/Tool/tex.xml | 2 +- src/engine/SCons/Tool/textfile.py | 2 +- src/engine/SCons/Tool/textfile.xml | 2 +- src/engine/SCons/Tool/tlib.py | 2 +- src/engine/SCons/Tool/tlib.xml | 2 +- src/engine/SCons/Tool/wix.py | 2 +- src/engine/SCons/Tool/wixTests.py | 2 +- src/engine/SCons/Tool/xgettext.py | 2 +- src/engine/SCons/Tool/xgettext.xml | 2 +- src/engine/SCons/Tool/yacc.py | 2 +- src/engine/SCons/Tool/yacc.xml | 2 +- src/engine/SCons/Tool/zip.py | 2 +- src/engine/SCons/Tool/zip.xml | 2 +- src/engine/SCons/Util.py | 2 +- src/engine/SCons/UtilTests.py | 2 +- src/engine/SCons/Variables/BoolVariable.py | 2 +- src/engine/SCons/Variables/BoolVariableTests.py | 2 +- src/engine/SCons/Variables/EnumVariable.py | 2 +- src/engine/SCons/Variables/EnumVariableTests.py | 2 +- src/engine/SCons/Variables/ListVariable.py | 2 +- src/engine/SCons/Variables/ListVariableTests.py | 2 +- src/engine/SCons/Variables/PackageVariable.py | 2 +- src/engine/SCons/Variables/PackageVariableTests.py | 2 +- src/engine/SCons/Variables/PathVariable.py | 2 +- src/engine/SCons/Variables/PathVariableTests.py | 2 +- src/engine/SCons/Variables/VariablesTests.py | 2 +- src/engine/SCons/Variables/__init__.py | 2 +- src/engine/SCons/Warnings.py | 20 +- src/engine/SCons/WarningsTests.py | 2 +- src/engine/SCons/__init__.py | 8 +- src/engine/SCons/compat/__init__.py | 2 +- src/engine/SCons/compat/_scons_dbm.py | 2 +- src/engine/SCons/cpp.py | 2 +- src/engine/SCons/cppTests.py | 2 +- src/engine/SCons/exitfuncs.py | 2 +- src/script/scons-configure-cache.py | 8 +- src/script/scons-time.py | 26 +- src/script/scons.bat | 4 +- src/script/scons.py | 8 +- src/script/sconsign.py | 8 +- src/setup.py | 4 +- src/test_files.py | 2 +- src/test_interrupts.py | 2 +- src/test_pychecker.py | 2 +- src/test_setup.py | 11 +- src/test_strings.py | 4 +- testing/framework/README.txt | 2 +- testing/framework/TestCmd.py | 2 +- testing/framework/TestCommon.py | 4 +- testing/framework/TestRuntest.py | 2 +- testing/framework/TestSCons.py | 6 +- testing/framework/TestSConsMSVS.py | 2 +- testing/framework/TestSCons_time.py | 21 +- testing/framework/TestSConsign.py | 2 +- testing/framework/test-framework.rst | 2 +- 420 files changed, 2964 insertions(+), 4488 deletions(-) create mode 100644 .gitattributes create mode 100644 CONTRIBUTING.md delete mode 100644 bin/rsync-sourceforge delete mode 100755 bin/scons-review.sh mode change 100644 => 100755 bin/scons_dev_master.py delete mode 100644 bin/sfsum delete mode 100644 bin/timebuild delete mode 100644 config diff --git a/.appveyor.yml b/.appveyor.yml index d2c63cb..09cd996 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,10 +1,11 @@ #version: '3.0.1.{build}' image: - # linux builds disabled for now + # linux builds done in Travis CI for now # - Ubuntu - Visual Studio 2015 - Visual Studio 2017 + - Visual Studio 2019 cache: - downloads -> appveyor.yml @@ -24,6 +25,7 @@ install: - cmd: set STATIC_DEPS=true & C:\\%WINPYTHON%\\python.exe -m pip install -U --progress-bar off lxml # install 3rd party tools to test with - cmd: choco install --allow-empty-checksums dmd ldc swig vswhere xsltproc winflexbison + - cmd: set SCONS_CACHE_MSVC_CONFIG=true - cmd: set ### LINUX ### @@ -36,58 +38,37 @@ install: - sh: which python$PYTHON - sh: python$PYTHON --version - sh: export PYSITEDIR=$(python$PYTHON -m site --user-site) - - sh: python$PYTHON -m pip install --user -U --progress-bar off pip setuptools wheel + - sh: python$PYTHON -m pip install --user -U --progress-bar off pip setuptools wheel - sh: python$PYTHON -m pip install --user -U --progress-bar off coverage codecov - sh: STATIC_DEPS=true python$PYTHON -m pip install --user -U --progress-bar off lxml - sh: ./.travis/install.sh - sh: printenv -# build matrix will be number of images multiplied -# by each '-' below, split jobs into groups of 4 -# to avoid timeing out +# build matrix will be number of images multiplied by each '-' below, +# less any exclusions. +# split builds into sets of four jobs due to appveyor per-job time limit environment: matrix: - WINPYTHON: "Python27" PYTHON: "2.7" PYVER: 27 BUILD_JOB_NUM: 1 - COVERAGE: 1 + COVERAGE: 0 - WINPYTHON: "Python27" PYTHON: "2.7" PYVER: 27 BUILD_JOB_NUM: 2 - COVERAGE: 1 + COVERAGE: 0 - WINPYTHON: "Python27" PYTHON: "2.7" PYVER: 27 BUILD_JOB_NUM: 3 - COVERAGE: 1 + COVERAGE: 0 - WINPYTHON: "Python27" PYTHON: "2.7" PYVER: 27 BUILD_JOB_NUM: 4 - COVERAGE: 1 - - - WINPYTHON: "Python36" - PYTHON: "3.6" - PYVER: 36 - BUILD_JOB_NUM: 1 - COVERAGE: 1 - - WINPYTHON: "Python36" - PYTHON: "3.6" - PYVER: 36 - BUILD_JOB_NUM: 2 - COVERAGE: 1 - - WINPYTHON: "Python36" - PYTHON: "3.6" - PYVER: 36 - BUILD_JOB_NUM: 3 - COVERAGE: 1 - - WINPYTHON: "Python36" - PYTHON: "3.6" - PYVER: 36 - BUILD_JOB_NUM: 4 - COVERAGE: 1 + COVERAGE: 0 - WINPYTHON: "Python35" PYTHON: "3.5" @@ -110,6 +91,27 @@ environment: BUILD_JOB_NUM: 4 COVERAGE: 0 + - WINPYTHON: "Python36" + PYTHON: "3.6" + PYVER: 36 + BUILD_JOB_NUM: 1 + COVERAGE: 1 + - WINPYTHON: "Python36" + PYTHON: "3.6" + PYVER: 36 + BUILD_JOB_NUM: 2 + COVERAGE: 1 + - WINPYTHON: "Python36" + PYTHON: "3.6" + PYVER: 36 + BUILD_JOB_NUM: 3 + COVERAGE: 1 + - WINPYTHON: "Python36" + PYTHON: "3.6" + PYVER: 36 + BUILD_JOB_NUM: 4 + COVERAGE: 1 + - WINPYTHON: "Python37" PYTHON: "3.7" PYVER: 37 @@ -133,40 +135,49 @@ environment: # remove sets of build jobs based on critia below # to fine tune the number and platforms tested -matrix: - exclude: - # test python 3.5, 3.6 on Visual Studio 2015 image - - image: Visual Studio 2015 - WINPYTHON: "Python37" - - image: Visual Studio 2015 +matrix: + exclude: + # test python 3.5 on Visual Studio 2015 image + - image: Visual Studio 2015 WINPYTHON: "Python27" + - image: Visual Studio 2015 + WINPYTHON: "Python36" + - image: Visual Studio 2015 + WINPYTHON: "Python37" - # test python 2.7, 3.7 on Visual Studio 2015 image + # test python 2.7, 3.6 on Visual Studio 2017 image - image: Visual Studio 2017 WINPYTHON: "Python35" - - image: Visual Studio 2017 + - image: Visual Studio 2017 + WINPYTHON: "Python37" + + # test python 3.7 on Visual Studio 2019 image + - image: Visual Studio 2019 + WINPYTHON: "Python27" + - image: Visual Studio 2019 + WINPYTHON: "Python35" + - image: Visual Studio 2019 WINPYTHON: "Python36" # test python 3.7 on Ubuntu - - image: Ubuntu - WINPYTHON: "Python27" - - image: Ubuntu + - image: Ubuntu + WINPYTHON: "Python27" + - image: Ubuntu WINPYTHON: "Python35" - - image: Ubuntu + - image: Ubuntu WINPYTHON: "Python36" # remove some binaries we dont to be found before_build: - ps: | - if ($isWindows) - { + if ($isWindows) { dir "C:\Program Files\Git\usr\bin\x*.exe" if (Test-Path "C:\Program Files\Git\usr\bin\xsltproc.EXE" ) { Remove-Item "C:\Program Files\Git\usr\bin\xsltproc.EXE" -ErrorAction Ignore } dir "C:\Program Files\Git\usr\bin\x*.exe" } - + build: off build_script: @@ -174,18 +185,17 @@ build_script: - cmd: "C:\\%WINPYTHON%\\python.exe runtest.py -l -a > all_tests.txt" - sh: python$PYTHON runtest.py -l -a > all_tests.txt - # setup coverage by creating the coverage config file, and adding coverage + # setup coverage by creating the coverage config file, and adding coverage # to the usercustomize so that all python processes start with coverage - ps: | - if ($env:COVERAGE -eq 1){ + if ($env:COVERAGE -eq 1) { $env:COVERAGE_PROCESS_START = "$($env:APPVEYOR_BUILD_FOLDER)/.coveragerc"; $env:PYTHONNOUSERSITE = ""; New-Item -ItemType Directory -Force -Path "$($env:PYSITEDIR)"; $env:COVERAGE_FILE = "$($env:APPVEYOR_BUILD_FOLDER)/.coverage"; $usercustomizeText = "import os`r`nos.environ['COVERAGE_PROCESS_START'] = '$($env:COVERAGE_PROCESS_START)'`r`nimport coverage`r`ncoverage.process_startup()"; $usercustomizeText|Set-Content "$($env:PYSITEDIR)/usercustomize.py"; - if ($isWindows) - { + if ($isWindows) { $coveragercFile = "[run]`r`nsource = $($env:APPVEYOR_BUILD_FOLDER)/src`r`nparallel = True`r`ndisable_warnings = trace-changed`r`nomit =`r`n`t*Tests.py`r`n`tsrc\test_*`r`n`tsrc\setup.py`r`n`r`n[path]`r`nsource = $($env:APPVEYOR_BUILD_FOLDER)`r`n[report]`r`nomit =`r`n`t*Tests.py`r`n`tsrc\test_*`r`n`tsrc\setup.py`r`n`r`n" } else @@ -205,35 +215,34 @@ build_script: if ( $start -eq 0 ){ $start = 1 }; get-content all_tests.txt | select -first ($end - $start) -skip ($start - 1) | Out-File -Encoding ASCII build_tests.txt; - # exclude VS 10.0 because it hangs the testing until this is resolved: + # exclude VS 10.0 because it hangs the testing until this is resolved: # https://help.appveyor.com/discussions/problems/19283-visual-studio-2010-trial-license-has-expired - ps: | New-Item -Name exclude_list.txt -ItemType File $workaround_image = "Visual Studio 2015" - if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq $workaround_image){ + if ($env:APPVEYOR_BUILD_WORKER_IMAGE -eq $workaround_image) { Add-Content -Path 'exclude_list.txt' -Value 'test\MSVS\vs-10.0-exec.py' } # Windows run the tests # NOTE: running powershell from cmd on purpose because it formats the output # correctly - - cmd: powershell -Command "& { if($env:COVERAGE -eq 1) { coverage run -p --rcfile=$($env:COVERAGE_PROCESS_START) runtest.py -j 2 --exclude-list exclude_list.txt -f build_tests.txt } else { C:\\%WINPYTHON%\\python.exe runtest.py -j 2 --exclude-list exclude_list.txt -f build_tests.txt }; if($LastExitCode -eq 2 -Or $LastExitCode -eq 0) { $host.SetShouldExit(0 )} else {$host.SetShouldExit(1)}}" + - cmd: powershell -Command "& { if($env:COVERAGE -eq 1) { coverage run -p --rcfile=$($env:COVERAGE_PROCESS_START) runtest.py -j 2 -t --exclude-list exclude_list.txt -f build_tests.txt } else { C:\\%WINPYTHON%\\python.exe runtest.py -j 2 -t --exclude-list exclude_list.txt -f build_tests.txt }; if($LastExitCode -eq 2 -Or $LastExitCode -eq 0) { $host.SetShouldExit(0 )} else {$host.SetShouldExit(1)}}" # linux run the tests # unset JAVA_TOOL_OPTIONS because newer java prints this to stderr - sh: | unset JAVA_TOOL_OPTIONS - if [ "$COVERAGE" -eq "1" ]; then - coverage run -p --rcfile="$COVERAGE_PROCESS_START" runtest.py --exclude-list exclude_list.txt -f build_tests.txt || if [[ $? == 2 ]]; then true; else false; fi; + if [ "$COVERAGE" -eq "1" ]; then + coverage run -p --rcfile="$COVERAGE_PROCESS_START" runtest.py --exclude-list exclude_list.txt -f build_tests.txt || if [[ $? == 2 ]]; then true; else false; fi; else - python$PYTHON runtest.py -j 2 --exclude-list exclude_list.txt -f build_tests.txt || if [[ $? == 2 ]]; then true; else false; fi; + python$PYTHON runtest.py -j 2 --exclude-list exclude_list.txt -f build_tests.txt || if [[ $? == 2 ]]; then true; else false; fi; fi # run converage even if there was a test failure on_finish: - ps: | - if ($env:COVERAGE -eq 1) - { + if ($env:COVERAGE -eq 1) { & coverage combine & coverage report & coverage xml -o coverage_xml.xml @@ -244,5 +253,5 @@ on_finish: - sh: if [ $COVERAGE -eq 1 ]; then codecov -X gcov --file coverage_xml.xml; fi # not using coveralls, so leaving it commented out in case we switch back #- cmd: "C:\\%WINPYTHON%\\python.exe -m pip install --user -U coveralls" - #- sh: python$PYTHON -m pip install --user -U coveralls + #- sh: python$PYTHON -m pip install --user -U coveralls #- ps: coveralls --rcfile="$($env:COVERAGE_PROCESS_START)" diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..089d31b --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +doc/* linguist-documentation +src/engine/SCons/Tool/docbook/docbook-xsl-1.76.1 linguist-vendored +*.xml linguist-documentation +*.xsl linguist-documentation +*.gen linguist-documentation + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..2b781b2 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,13 @@ +# Contributing to SCons + +First off, thanks for taking the time to contribute! + +Here are some pointers to get started, before more information gets moved here to this page. + + * [Bugs and Feature Requests](https://scons.org/bugs.html) + * [Development](https://scons.org/dev.html) + * [SCons Developer's Guidelines](https://scons.org/guidelines.html) + +Various resources to contact are here: + + * [Contacts](https://scons.org/contact.html) diff --git a/LICENSE b/LICENSE index 6b6cd6c..67e0e2f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,5 @@ +MIT License + Copyright (c) 2001 - 2019 The SCons Foundation Permission is hereby granted, free of charge, to any person obtaining diff --git a/README.rst b/README.rst index 9589df7..7b7c221 100755 --- a/README.rst +++ b/README.rst @@ -499,13 +499,13 @@ about `Executing SCons Without Installing`_):: Depending on the utilities installed on your system, any or all of the following packages will be built:: - build/dist/scons-3.1.1.tar.gz - build/dist/scons-3.1.1.zip - build/dist/scons-doc-3.1.1.tar.gz - build/dist/scons-local-3.1.1.tar.gz - build/dist/scons-local-3.1.1.zip - build/dist/scons-src-3.1.1.tar.gz - build/dist/scons-src-3.1.1.zip + build/dist/scons-3.1.2.tar.gz + build/dist/scons-3.1.2.zip + build/dist/scons-doc-3.1.2.tar.gz + build/dist/scons-local-3.1.2.tar.gz + build/dist/scons-local-3.1.2.zip + build/dist/scons-src-3.1.2.tar.gz + build/dist/scons-src-3.1.2.zip The SConstruct file is supposed to be smart enough to avoid trying to build packages for which you don't have the proper utilities installed. For diff --git a/SConstruct b/SConstruct index 34d73dc..69221d0 100644 --- a/SConstruct +++ b/SConstruct @@ -8,7 +8,7 @@ from __future__ import print_function copyright_years = '2001 - 2019' # This gets inserted into the man pages to reflect the month of release. -month_year = 'August 2019' +month_year = 'December 2019' # # Copyright (c) 2001 - 2019 The SCons Foundation @@ -49,7 +49,7 @@ import textwrap import bootstrap project = 'scons' -default_version = '3.1.1' +default_version = '3.1.2' copyright = "Copyright (c) %s The SCons Foundation" % copyright_years SConsignFile() @@ -552,7 +552,7 @@ for p in [ scons ]: # # Now run everything in src_file through the sed command we - # concocted to expand SConstruct, 3.1.1, etc. + # concocted to expand SConstruct, 3.1.2, etc. # for b in src_files: s = p['filemap'].get(b, b) diff --git a/bin/SConsDoc.py b/bin/SConsDoc.py index e44a8db..f1de48a 100644 --- a/bin/SConsDoc.py +++ b/bin/SConsDoc.py @@ -26,7 +26,8 @@ # from __future__ import print_function -__doc__ = """ + +__doc__ = r""" This module parses home-brew XML files that document various things in SCons. Right now, it handles Builders, functions, construction variables, and Tools, but we expect it to get extended in the future. @@ -117,16 +118,18 @@ import re import sys import copy +PY2 = sys.version_info[0] == 2 + # Do we have libxml2/libxslt/lxml? has_libxml2 = True try: import libxml2 import libxslt -except: +except ImportError: has_libxml2 = False try: import lxml - except: + except ImportError: raise ImportError("Failed to import either libxml2/libxslt or lxml") has_etree = False @@ -155,13 +158,16 @@ if not has_etree: except ImportError: raise ImportError("Failed to import ElementTree from any known place") -re_entity = re.compile(r"\&([^;]+);") +# patterns to help trim XML passed in as strings +re_entity = re.compile(r"&([^;]+);") re_entity_header = re.compile(r"") # Namespace for the SCons Docbook XSD -dbxsd="http://www.scons.org/dbxsd/v1.0" +dbxsd = "http://www.scons.org/dbxsd/v1.0" +# Namsespace pattern to help identify an scons-xml file read as bytes +dbxsdpat = b'xmlns="%s"' % dbxsd.encode('utf-8') # Namespace map identifier for the SCons Docbook XSD -dbxid="dbx" +dbxid = "dbx" # Namespace for schema instances xsi = "http://www.w3.org/2001/XMLSchema-instance" @@ -170,19 +176,22 @@ copyright_comment = """ Copyright (c) 2001 - 2019 The SCons Foundation This file is processed by the bin/SConsDoc.py module. -See its __doc__ string for a discussion of the format. +See its docstring for a discussion of the format. """ def isSConsXml(fpath): - """ Check whether the given file is a SCons XML file, i.e. it - contains the default target namespace definition. + """ Check whether the given file is an SCons XML file. + + It is SCons XML if it contains the default target namespace definition + described by dbxsdpat + """ try: - with open(fpath,'r') as f: + with open(fpath, 'rb') as f: content = f.read() - if content.find('xmlns="%s"' % dbxsd) >= 0: + if content.find(dbxsdpat) >= 0: return True - except: + except Exception: pass return False @@ -195,10 +204,11 @@ def remove_entities(content): return content -default_xsd = os.path.join('doc','xsd','scons.xsd') +default_xsd = os.path.join('doc', 'xsd', 'scons.xsd') ARG = "dbscons" + class Libxml2ValidityHandler: def __init__(self): @@ -224,10 +234,11 @@ class DoctypeEntity: def getEntityString(self): txt = """ %(perc)s%(name)s; -""" % {'perc' : perc, 'name' : self.name, 'uri' : self.uri} +""" % {'perc': perc, 'name': self.name, 'uri': self.uri} return txt + class DoctypeDeclaration: def __init__(self, name_=None): self.name = name_ @@ -253,14 +264,16 @@ class DoctypeDeclaration: return content if not has_libxml2: - class TreeFactory: + class TreeFactory(object): def __init__(self): pass - def newNode(self, tag): + @staticmethod + def newNode(tag): return etree.Element(tag) - def newEtreeNode(self, tag, init_ns=False): + @staticmethod + def newEtreeNode(tag, init_ns=False): if init_ns: NSMAP = {None: dbxsd, 'xsi' : xsi} @@ -268,47 +281,66 @@ if not has_libxml2: return etree.Element(tag) - def copyNode(self, node): + @staticmethod + def copyNode(node): return copy.deepcopy(node) - def appendNode(self, parent, child): + @staticmethod + def appendNode(parent, child): parent.append(child) - def hasAttribute(self, node, att): + @staticmethod + def hasAttribute(node, att): return att in node.attrib - def getAttribute(self, node, att): + @staticmethod + def getAttribute(node, att): return node.attrib[att] - def setAttribute(self, node, att, value): + @staticmethod + def setAttribute(node, att, value): node.attrib[att] = value - def getText(self, root): + @staticmethod + def getText(root): return root.text - def setText(self, root, txt): + @staticmethod + def setText(root, txt): root.text = txt - def writeGenTree(self, root, fp): + @staticmethod + def writeGenTree(root, fp): dt = DoctypeDeclaration() - fp.write(etree.tostring(root, xml_declaration=True, - encoding="UTF-8", pretty_print=True, + try: + encfun = unicode # PY2 + except NameError: + encfun = str + fp.write(etree.tostring(root, encoding=encfun, + pretty_print=True, doctype=dt.createDoctype())) - def writeTree(self, root, fpath): - with open(fpath, 'w') as fp: - fp.write(etree.tostring(root, xml_declaration=True, - encoding="UTF-8", pretty_print=True)) - - def prettyPrintFile(self, fpath): - with open(fpath,'r') as fin: + @staticmethod + def writeTree(root, fpath): + try: + encfun = unicode # PY2 + except NameError: + encfun = "utf-8" + with open(fpath, 'wb') as fp: + fp.write(etree.tostring(root, encoding=encfun, + pretty_print=True)) + + @staticmethod + def prettyPrintFile(fpath): + with open(fpath,'rb') as fin: tree = etree.parse(fin) pretty_content = etree.tostring(tree, pretty_print=True) - with open(fpath,'w') as fout: + with open(fpath,'wb') as fout: fout.write(pretty_content) - def decorateWithHeader(self, root): + @staticmethod + def decorateWithHeader(root): root.attrib["{"+xsi+"}schemaLocation"] = "%s %s/scons.xsd" % (dbxsd, dbxsd) return root @@ -316,12 +348,12 @@ if not has_libxml2: """ Return a XML file tree with the correct namespaces set, the element root as top entry and the given header comment. """ - NSMAP = {None: dbxsd, - 'xsi' : xsi} + NSMAP = {None: dbxsd, 'xsi' : xsi} t = etree.Element(root, nsmap=NSMAP) return self.decorateWithHeader(t) - def validateXml(self, fpath, xmlschema_context): + @staticmethod + def validateXml(fpath, xmlschema_context): # Use lxml xmlschema = etree.XMLSchema(xmlschema_context) try: @@ -339,19 +371,22 @@ if not has_libxml2: return False return True - def findAll(self, root, tag, ns=None, xp_ctxt=None, nsmap=None): + @staticmethod + def findAll(root, tag, ns=None, xp_ctxt=None, nsmap=None): expression = ".//{%s}%s" % (nsmap[ns], tag) if not ns or not nsmap: expression = ".//%s" % tag return root.findall(expression) - def findAllChildrenOf(self, root, tag, ns=None, xp_ctxt=None, nsmap=None): + @staticmethod + def findAllChildrenOf(root, tag, ns=None, xp_ctxt=None, nsmap=None): expression = "./{%s}%s/*" % (nsmap[ns], tag) if not ns or not nsmap: expression = "./%s/*" % tag return root.findall(expression) - def convertElementTree(self, root): + @staticmethod + def convertElementTree(root): """ Convert the given tree of etree.Element entries to a list of tree nodes for the current XML toolkit. @@ -359,53 +394,63 @@ if not has_libxml2: return [root] else: - class TreeFactory: + class TreeFactory(object): def __init__(self): pass - def newNode(self, tag): + @staticmethod + def newNode(tag): return libxml2.newNode(tag) - def newEtreeNode(self, tag, init_ns=False): + @staticmethod + def newEtreeNode(tag, init_ns=False): return etree.Element(tag) - def copyNode(self, node): + @staticmethod + def copyNode(node): return node.copyNode(1) - def appendNode(self, parent, child): + @staticmethod + def appendNode(parent, child): if hasattr(parent, 'addChild'): parent.addChild(child) else: parent.append(child) - def hasAttribute(self, node, att): + @staticmethod + def hasAttribute(node, att): if hasattr(node, 'hasProp'): return node.hasProp(att) return att in node.attrib - def getAttribute(self, node, att): + @staticmethod + def getAttribute(node, att): if hasattr(node, 'prop'): return node.prop(att) return node.attrib[att] - def setAttribute(self, node, att, value): + @staticmethod + def setAttribute(node, att, value): if hasattr(node, 'setProp'): node.setProp(att, value) else: node.attrib[att] = value - def getText(self, root): + @staticmethod + def getText(root): if hasattr(root, 'getContent'): return root.getContent() return root.text - def setText(self, root, txt): + @staticmethod + def setText(root, txt): if hasattr(root, 'setContent'): root.setContent(txt) else: root.text = txt - def writeGenTree(self, root, fp): + @staticmethod + def writeGenTree(root, fp): doc = libxml2.newDoc('1.0') dtd = doc.newDtd("sconsdoc", None, None) doc.addChild(dtd) @@ -420,23 +465,26 @@ else: fp.write(content) doc.freeDoc() - def writeTree(self, root, fpath): - with open(fpath, 'w') as fp: + @staticmethod + def writeTree(root, fpath): + with open(fpath, 'wb') as fp: doc = libxml2.newDoc('1.0') doc.setRootElement(root) fp.write(doc.serialize("UTF-8", 1)) doc.freeDoc() - def prettyPrintFile(self, fpath): + @staticmethod + def prettyPrintFile(fpath): # Read file and resolve entities doc = libxml2.readFile(fpath, None, libxml2d.XML_PARSE_NOENT) - with open(fpath, 'w') as fp: + with open(fpath, 'wb') as fp: # Prettyprint fp.write(doc.serialize("UTF-8", 1)) # Cleanup doc.freeDoc() - def decorateWithHeader(self, root): + @staticmethod + def decorateWithHeader(root): # Register the namespaces ns = root.newNs(dbxsd, None) xi = root.newNs(xsi, 'xsi') @@ -453,7 +501,8 @@ else: t = libxml2.newNode(root) return self.decorateWithHeader(t) - def validateXml(self, fpath, xmlschema_context): + @staticmethod + def validateXml(fpath, xmlschema_context): retval = True # Create validation context @@ -479,7 +528,8 @@ else: return retval - def findAll(self, root, tag, ns=None, xpath_context=None, nsmap=None): + @staticmethod + def findAll(root, tag, ns=None, xpath_context=None, nsmap=None): if hasattr(root, 'xpathEval') and xpath_context: # Use the xpath context xpath_context.setContextNode(root) @@ -493,7 +543,8 @@ else: expression = ".//%s" % tag return root.findall(expression) - def findAllChildrenOf(self, root, tag, ns=None, xpath_context=None, nsmap=None): + @staticmethod + def findAllChildrenOf(root, tag, ns=None, xpath_context=None, nsmap=None): if hasattr(root, 'xpathEval') and xpath_context: # Use the xpath context xpath_context.setContextNode(root) @@ -562,20 +613,18 @@ else: tf = TreeFactory() -class SConsDocTree: +class SConsDocTree(object): def __init__(self): - self.nsmap = {'dbx' : dbxsd} + self.nsmap = {'dbx': dbxsd} self.doc = None self.root = None self.xpath_context = None def parseContent(self, content, include_entities=True): - """ Parses the given content as XML file. This method - is used when we generate the basic lists of entities - for the builders, tools and functions. - So we usually don't bother about namespaces and resolving - entities here...this is handled in parseXmlFile below - (step 2 of the overall process). + """ Parses the given text content as XML + + This is the setup portion, called from parseContent in + an SConsDocHandler instance - see the notes there. """ if not include_entities: content = remove_entities(content) @@ -583,7 +632,6 @@ class SConsDocTree: self.root = etree.fromstring(content) def parseXmlFile(self, fpath): - nsmap = {'dbx' : dbxsd} if not has_libxml2: # Create domtree from file domtree = etree.parse(fpath) @@ -604,7 +652,7 @@ class SConsDocTree: if self.xpath_context is not None: self.xpath_context.xpathFreeContext() -perc="%" +perc = "%" def validate_all_xml(dpaths, xsdfile=default_xsd): xmlschema_context = None @@ -620,7 +668,7 @@ def validate_all_xml(dpaths, xsdfile=default_xsd): fpaths = [] for dp in dpaths: if dp.endswith('.xml') and isSConsXml(dp): - path='.' + path = '.' fpaths.append(dp) else: for path, dirs, files in os.walk(dp): @@ -633,8 +681,8 @@ def validate_all_xml(dpaths, xsdfile=default_xsd): fails = [] for idx, fp in enumerate(fpaths): fpath = os.path.join(path, fp) - print("%.2f%s (%d/%d) %s" % (float(idx+1)*100.0/float(len(fpaths)), - perc, idx+1, len(fpaths),fp)) + print("%.2f%s (%d/%d) %s" % (float(idx + 1) * 100.0 /float(len(fpaths)), + perc, idx + 1, len(fpaths), fp)) if not tf.validateXml(fp, xmlschema_context): fails.append(fp) @@ -649,6 +697,7 @@ def validate_all_xml(dpaths, xsdfile=default_xsd): return True + class Item(object): def __init__(self, name): self.name = name @@ -668,21 +717,25 @@ class Item(object): def __lt__(self, other): return self.sort_name < other.sort_name + class Builder(Item): pass + class Function(Item): - def __init__(self, name): - super(Function, self).__init__(name) + pass + class Tool(Item): def __init__(self, name): Item.__init__(self, name) self.entity = self.name.replace('+', 'X') + class ConstructionVariable(Item): pass + class Arguments(object): def __init__(self, signature, body=None): if not body: @@ -692,7 +745,7 @@ class Arguments(object): def __str__(self): s = ''.join(self.body).strip() result = [] - for m in re.findall('([a-zA-Z/_]+|[^a-zA-Z/_]+)', s): + for m in re.findall(r'([a-zA-Z/_]+|[^a-zA-Z/_]+)', s): if ' ' in m: m = '"%s"' % m result.append(m) @@ -700,6 +753,7 @@ class Arguments(object): def append(self, data): self.body.append(data) + class SConsDocHandler(object): def __init__(self): self.builders = {} @@ -794,7 +848,7 @@ class SConsDocHandler(object): self.parseDomtree(t.root, t.xpath_context, t.nsmap) # lifted from Ka-Ping Yee's way cool pydoc module. -if sys.version_info[0] == 2: +if PY2: def importfile(path): """Import a Python source file or compiled file given its path.""" import imp @@ -817,11 +871,9 @@ if sys.version_info[0] == 2: else: # PY3 version, from newer pydoc def importfile(path): """Import a Python source file or compiled file given its path.""" - import importlib - from pydoc import ErrorDuringImport - magic = importlib.util.MAGIC_NUMBER + from importlib.util import MAGIC_NUMBER with open(path, 'rb') as ifp: - is_bytecode = magic == ifp.read(len(magic)) + is_bytecode = MAGIC_NUMBER == ifp.read(len(MAGIC_NUMBER)) filename = os.path.basename(path) name, ext = os.path.splitext(filename) if is_bytecode: @@ -832,7 +884,7 @@ else: # PY3 version, from newer pydoc spec = importlib.util.spec_from_file_location(name, path, loader=loader) try: return importlib._bootstrap._load(spec) - except: + except ImportError: raise ErrorDuringImport(path, sys.exc_info()) # Local Variables: diff --git a/bin/SConsExamples.py b/bin/SConsExamples.py index 7491c58..dbb8715 100644 --- a/bin/SConsExamples.py +++ b/bin/SConsExamples.py @@ -287,9 +287,8 @@ def ensureExampleOutputsExist(dpath): fpath = os.path.join(generated_examples, key + '_' + r.name.replace("/", "_")) # Write file - f = open(fpath, 'w') - f.write("%s\n" % content) - f.close() + with open(fpath, 'w') as f: + f.write("%s\n" % content) perc = "%" @@ -324,9 +323,8 @@ def createAllExampleOutputs(dpath): fpath = os.path.join(generated_examples, key + '_' + r.name.replace("/", "_")) # Write file - f = open(fpath, 'w') - f.write("%s\n" % content) - f.close() + with open(fpath, 'w') as f: + f.write("%s\n" % content) idx += 1 def collectSConsExampleNames(fpath): @@ -458,6 +456,7 @@ import re import SCons.Action import SCons.Defaults import SCons.Node.FS +import shutil platform = '%(osname)s' @@ -540,30 +539,28 @@ def Null(target, source, env): def Cat(target, source, env): target = str(target[0]) - f = open(target, "wb") for src in map(str, source): - f.write(open(src, "rb").read()) - f.close() + shutil.copy(src, target) def CCCom(target, source, env): - target = str(target[0]) - fp = open(target, "wb") - def process(source_file, fp=fp): - for line in open(source_file, "rb").readlines(): - m = re.match(r'#include\s[<"]([^<"]+)[>"]', line) - if m: - include = m.group(1) - for d in [str(env.Dir('$CPPPATH')), '.']: - f = os.path.join(d, include) - if os.path.exists(f): - process(f) - break - elif line[:11] != "STRIP CCCOM": - fp.write(line) - for src in map(str, source): - process(src) - fp.write('debug = ' + ARGUMENTS.get('debug', '0') + '\\n') - fp.close() + def process(source_file, ofp): + with open(source_file, "r") as ifp: + for line in ifp.readlines(): + m = re.match(r'#include\s[<"]([^<"]+)[>"]', line) + if m: + include = m.group(1) + for d in [str(env.Dir('$CPPPATH')), '.']: + f = os.path.join(d, include) + if os.path.exists(f): + process(f, ofp) + break + elif line[:11] != "STRIP CCCOM": + ofp.write(line) + + with open(str(target[0]), "w") as fp: + for src in map(str, source): + process(src, fp) + fp.write('debug = ' + ARGUMENTS.get('debug', '0') + '\\n') public_class_re = re.compile('^public class (\S+)', re.MULTILINE) @@ -577,20 +574,23 @@ def JavaCCom(target, source, env): for t in tlist: not_copied[t] = 1 for src in map(str, source): - contents = open(src, "rb").read() + with open(src, "r") as f: + contents = f.read() classes = public_class_re.findall(contents) for c in classes: for t in [x for x in tlist if x.find(c) != -1]: - open(t, "wb").write(contents) + with open(t, "w") as f: + f.write(contents) del not_copied[t] for t in not_copied.keys(): - open(t, "wb").write("\\n") + with open(t, "w") as f: + f.write("\\n") def JavaHCom(target, source, env): tlist = map(str, target) slist = map(str, source) for t, s in zip(tlist, slist): - open(t, "wb").write(open(s, "rb").read()) + shutil.copy(s, t) def JarCom(target, source, env): target = str(target[0]) @@ -599,10 +599,8 @@ def JarCom(target, source, env): for dirpath, dirnames, filenames in os.walk(src): class_files.extend([ os.path.join(dirpath, f) for f in filenames if f.endswith('.class') ]) - f = open(target, "wb") for cf in class_files: - f.write(open(cf, "rb").read()) - f.close() + shutil.copy(cf, target) # XXX Adding COLOR, COLORS and PACKAGE to the 'cc' varlist(s) by hand # here is bogus. It's for the benefit of doc/user/command-line.in, which @@ -721,7 +719,8 @@ def command_touch(args, command, test, values): if not os.path.isabs(file): file = os.path.join(test.workpath('WORK'), file) if not os.path.exists(file): - open(file, 'wb') + with open(file, 'w'): + pass os.utime(file, times) return [] @@ -735,8 +734,8 @@ def command_edit(args, c, test, values): for file in args: if not os.path.isabs(file): file = os.path.join(test.workpath('WORK'), file) - contents = open(file, 'rb').read() - open(file, 'wb').write(contents + add_string) + with open(file, 'a') as f: + f.write(add_string) return [] def command_ls(args, c, test, values): @@ -825,7 +824,7 @@ def create_scons_output(e): t.write(path, content) if hasattr(f, 'chmod'): if len(f.chmod): - os.chmod(path, int(f.chmod, 0)) + os.chmod(path, int(f.chmod, base=8)) # Regular expressions for making the doc output consistent, # regardless of reported addresses or Python version. @@ -882,7 +881,7 @@ def create_scons_output(e): lines = ExecuteCommand(args, command, t, {'osname':o.os, 'tools':o.tools}) if not command.output and lines: ncontent = '\n'.join(lines) - ncontent = address_re.sub(r' at 0x700000>', ncontent) + ncontent = address_re.sub(r' at 0x700000>', ncontent) ncontent = engine_re.sub(r' File "bootstrap/src/engine/SCons/', ncontent) ncontent = file_re.sub(r'\1 ', ncontent) ncontent = nodelist_re.sub(r"\1 'NodeList' object \2", ncontent) diff --git a/bin/calibrate.py b/bin/calibrate.py index 3f9104e..be06a54 100644 --- a/bin/calibrate.py +++ b/bin/calibrate.py @@ -28,8 +28,8 @@ import re import subprocess import sys -variable_re = re.compile('^VARIABLE: (.*)$', re.M) -elapsed_re = re.compile('^ELAPSED: (.*)$', re.M) +variable_re = re.compile(r'^VARIABLE: (.*)$', re.M) +elapsed_re = re.compile(r'^ELAPSED: (.*)$', re.M) def main(argv=None): if argv is None: @@ -60,7 +60,8 @@ def main(argv=None): while good < 3: p = subprocess.Popen(command, stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) + stderr=subprocess.STDOUT, + universal_newlines=True) output = p.communicate()[0] vm = variable_re.search(output) em = elapsed_re.search(output) @@ -70,12 +71,13 @@ def main(argv=None): print(output) raise print("run %3d: %7.3f: %s" % (run, elapsed, ' '.join(vm.groups()))) - if opts.min < elapsed and elapsed < opts.max: + if opts.min < elapsed < opts.max: good += 1 else: good = 0 for v in vm.groups(): var, value = v.split('=', 1) + # TODO: this sometimes converges slowly, better algorithm? value = int((int(value) * opts.max) // elapsed) os.environ[var] = str(value) run += 1 diff --git a/bin/docs-update-generated.py b/bin/docs-update-generated.py index c164baf..78b60a7 100644 --- a/bin/docs-update-generated.py +++ b/bin/docs-update-generated.py @@ -10,6 +10,8 @@ from __future__ import print_function import os import sys +import subprocess + import SConsDoc # Directory where all generated files are stored @@ -17,8 +19,8 @@ gen_folder = os.path.join('doc','generated') def argpair(key): """ Return the argument pair *.gen,*.mod for the given key. """ - arg = '%s,%s' % (os.path.join(gen_folder,'%s.gen' % key), - os.path.join(gen_folder,'%s.mod' % key)) + arg = '%s,%s' % (os.path.join(gen_folder, '%s.gen' % key), + os.path.join(gen_folder, '%s.mod' % key)) return arg @@ -43,10 +45,13 @@ def generate_all(): print("Couldn't create destination folder %s! Exiting..." % gen_folder) return # Call scons-proc.py - os.system('%s %s -b %s -f %s -t %s -v %s %s' % - (sys.executable, os.path.join('bin','scons-proc.py'), - argpair('builders'), argpair('functions'), - argpair('tools'), argpair('variables'), ' '.join(flist))) + _ = subprocess.call([sys.executable, + os.path.join('bin','scons-proc.py'), + '-b', argpair('builders'), + '-f', argpair('functions'), + '-t', argpair('tools'), + '-v', argpair('variables')] + flist, + shell=False) if __name__ == "__main__": diff --git a/bin/import-test.py b/bin/import-test.py index 5c4902f..23718cf 100644 --- a/bin/import-test.py +++ b/bin/import-test.py @@ -25,7 +25,7 @@ # """ triple-quotes will need to have their contents edited by hand. # -__revision__ = "bin/import-test.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" +__revision__ = "bin/import-test.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan" import os.path import sys diff --git a/bin/linecount.py b/bin/linecount.py index f2f3713..f9a3f5f 100644 --- a/bin/linecount.py +++ b/bin/linecount.py @@ -23,7 +23,7 @@ # interesting one for most purposes. from __future__ import division, print_function -__revision__ = "bin/linecount.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" +__revision__ = "bin/linecount.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan" import os.path diff --git a/bin/restore.sh b/bin/restore.sh index 1db2aca..2e7883d 100644 --- a/bin/restore.sh +++ b/bin/restore.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh # -# Simple hack script to restore __revision__, __COPYRIGHT_, 3.1.1 +# Simple hack script to restore __revision__, __COPYRIGHT_, 3.1.2 # and other similar variables to what gets checked in to source. This # comes in handy when people send in diffs based on the released source. # @@ -24,7 +24,7 @@ for i in `find $DIRS -name '*.py'`; do ed $i <&2 -# exit 1 -#fi -#if test "X$AEGIS_PROJECT" = "X"; then -# echo "scons-review: AEGIS_PROJECT is not set" >&2 -# exit 1 -#fi -#DIR=`aegis -cd -dd $*` -#if test "X${DIR}" = "X"; then -# echo "scons-review: No Aegis directory for '$*'" >&2 -# exit 1 -#fi -#(cd ${DIR} && find * -name '*,D' | sort | xargs cat) | pine scons-dev diff --git a/bin/scons_dev_master.py b/bin/scons_dev_master.py old mode 100644 new mode 100755 index 4b1160f..cdbd68e --- a/bin/scons_dev_master.py +++ b/bin/scons_dev_master.py @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/python # # A script for turning a generic Ubuntu system into a master for diff --git a/bin/sfsum b/bin/sfsum deleted file mode 100644 index 142793a..0000000 --- a/bin/sfsum +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env python -# -# sfsum.py: A script for parsing XML data exported from -# SourceForge projects. -# -# Right now, this is hard-coded to generate a summary of open bugs. -# -# XML data for SourceForge project is available for download by project -# administrators. Because it's intended for backup purposes, you have -# to slurp the whole set of data, including info about all of the closed -# items, the feature requests, etc., so it can get big. -# -# You can do this by hand (if you're an administrator) with a URL like -# this (where 30337 is the group_id for SCons): -# -# http://sourceforge.net/export/xml_export.php?group_id=30337 -# -# They also have a Perl script, called xml_export, available as part -# of a set of utilities called "adocman" which automate dealing with -# SourceForge document management from the command line. "adocman" -# is available at: -# -# https://sourceforge.net/projects/sitedocs/ -# -from __future__ import print_function - -import xml.sax -import xml.sax.saxutils -import sys - -SFName = { - 'Unassigned' : 'nobody', - 'Chad Austin' : 'aegis', - 'Charle Crain' : 'diewarzau', - 'Steven Knight' : 'stevenknight', - 'Steve Leblanc' : 'stevenleblanc', - 'Jeff Petkau' : 'jpet', - 'Anthony Roach' : 'anthonyroach', - 'Steven Shaw' : 'steven_shaw', - 'Terrel Shumway' : 'terrelshumway', - 'Greg Spencer' : 'greg_spencer', - 'Christoph Wiedemann' : 'wiedeman', -} - -class Artifact(object): - """Just a place to hold attributes that we find in the XML.""" - pass - -Artifacts = {} - -def nws(text): - """Normalize white space. This will become important if/when - we enhance this to search for arbitrary fields.""" - return ' '.join(text.split()) - -class ClassifyArtifacts(xml.sax.saxutils.DefaultHandler): - """ - Simple SAX subclass to classify the artifacts in SourceForge - XML output. - - This reads up the fields in an XML description and turns the field - descriptions into attributes of an Artificat object, on the fly. - Artifacts are of the following types: - - Bugs - Feature Requests - Patches - Support Requests - - We could, if we choose to, add additional types in the future - by creating additional trackers. - - This class loses some info right now because we don't pay attention - to the tag in the output, which contains a list of items - that have tags in them. Right now, these just overwrite - each other in the Arifact object we create. - - We also don't pay attention to any attributes of a tag other - than the "name" attribute. We'll need to extend this class if we - ever want to pay attention to those attributes. - """ - def __init__(self): - self.artifact = None - - def startElement(self, name, attrs): - self.text = "" - if name == 'artifact': - self.artifact = Artifact() - elif not self.artifact is None and name == 'field': - self.fname = attrs.get('name', None) - - def characters(self, ch): - if not self.artifact is None: - self.text = self.text + ch - - def endElement(self, name): - global Artifacts - if name == 'artifact': - type = self.artifact.artifact_type - try: - list = Artifacts[type] - except KeyError: - Artifacts[type] = list = [] - list.append(self.artifact) - self.artifact = None - elif not self.artifact is None and name == 'field': - setattr(self.artifact, self.fname, self.text) - -if __name__ == '__main__': - # Create a parser. - parser = xml.sax.make_parser() - # Tell the parser we are not interested in XML namespaces. - parser.setFeature(xml.sax.handler.feature_namespaces, 0) - - # Instantiate our handler and tell the parser to use it. - parser.setContentHandler(ClassifyArtifacts()) - - # Parse the input. - parser.parse(sys.argv[1]) - - # Hard-coded search for 'Open' bugs. This should be easily - # generalized once we figure out other things for this script to do. - bugs = [x for x in Artifacts['Bugs'] if x.status == 'Open'] - - print(list(Artifacts.keys())) - - print("%d open bugs" % len(bugs)) - - # Sort them into a separate list for each assignee. - Assigned = {} - for bug in bugs: - a = bug.assigned_to - try: - list = Assigned[a] - except KeyError: - Assigned[a] = list = [] - list.append(bug) - - for a in SFName.keys(): - try: - b = Assigned[SFName[a]] - except KeyError: - pass - else: - print(" %s" % a) - b.sort(key=lambda x, y: (x.artifact_id, y.artifact_id)) - for bug in b: - print(" %-6s %s" % (bug.artifact_id, bug.summary)) diff --git a/bin/timebuild b/bin/timebuild deleted file mode 100644 index d5af983..0000000 --- a/bin/timebuild +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/sh -# -# Profile running SCons to build itself from the current package. -# -# This runs "aegis -build" to build a current scons-src-*.tar.gz -# package, unpacks it in the supplied directory name, and then -# starts a profiled run of an SCons build, followed by another. -# This results in two profiles: -# -# NAME/NAME-0.prof -# profile of a build-everything run -# -# NAME/NAME-1.prof -# profile of an all-up-to-date run -# -# This also copies the build scons-src-*.tar.gz file to the NAME -# subdirectory, and tars up everything under src/ as NAME/src.tar.gz, -# so that repeated runs with different in-progress changes can serve -# as their own crude version control, so you don't lose that exact -# combination of features which performed best. - -if test X$1 = X; then - echo "Must supply name!" >&2 - exit 1 -fi - -VERSION=0.90 - -DIR=$1 - -SRC="scons-src-$VERSION" -SRC_TAR_GZ="${SRC}.tar.gz" -B_D_SRC_TAR_GZ="build/dist/${SRC_TAR_GZ}" - -echo "Building ${B_D_SRC_TAR_GZ}: " `date` -aegis -build ${B_D_SRC_TAR_GZ} - -echo "mkdir ${DIR}: " `date` -mkdir ${DIR} - -echo "cp ${B_D_SRC_TAR_GZ} ${DIR}: " `date` -cp ${B_D_SRC_TAR_GZ} ${DIR} - -echo "tar cf ${DIR}/src.tar.gz: " `date` -tar cf ${DIR}/src.tar.gz src - -cd ${DIR} - -echo "tar zxf ${SRC_TAR_GZ}: " `date` -tar zxf ${SRC_TAR_GZ} - -cd ${SRC} - -SCRIPT="src/script/scons.py" -ARGS="version=$VERSION" - -export SCONS_LIB_DIR=`pwd`/src/engine - -echo "Build run starting: " `date` -python $SCRIPT --profile=../$DIR-0.prof $ARGS > ../$DIR-0.log 2>&1 - -echo "Up-to-date run starting: " `date` -python $SCRIPT --profile=../$DIR-1.prof $ARGS > ../$DIR-1.log 2>&1 - -echo "Finished $DIR at: " `date` diff --git a/bin/update-release-info.py b/bin/update-release-info.py index 7db9037..4f33857 100644 --- a/bin/update-release-info.py +++ b/bin/update-release-info.py @@ -58,7 +58,7 @@ In 'post' mode, files are prepared for the next release cycle: # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. from __future__ import print_function -__revision__ = "bin/update-release-info.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" +__revision__ = "bin/update-release-info.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan" import os import sys diff --git a/config b/config deleted file mode 100644 index b055bdb..0000000 --- a/config +++ /dev/null @@ -1,299 +0,0 @@ -/* - * MANIFEST: use of SCons in project config file to build itself - * - * SCons has a Repository feature, introduced in SCons 0.09, that was - * designed to work well with Aegis. - */ - -/* - * The build_command field of the project config file is used to invoke - * the relevant build command. This command tells SCons where to find - * the rules. - * - * Our chicken-and-egg dilemma is this: we want to use the version of - * SCons under development in an Aegis change to build itself. But the - * pieces of SCons are likely only partly in this change, and partly in - * baselines. - * - * Python only imports things on a module-by-module basis--which is to - * say, once it finds __init__.py in a given directory, it assumes that - * all other files in that module are in the same directory. But that's - * not the way Aegis works, because if a file hasn't changed on the - * branch, it will only be in its parent's baseline directory. - * - * Aegis' mechanism for working around this sort of problem is to make - * symlinks to the proper baseline versions of each file, which makes - * it look like everything is in the local tree. That's unattractive, - * though, because we really want to eat our own dog food and use the - * SCons -Y options to pull things from the baseline repositories. - * - * So our solution (suggested by Anthony Roach) is a bootstrap.py script - * that does some Aegis-like searching through the baseline directories - * and makes a bootstrap copy of the version of SCons under development - * that we can use for building. After it makes this copy of SCons, it - * executes it with the same command-line arguments we supplied (and - * setting $SCONS_LIB_DIR to the right directory) so we can use it - * here with command-line options as if it were SCons itself. (Note, - * however, that bootstrap.py only understands the specific command-line - * options already in use here, so if you change the call below to add - * some other SCons options, you may have to modify bootstrap.py to - * recognize them. - * - * The ${Source bootstrap.py} substitution finds bootstrap.py wherever - * it may be in the Aegis baselines. - * - * The long -Y${SUBSTitute...} substitution takes the Aegis baseline - * search path and turns it into the right -Y command-line options for - * SCons. - * - * The rest of the substitutions (${DEVeloper}, etc.) should be obvious. - * - * Look in aesub(5) for more information about command substitutions. - */ -build_command = "python2.1 ${Source bootstrap.py} -Y${SUBSTitute : \\ -Y $Search_Path} date='${DAte %Y/%m/%d %H:%M:%S}' developer=${DEVeloper} version=${VERsion} change=${Change}"; - -/* - * SCons removes its targets before constructing them, which qualifies it - * for the following entry in the config file. The files must be removed - * first, otherwise the baseline would cease to be self-consistent. - */ - -link_integration_directory = true; - -/* - * This is set temporarily to allow us to build using the SCons - * currently checked in to the src directory. -create_symlinks_before_build = true; - */ - -/* - * aegis - project change supervisor - * This file is in the Public Domain, 1995, 1998 Peter Miller. - * - * MANIFEST: example of using rcs in the project config file - * - * The entries for the commands are listed below. RCS uses a slightly - * different model than aegis wants, so some maneuvering is required. - * The command strings in this section assume that the RCS commands ci and co - * and rcs and rlog are in the command search PATH, but you may like to - * hard-wire the paths, or set PATH at the start of each. You should also note - * that the strings are always handed to the Bourne shell to be executed, and - * are set to exit with an error immediately a sub-command fails. - * - * In these commands, the RCS file is kept unlocked, since only the owner will - * be checking changes in. The RCS functionality for coordinating shared - * access is not required. - * - * One advantage of using RCS version 5.6 or later is that binary files are - * supported, should you want to have binary files in the baseline. - * - * The ${quote ...} construct is used to quote filenames which contain - * shell special characters. A minimum of quoting is performed, so if - * the filenames do not contail shell special characters, no quotes will - * be used. - */ - -/* - * This command is used to create a new file history. - * This command is always executed as the project owner. - * The following substitutions are available: - * - * ${Input} - * absolute path of the source file - * ${History} - * absolute path of the history file - * - * The "ci -f" option is used to specify that a copy is to be checked-in even - * if there are no changes. - * The "ci -u" option is used to specify that an unlocked copy will remain in - * the baseline. - * The "ci -d" option is used to specify that the file time rather than the - * current time is to be used for the new revision. - * The "ci -M" option is used to specify that the mode date on the original - * file is not to be altered. - * The "ci -t" option is used to specify that there is to be no description - * text for the new RCS file. - * The "ci -m" option is used to specify that the change number is to be stored - * in the file log if this is actually an update (typically from aenf - * after aerm on the same file name). - * The "rcs -U" option is used to specify that the new RCS file is to have - * unstrict locking. - * The "rcs -kk" option is used to specify that keyword substitution is - * disabled (only keyword names, not values, are substituted). - */ -history_create_command = - "ci -f -u -d -M -m$c -t/dev/null ${quote $input} ${quote $history,v}; \ -rcs -kk -U ${quote $history,v}"; - - -/* - * This command is used to get a specific edit back from history. - * This command is always executed as the project owner. - * The following substitutions are available: - * - * ${History} - * absolute path of the history file - * ${Edit} - * edit number, as given by history_\%query_\%command - * ${Output} - * absolute path of the destination file - * - * The "co -r" option is used to specify the edit to be retrieved. - * The "co -p" option is used to specify that the results be printed on the - * standard output; this is because the destination filename will never - * look anything like the history source filename. - * The "rcs -kk" option is used to specify that keyword substitution is - * disabled (only keyword names, not values, are substituted). - */ -history_get_command = - "co -kk -r${quote $edit} -p ${quote $history,v} > ${quote $output}"; - -/* - * This command is used to add a new "top-most" entry to the history file. - * This command is always executed as the project owner. - * The following substitutions are available: - * - * ${Input} - * absolute path of source file - * ${History} - * absolute path of history file - * - * The "ci -f" option is used to specify that a copy is to be checked-in even - * if there are no changes. - * The "ci -u" option is used to specify that an unlocked copy will remain in - * the baseline. - * The "ci -d" option is used to specify that the file time rather than the - * current time is to be used for the new revision. - * The "ci -M" option is used to specify that the mode date on the original - * file is not to be altered. - * The "ci -m" option is used to specify that the change number is to be stored - * in the file log, which allows rlog to be used to find the change - * numbers to which each revision of the file corresponds. - * - * It is possible for a a very cautious approach has been taken, in which case - * the history_put_command may be set to the same string specified above for - * the history_create_command. - */ -history_put_command = - "ci -f -u -d -M -m$c ${quote $input} ${quote $history,v}"; - -/* - * This command is used to query what the history mechanism calls the top-most - * edit of a history file. The result may be any arbitrary string, it need not - * be anything like a number, just so long as it uniquely identifies the edit - * for use by the history_get_command at a later date. The edit number is to - * be printed on the standard output. This command is always executed as the - * project owner. - * - * The following substitutions are available: - * - * ${History} - * absolute path of the history file - */ -history_query_command = - "rlog -r ${quote $history,v} | awk '/^head:/ {print $$2}'"; - -/* - * RCS also provides a merge program, which can be used to provide a three-way - * merge. It has an ouput format some sites prefer to the fmerge output. - * - * This command is used by aed(1) to produce a difference listing when a file - * in the development directory is out of date compared to the current version - * in the baseline. - * - * All of the command substitutions described in aesub(5) are available. - * In addition, the following substitutions are also available: - * - * ${ORiginal} - * The absolute path name of a file containing the common ancestor - * version of ${MostRecent} and {$Input}. Usually the version originally - * copied into the change. Usually in a temporary file. - * ${Most_Recent} - * The absolute path name of a file containing the most recent version. - * Usually in the baseline. - * ${Input} - * The absolute path name of the edited version of the file. Usually in - * the development directory. - * ${Output} - * The absolute path name of the file in which to write the difference - * listing. Usually in the development directory. - * - * An exit status of 0 means successful, even of the files differ (and they - * usually do). An exit status which is non-zero means something is wrong. - * - * The "merge -L" options are used to specify labels for the baseline and the - * development directory, respecticvely, when conflict lines are inserted - * into the result. - * The "merge -p" options is used to specify that the results are to be printed - * on the standard output. - */ - -diff3_command = - "set +e; \ -merge -p -L baseline -L C$c ${quote $mostrecent} ${quote $original} \ -${quote $input} > ${quote $output}; \ -test $? -le 1"; - -/* - * The diff command in Red Hat 8.0 changed the exit status so it *fails* - * when *it* thinks it's trying to diff a binary (non-ASCII-text) file. - * The -a option disables this behavior and makes diff's exit status - * behave like it used to, even on any binary files we have checked in. - */ - -diff_command = - "set +e; \ - diff -a -c ${quote $original} ${quote $input} > ${quote $output}; \ - test $? -le 1"; - -/* - * We use a runtest.py script to execute tests. This takes care of - * massaging environment variables and the like to test against the - * unpacked package in the current directory. - * - * Note that we must include $spe in the batch_test_command line (so - * that Aegis thinks we're smart about testing ourselves against the - * baseline) but we don't actually need it. Our tests always run - * relative to the package built under the current directory, which - * is set appropriately during a baseline test. So we just use the - * proper aesub variable to comment out the expanded $spe. - */ -test_command = "python1.5 ${Source runtest.py Absolute} --noqmtest -p tar-gz -t -v ${SUBSTitute '\\.[CD][0-9]+$' '' ${VERsion}} -q --sp ${Search_Path} --spe ${Search_Path_Executable} ${File_Name}"; - -batch_test_command = "python1.5 ${Source runtest.py Absolute} --noqmtest -p tar-gz -t -v ${SUBSTitute '\\.[CD][0-9]+$' '' ${VERsion}} -o ${Output} --aegis --sp ${Search_Path} --spe ${Search_Path_Executable} ${File_Names}"; - -new_test_filename = "test/CHANGETHIS.py"; - -/* - * - */ -file_template = -[ - { - pattern = [ "src/engine/*__init__.py" ]; - body = "${read_file ${source template/__init__.py abs}}"; - }, - { - pattern = [ "src/engine/*Tests.py" ]; - body = "${read_file ${source template/Tests.py abs}}"; - }, - { - pattern = [ "src/engine/*.py" ]; - body = "${read_file ${source template/file.py abs}}"; - }, - { - pattern = [ "test/*.py" ]; - body = "${read_file ${source template/test.py abs}}"; - }, -]; - -/* - * Command for distributing changes from Aegis to all of the repositories - * we want to mirror the information. - * - * XXX Uncomment after upgrading to an Aegis version that supports this. - -integrate_pass_notify_command = - "$sh ${s bin/scons-cdist} -p $project $change"; - * - */ diff --git a/doc/generated/builders.gen b/doc/generated/builders.gen index 7c62558..59d2dca 100644 --- a/doc/generated/builders.gen +++ b/doc/generated/builders.gen @@ -48,11 +48,15 @@ env.CFile(target = 'bar', source = 'bar.y') -The Command "Builder" is actually implemented -as a function that looks like a Builder, -but actually takes an additional argument of the action -from which the Builder should be made. -See the Command function description +The Command "Builder" is actually +a function that looks like a Builder, +but takes a required third argument, which is the +action to take to construct the target +from the source, used for "one-off" builds +where a full builder is not needed. +Thus it does not follow the builder +calling rules described at the start of this section. +See instead the Command function description for the calling syntax and details. @@ -465,6 +469,22 @@ a builder. env.Install('/usr/local/bin', source = ['foo', 'bar']) + + +If the command line +option is given, the target directory will be prefixed +by the directory path specified. +This is useful to test installs without installing to +a "live" location in the system. + + + +See also FindInstalledFiles. +For more thoughts on installation, see the User Guide +(particularly the section on Command-Line Targets +and the chapters on Installing Files and on Alias Targets). + + @@ -1841,72 +1861,28 @@ env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f']) env.ProgramAllAtOnce() - - Builds an executable from D sources without first creating individual - objects for each file. - - - D sources can be compiled file-by-file as C and C++ source are, and - D is integrated into the scons Object and Program builders for - this model of build. D codes can though do whole source - meta-programming (some of the testing frameworks do this). For this - it is imperative that all sources are compiled and linked in a single call of - the D compiler. This builder serves that purpose. - - - env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) - - - This command will compile the modules mod_a, mod_b, and mod_c in a - single compilation process without first creating object files for - the modules. Some of the D compilers will create executable.o others - will not. - - - - Builds an executable from D sources without first creating individual - objects for each file. - - - D sources can be compiled file-by-file as C and C++ source are, and - D is integrated into the scons Object and Program builders for - this model of build. D codes can though do whole source - meta-programming (some of the testing frameworks do this). For this - it is imperative that all sources are compiled and linked in a single call of - the D compiler. This builder serves that purpose. - - - env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) - - - This command will compile the modules mod_a, mod_b, and mod_c in a - single compilation process without first creating object files for - the modules. Some of the D compilers will create executable.o others - will not. - - - - Builds an executable from D sources without first creating individual - objects for each file. - - - D sources can be compiled file-by-file as C and C++ source are, and - D is integrated into the scons Object and Program builders for - this model of build. D codes can though do whole source - meta-programming (some of the testing frameworks do this). For this - it is imperative that all sources are compiled and linked in a single call of - the D compiler. This builder serves that purpose. - - - env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) - - - This command will compile the modules mod_a, mod_b, and mod_c in a - single compilation process without first creating object files for - the modules. Some of the D compilers will create executable.o others - will not. - - + + Builds an executable from D sources without first creating individual + objects for each file. + + + D sources can be compiled file-by-file as C and C++ source are, and + D is integrated into the scons Object and Program builders for + this model of build. D codes can though do whole source + meta-programming (some of the testing frameworks do this). For this + it is imperative that all sources are compiled and linked in a single + call to the D compiler. This builder serves that purpose. + + + env.ProgramAllAtOnce('executable', ['mod_a.d, mod_b.d', 'mod_c.d']) + + + This command will compile the modules mod_a, mod_b, and mod_c in a + single compilation process without first creating object files for + the modules. Some of the D compilers will create executable.o others + will not. + + diff --git a/doc/generated/examples/caching_ex-random_1.xml b/doc/generated/examples/caching_ex-random_1.xml index d484ca4..1c99727 100644 --- a/doc/generated/examples/caching_ex-random_1.xml +++ b/doc/generated/examples/caching_ex-random_1.xml @@ -1,9 +1,9 @@ % scons -Q -cc -o f4.o -c f4.c cc -o f3.o -c f3.c -cc -o f5.o -c f5.c -cc -o f2.o -c f2.c +cc -o f4.o -c f4.c cc -o f1.o -c f1.c +cc -o f2.o -c f2.c +cc -o f5.o -c f5.c cc -o prog f1.o f2.o f3.o f4.o f5.o diff --git a/doc/generated/examples/troubleshoot_Dump_1.xml b/doc/generated/examples/troubleshoot_Dump_1.xml index 99518c0..1f6f250 100644 --- a/doc/generated/examples/troubleshoot_Dump_1.xml +++ b/doc/generated/examples/troubleshoot_Dump_1.xml @@ -1,7 +1,7 @@ % scons scons: Reading SConscript files ... -{ 'BUILDERS': {'_InternalInstall': <function InstallBuilderWrapper at 0x700000&gt;, '_InternalInstallVersionedLib': <function InstallVersionedBuilderWrapper at 0x700000&gt;, '_InternalInstallAs': <function InstallAsBuilderWrapper at 0x700000&gt;}, +{ 'BUILDERS': {'_InternalInstall': <function InstallBuilderWrapper at 0x700000>, '_InternalInstallVersionedLib': <function InstallVersionedBuilderWrapper at 0x700000>, '_InternalInstallAs': <function InstallAsBuilderWrapper at 0x700000>}, 'CONFIGUREDIR': '#/.sconf_temp', 'CONFIGURELOG': '#/config.log', 'CPPSUFFIXES': [ '.c', @@ -25,16 +25,16 @@ scons: Reading SConscript files ... '.SPP', '.sx'], 'DSUFFIXES': ['.d'], - 'Dir': <SCons.Defaults.Variable_Method_Caller object at 0x700000&gt;, - 'Dirs': <SCons.Defaults.Variable_Method_Caller object at 0x700000&gt;, + 'Dir': <SCons.Defaults.Variable_Method_Caller object at 0x700000>, + 'Dirs': <SCons.Defaults.Variable_Method_Caller object at 0x700000>, 'ENV': { 'PATH': '/usr/local/bin:/opt/bin:/bin:/usr/bin'}, - 'ESCAPE': <function escape at 0x700000&gt;, - 'File': <SCons.Defaults.Variable_Method_Caller object at 0x700000&gt;, + 'ESCAPE': <function escape at 0x700000>, + 'File': <SCons.Defaults.Variable_Method_Caller object at 0x700000>, 'HOST_ARCH': None, 'HOST_OS': None, 'IDLSUFFIXES': ['.idl', '.IDL'], - 'INSTALL': <function copyFunc at 0x700000&gt;, - 'INSTALLVERSIONEDLIB': <function copyFuncVersionedLib at 0x700000&gt;, + 'INSTALL': <function copyFunc at 0x700000>, + 'INSTALLVERSIONEDLIB': <function copyFuncVersionedLib at 0x700000>, 'LIBPREFIX': 'lib', 'LIBPREFIXES': ['$LIBPREFIX'], 'LIBSUFFIX': '.a', @@ -45,15 +45,15 @@ scons: Reading SConscript files ... 'PLATFORM': 'posix', 'PROGPREFIX': '', 'PROGSUFFIX': '', - 'PSPAWN': <function piped_env_spawn at 0x700000&gt;, - 'RDirs': <SCons.Defaults.Variable_Method_Caller object at 0x700000&gt;, - 'SCANNERS': [<SCons.Scanner.Base object at 0x700000&gt;], + 'PSPAWN': <function piped_env_spawn at 0x700000>, + 'RDirs': <SCons.Defaults.Variable_Method_Caller object at 0x700000>, + 'SCANNERS': [<SCons.Scanner.Base object at 0x700000>], 'SHELL': 'sh', 'SHLIBPREFIX': '$LIBPREFIX', 'SHLIBSUFFIX': '.so', 'SHOBJPREFIX': '$OBJPREFIX', 'SHOBJSUFFIX': '$OBJSUFFIX', - 'SPAWN': <function subprocess_spawn at 0x700000&gt;, + 'SPAWN': <function subprocess_spawn at 0x700000>, 'TARGET_ARCH': None, 'TARGET_OS': None, 'TEMPFILE': <class 'SCons.Platform.TempFileMunge'>, @@ -69,10 +69,10 @@ scons: Reading SConscript files ... '__LDMODULEVERSIONFLAGS': '${__libversionflags(__env__,"LDMODULEVERSION","_LDMODULEVERSIONFLAGS")}', '__RPATH': '$_RPATH', '__SHLIBVERSIONFLAGS': '${__libversionflags(__env__,"SHLIBVERSION","_SHLIBVERSIONFLAGS")}', - '__libversionflags': <function __libversionflags at 0x700000&gt;, - '_concat': <function _concat at 0x700000&gt;, - '_defines': <function _defines at 0x700000&gt;, - '_stripixes': <function _stripixes at 0x700000&gt;} + '__libversionflags': <function __libversionflags at 0x700000>, + '_concat': <function _concat at 0x700000>, + '_defines': <function _defines at 0x700000>, + '_stripixes': <function _stripixes at 0x700000>} scons: done reading SConscript files. scons: Building targets ... scons: `.' is up to date. diff --git a/doc/generated/examples/troubleshoot_Dump_2.xml b/doc/generated/examples/troubleshoot_Dump_2.xml index d83fb94..4b8aa0b 100644 --- a/doc/generated/examples/troubleshoot_Dump_2.xml +++ b/doc/generated/examples/troubleshoot_Dump_2.xml @@ -1,9 +1,9 @@ C:\>scons scons: Reading SConscript files ... -{ 'BUILDERS': {'_InternalInstallVersionedLib': <function InstallVersionedBuilderWrapper at 0x700000&gt;, '_InternalInstall': <function InstallBuilderWrapper at 0x700000&gt;, 'Object': <SCons.Builder.CompositeBuilder object at 0x700000&gt;, 'PCH': <SCons.Builder.BuilderBase object at 0x700000&gt;, 'RES': <SCons.Builder.BuilderBase object at 0x700000&gt;, 'SharedObject': <SCons.Builder.CompositeBuilder object at 0x700000&gt;, 'StaticObject': <SCons.Builder.CompositeBuilder object at 0x700000&gt;, '_InternalInstallAs': <function InstallAsBuilderWrapper at 0x700000&gt;}, +{ 'BUILDERS': {'_InternalInstallVersionedLib': <function InstallVersionedBuilderWrapper at 0x700000>, '_InternalInstall': <function InstallBuilderWrapper at 0x700000>, 'Object': <SCons.Builder.CompositeBuilder object at 0x700000>, 'PCH': <SCons.Builder.BuilderBase object at 0x700000>, 'RES': <SCons.Builder.BuilderBase object at 0x700000>, 'SharedObject': <SCons.Builder.CompositeBuilder object at 0x700000>, 'StaticObject': <SCons.Builder.CompositeBuilder object at 0x700000>, '_InternalInstallAs': <function InstallAsBuilderWrapper at 0x700000>}, 'CC': 'cl', - 'CCCOM': <SCons.Action.FunctionAction object at 0x700000&gt;, + 'CCCOM': <SCons.Action.FunctionAction object at 0x700000>, 'CCFLAGS': ['/nologo'], 'CCPCHFLAGS': ['${(PCH and "/Yu%s \\"/Fp%s\\""%(PCHSTOP or "",File(PCH))) or ""}'], 'CCPDBFLAGS': ['${(PDB and "/Z7") or ""}'], @@ -38,20 +38,20 @@ scons: Reading SConscript files ... 'CXXFILESUFFIX': '.cc', 'CXXFLAGS': ['$(', '/TP', '$)'], 'DSUFFIXES': ['.d'], - 'Dir': <SCons.Defaults.Variable_Method_Caller object at 0x700000&gt;, - 'Dirs': <SCons.Defaults.Variable_Method_Caller object at 0x700000&gt;, + 'Dir': <SCons.Defaults.Variable_Method_Caller object at 0x700000>, + 'Dirs': <SCons.Defaults.Variable_Method_Caller object at 0x700000>, 'ENV': { 'PATH': 'C:\\WINDOWS\\System32', 'PATHEXT': '.COM;.EXE;.BAT;.CMD', 'SystemRoot': 'C:\\WINDOWS'}, - 'ESCAPE': <function escape at 0x700000&gt;, - 'File': <SCons.Defaults.Variable_Method_Caller object at 0x700000&gt;, + 'ESCAPE': <function escape at 0x700000>, + 'File': <SCons.Defaults.Variable_Method_Caller object at 0x700000>, 'HOST_ARCH': '', 'HOST_OS': 'win32', 'IDLSUFFIXES': ['.idl', '.IDL'], 'INCPREFIX': '/I', 'INCSUFFIX': '', - 'INSTALL': <function copyFunc at 0x700000&gt;, - 'INSTALLVERSIONEDLIB': <function copyFuncVersionedLib at 0x700000&gt;, + 'INSTALL': <function copyFunc at 0x700000>, + 'INSTALLVERSIONEDLIB': <function copyFuncVersionedLib at 0x700000>, 'LEXUNISTD': ['--nounistd'], 'LIBPREFIX': '', 'LIBPREFIXES': ['$LIBPREFIX'], @@ -66,26 +66,26 @@ scons: Reading SConscript files ... 'PLATFORM': 'win32', 'PROGPREFIX': '', 'PROGSUFFIX': '.exe', - 'PSPAWN': <function piped_spawn at 0x700000&gt;, + 'PSPAWN': <function piped_spawn at 0x700000>, 'RC': 'rc', - 'RCCOM': <SCons.Action.FunctionAction object at 0x700000&gt;, + 'RCCOM': <SCons.Action.FunctionAction object at 0x700000>, 'RCFLAGS': ['/nologo'], 'RCSUFFIXES': ['.rc', '.rc2'], - 'RDirs': <SCons.Defaults.Variable_Method_Caller object at 0x700000&gt;, - 'SCANNERS': [<SCons.Scanner.Base object at 0x700000&gt;], + 'RDirs': <SCons.Defaults.Variable_Method_Caller object at 0x700000>, + 'SCANNERS': [<SCons.Scanner.Base object at 0x700000>], 'SHCC': '$CC', - 'SHCCCOM': <SCons.Action.FunctionAction object at 0x700000&gt;, + 'SHCCCOM': <SCons.Action.FunctionAction object at 0x700000>, 'SHCCFLAGS': ['$CCFLAGS'], 'SHCFLAGS': ['$CFLAGS'], 'SHCXX': '$CXX', 'SHCXXCOM': '${TEMPFILE("$SHCXX $_MSVC_OUTPUT_FLAG /c $CHANGED_SOURCES $SHCXXFLAGS $SHCCFLAGS $_CCCOMCOM","$SHCXXCOMSTR")}', 'SHCXXFLAGS': ['$CXXFLAGS'], - 'SHELL': 'command', + 'SHELL': None, 'SHLIBPREFIX': '', 'SHLIBSUFFIX': '.dll', 'SHOBJPREFIX': '$OBJPREFIX', 'SHOBJSUFFIX': '$OBJSUFFIX', - 'SPAWN': <function spawn at 0x700000&gt;, + 'SPAWN': <function spawn at 0x700000>, 'STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME': 1, 'TARGET_ARCH': None, 'TARGET_OS': None, @@ -98,14 +98,14 @@ scons: Reading SConscript files ... '_CPPINCFLAGS': '$( ${_concat(INCPREFIX, CPPPATH, INCSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)', '_LIBDIRFLAGS': '$( ${_concat(LIBDIRPREFIX, LIBPATH, LIBDIRSUFFIX, __env__, RDirs, TARGET, SOURCE)} $)', '_LIBFLAGS': '${_concat(LIBLINKPREFIX, LIBS, LIBLINKSUFFIX, __env__)}', - '_MSVC_OUTPUT_FLAG': <function msvc_output_flag at 0x700000&gt;, + '_MSVC_OUTPUT_FLAG': <function msvc_output_flag at 0x700000>, '__DSHLIBVERSIONFLAGS': '${__libversionflags(__env__,"DSHLIBVERSION","_DSHLIBVERSIONFLAGS")}', '__LDMODULEVERSIONFLAGS': '${__libversionflags(__env__,"LDMODULEVERSION","_LDMODULEVERSIONFLAGS")}', '__SHLIBVERSIONFLAGS': '${__libversionflags(__env__,"SHLIBVERSION","_SHLIBVERSIONFLAGS")}', - '__libversionflags': <function __libversionflags at 0x700000&gt;, - '_concat': <function _concat at 0x700000&gt;, - '_defines': <function _defines at 0x700000&gt;, - '_stripixes': <function _stripixes at 0x700000&gt;} + '__libversionflags': <function __libversionflags at 0x700000>, + '_concat': <function _concat at 0x700000>, + '_defines': <function _defines at 0x700000>, + '_stripixes': <function _stripixes at 0x700000>} scons: done reading SConscript files. scons: Building targets ... scons: `.' is up to date. diff --git a/doc/generated/examples/troubleshoot_explain1_3.xml b/doc/generated/examples/troubleshoot_explain1_3.xml index ed8f6d9..ebc13f8 100644 --- a/doc/generated/examples/troubleshoot_explain1_3.xml +++ b/doc/generated/examples/troubleshoot_explain1_3.xml @@ -3,5 +3,5 @@ cp file.in file.oout scons: warning: Cannot find target file.out after building -File "/Users/bdbaddog/devel/scons/git/as_scons/src/script/scons.py", line 204, in <module> +File "/home/bdeegan/devel/scons/git/as_scons/src/script/scons.py", line 204, in <module> diff --git a/doc/generated/examples/troubleshoot_stacktrace_2.xml b/doc/generated/examples/troubleshoot_stacktrace_2.xml index 2d88ae8..70a429d 100644 --- a/doc/generated/examples/troubleshoot_stacktrace_2.xml +++ b/doc/generated/examples/troubleshoot_stacktrace_2.xml @@ -4,7 +4,7 @@ scons: *** [prog.o] Source `prog.c' not found, needed by target `prog.o'. scons: internal stack trace: File "bootstrap/src/engine/SCons/Job.py", line 199, in start task.prepare() - File "bootstrap/src/engine/SCons/Script/Main.py", line 190, in prepare + File "bootstrap/src/engine/SCons/Script/Main.py", line 191, in prepare return SCons.Taskmaster.OutOfDateTask.prepare(self) File "bootstrap/src/engine/SCons/Taskmaster.py", line 198, in prepare executor.prepare() diff --git a/doc/generated/functions.gen b/doc/generated/functions.gen index 9bed358..d71387e 100644 --- a/doc/generated/functions.gen +++ b/doc/generated/functions.gen @@ -25,8 +25,8 @@ Creates an Action object for the specified action. -See the section "Action Objects," -below, for a complete explanation of the arguments and behavior. +See the manpage section "Action Objects" +for a complete explanation of the arguments and behavior. @@ -121,11 +121,11 @@ env.other_method_name('another arg') This function adds a new command-line option to be recognized. The specified arguments -are the same as supported by the standard Python -optparse.add_option() -method (with a few additional capabilities noted below); +are the same as supported by the add_option +method in the standard Python library module optparse, +with a few additional capabilities noted below; see the documentation for -optparse +optparse for a thorough discussion of its option-processing capabities. @@ -165,6 +165,15 @@ the option will have a default value of None. + +Unlike regular optparse, option names +added via AddOption must be matched +exactly, the automatic matching of abbreviations on the +command line for long options is not supported. +To allow specific abbreviations, +include them in the AddOption call. + + Once a new command-line option has been added with AddOption, @@ -172,17 +181,21 @@ the option value may be accessed using GetOption or env.GetOption(). + +SetOption is not currently supported for +options added with AddOption. @@ -221,6 +234,22 @@ AddOption('--prefix', help='installation prefix') env = Environment(PREFIX = GetOption('prefix')) + + + +While AddOption behaves like +add_option, +from the optparse module, +the behavior of options added by AddOption +which take arguments is underfined in +scons if whitespace +(rather than an = sign) is used as +the separator on the command line when +the option is invoked. +Such usage should be avoided. + + + @@ -241,7 +270,8 @@ has been built. The specified action(s) may be an Action object, or anything that can be converted into an Action object -(see below). +See the manpage section "Action Objects" +for a complete explanation. @@ -270,7 +300,8 @@ is built. The specified action(s) may be an Action object, or anything that can be converted into an Action object -(see below). +See the manpage section "Action Objects" +for a complete explanation. @@ -444,7 +475,7 @@ Otherwise, the construction variable and the value of the keyword argument are both coerced to lists, and the lists are added together. -(See also the Prepend method, below.) +(See also the Prepend method). @@ -530,30 +561,6 @@ Example: env.AppendUnique(CCFLAGS = '-g', FOO = ['foo.yyy']) - - - - - BuildDir(build_dir, src_dir, [duplicate]) - - - env.BuildDir(build_dir, src_dir, [duplicate]) - - - -Deprecated synonyms for -VariantDir -and -env.VariantDir(). -The -build_dir -argument becomes the -variant_dir -argument of -VariantDir -or -env.VariantDir(). - @@ -568,8 +575,8 @@ or Creates a Builder object for the specified action. -See the section "Builder Objects," -below, for a complete explanation of the arguments and behavior. +See the manpage section "Builder Objects" +for a complete explanation of the arguments and behavior. @@ -849,19 +856,29 @@ for a single special-case build. -As a special case, the -source_scanner -keyword argument can +Command builder accepts +source_scanner, +target_scanner, +source_factory, and +target_factory +keyword arguments. The *_scanner args can be used to specify a Scanner object -that will be used to scan the sources. -(The global +that will be used to apply a custom +scanner for a source or target. +For example, the global DirScanner object can be used if any of the sources will be directories that must be scanned on-disk for changes to files that aren't -already specified in other Builder of function calls.) +already specified in other Builder of function calls. +The *_factory args take a factory function that the +Command will use to turn any sources or targets +specified as strings into SCons Nodes. +See the sections "Builder Objects" +below, for more information about how these +args work in a Builder. @@ -873,7 +890,7 @@ same-named existing construction variables. An action can be an external command, specified as a string, or a callable Python object; -see "Action Objects," below, +see the manpage section "Action Objects" for more complete information. Also note that a string specifying an external command may be preceded by an @@ -897,7 +914,7 @@ env.Command('foo.out', 'foo.in', env.Command('bar.out', 'bar.in', ["rm -f $TARGET", "$BAR_BUILD < $SOURCES > $TARGET"], - ENV = {'PATH' : '/usr/local/bin/'}) + ENV={'PATH': '/usr/local/bin/'}) def rename(env, target, source): import os @@ -905,7 +922,7 @@ def rename(env, target, source): env.Command('baz.out', 'baz.in', ["$BAZ_BUILD < $SOURCES > .tmp", - rename ]) + rename]) @@ -914,14 +931,14 @@ Note that the function will usually assume, by default, that the specified targets and/or sources are Files, if no other part of the configuration -identifies what type of entry it is. +identifies what type of entries they are. If necessary, you can explicitly specify that targets or source nodes should -be treated as directoriese +be treated as directories by using the Dir or -env.Dir() +env.Dir functions. @@ -937,9 +954,9 @@ env.Command(env.Dir('$DISTDIR')), None, make_distdir) -(Also note that SCons will usually +Also note that SCons will usually automatically create any directory necessary to hold a target file, -so you normally don't need to create directories by hand.) +so you normally don't need to create directories by hand. @@ -954,8 +971,8 @@ so you normally don't need to create directories by hand.) Creates a Configure object for integrated functionality similar to GNU autoconf. -See the section "Configure Contexts," -below, for a complete explanation of the arguments and behavior. +See the manpage section "Configure Contexts" +for a complete explanation of the arguments and behavior. @@ -1262,15 +1279,21 @@ see below. - DefaultEnvironment([args]) + DefaultEnvironment([**kwargs]) -Creates and returns a default construction environment object. -This construction environment is used internally by SCons -in order to execute many of the global functions in this list, -and to fetch source files transparently +Creates and returns the default construction environment object. +The default construction environment is used internally by SCons +in order to execute many of the global functions in this list +(i.e. those not called as methods of a specific +construction environment), and to fetch source files transparently from source code management systems. +The default environment is a singleton, so the keyword +arguments affect it only on the first call, on subsequent +calls the already-constructed object is returned. +The default environment can be modified in the same way +as any construction environment. @@ -1333,11 +1356,11 @@ env.Depends(bar, installed_lib) Returns a dictionary object -containing copies of all of the -construction variables in the environment. -If there are any variable names specified, -only the specified construction -variables are returned in the dictionary. +containing the construction variables in the construction environment. +If there are any arguments specified, +the values of the specified construction variables +are returned as a string (if one +argument) or as a list of strings. @@ -1345,8 +1368,8 @@ Example: -dict = env.Dictionary() -cc_dict = env.Dictionary('CC', 'CCFLAGS', 'CCCOM') +cvars = env.Dictionary() +cc_values = env.Dictionary('CC', 'CCFLAGS', 'CCCOM') @@ -1385,7 +1408,8 @@ would supply a string as a directory name to a Builder method or function. Directory Nodes have attributes and methods that are useful in many situations; -see "File and Directory Nodes," below. +see manpage section "File and Directory Nodes" +for more information. @@ -1408,7 +1432,7 @@ This SConstruct: env=Environment() -print env.Dump('CCCOM') +print(env.Dump('CCCOM')) @@ -1425,7 +1449,7 @@ While this SConstruct: env=Environment() -print env.Dump() +print(env.Dump()) @@ -1528,8 +1552,8 @@ Executes an Action object. The specified action may be an Action object -(see the section "Action Objects," -below, for a complete explanation of the arguments and behavior), +(see manpage section "Action Objects" +for a complete explanation of the arguments and behavior), or it may be a command-line string, list of commands, or executable Python function, @@ -1686,7 +1710,8 @@ would supply a string as a file name to a Builder method or function. File Nodes have attributes and methods that are useful in many situations; -see "File and Directory Nodes," below. +see manpage section "File and Directory Nodes" +for more information. @@ -2836,7 +2861,7 @@ and the construction variables they affect are as specified for the env.ParseFlags method (which this method calls). -See that method's description, below, +See that method's description for a table of options and construction variables. @@ -2955,6 +2980,7 @@ and added to the following construction variables: -fmerge-all-constants CCFLAGS, LINKFLAGS -fopenmp CCFLAGS, LINKFLAGS -include CCFLAGS +-imacros CCFLAGS -isysroot CCFLAGS, LINKFLAGS -isystem CCFLAGS -iquote CCFLAGS @@ -3539,8 +3565,8 @@ Return('val1 val2') Creates a Scanner object for the specified function. -See the section "Scanner Objects," -below, for a complete explanation of the arguments and behavior. +See manpage section "Scanner Objects" +for a complete explanation of the arguments and behavior. @@ -4227,107 +4253,6 @@ env.SourceCode('no_source.c', None) - - - - - SourceSignatures(type) - - - env.SourceSignatures(type) - - - -Note: Although it is not yet officially deprecated, -use of this function is discouraged. -See the -Decider -function for a more flexible and straightforward way -to configure SCons' decision-making. - - - -The -SourceSignatures -function tells -scons -how to decide if a source file -(a file that is not built from any other files) -has changed since the last time it -was used to build a particular target file. -Legal values are -MD5 -or -timestamp. - - - -If the environment method is used, -the specified type of source signature -is only used when deciding whether targets -built with that environment are up-to-date or must be rebuilt. -If the global function is used, -the specified type of source signature becomes the default -used for all decisions -about whether targets are up-to-date. - - - -MD5 -means -scons -decides that a source file has changed -if the MD5 checksum of its contents has changed since -the last time it was used to rebuild a particular target file. - - - -timestamp -means -scons -decides that a source file has changed -if its timestamp (modification time) has changed since -the last time it was used to rebuild a particular target file. -(Note that although this is similar to the behavior of Make, -by default it will also rebuild if the dependency is -older -than the last time it was used to rebuild the target file.) - - - -There is no different between the two behaviors -for Python -Value -node objects. - - - -MD5 -signatures take longer to compute, -but are more accurate than -timestamp -signatures. -The default value is -MD5. - - - -Note that the default -TargetSignatures -setting (see below) -is to use this -SourceSignatures -setting for any target files that are used -to build other target files. -Consequently, changing the value of -SourceSignatures -will, by default, -affect the up-to-date decision for all files in the build -(or all files built with a specific construction environment -when -env.SourceSignatures -is used). - @@ -4462,7 +4387,7 @@ Example: -print env.subst("The C compiler is: $CC") +print(env.subst("The C compiler is: $CC")) def compile(target, source, env): sourceDir = env.subst("${SOURCE.srcdir}", @@ -4492,168 +4417,13 @@ Examples: -# makes sure the built library will be installed with 0644 file +# makes sure the built library will be installed with 0o644 file # access mode -Tag( Library( 'lib.c' ), UNIX_ATTR="0644" ) +Tag( Library( 'lib.c' ), UNIX_ATTR="0o644" ) # marks file2.txt to be a documentation file Tag( 'file2.txt', DOC ) - - - - - TargetSignatures(type) - - - env.TargetSignatures(type) - - - -Note: Although it is not yet officially deprecated, -use of this function is discouraged. -See the -Decider -function for a more flexible and straightforward way -to configure SCons' decision-making. - - - -The -TargetSignatures -function tells -scons -how to decide if a target file -(a file that -is -built from any other files) -has changed since the last time it -was used to build some other target file. -Legal values are -"build"; -"content" -(or its synonym -"MD5"); -"timestamp"; -or -"source". - - - -If the environment method is used, -the specified type of target signature is only used -for targets built with that environment. -If the global function is used, -the specified type of signature becomes the default -used for all target files that -don't have an explicit target signature type -specified for their environments. - - - -"content" -(or its synonym -"MD5") -means -scons -decides that a target file has changed -if the MD5 checksum of its contents has changed since -the last time it was used to rebuild some other target file. -This means -scons -will open up -MD5 sum the contents -of target files after they're built, -and may decide that it does not need to rebuild -"downstream" target files if a file was -rebuilt with exactly the same contents as the last time. - - - -"timestamp" -means -scons -decides that a target file has changed -if its timestamp (modification time) has changed since -the last time it was used to rebuild some other target file. -(Note that although this is similar to the behavior of Make, -by default it will also rebuild if the dependency is -older -than the last time it was used to rebuild the target file.) - - - -"source" -means -scons -decides that a target file has changed -as specified by the corresponding -SourceSignatures -setting -("MD5" -or -"timestamp"). -This means that -scons -will treat all input files to a target the same way, -regardless of whether they are source files -or have been built from other files. - - - -"build" -means -scons -decides that a target file has changed -if it has been rebuilt in this invocation -or if its content or timestamp have changed -as specified by the corresponding -SourceSignatures -setting. -This "propagates" the status of a rebuilt file -so that other "downstream" target files -will always be rebuilt, -even if the contents or the timestamp -have not changed. - - - -"build" -signatures are fastest because -"content" -(or -"MD5") -signatures take longer to compute, -but are more accurate than -"timestamp" -signatures, -and can prevent unnecessary "downstream" rebuilds -when a target file is rebuilt to the exact same contents -as the previous build. -The -"source" -setting provides the most consistent behavior -when other target files may be rebuilt from -both source and target input files. -The default value is -"source". - - - -Because the default setting is -"source", -using -SourceSignatures -is generally preferable to -TargetSignatures, -so that the up-to-date decision -will be consistent for all files -(or all files built with a specific construction environment). -Use of -TargetSignatures -provides specific control for how built target files -affect their "downstream" dependencies. - @@ -4949,30 +4719,51 @@ SConscript(dirs='doc', variant_dir='build/doc', duplicate=0) Searches for the specified executable program, returning the full path name to the program -if it is found, -and returning None if not. -Searches the specified -path, -the value of the calling environment's PATH -(env['ENV']['PATH']), -or the user's current external PATH -(os.environ['PATH']) -by default. +if it is found, else None. +Searches the value of the +path keyword argument, +or if None (the default) +the value of the calling environment's PATH +(env['ENV']['PATH']). +If path is None and +the env['ENV']['PATH'] key does not exist, +the user's current external PATH +(os.environ['PATH']) is used as fallback. + + On Windows systems, searches for executable -programs with any of the file extensions -listed in the specified -pathext, -the calling environment's PATHEXT -(env['ENV']['PATHEXT']) -or the user's current PATHEXT +programs with any of the file extensions listed in the +pathext keyword argument, +or if None (the default) +the calling environment's PATHEXT +(env['ENV']['PATHEXT']). +The user's current external PATHEXT (os.environ['PATHEXT']) -by default. +is used as a fallback if pathext is +None +and the key env['ENV']['PATHEXT'] +does not exist. + + Will not select any path name or names in the specified reject list, if any. + + +If you would prefer to search +the user's current external PATH +(os.environ['PATH']) +by default, +consider using the function SCons.Util.WhereIs instead. +Note that SCons.Util.WhereIs +does not expand environment variables automatically +(no implicit env.subst for its arguments). + + + diff --git a/doc/generated/functions.mod b/doc/generated/functions.mod index e460aaf..3d49229 100644 --- a/doc/generated/functions.mod +++ b/doc/generated/functions.mod @@ -19,7 +19,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. Append"> AppendENVPath"> AppendUnique"> -BuildDir"> Builder"> CacheDir"> Clean"> @@ -82,11 +81,9 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. SetOption"> SideEffect"> SourceCode"> -SourceSignatures"> Split"> subst"> Tag"> -TargetSignatures"> Tool"> Value"> VariantDir"> @@ -103,7 +100,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.Append"> env.AppendENVPath"> env.AppendUnique"> -env.BuildDir"> env.Builder"> env.CacheDir"> env.Clean"> @@ -166,11 +162,9 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.SetOption"> env.SideEffect"> env.SourceCode"> -env.SourceSignatures"> env.Split"> env.subst"> env.Tag"> -env.TargetSignatures"> env.Tool"> env.Value"> env.VariantDir"> @@ -197,7 +191,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. Append"> AppendENVPath"> AppendUnique"> -BuildDir"> Builder"> CacheDir"> Clean"> @@ -260,11 +253,9 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. SetOption"> SideEffect"> SourceCode"> -SourceSignatures"> Split"> subst"> Tag"> -TargetSignatures"> Tool"> Value"> VariantDir"> @@ -281,7 +272,6 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.Append"> env.AppendENVPath"> env.AppendUnique"> -env.BuildDir"> env.Builder"> env.CacheDir"> env.Clean"> @@ -344,11 +334,9 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. env.SetOption"> env.SideEffect"> env.SourceCode"> -env.SourceSignatures"> env.Split"> env.subst"> env.Tag"> -env.TargetSignatures"> env.Tool"> env.Value"> env.VariantDir"> diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen index ecd9c98..0d30f6f 100644 --- a/doc/generated/tools.gen +++ b/doc/generated/tools.gen @@ -91,7 +91,7 @@ Sets construction variables for the bcc32 compiler. cc -Sets construction variables for generic POSIX C copmilers. +Sets construction variables for generic POSIX C compilers. Sets: &cv-link-CC;, &cv-link-CCCOM;, &cv-link-CCFLAGS;, &cv-link-CFILESUFFIX;, &cv-link-CFLAGS;, &cv-link-CPPDEFPREFIX;, &cv-link-CPPDEFSUFFIX;, &cv-link-FRAMEWORKPATH;, &cv-link-FRAMEWORKS;, &cv-link-INCPREFIX;, &cv-link-INCSUFFIX;, &cv-link-SHCC;, &cv-link-SHCCCOM;, &cv-link-SHCCFLAGS;, &cv-link-SHCFLAGS;, &cv-link-SHOBJSUFFIX;.Uses: &cv-link-PLATFORM;. @@ -139,9 +139,91 @@ Set construction variables for cygwin linker/loader. default -Sets variables by calling a default list of Tool modules -for the platform on which SCons is running. +Sets construction variables for a default list of Tool modules. +Use default +in the tools list to retain the original defaults, +since the tools parameter +is treated as a literal statement of the tools +to be made available in that construction environment, not an addition. + + +The list of tools selected by default is not static, +but is dependent both on +the platform and on the software installed on the platform. +Some tools will not initialize if an underlying command is +not found, and some tools are selected from a list of choices +on a first-found basis. The finished tool list can be +examined by inspecting the TOOLS construction variable +in the construction environment. + + + +On all platforms, all tools from the following list +are selected whose respective conditions are met: +filesystem, wix, lex, yacc, rpcgen, swig, +jar, javac, javah, rmic, dvipdf, dvips, gs, +tex, latex, pdflatex, pdftex, tar, zip, textfile. + + + +On Linux systems, the default tools list selects +(first-found): a C compiler from +gcc, intelc, icc, cc; +a C++ compiler from +g++, intelc, icc, cxx; +an assembler from +gas, nasm, masm; +a linker from +gnulink, ilink; +a Fortran compiler from +gfortran, g77, ifort, ifl, f95, f90, f77; +and a static archiver 'ar'. +It also selects all found from the list +m4, rpm. + + + +On Windows systems, the default tools list selects +(first-found): a C compiler from +msvc, mingw, gcc, intelc, icl, icc, cc, bcc32; +a C++ compiler from +msvc, intelc, icc, g++, cxx, bcc32; +an assembler from +masm, nasm, gas, 386asm; +a linker from +mslink, gnulink, ilink, linkloc, ilink32; +a Fortran compiler from +gfortran, g77, ifl, cvf, f95, f90, fortran; +and a static archiver from +mslib, ar, tlib; +It also selects all found from the list +msvs, midl. + + + +On MacOS systems, the default tools list selects +(first-found): a C compiler from +gcc, cc; +a C++ compiler from +g++, cxx; +an assembler 'as'; +a linker from +applelink, gnulink; +a Fortran compiler from +gfortran, f95, f90, g77; +and a static archiver ar. +It also selects all found from the list +m4, rpm. + + + +Default lists for other platforms can be found by +examining the scons +source code (see +SCons/Tool/__init__.py). + + @@ -627,7 +709,9 @@ Sets construction variables for the -Sets construction variables for generic POSIX linkers. +Sets construction variables for generic POSIX linkers. This is +a "smart" linker tool which selects a compiler to complete the linking +based on the types of source files. Sets: &cv-link-LDMODULE;, &cv-link-LDMODULECOM;, &cv-link-LDMODULEFLAGS;, &cv-link-LDMODULENOVERSIONSYMLINKS;, &cv-link-LDMODULEPREFIX;, &cv-link-LDMODULESUFFIX;, &cv-link-LDMODULEVERSION;, &cv-link-LDMODULEVERSIONFLAGS;, &cv-link-LIBDIRPREFIX;, &cv-link-LIBDIRSUFFIX;, &cv-link-LIBLINKPREFIX;, &cv-link-LIBLINKSUFFIX;, &cv-link-LINK;, &cv-link-LINKCOM;, &cv-link-LINKFLAGS;, &cv-link-SHLIBSUFFIX;, &cv-link-SHLINK;, &cv-link-SHLINKCOM;, &cv-link-SHLINKFLAGS;, &cv-link-__LDMODULEVERSIONFLAGS;, &cv-link-__SHLIBVERSIONFLAGS;.Uses: &cv-link-LDMODULECOMSTR;, &cv-link-LINKCOMSTR;, &cv-link-SHLINKCOMSTR;. diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index 3f26933..9050832 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -488,7 +488,8 @@ after the SCons template for the file has been written. A reserved variable name that may not be set or used in a construction environment. -(See "Variable Substitution," below.) +(See the manpage section "Variable Substitution" +for more information). @@ -498,7 +499,8 @@ that may not be set or used in a construction environment. A reserved variable name that may not be set or used in a construction environment. -(See "Variable Substitution," below.) +(See the manpage section "Variable Substitution" +for more information). @@ -874,35 +876,15 @@ depending on the specific C++ compiler being used. The D compiler to use. - - -The D compiler to use. - - - -The D compiler to use. - DCOM - The command line used to compile a D file to an object file. - Any options specified in the $DFLAGS construction variable - is included on this command line. - - - - The command line used to compile a D file to an object file. - Any options specified in the $DFLAGS construction variable - is included on this command line. - - - - The command line used to compile a D file to an object file. - Any options specified in the $DFLAGS construction variable - is included on this command line. +The command line used to compile a D file to an object file. +Any options specified in the $DFLAGS construction variable +is included on this command line. @@ -910,49 +892,25 @@ The D compiler to use. DDEBUG - List of debug tags to enable when compiling. - - - - List of debug tags to enable when compiling. - - - - List of debug tags to enable when compiling. +List of debug tags to enable when compiling. DDEBUGPREFIX - - DDEBUGPREFIX. - - - - DDEBUGPREFIX. - - - - DDEBUGPREFIX. - - + +DDEBUGPREFIX. + + DDEBUGSUFFIX - - DDEBUGSUFFIX. - - - - DDEBUGSUFFIX. - - - - DDEBUGSUFFIX. - - + +DDEBUGSUFFIX. + + DESCRIPTION @@ -980,98 +938,50 @@ section of an RPM DFILESUFFIX - - DFILESUFFIX. - - - - DFILESUFFIX. - - - - DFILESUFFIX. - - + +DFILESUFFIX. + + DFLAGPREFIX - - DFLAGPREFIX. - - - - DFLAGPREFIX. - - - - DFLAGPREFIX. - - + +DFLAGPREFIX. + + DFLAGS - General options that are passed to the D compiler. - - - - General options that are passed to the D compiler. - - - - General options that are passed to the D compiler. +General options that are passed to the D compiler. DFLAGSUFFIX - - DFLAGSUFFIX. - - - - DFLAGSUFFIX. - - - - DFLAGSUFFIX. - - + +DFLAGSUFFIX. + + DINCPREFIX - - DINCPREFIX. - - - - DINCPREFIX. - - - - DINCPREFIX. - - + +DINCPREFIX. + + DINCSUFFIX - - DLIBFLAGSUFFIX. - - - - DLIBFLAGSUFFIX. - - - - DLIBFLAGSUFFIX. - - + +DLIBFLAGSUFFIX. + + Dir @@ -1100,15 +1010,7 @@ into a list of Dir instances relative to the target being built. DLIB - Name of the lib tool to use for D codes. - - - - Name of the lib tool to use for D codes. - - - - Name of the lib tool to use for D codes. +Name of the lib tool to use for D codes. @@ -1116,127 +1018,63 @@ into a list of Dir instances relative to the target being built. DLIBCOM - The command line to use when creating libraries. - - - - The command line to use when creating libraries. - - - - The command line to use when creating libraries. +The command line to use when creating libraries. DLIBDIRPREFIX - - DLIBLINKPREFIX. - - - - DLIBLINKPREFIX. - - - - DLIBLINKPREFIX. - - + +DLIBLINKPREFIX. + + DLIBDIRSUFFIX - - DLIBLINKSUFFIX. - - - - DLIBLINKSUFFIX. - - - - DLIBLINKSUFFIX. - - + +DLIBLINKSUFFIX. + + DLIBFLAGPREFIX - - DLIBFLAGPREFIX. - - - - DLIBFLAGPREFIX. - - - - DLIBFLAGPREFIX. - - + +DLIBFLAGPREFIX. + + DLIBFLAGSUFFIX - - DLIBFLAGSUFFIX. - - - - DLIBFLAGSUFFIX. - - - - DLIBFLAGSUFFIX. - - + +DLIBFLAGSUFFIX. + + DLIBLINKPREFIX - - DLIBLINKPREFIX. - - - - DLIBLINKPREFIX. - - - - DLIBLINKPREFIX. - - + +DLIBLINKPREFIX. + + DLIBLINKSUFFIX - - DLIBLINKSUFFIX. - - - - DLIBLINKSUFFIX. - - - - DLIBLINKSUFFIX. - - + +DLIBLINKSUFFIX. + + DLINK - Name of the linker to use for linking systems including D sources. - - - - Name of the linker to use for linking systems including D sources. - - - - Name of the linker to use for linking systems including D sources. +Name of the linker to use for linking systems including D sources. @@ -1244,33 +1082,17 @@ into a list of Dir instances relative to the target being built. DLINKCOM - The command line to use when linking systems including D sources. - - - - The command line to use when linking systems including D sources. - - - - The command line to use when linking systems including D sources. +The command line to use when linking systems including D sources. DLINKFLAGPREFIX - - DLINKFLAGPREFIX. - - - - DLINKFLAGPREFIX. - - - - DLINKFLAGPREFIX. - - + +DLINKFLAGPREFIX. + + DLINKFLAGS @@ -1278,31 +1100,15 @@ into a list of Dir instances relative to the target being built. List of linker flags. - - -List of linker flags. - - - -List of linker flags. - DLINKFLAGSUFFIX - - DLINKFLAGSUFFIX. - - - - DLINKFLAGSUFFIX. - - - - DLINKFLAGSUFFIX. - - + +DLINKFLAGSUFFIX. + + DOCBOOK_DEFAULT_XSL_EPUB @@ -1507,39 +1313,31 @@ for saxon and saxon-xslt, respectively. List of paths to search for import modules. - - - List of paths to search for import modules. - - - - List of paths to search for import modules. - DRPATHPREFIX - - DRPATHPREFIX. - - + +DRPATHPREFIX. + + DRPATHSUFFIX - - DRPATHSUFFIX. - - + +DRPATHSUFFIX. + + DShLibSonameGenerator - - DShLibSonameGenerator. - - + +DShLibSonameGenerator. + + DSUFFIXES @@ -1558,50 +1356,26 @@ The default list is: DVERPREFIX - - DVERPREFIX. - - - - DVERPREFIX. - - - - DVERPREFIX. - - + +DVERPREFIX. + + DVERSIONS - List of version tags to enable when compiling. - - - - List of version tags to enable when compiling. - - - - List of version tags to enable when compiling. +List of version tags to enable when compiling. DVERSUFFIX - - DVERSUFFIX. - - - - DVERSUFFIX. - - - - DVERSUFFIX. - - + +DVERSUFFIX. + + DVIPDF @@ -3128,7 +2902,7 @@ to '.dll'. Used to override $SHLIBVERSION/$LDMODULEVERSION when generating versioned import library for a shared library/loadable module. If undefined, the $SHLIBVERSION/$LDMODULEVERSION is used to -determine the version of versioned import library. +determine the version of versioned import library. @@ -3298,7 +3072,7 @@ The command line used to call the Java archive tool. The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. @@ -3308,7 +3082,7 @@ env = Environment(JARCOMSTR = "JARchiving $SOURCES into $TARGET") The string displayed when the Java archive tool is called -If this is not set, then $JARCOM (the command line) is displayed. +If this is not set, then $JARCOM (the command line) is displayed. @@ -3672,6 +3446,17 @@ On other systems, this is the same as $LDMODULECOM (the command line) is displayed. + + + + LDMODULEEMITTER + + +Contains the emitter specification for the +LoadableModule builder. +The manpage section "Builder Objects" contains +general information on specifying emitters. + @@ -3846,7 +3631,10 @@ when the $_LIBDIRFLAGS va LIBEMITTER -TODO +Contains the emitter specification for the +StaticLibrary builder. +The manpage section "Builder Objects" contains +general information on specifying emitters. @@ -4239,7 +4027,7 @@ The command line used to pass files to the Microsoft IDL compiler. The string displayed when -the Microsoft IDL copmiler is called. +the Microsoft IDL compiler is called. If this is not set, then $MIDLCOM (the command line) is displayed. @@ -5336,7 +5124,10 @@ for example. PROGEMITTER -TODO +Contains the emitter specification for the +Program builder. +The manpage section "Builder Objects" contains +general information on specifying emitters. @@ -6031,9 +5822,9 @@ appending to this list, although the more flexible approach is to associate scanners with a specific Builder. -See the sections "Builder Objects" -and "Scanner Objects," -below, for more information. +See the manpage sections "Builder Objects" +and "Scanner Objects" +for more information. @@ -6149,18 +5940,8 @@ to generate shared-library objects. SHDC - The name of the compiler to use when compiling D source - destined to be in a shared objects. - - - - The name of the compiler to use when compiling D source - destined to be in a shared objects. - - - - The name of the compiler to use when compiling D source - destined to be in a shared objects. +The name of the compiler to use when compiling D source +destined to be in a shared objects. @@ -6168,50 +5949,32 @@ to generate shared-library objects. SHDCOM - The command line to use when compiling code to be part of shared objects. - - - - The command line to use when compiling code to be part of shared objects. - - - - The command line to use when compiling code to be part of shared objects. +The command line to use when compiling code to be part of shared objects. SHDLIBVERSION - - SHDLIBVERSION. - - + +SHDLIBVERSION. + + SHDLIBVERSIONFLAGS - - SHDLIBVERSIONFLAGS. - - + +SHDLIBVERSIONFLAGS. + + SHDLINK - The linker to use when creating shared objects for code bases - include D sources. - - - - The linker to use when creating shared objects for code bases - include D sources. - - - - The linker to use when creating shared objects for code bases - include D sources. +The linker to use when creating shared objects for code bases +include D sources. @@ -6219,15 +5982,7 @@ to generate shared-library objects. SHDLINKCOM - The command line to use when generating shared objects. - - - - The command line to use when generating shared objects. - - - - The command line to use when generating shared objects. +The command line to use when generating shared objects. @@ -6235,15 +5990,7 @@ to generate shared-library objects. SHDLINKFLAGS - The list of flags to use when generating a shared object. - - - - The list of flags to use when generating a shared object. - - - - The list of flags to use when generating a shared object. +The list of flags to use when generating a shared object. @@ -6737,7 +6484,10 @@ If this is not set, then -TODO +Contains the emitter specification for the +SharedLibrary builder. +The manpage section "Builder Objects" contains +general information on specifying emitters. @@ -6781,23 +6531,13 @@ The suffix used for shared library file names. When this construction variable is defined, a versioned shared library -is created by SharedLibrary builder. This activates the +is created by the SharedLibrary builder. This activates the $_SHLIBVERSIONFLAGS and thus modifies the $SHLINKCOM as required, adds the version number to the library name, and creates the symlinks that are needed. $SHLIBVERSION versions should exist as alpha-numeric, decimal-delimited values as defined by the regular expression "\w+[\.\w+]*". Example $SHLIBVERSION values include '1', '1.2.3', and '1.2.gitaa412c8b'. - - - - SHLIBVERSIONFLAGS - - -Extra flags added to $SHLINKCOM when building versioned -SharedLibrary. These flags are only used when $SHLIBVERSION is -set. - @@ -6811,6 +6551,16 @@ and some extra dynamically generated options (such as -Wl,-soname=$_SHLIBSONAME. It is unused by "plain" (unversioned) shared libraries. + + + + SHLIBVERSIONFLAGS + + +Extra flags added to $SHLINKCOM when building versioned +SharedLibrary. These flags are only used when $SHLIBVERSION is +set. + @@ -6901,7 +6651,8 @@ The variable is used, for example, by A reserved variable name that may not be set or used in a construction environment. -(See "Variable Substitution," below.) +(See the manpage section "Variable Substitution" +for more information). @@ -6924,7 +6675,8 @@ field in the controlling information for Ipkg and RPM packages. A reserved variable name that may not be set or used in a construction environment. -(See "Variable Substitution," below.) +(See the manpage section "Variable Substitution" +for more information). @@ -7268,7 +7020,8 @@ General options passed to the tar archiver. A reserved variable name that may not be set or used in a construction environment. -(See "Variable Substitution," below.) +(See the manpage section "Variable Substitution" +for more information). @@ -7332,7 +7085,8 @@ For example, if you want to compile 64-bit binaries, you would set A reserved variable name that may not be set or used in a construction environment. -(See "Variable Substitution," below.) +(See the manpage section "Variable Substitution" +for more information). @@ -7465,7 +7219,8 @@ that are part of this construction environment. A reserved variable name that may not be set or used in a construction environment. -(See "Variable Substitution," below.) +(See the manpage section "Variable Substitution" +for more information). @@ -7475,7 +7230,8 @@ that may not be set or used in a construction environment. A reserved variable name that may not be set or used in a construction environment. -(See "Variable Substitution," below.) +(See the manpage section "Variable Substitution" +for more information). diff --git a/doc/generated/variables.mod b/doc/generated/variables.mod index 372a15f..ba92aa9 100644 --- a/doc/generated/variables.mod +++ b/doc/generated/variables.mod @@ -251,6 +251,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $LDMODULE"> $LDMODULECOM"> $LDMODULECOMSTR"> +$LDMODULEEMITTER"> $LDMODULEFLAGS"> $LDMODULENOVERSIONSYMLINKS"> $LDMODULEPREFIX"> @@ -504,8 +505,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $_SHLIBSONAME"> $SHLIBSUFFIX"> $SHLIBVERSION"> -$SHLIBVERSIONFLAGS"> $_SHLIBVERSIONFLAGS"> +$SHLIBVERSIONFLAGS"> $SHLINK"> $SHLINKCOM"> $SHLINKCOMSTR"> @@ -891,6 +892,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $LDMODULE"> $LDMODULECOM"> $LDMODULECOMSTR"> +$LDMODULEEMITTER"> $LDMODULEFLAGS"> $LDMODULENOVERSIONSYMLINKS"> $LDMODULEPREFIX"> @@ -1144,8 +1146,8 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. $_SHLIBSONAME"> $SHLIBSUFFIX"> $SHLIBVERSION"> -$SHLIBVERSIONFLAGS"> $_SHLIBVERSIONFLAGS"> +$SHLIBVERSIONFLAGS"> $SHLINK"> $SHLINKCOM"> $SHLINKCOMSTR"> diff --git a/doc/man/scons-time.xml b/doc/man/scons-time.xml index 2632e41..b973dba 100644 --- a/doc/man/scons-time.xml +++ b/doc/man/scons-time.xml @@ -32,8 +32,8 @@ SCONS-TIME 1 -SCons 3.1.1 -SCons 3.1.1 +SCons 3.1.2 +SCons 3.1.2 scons-time @@ -53,7 +53,6 @@ Generating Timing Information scons-time run [] -[PROJECT] [FILE] [NUMBER] [OUTDIR] @@ -644,7 +643,6 @@ files. The run Subcommand scons-time run [] -[PROJECT] [FILE] [NUMBER] [OUTDIR] @@ -727,31 +725,6 @@ this should be an up-to-date, "do nothing" rebuild. scons-time run subcommand supports the following options: - - --aegis=PROJECT - -Specifies the Aegis -PROJECT -from which the -version(s) of -scons -being timed will be extracted. -When - -is specified, the -NUMBER -option specifies delta numbers -that will be tested. -Output from each invocation run will be placed in file -names that match the Aegis delta numbers. -If the - -option is not specified, -then the default behavior is to time the -tip of the specified -PROJECT. - - -f FILE, --file=FILE @@ -798,14 +771,6 @@ the log files and profile outputs generated by this run. -When used in conjunction with the -PROJECT -option, -NUMBER -specifies one or more comma-separated Aegis delta numbers -that will be retrieved automatically from the specified Aegis -PROJECT. - When used in conjunction with the URL option, @@ -1056,24 +1021,6 @@ and provides a handy way to "shrink-wrap" the necessary information for producing (and reporting) consistent timing runs for a given configuration. - - aegis - -The Aegis executable for extracting deltas. -The default is simply -aegis. - - - - aegis_project - -The Aegis project from which deltas should be extracted. -The default is whatever is specified -with the - -command-line option. - - archive_list diff --git a/doc/man/scons.xml b/doc/man/scons.xml index 87344cc..20e9d84 100644 --- a/doc/man/scons.xml +++ b/doc/man/scons.xml @@ -75,8 +75,8 @@ SCONS 1 -SCons 3.1.1 -SCons 3.1.1 +SCons 3.1.2 +SCons 3.1.2 scons @@ -209,12 +209,12 @@ that you want to use to build your target files are not in standard system locations, scons will not find them unless -you explicitly set the PATH +you explicitly set the PATH to include those locations. Whenever you create an scons construction environment, -you can propagate the value of PATH +you can propagate the value of PATH from your external environment as follows: @@ -223,13 +223,20 @@ env = Environment(ENV = {'PATH' : os.environ['PATH']}) Similarly, if the commands use external environment variables -like $PATH, $HOME, $JAVA_HOME, $LANG, $SHELL, $TERM, etc., +like +PATH, +HOME, +JAVA_HOME, +LANG, +SHELL, +TERM, +etc., these variables can also be explicitly propagated: import os -env = Environment(ENV = {'PATH' : os.environ['PATH'], - 'HOME' : os.environ['HOME']}) +env = Environment(ENV = {'PATH': os.environ['PATH'], + 'HOME': os.environ['HOME']}) Or you may explicitly propagate the invoking user's @@ -679,19 +686,32 @@ option except for the way default targets are handled. When this option is used and no targets are specified on the command line, all default targets are built, whether or not they are below the current directory. - + - --debug=type + --debug=type[,type...] Debug the build process. -type[,type...] -specifies what type of debugging. Multiple types may be specified, -separated by commas. The following types are valid: +type +specifies the kind of debugging info to emit. +Multiple types may be specified, separated by commas. +The following entries show the recognized types: + + + + --debug=action-timestamps + +Prints additional time profiling information. For +each command, shows the absolute start and end times. +This may be useful in debugging parallel builds. +Implies the option. + +Since &scons; 3.1. + --debug=count @@ -717,17 +737,6 @@ files). its source file. Includes debugging info for unlinking stale variant files, as well as unlinking old targets before building them. - - - - --debug=dtree - -A synonym for the newer - -option. -This will be deprecated in some future release -and ultimately removed. - @@ -783,13 +792,6 @@ instead of recomputing them each time they're needed. before and after reading the SConscript files and before and after building targets. - - - - --debug=nomemoizer - -A deprecated option preserved for backwards compatibility. - @@ -846,17 +848,6 @@ Building myprog.o with action(s): Prints an internal Python stack trace when encountering an otherwise unexplained error. - - - - --debug=stree - -A synonym for the newer - -option. -This will be deprecated in some future release -and ultimately removed. - @@ -912,20 +903,9 @@ since multiple build commands and intervening SCons processing should take place in parallel.) - - - --debug=tree - -A synonym for the newer - -option. -This will be deprecated in some future release -and ultimately removed. - - --diskcheck=types @@ -1113,6 +1093,18 @@ This implies + + + --install-sandbox=path + + +When using the &Install; functions, prepend path +to the installation paths such that all installed files will be placed +underneath path. + + + + --interactive @@ -1803,41 +1795,6 @@ Warnings for some specific deprecated features may be enabled or disabled individually; see below. -
- - - --warn=deprecated-copy, --warn=no-deprecated-copy - -Enables or disables warnings about use of the deprecated -env.Copy() -method. - - - - - --warn=deprecated-source-signatures, --warn=no-deprecated-source-signatures - -Enables or disables warnings about use of the deprecated -SourceSignatures() -function or -env.SourceSignatures() -method. - - - - - --warn=deprecated-target-signatures, --warn=no-deprecated-target-signatures - -Enables or disables warnings about use of the deprecated -TargetSignatures() -function or -env.TargetSignatures() -method. - - - -
-
@@ -1914,7 +1871,7 @@ These warnings are enabled by default. feature not working when scons -is run with the python +is run with the Python option or from optimized Python (.pyo) modules. @@ -2041,7 +1998,7 @@ env['BAR'] = 'bar' As a convenience, construction variables may also be set or modified by the -parse_flags +parse_flags keyword argument, which applies the &f-link-env-MergeFlags; method (described below) to the argument value @@ -2112,36 +2069,59 @@ env = Environment(platform = my_platform) Additionally, a specific set of tools with which to initialize the environment -may be specified as an optional keyword argument: +may be specified using the optional keyword argument +tools: -env = Environment(tools = ['msvc', 'lex']) +env = Environment(tools=['msvc', 'lex']) -Non-built-in tools may be specified using the toolpath argument: + +The tools argument overrides +the tool list, it does not add to it, so be +sure to include all the tools you need. +For example if you are building a c/c++ program +you must add a tool for both compiler and linker, +as in tools=['clang', 'link']. +The tool name 'default' can +be used to retain the default list. + + +Non-built-in tools may be specified using the +optional toolpath keyword argument: -env = Environment(tools = ['default', 'foo'], toolpath = ['tools']) +env = Environment(tools=['default', 'foo'], toolpath=['tools']) -This looks for a tool specification in tools/foo.py (as well as -using the ordinary default tools for the platform). foo.py should -have two functions: generate(env, **kw) and exists(env). + +This looks for a tool specification in tools/foo.py +as well as using the ordinary default tools for the platform. + + + +A tool specification must include two functions: +generate(env, **kw) +and exists(env). The -generate() +generate function -modifies the passed-in environment +modifies the environment referenced by env to set up variables so that the tool can be executed; it may use any keyword arguments -that the user supplies (see below) +that the user supplies in kw (see below) to vary its initialization. The -exists() +exists function should return a true value if the tool is available. + + + Tools in the toolpath are used before -any of the built-in ones. For example, adding gcc.py to the toolpath +any of the built-in ones. For example, adding +gcc.py to the toolpath would override the built-in gcc tool. Also note that the toolpath is stored in the environment for use @@ -2149,7 +2129,8 @@ by later calls to Clone() and Tool() -methods: +methods: + base = Environment(toolpath=['custom_path']) @@ -2192,11 +2173,12 @@ or otherwise changing its initialization. def generate(env, **kw): # Sets MY_TOOL to the value of keyword argument 'arg1' or 1. env['MY_TOOL'] = kw.get('arg1', '1') + def exists(env): - return 1 + return True # in SConstruct: -env = Environment(tools = ['default', ('my_tool', {'arg1': 'abc'})], +env = Environment(tools=['default', ('my_tool', {'arg1': 'abc'})], toolpath=['tools']) @@ -2215,7 +2197,7 @@ With a nested tool name the dot represents a directory seperator # namespaced builder -env = Environment(ENV = os.environ, tools = ['SubDir1.SubDir2.SomeTool']) +env = Environment(ENV=os.environ, tools=['SubDir1.SubDir2.SomeTool']) env.SomeTool(targets, sources) # Search Paths @@ -2257,90 +2239,108 @@ env.SomeTool(targets, sources) -Additionally, there is a "tool" named -default -which configures the -environment with a default set of tools for the current platform. - -On posix and cygwin platforms -the GNU tools (e.g. gcc) are preferred by SCons, -on Windows the Microsoft tools (e.g. msvc) -followed by MinGW are preferred by SCons, -and in OS/2 the IBM tools (e.g. icc) are preferred by SCons. -
Builder Methods -Build rules are specified by calling a construction -environment's builder methods. -The arguments to the builder methods are -target -(a list of targets to be built, -usually file names) +You tell scons what to build +by calling Builders, functions which know to take a +particular action when given files of a particular type +to produce a particular result type. scons +defines a number of builders, and you can also write your own. +Builders are attached to a &consenv; as methods, +and the available builder methods are listed as +key-value pairs in the +BUILDERS attribute of the &consenv;. +The available builders can be displayed like this +for debugging purposes: + + + +print("Builders:", list(env['BUILDERS'])) + + + +Builder methods always take two arguments: +target +(a target or a list of targets to be built) and -source -(a list of sources to be built, -usually file names). +source +(a source or list of sources to be used as input +when building), +although in some circumstances, +the target argument can actually be omitted (see below). +Builder methods also take a variety of +keyword arguments, described below. + Because long lists of file names can lead to a lot of quoting, scons -supplies a -Split() +supplies a &Split; global function and a same-named environment method that split a single string into a list, separated on strings of white-space characters. -(These are similar to the split() member function of Python strings -but work even if the input isn't a string.) +(These are similar to the Python string split +method, but work even if the input isn't a string.) -Like all Python arguments, -the target and source arguments to a builder method -can be specified either with or without -the "target" and "source" keywords. -When the keywords are omitted, -the target is first, -followed by the source. -The following are equivalent examples of calling the Program builder method: + +The target and source arguments to a builder method +can be specified either as positional arguments, +in which case the target comes first, or as +keyword arguments, using target= +and source=. +The following are equivalent examples of calling the +&Program; builder method: + env.Program('bar', ['bar.c', 'foo.c']) env.Program('bar', Split('bar.c foo.c')) env.Program('bar', env.Split('bar.c foo.c')) -env.Program(source = ['bar.c', 'foo.c'], target = 'bar') -env.Program(target = 'bar', Split('bar.c foo.c')) -env.Program(target = 'bar', env.Split('bar.c foo.c')) -env.Program('bar', source = 'bar.c foo.c'.split()) +env.Program(source=['bar.c', 'foo.c'], target='bar') +env.Program(target='bar', source=Split('bar.c foo.c')) +env.Program(target='bar', source=env.Split('bar.c foo.c')) +env.Program('bar', source='bar.c foo.c'.split()) -Target and source file names -that are not absolute path names -(that is, do not begin with -/ -on POSIX systems -or -\ -on Windows systems, -with or without -an optional drive letter) -are interpreted relative to the directory containing the -SConscript -file being read. -An initial -# -(hash mark) -on a path name means that the rest of the file name -is interpreted relative to -the directory containing -the top-level -SConstruct -file, -even if the -# -is followed by a directory separator character -(slash or backslash). + +Python follows the POSIX pathname convention for path +strings: if a string begins with the operating system pathname separator +(on Windows both the slash and backslash separator work, +and any leading drive specifier is ignored for +the determination) it is considered an absolute path, +otherwise it is a relative path. +If the path string contains no separator characters, +it is searched for as a file in the current directory. If it +contains separator characters, the search follows down +from the starting point, which is the top of the directory tree for +an absolute path and the current directory for a relative path. + + +scons recognizes a third way to specify +path strings: if the string begins with +the # character it is +top-relative - it works like a relative path but the +search follows down from the directory containing the top-level +SConstruct rather than +from the current directory (the # is allowed +to be followed by a pathname separator, which is ignored if +found in that position). +Top-relative paths only work in places where &scons; will +interpret the path (see some examples below). To be +used in other contexts the string will need to be converted +to a relative or absolute path first. + + + +Target and source pathnames can be absolute, relative, or +top-relative. Relative pathnames are searched considering the +directory of the SConscript +file currently being processed as the "current directory". + Examples: @@ -2382,12 +2382,12 @@ executable program or bar.exe (on Windows systems) -from the bar.c source file: +from the bar.c source file: -env.Program(target = 'bar', source = 'bar.c') -env.Program('bar', source = 'bar.c') -env.Program(source = 'bar.c') +env.Program(target='bar', source='bar.c') +env.Program('bar', source='bar.c') +env.Program(source='bar.c') env.Program('bar.c') @@ -2397,28 +2397,31 @@ keyword argument may be specified when calling a Builder. When specified, all source file strings that are not absolute paths +or top-relative paths will be interpreted relative to the specified srcdir. The following example will build the -build/prog +build/prog (or -build/prog.exe +build/prog.exe on Windows) program from the files -src/f1.c +src/f1.c and -src/f2.c: +src/f2.c: + env.Program('build/prog', ['f1.c', 'f2.c'], srcdir='src') -It is possible to override or add construction variables when calling a -builder method by passing additional keyword arguments. -These overridden or added -variables will only be in effect when building the target, so they will not -affect other parts of the build. For example, if you want to add additional -libraries for just one program: +It is possible to override (replace or add) +construction variables when calling a +builder method by passing them as keyword arguments. +These overrides +will only be in effect when building that target, and will not +affect other parts of the build. For example, if you want to specify +some libraries needed by just one program: env.Program('hello', 'hello.c', LIBS=['gl', 'glut']) @@ -2438,7 +2441,7 @@ for dependencies on the non-standard library names; see the descriptions of these variables, below, for more information.) It is also possible to use the -parse_flags +parse_flags keyword argument in an override, to merge command-line style arguments into the appropriate construction variables @@ -2483,8 +2486,7 @@ from SCons.Script import * All builder methods return a list-like object -containing Nodes that -represent the target or targets that will be built. +containing Nodes that will be built. A Node is an internal SCons object @@ -2496,9 +2498,8 @@ can be passed to other builder methods as source(s) or passed to any SCons function or method where a filename would normally be accepted. For example, if it were necessary -to add a specific - -flag when compiling one specific object file: +to add a specific preprocessor define +when compiling one specific object file: bar_obj_list = env.StaticObject('bar.c', CPPDEFINES='-DBAR') @@ -2509,14 +2510,14 @@ env.Program(source = ['foo.c', bar_obj_list, 'main.c']) makes for a more portable build by avoiding having to specify a platform-specific object suffix -when calling the Program() builder method. +when calling the &Program; builder method. -Note that Builder calls will automatically "flatten" +Note that builder calls will automatically "flatten" the source and target file lists, -so it's all right to have the bar_obj list -return by the StaticObject() call +so it's all right to have the bar_obj_list +returned by the &StaticObject; call in the middle of the source file list. -If you need to manipulate a list of lists returned by Builders +If you need to manipulate a list of lists returned by builders directly using Python, you can either build the list by hand: @@ -2528,8 +2529,7 @@ for object in objects: print(str(object)) -Or you can use the -Flatten() +Or you can use the &Flatten; function supplied by scons to create a list containing just the Nodes, which may be more convenient: @@ -2542,23 +2542,23 @@ for object in objects: print(str(object)) -Note also that because Builder calls return +Note also that because builder calls return a list-like object, not an actual Python list, you should not -use the Python -+= -operator to append Builder results to a Python list. +use the Python add +operator (+ or +=) +to append builder results to a Python list. Because the list and the object are different types, Python will not update the original list in place, but will instead create a new Node-list object containing the concatenation of the list -elements and the Builder results. +elements and the builder results. This will cause problems for any other Python variables in your SCons configuration that still hold on to a reference to the original list. -Instead, use the Python -.extend() +Instead, use the Python list +extend method to make sure the list is updated in-place. Example: @@ -2571,14 +2571,14 @@ object_files = [] # # It will not update the object_files list in place. # -# Instead, use the .extend() method: +# Instead, use the list extend method: object_files.extend(Object('bar.c')) The path name for a Node's file may be used -by passing the Node to the Python-builtin -str() +by passing the Node to Python's builtin +str function: @@ -2588,7 +2588,7 @@ print("The path to bar_obj is:", str(bar_obj_list[0])) Note again that because the Builder call returns a list, we have to access the first element in the list -(bar_obj_list[0]) +((bar_obj_list[0])) to get at the Node that actually represents the object file. @@ -2651,7 +2651,12 @@ to use just the filename portion of the targets and source. scons -provides the following builder methods: +predefined the following builder methods. +Depending on the setup of a particular +&consenv; and on the type and software +installation status of the underlying system, +not all builders may be available to that +&consenv;. @@ -3119,11 +3124,12 @@ defined construction variables: method of the construction environment: -dict = env.Dictionary() -dict["CC"] = "cc" +cvars = env.Dictionary() +cvars["CC"] = "cc" -or using the [] operator: +or using the key lookup operator [] +directly on the construction environment: env["CC"] = "cc" @@ -4387,7 +4393,7 @@ functions return and Dir Nodes, respectively. -python objects, respectively. +Python objects, respectively. Those objects have several user-visible attributes and methods that are often useful: @@ -4544,7 +4550,7 @@ incl = Dir('include') f = incl.File('header.h') # Get a Node for a subdirectory within a directory -dist = Dir('project-3.2.1) +dist = Dir('project-3.2.1') src = dist.Dir('src') # Get a Node for a file in the same directory @@ -4919,7 +4925,8 @@ the same target file(s). The default is 0, which means the builder can not be called multiple times for the same target file(s). Calling a builder multiple times for the same target simply adds additional source files to the target; it is not allowed to change the environment associated -with the target, specify addition environment overrides, or associate a different +with the target, specify additional environment overrides, +or associate a different builder with the target. @@ -5404,17 +5411,15 @@ a = Action(build_it, varlist=['XXX']) The -Action() +&Action; global function can be passed the following optional keyword arguments to modify the Action object's behavior: - -chdir -The -chdir -keyword argument specifies that + +chdir +specifies that scons will execute the action after changing to the specified directory. If the @@ -5459,15 +5464,9 @@ a = Action("build < ${SOURCE.file} > ${TARGET.file}", chdir=1) - -exitstatfunc -The -Action() -global function -also takes an -exitstatfunc -keyword argument -which specifies a function + +exitstatfunc +specifies a function that is passed the exit status (or return value) from the specified action @@ -5489,11 +5488,9 @@ a = Action("build < ${SOURCE.file} > ${TARGET.file}", -batch_key -The -batch_key -keyword argument can be used -to specify that the Action can create multiple target files + +batch_key +specifies that the Action can create multiple target files by processing multiple independent source files simultaneously. (The canonical example is "batch compilation" of multiple object files @@ -5502,7 +5499,7 @@ to a single invocation of a compiler such as Microsoft's Visual C / C++ compiler.) If the batch_key -argument is any non-False, non-callable Python value, +argument evaluates True and is not a callable object, the configured Action object will cause scons to collect all targets built with the Action object @@ -5534,7 +5531,7 @@ will be used to identify different for batch building. A batch_key -function must take the following arguments: +function must accept the following arguments: @@ -5666,7 +5663,7 @@ sequences of file manipulation without relying on platform-specific external commands: -that + env = Environment(TMPBUILD = '/tmp/builddir') env.Command('foo.out', 'foo.in', @@ -5689,11 +5686,11 @@ which can be octal or string, similar to the bash command. Examples: -Execute(Chmod('file', 0755)) +Execute(Chmod('file', 0o755)) env.Command('foo.out', 'foo.in', [Copy('$TARGET', '$SOURCE'), - Chmod('$TARGET', 0755)]) + Chmod('$TARGET', 0o755)]) Execute(Chmod('file', "ugo+w")) @@ -5826,13 +5823,13 @@ env.Command('marker', 'input_file', Before executing a command, scons -performs construction variable interpolation on the strings that make up -the command line of builders. -Variables are introduced by a -$ +performs construction variable interpolation on the string that makes up +the command line of the builder. +Variables are introduced in such strings by a +$ prefix. -Besides construction variables, scons provides the following -variables for each command execution: +Besides regular construction variables, scons provides the following +special variables for each command execution: @@ -5901,15 +5898,19 @@ from sources that have not changed since the target was last built. -(Note that the above variables are reserved -and may not be set in a construction environment.) - -For example, given the construction variable CC='cc', targets=['foo'], and -sources=['foo.c', 'bar.c']: +Note that the above variables are reserved +and may not be set in a construction environment. + +For example, given the construction variables +CC='cc', +targets=['foo'] +and +sources=['foo.c', 'bar.c']: + action='$CC -c -o $TARGET $SOURCES' @@ -5921,8 +5922,10 @@ action='$CC -c -o $TARGET $SOURCES' cc -c -o foo foo.c bar.c -Variable names may be surrounded by curly braces ({}) -to separate the name from the trailing characters. +Variable names may be surrounded by curly braces +{ } +to separate the name from surrounding characters which +are not part of the name. Within the curly braces, a variable name may have a Python slice subscript appended to select one or more items from a list. @@ -6085,20 +6088,42 @@ may be a callable Python function associated with a construction variable in the environment. The function should -take four arguments: -target -- a list of target nodes, -source -- a list of source nodes, -env -- the construction environment, -for_signature -- a Boolean value that specifies +accept four arguments: + + + + target + +a list of target nodes + + + + source + +a list of source nodes + + + + env + +the construction environment + + + + for_signature + +a Boolean value that specifies whether the function is being called -for generating a build signature. +for generating a build signature. + + + + + SCons will insert whatever the called function returns -into the expanded string: +into the expanded string: + def foo(target, source, env, for_signature): @@ -6179,9 +6204,12 @@ echo Last build occurred . > $TARGET Python Code Substitution -Any python code within -${-} -pairs gets evaluated by python 'eval', with the python globals set to + +Any Python code within curly braces +{ } +and introduced by the variable prefix $ +gets evaluated by the Python eval statement, +with the Python globals set to the current environment's set of construction variables. So in the following case: @@ -6197,14 +6225,20 @@ echo FOO > foo.out echo BAR > foo.out -according to the current value of env['COND'] when the command is -executed. The evaluation occurs when the target is being -built, not when the SConscript is being read. So if env['COND'] is changed +according to the current value of env['COND'] +when the command is executed. +The evaluation takes place when the target is being +built, not when the SConscript is being read. So if +env['COND'] is changed later in the SConscript, the final value will be used. -Here's a more interesting example. Note that all of COND, FOO, and -BAR are environment variables, and their values are substituted into -the final command. FOO is a list, so its elements are interpolated +Here's a more interesting example. Note that all of +COND, +FOO, +and +BAR are construction variables, +and their values are substituted into the final command. +FOO is a list, so its elements are interpolated separated by spaces. @@ -6315,7 +6349,8 @@ might not exist argument is the construction environment for the scan. Fetch values from it using the env.Dictionary() -method. +method or using the key lookup operator +directly on the construction environment. The path @@ -6551,9 +6586,10 @@ do this, in part, by sharing an ability to interpret UNIX-like path names. For example, the Cygwin tools will internally translate a Cygwin path name -like /cygdrive/c/mydir +like /cygdrive/c/mydir to an equivalent Windows pathname -of C:/mydir (equivalent to C:\mydir). +of C:/mydir (equivalent to C:\mydir). + Versions of Python that are built for native Windows execution, @@ -6561,7 +6597,8 @@ such as the python.org and ActiveState versions, do not have the Cygwin path name semantics. This means that using a native Windows version of Python to build compiled programs using Cygwin tools -(such as gcc, bison, and flex) +(such as gcc, bison, +and flex) may yield unpredictable results. "Mixing and matching" in this way can be made to work, @@ -6771,7 +6808,7 @@ env['BUILDERS]['PDFBuilder'] = bld Defining Your Own Scanner Object -The following example shows an extremely simple scanner (the +The following example shows adding an extremely simple scanner (the kfile_scan() function) that doesn't use a search path at all @@ -6796,8 +6833,10 @@ kscan = Scanner(name = 'kfile', function = kfile_scan, argument = None, skeys = ['.k']) -scanners = Environment().Dictionary('SCANNERS') -env = Environment(SCANNERS = scanners + [kscan]) + +scanners = DefaultEnvironment()['SCANNERS'] +scanners.append(kscan) +env = Environment(SCANNERS=scanners) env.Command('foo', 'foo.k', 'kprocess < $SOURCES > $TARGET') @@ -6814,7 +6853,8 @@ you can use the function of your current Environment in order to create nodes on the fly from a sequence of file names with relative paths. -Here is a similar but more complete example that searches +Here is a similar but more complete example that adds +a scanner which searches a path of directories (specified as the MYPATH @@ -6840,15 +6880,16 @@ def my_scan(node, env, path, arg): break return env.File(results) -scanner = Scanner(name = 'myscanner', - function = my_scan, - argument = None, - skeys = ['.x'], - path_function = FindPathDirs('MYPATH') +scanner = Scanner(name='myscanner', + function=my_scan, + argument=None, + skeys=['.x'], + path_function=FindPathDirs('MYPATH') ) -scanners = Environment().Dictionary('SCANNERS') -env = Environment(SCANNERS = scanners + [scanner], - MYPATH = ['incs']) + +scanners = DefaultEnvironment()['SCANNERS'] +scanners.append(scanner) +env = Environment(SCANNERS=scanners, MYPATH=['incs']) env.Command('foo', 'foo.x', 'xprocess < $SOURCES > $TARGET') @@ -6861,8 +6902,8 @@ that will return a list of directories specified in the $MYPATH construction variable. It lets SCons detect the file -incs/foo.inc -, even if +incs/foo.inc, +even if foo.x contains the line include foo.inc @@ -6883,17 +6924,18 @@ def pf(env, dir, target, source, arg): results.append(top_dir + os.sep + p) return results -scanner = Scanner(name = 'myscanner', - function = my_scan, - argument = None, - skeys = ['.x'], - path_function = pf +scanner = Scanner(name='myscanner', + function=my_scan, + argument=None, + skeys=['.x'], + path_function=pf ) -Creating a Hierarchical Build + +Creating a Hierarchical Build Notice that the file names specified in a subdirectory's SConscript @@ -6982,7 +7024,7 @@ value each time we call the SConscript function. SConstruct: - env = Environment(LIBPATH = ['#libA', '#libB']) + env = Environment(LIBPATH=['#libA', '#libB']) Export('env') SConscript('libA/SConscript') SConscript('libB/SConscript') @@ -7001,7 +7043,7 @@ libB/SConscript: Main/SConscript: Import('env') - e = env.Copy(LIBS = ['a', 'b']) + e = env.Clone(LIBS=['a', 'b']) e.Program('foo', Split('m1.c m2.c m3.c')) @@ -7126,22 +7168,62 @@ env.Program('MyApp', ['Foo.cpp', 'Bar.cpp'])
ENVIRONMENT + +In general, &scons; is not controlled by environment +variables set in the shell used to invoke it, leaving it +up to the SConscript file author to import those if desired. +However the following variables are imported by +&scons; itself if set: + + - SCONS_LIB_DIR - -Specifies the directory that contains the SCons Python module directory -(e.g. /home/aroach/scons-src-0.01/src/engine). + SCONS_LIB_DIR + +Specifies the directory that contains the &scons; +Python module directory (for example, +/home/aroach/scons-src-0.01/src/engine). + + - + + SCONSFLAGS + +A string of options that will be used by &scons; +in addition to those passed on the command line. + + - SCONSFLAGS - -A string of options that will be used by scons in addition to those passed -on the command line. + SCONS_CACHE_MSVC_CONFIG + +(Windows only). If set, save the shell environment variables +generated when setting up the Microsoft Visual C++ compiler +(and/or Build Tools) to a file to give these settings, +which are expensive to generate, persistence +across &scons; invocations. +Use of this option is primarily intended to aid performance +in tightly controlled Continuous Integration setups. + +If set to a True-like value ("1", +"true" or +"True") will cache to a file named +.scons_msvc_cache in the user's home directory. +If set to a pathname, will use that pathname for the cache. + +Note: use this cache with caution as it +might be somewhat fragile: while each major toolset version +(e.g. Visual Studio 2017 vs 2019) and architecture pair will get separate +cache entries, if toolset updates cause a change +to settings within a given release series, &scons; will not +detect the change and will reuse old settings. +Remove the cache file in case of problems with this. +&scons; will ignore failures reading or writing the file +and will silently revert to non-cached behavior in such cases. + +Since &scons; 3.1. - + @@ -7157,8 +7239,9 @@ source code. AUTHORS -Originally: Steven Knight <knight@baldmt.com> and Anthony Roach <aroach@electriceyeball.com> -Since 2010: The SCons Development Team <scons-dev@scons.org> +Originally: Steven Knight knight@baldmt.com +and Anthony Roach aroach@electriceyeball.com. +Since 2010: The SCons Development Team scons-dev@scons.org. diff --git a/doc/man/sconsign.xml b/doc/man/sconsign.xml index daaa260..a1308ea 100644 --- a/doc/man/sconsign.xml +++ b/doc/man/sconsign.xml @@ -32,8 +32,8 @@ SCONSIGN 1 -SCons 3.1.1 -SCons 3.1.1 +SCons 3.1.2 +SCons 3.1.2 sconsign diff --git a/doc/scons.mod b/doc/scons.mod index cf46e3b..7a48f5f 100644 --- a/doc/scons.mod +++ b/doc/scons.mod @@ -212,6 +212,7 @@ Import"> Install"> InstallAs"> +InstallVersionedLib"> Link"> ListOption"> ListVariable"> @@ -259,11 +260,8 @@ SetDefault"> SetOption"> SideEffect"> -SourceSignature"> -SourceSignatures"> Split"> Tag"> -TargetSignatures"> Task"> Touch"> UnknownOptions"> diff --git a/doc/user/README b/doc/user/README index 5433ea2..a66d20b 100644 --- a/doc/user/README +++ b/doc/user/README @@ -12,7 +12,7 @@ Writing examples: here's a simple template. env = Environment() - print env.Dump("CC") + print(env.Dump("CC")) diff --git a/doc/user/builders-writing.xml b/doc/user/builders-writing.xml index 2fcb11b..a408479 100644 --- a/doc/user/builders-writing.xml +++ b/doc/user/builders-writing.xml @@ -196,7 +196,7 @@ env.Foo('file.foo', 'file.input') file.input - + cat @@ -309,7 +309,7 @@ file.input hello.c - + cat @@ -389,7 +389,7 @@ file1.input file2.input - + cat @@ -682,7 +682,7 @@ env.Foo('file') file.input - + cat @@ -766,7 +766,7 @@ file.input new_source - + cat @@ -840,7 +840,7 @@ modify1.input modify2.input - + cat diff --git a/doc/user/command-line.xml b/doc/user/command-line.xml index bb1d32b..e14ed07 100644 --- a/doc/user/command-line.xml +++ b/doc/user/command-line.xml @@ -2,7 +2,7 @@ %scons; - + %builders-mod; @@ -89,7 +89,7 @@ all of the command-line variable settings, the ability to apply command-line variable settings to construction environments, - and functions for configuring + and functions for configuring specific types of variables (Boolean values, path names, etc.) with automatic validation of the user's specified values. @@ -599,24 +599,30 @@ foo.in &SCons; also allows you to define your own command-line options with the &AddOption; function. The &AddOption; function takes the same arguments - as the optparse.add_option function - from the standard Python library. + as the add_option method + from the standard Python library module optparse. The &AddOption; function is, in fact, implemented using a subclass - of the optparse.OptionParser. + of optparse.OptionParser. + + + Once you have added a custom command-line option with the &AddOption; function, the value of the option (if any) is immediately available using the standard &GetOption; function. + + &SetOption; is not currently supported for + options added with &AddOption;. @@ -678,6 +684,47 @@ foo.in scons -Q -n --prefix=/tmp/install + + + Option-arguments separated from long options by whitespace, + rather than by an =, cannot be correctly + resolved by scons. + While --input=ARG + is clearly opt followed by arg, for --input ARG + it is not possible to tell without instructions whether + ARG is an argument belonging to the + input option or a positional argument. + scons treats positional arguments as either + command-line build options or command-line targets + which are made available for use in an &SConscript; + (see the immediately following sections for details). + Thus, they must be collected before &SConscript; processing + takes place. Since &AddOption; calls, which provide + the processing instructions to resolve any ambiguity, + happen in an &SConscript;, + scons does not know in time + for options added this way, and unexpected things will happen, + such as option-arguments assigned as targets and/or exceptions + due to missing option-arguments. + + + As a result, this usage style should be avoided when invoking + scons. For single-argument + options, use the --input=ARG form on the + command line. For multiple-argument options + (nargs greater than one), + set nargs to one in + &AddOption; calls and either: combine the option-arguments into one word + with a separator, and parse the result in your own code + (see the built-in --debug option, which + allows specifying multiple arguments as a single comma-separated + word, for an example of such usage); or allow the option to + be specified multiple times by setting + action='append'. Both methods can be + supported at the same time. + + + @@ -1132,12 +1179,12 @@ vars = Variables('custom.py', ARGUMENTS) - + where values in the option file &custom_py; get overwritten by the ones specified on the command line. - +
diff --git a/doc/user/depends.xml b/doc/user/depends.xml index bb0a142..96a8685 100644 --- a/doc/user/depends.xml +++ b/doc/user/depends.xml @@ -764,185 +764,8 @@ int main() { printf("Hello, world!\n"); } encounter them in older &SConscript; files. - -
- The &SourceSignatures; Function - - - - The &SourceSignatures; function is fairly straightforward, - and supports two different argument values - to configure whether source file changes should be decided - using MD5 signatures: - - - - -Program('hello.c') -SourceSignatures('MD5') - - - - - Or using time stamps: - - - - -Program('hello.c') -SourceSignatures('timestamp') - - - - - These are roughly equivalent to specifying - Decider('MD5') - or - Decider('timestamp-match'), - respectively, - although it only affects how SCons makes - decisions about dependencies on - source files--that is, - files that are not built from any other files. - - - -
- -
- The &TargetSignatures; Function - - - - The &TargetSignatures; function - specifies how &SCons; decides - when a target file has changed - when it is used as a - dependency of (input to) another target--that is, - the &TargetSignatures; function configures - how the signatures of "intermediate" target files - are used when deciding if a "downstream" target file - must be rebuilt. - - This easily-overlooked distinction between - how &SCons; decides if the target itself must be rebuilt - and how the target is then used to decide if a different - target must be rebuilt is one of the confusing - things that has led to the &TargetSignatures; - and &SourceSignatures; functions being - replaced by the simpler &Decider; function. - - - - - - - The &TargetSignatures; function supports the same - 'MD5' and 'timestamp' - argument values that are supported by the &SourceSignatures;, - with the same meanings, but applied to target files. - That is, in the example: - - - - -Program('hello.c') -TargetSignatures('MD5') - - - - - The MD5 checksum of the &hello_o; target file - will be used to decide if it has changed since the last - time the "downstream" &hello; target file was built. - And in the example: - - - - -Program('hello.c') -TargetSignatures('timestamp') - - - - - The modification time of the &hello_o; target file - will be used to decide if it has changed since the last - time the "downstream" &hello; target file was built. - - - - - - The &TargetSignatures; function supports - two additional argument values: - 'source' and 'build'. - The 'source' argument - specifies that decisions involving - whether target files have changed - since a previous build - should use the same behavior - for the decisions configured for source files - (using the &SourceSignatures; function). - So in the example: - - - - -Program('hello.c') -TargetSignatures('source') -SourceSignatures('timestamp') - - - - - All files, both targets and sources, - will use modification times - when deciding if an input file - has changed since the last - time a target was built. - - - - - - Lastly, the 'build' argument - specifies that &SCons; should examine - the build status of a target file - and always rebuild a "downstream" target - if the target file was itself rebuilt, - without re-examining the contents or timestamp - of the newly-built target file. - If the target file was not rebuilt during - this &scons; invocation, - then the target file will be examined - the same way as configured by - the &SourceSignature; call - to decide if it has changed. - - - - - - This mimics the behavior of - build signatures - in earlier versions of &SCons;. - A &buildsignature; re-combined - signatures of all the input files - that went into making the target file, - so that the target file itself - did not need to have its contents read - to compute an MD5 signature. - This can improve performance for some configurations, - but is generally not as effective as using - Decider('MD5-timestamp'). - - - -
-
- +
Implicit Dependencies: The &cv-CPPPATH; Construction Variable diff --git a/doc/user/environments.xml b/doc/user/environments.xml index ede9bc3..5df58c5 100644 --- a/doc/user/environments.xml +++ b/doc/user/environments.xml @@ -618,7 +618,7 @@ int main() { } - You can fetch individual construction variables + You can fetch individual &consvars; using the normal syntax for accessing individual named items in a Python dictionary: @@ -645,20 +645,21 @@ print("CC is: %s"%env['CC']) - A construction environment, however, - is actually an object with associated methods, etc. + A &consenv; + is actually an object with associated methods and + attributes. If you want to have direct access to only the - dictionary of construction variables, + dictionary of &consvars; you can fetch this using the &Dictionary; method: -env = Environment(FOO = 'foo', BAR = 'bar') -dict = env.Dictionary() +env = Environment(FOO='foo', BAR='bar') +cvars = env.Dictionary() for key in ['OBJSUFFIX', 'LIBSUFFIX', 'PROGSUFFIX']: - print("key = %s, value = %s" % (key, dict[key])) + print("key = %s, value = %s" % (key, cvars[key])) @@ -687,7 +688,7 @@ for key in ['OBJSUFFIX', 'LIBSUFFIX', 'PROGSUFFIX']: If you want to loop and print the values of - all of the construction variables in a construction environment, + all of the &consvars; in a &consenv;, the Python code to do that in sorted order might look something like: @@ -698,6 +699,16 @@ for item in sorted(env.Dictionary().items()): print("construction variable = '%s', value = '%s'" % item) + + It should be noted that for the previous example, there is actually + a &consenv; method that does the same thing more simply, + and tries to format the output nicely as well: + + +env = Environment() +print(env.Dump()) + +
@@ -706,10 +717,10 @@ for item in sorted(env.Dictionary().items()): Another way to get information from - a construction environment + a &consenv; is to use the &subst; method on a string containing $ expansions - of construction variable names. + of &consvar; names. As a simple example, the example from the previous section that used @@ -728,7 +739,7 @@ print("CC is: %s"%env.subst('$CC')) One advantage of using &subst; to expand strings is - that construction variables + that &consvars; in the result get re-expanded until there are no expansions left in the string. So a simple fetch of a value like @@ -875,33 +886,30 @@ print("value is: %s"%env.subst( '->${1 / 0}<-' )) All of the &Builder; functions that we've introduced so far, - like &Program; and &Library;, - actually use a default &consenv; - that contains settings - for the various compilers - and other tools that - &SCons; configures by default, - or otherwise knows about - and has discovered on your system. - The goal of the default construction environment - is to make many configurations to "just work" - to build software using - readily available tools + like &Program; and &Library;, use a &consenv; + that contains settings for the various compilers + and other tools that &SCons; configures by default, + or otherwise knows about and has discovered on your system. + If not invoked as methods of a specific &consenv;, + they use the default &consenv; + The goal of the default &consenv; + is to make many configurations "just work" + to build software using readily available tools with a minimum of configuration changes. - You can, however, control the settings - in the default construction environment + If needed, you can control the default &consenv; by using the &DefaultEnvironment; function - to initialize various settings: + to initialize various settings by passing + them as keyword arguments: -DefaultEnvironment(CC = '/usr/local/bin/gcc') +DefaultEnvironment(CC='/usr/local/bin/gcc') @@ -917,15 +925,15 @@ DefaultEnvironment(CC = '/usr/local/bin/gcc') - Note that the &DefaultEnvironment; function - returns the initialized - default construction environment object, - which can then be manipulated like any - other construction environment. - So the following - would be equivalent to the - previous example, - setting the &cv-CC; + The &DefaultEnvironment; function + returns the initialized default &consenv; object, + which can then be manipulated like any other &consenv; + (note that the default environment works like a singleton - + it can have only one instance - so the keyword arguments + are processed only on the first call. On any subsequent + call the existing object is returned). + So the following would be equivalent to the + previous example, setting the &cv-CC; variable to /usr/local/bin/gcc but as a separate step after the default construction environment has been initialized: @@ -960,8 +968,8 @@ env['CC'] = '/usr/local/bin/gcc' -env = DefaultEnvironment(tools = ['gcc', 'gnulink'], - CC = '/usr/local/bin/gcc') +env = DefaultEnvironment(tools=['gcc', 'gnulink'], + CC='/usr/local/bin/gcc') @@ -983,9 +991,8 @@ env = DefaultEnvironment(tools = ['gcc', 'gnulink'], - The real advantage of construction environments - is that you can create as many different construction - environments as you need, + The real advantage of &consenvs; + is that you can create as many different ones as you need, each tailored to a different way to build some piece of software or other file. If, for example, we need to build @@ -1018,7 +1025,7 @@ int main() { } - We can even use multiple construction environments to build + We can even use multiple &consenvs; to build multiple versions of a single program. If you do this by simply trying to use the &b-link-Program; builder with both environments, though, @@ -1641,7 +1648,7 @@ env['ENV']['PATH'] = '/usr/local/bin:/bin:/usr/bin' env = Environment() env.Command('foo', [], '__ROOT__/usr/bin/printenv.py') - + #!/usr/bin/env python import os import sys diff --git a/doc/user/factories.xml b/doc/user/factories.xml index 43e417b..0756ad0 100644 --- a/doc/user/factories.xml +++ b/doc/user/factories.xml @@ -161,7 +161,7 @@ env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() SConscript('S') file.in - + touch $* @@ -231,7 +231,7 @@ env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() SConscript('S') file.in - + touch $* @@ -325,7 +325,7 @@ env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() SConscript('S') file.in - + touch $* @@ -416,7 +416,7 @@ env['ENV']['PATH'] = env['ENV']['PATH'] + os.pathsep + os.getcwd() SConscript('S') file.in - + touch $* @@ -452,7 +452,7 @@ touch $* Command("file.out", "file.in", [ Copy("$TARGET", "$SOURCE"), - Chmod("$TARGET", 0755), + Chmod("$TARGET", 0o755), ]) file.in diff --git a/doc/user/file-removal.xml b/doc/user/file-removal.xml index fe38cf7..e772eeb 100644 --- a/doc/user/file-removal.xml +++ b/doc/user/file-removal.xml @@ -214,7 +214,7 @@ foo.in foo.log - + cat $3 > $2 diff --git a/doc/user/install.xml b/doc/user/install.xml index b3cb9dd..d977e6b 100644 --- a/doc/user/install.xml +++ b/doc/user/install.xml @@ -2,7 +2,7 @@ %scons; - + %builders-mod; @@ -11,7 +11,7 @@ %tools-mod; %variables-mod; - + ]> - Lastly, if you have multiple files that all + If you have multiple files that all need to be installed with different file names, you can either call the &InstallAs; function multiple times, or as a shorthand, @@ -268,4 +268,66 @@ int main() { printf("Goodbye, world!\n"); }
+
+ Installing a Shared Library + + + If a shared library is created with the + &cv-link-SHLIBVERSION; variable set, + &scons; will create symbolic links as needed based on that + variable. To properly install such a library including the + symbolic links, use the &InstallVersionedLib; function. + + + + For example, on a Linux system, this instruction: + + + +foo = env.SharedLibrary(target="foo", source="foo.c", SHLIBVERSION="1.2.3") + + + + Will produce a shared library + libfoo.so.1.2.3 + and symbolic links + libfoo.so and + libfoo.so.1 + which point to + libfoo.so.1.2.3. + You can use the Node returned by the &SharedLibrary; + builder in order to install the library and its + symbolic links in one go without having to list + them individually: + + + +env.InstallVersionedLib(target="lib", source=foo) + + + + +
+ diff --git a/doc/user/mergeflags.xml b/doc/user/mergeflags.xml index d802125..f4438f8 100644 --- a/doc/user/mergeflags.xml +++ b/doc/user/mergeflags.xml @@ -77,7 +77,7 @@ env = Environment() env.Append(CCFLAGS = '-option -O3 -O1') flags = { 'CCFLAGS' : '-whatever -O3' } env.MergeFlags(flags) -print env['CCFLAGS'] +print(env['CCFLAGS'])
@@ -104,7 +104,7 @@ env = Environment() env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include']) flags = { 'CPPPATH' : ['/usr/opt/include', '/usr/local/include'] } env.MergeFlags(flags) -print env['CPPPATH'] +print(env['CPPPATH'])
@@ -138,8 +138,8 @@ env = Environment() env.Append(CCFLAGS = '-option -O3 -O1') env.Append(CPPPATH = ['/include', '/usr/local/include', '/usr/include']) env.MergeFlags('-whatever -I/usr/opt/include -O3 -I/usr/local/include') -print env['CCFLAGS'] -print env['CPPPATH'] +print(env['CCFLAGS']) +print(env['CPPPATH'])
diff --git a/doc/user/output.xml b/doc/user/output.xml index db16393..c0edbca 100644 --- a/doc/user/output.xml +++ b/doc/user/output.xml @@ -309,7 +309,7 @@ Linking foo env = Environment() -if ARGUMENTS.get('VERBOSE') != "1': +if ARGUMENTS.get('VERBOSE') != '1': env['CCCOMSTR'] = "Compiling $TARGET" env['LINKCOMSTR'] = "Linking $TARGET" env.Program('foo.c') diff --git a/doc/user/parseconfig.xml b/doc/user/parseconfig.xml index 096d236..4adb20f 100644 --- a/doc/user/parseconfig.xml +++ b/doc/user/parseconfig.xml @@ -87,7 +87,7 @@ env = Environment() env['CPPPATH'] = ['/lib/compat'] env.ParseConfig("pkg-config x11 --cflags --libs") -print env['CPPPATH'] +print(env['CPPPATH']) @@ -139,7 +139,7 @@ scons: `.' is up to date. env = Environment() env.ParseConfig("pkg-config x11 --cflags --libs") env.ParseConfig("pkg-config x11 --cflags --libs") -print env['CPPPATH'] +print(env['CPPPATH'])
diff --git a/doc/user/parseflags.xml b/doc/user/parseflags.xml index 26313ce..cc31b3b 100644 --- a/doc/user/parseflags.xml +++ b/doc/user/parseflags.xml @@ -80,11 +80,12 @@ +from __future__ import print_function env = Environment() d = env.ParseFlags("-I/opt/include -L/opt/lib -lfoo") for k,v in sorted(d.items()): if v: - print k, v + print(k, v) env.MergeFlags(d) env.Program('f1.c') @@ -119,11 +120,12 @@ int main() { return 0; } +from __future__ import print_function env = Environment() d = env.ParseFlags("-whatever") for k,v in sorted(d.items()): if v: - print k, v + print(k, v) env.MergeFlags(d) env.Program('f1.c') @@ -145,11 +147,12 @@ env.Program('f1.c') +from __future__ import print_function env = Environment() d = env.ParseFlags(["-I/opt/include", ["-L/opt/lib", "-lfoo"]]) for k,v in sorted(d.items()): if v: - print k, v + print(k, v) env.MergeFlags(d) env.Program('f1.c') @@ -172,11 +175,12 @@ int main() { return 0; } +from __future__ import print_function env = Environment() d = env.ParseFlags(["!echo -I/opt/include", "!echo -L/opt/lib", "-lfoo"]) for k,v in sorted(d.items()): if v: - print k, v + print(k, v) env.MergeFlags(d) env.Program('f1.c') diff --git a/doc/user/separate.xml b/doc/user/separate.xml index 26500d6..3640fef 100644 --- a/doc/user/separate.xml +++ b/doc/user/separate.xml @@ -149,10 +149,8 @@ program using the F path name. One historical note: the &VariantDir; function - used to be called &BuildDir;. - That name is still supported - but has been deprecated - because the &SCons; functionality + used to be called &BuildDir;, a name which was + removed because the &SCons; functionality differs from the model of a "build directory" implemented by other build systems like the GNU Autotools. diff --git a/doc/user/sideeffect.xml b/doc/user/sideeffect.xml index e630e4f..e8f0614 100644 --- a/doc/user/sideeffect.xml +++ b/doc/user/sideeffect.xml @@ -164,7 +164,7 @@ env.SideEffect('logfile.txt', f1 + f2)
file1.in file2.in - + cat diff --git a/doc/user/troubleshoot.xml b/doc/user/troubleshoot.xml index 606c727..a9da534 100644 --- a/doc/user/troubleshoot.xml +++ b/doc/user/troubleshoot.xml @@ -289,7 +289,7 @@ file3.c env = Environment() -print env.Dump() +print(env.Dump()) @@ -349,7 +349,7 @@ print env.Dump() env = Environment() -print env.Dump('ENV') +print(env.Dump('ENV')) diff --git a/src/Announce.txt b/src/Announce.txt index 425aaa1..321496d 100755 --- a/src/Announce.txt +++ b/src/Announce.txt @@ -18,12 +18,43 @@ So that everyone using SCons can help each other learn how to use it more effectively, please go to http://scons.org/lists.html#users to sign up for the scons-users mailing list. -RELEASE 3.1.1 - Mon, 07 Aug 2019 20:09:12 -0500 +RELEASE 3.1.2 - Mon, 17 Dec 2019 02:06:27 +0000 Please consult the RELEASE.txt file for a summary of changes since the last release and consult the CHANGES.txt file for complete a list of changes since last release. This announcement highlights only the important changes. + + NOTE: The 4.0.0 Release of SCons will drop Python 2.7 Support + + Please note the following important changes since release 3.1.1: + - Added debug option "action_timestamps" which outputs to stdout the absolute start and end time for each target. + - Update Command() function to accept target_scanner, source_factory, and target_factory arguments. + This makes Command act more like a one-off builder. + - Added support for "-imacros" to ParseFlags + - Avoid crash with UnicodeDecodeError on Python 3 when a Latex log file in + non-UTF-8 encoding (e.g. containing umlauts in Latin-1 encoding when + the fontenc package is included with \usepackage[T1]{fontenc}) is read. + - Improved threading performance by ensuring NodeInfo is shared + across threads. Results in ~13% improvement for parallel builds + (-j# > 1) with many shared nodes. + - Improve performance of Entry.disambiguate() by making check for + most common case first, preventing unnecessary IO. + - Improved DAG walk performance by reducing unnecessary work when + there are no un-visited children. + - Turn previously deprecated debug options into failures: + --debug=tree, --debug=dtree, --debug=stree, --debug=nomemoizer. + - Experimental New Feature: Enable caching MSVC configuration + If SCONS_CACHE_MSVC_CONFIG shell environment variable is set, + SCons will cache the results of past calls to vcvarsall.bat to + a file; integrates with existing memoizing of such vars. + On vs2019 saves 5+ seconds per SCons invocation, which really + helps test suite runs. + - Remove deprecated SourceSignatures, TargetSignatures + - Remove deprecated Builder keywords: overrides and scanner + - Remove deprecated env.Copy + - Remove deprecated BuildDir plus SConscript keyword build_dir + Please note the following important changes since release 3.0.4: - Change the default for AppendENVPath to delete_existing=0, so path order will not be changed, unless explicitly set (Issue #3276) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index 953931b..745bcba 100755 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -4,6 +4,72 @@ Change Log +NOTE: The 4.0.0 Release of SCons will drop Python 2.7 Support + +RELEASE 3.1.2 - Mon, 17 Dec 2019 02:06:27 +0000 + + From Edoardo Bezzeccheri + - Added debug option "action_timestamps" which outputs to stdout the absolute start and end time for each target. + + From Rob Boehne + - Fix suncxx tool (Oracle Studio compiler) when using Python 3. Previously would throw an exception. + Resolved by properly handling tool version string output as unicode. + + From Tim Gates + - Resolved a typo in engine.SCons.Tool + + From Adam Gross: + - Resolved a race condition in multithreaded Windows builds with Python 2 + in the case where a child process is spawned while a Python action has a + file open. Original author: Ryan Beasley. + + From Jason Kenny + - Update Command() function to accept target_scanner, source_factory, and target_factory arguments. + This makes Command act more like a one-off builder. + + From Ivan Kravets + - Added support for "-imacros" to ParseFlags + + From Jacek Kuczera: + - Fix CheckFunc detection code for Visual 2019. Some functions + (e.g. memmove) were incorrectly recognized as not available. + + From Jakub Kulik + - Fix stacktrace when using SCons with Python 3.5+ and SunOS/Solaris related tools. + + From Philipp Maierhöfer: + - Avoid crash with UnicodeDecodeError on Python 3 when a Latex log file in + non-UTF-8 encoding (e.g. containing umlauts in Latin-1 encoding when + the fontenc package is included with \usepackage[T1]{fontenc}) is read. + + From Mathew Robinson: + - Improved threading performance by ensuring NodeInfo is shared + across threads. Results in ~13% improvement for parallel builds + (-j# > 1) with many shared nodes. + - Improve performance of Entry.disambiguate() by making check for + most common case first, preventing unnecessary IO. + - Improved DAG walk performance by reducing unnecessary work when + there are no un-visited children. + + From Mats Wichmann + - Replace instances of string find method with "in" checks where + the index from find() was not used. + - CmdStringHolder fix from issue #3428 + - Turn previously deprecated debug options into failures: + --debug=tree, --debug=dtree, --debug=stree, --debug=nomemoizer. + - Experimental New Feature: Enable caching MSVC configuration + If SCONS_CACHE_MSVC_CONFIG shell environment variable is set, + SCons will cache the results of past calls to vcvarsall.bat to + a file; integrates with existing memoizing of such vars. + On vs2019 saves 5+ seconds per SCons invocation, which really + helps test suite runs. + - Remove deprecated SourceSignatures, TargetSignatures + - Remove deprecated Builder keywords: overrides and scanner + - Remove deprecated env.Copy + - Remove deprecated BuildDir plus SConscript keyword build_dir + - A number of documentation improvements. + + RELEASE 3.1.1 - Mon, 07 Aug 2019 20:09:12 -0500 From William Deegan: diff --git a/src/LICENSE.txt b/src/LICENSE.txt index 6b6cd6c..67e0e2f 100644 --- a/src/LICENSE.txt +++ b/src/LICENSE.txt @@ -1,3 +1,5 @@ +MIT License + Copyright (c) 2001 - 2019 The SCons Foundation Permission is hereby granted, free of charge, to any person obtaining diff --git a/src/RELEASE.txt b/src/RELEASE.txt index db86a71..5f84c9e 100755 --- a/src/RELEASE.txt +++ b/src/RELEASE.txt @@ -1,73 +1,90 @@ - A new SCons checkpoint release, 3.1.1, is now available + A new SCons checkpoint release, 3.1.2, is now available on the SCons download page: https://scons.org/pages/download.html - XXX The primary purpose of this release ... XXX + Here is a summary of the changes since 3.1.1: - 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: + NOTE: The 4.0.0 Release of SCons will drop Python 2.7 Support NEW FUNCTIONALITY + - Added debug option "action_timestamps" which outputs to stdout the absolute start and end time for each target. - - List new features (presumably why a checkpoint is being released) - - DEPRECATED FUNCTIONALITY + REMOVED FUNCTIONALITY + - Turn previously deprecated debug options into failures: + --debug=tree, --debug=dtree, --debug=stree, --debug=nomemoizer. + - Remove deprecated SourceSignatures, TargetSignatures + - Remove deprecated Builder keywords: overrides and scanner + - Remove deprecated env.Copy + - Remove deprecated BuildDir plus SConscript keyword build_dir - - 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 + - Update Command() function to accept target_scanner, source_factory, and target_factory arguments. + This makes Command act more like a one-off builder. + - Added support for "-imacros" to ParseFlags + - EXPERIMENTAL NEW FEATURE: Enable caching MSVC configuration + If SCONS_CACHE_MSVC_CONFIG shell environment variable is set, + SCons will cache the results of past calls to vcvarsall.bat to + a file; integrates with existing memoizing of such vars. + On vs2019 saves 5+ seconds per SCons invocation, which really + helps test suite runs. FIXES - - - List fixes of outright bugs + - Fix suncxx tool (Oracle Studio compiler) when using Python 3. Previously would throw an exception. + Resolved by properly handling tool version string output as unicode. + - Resolved a race condition in multithreaded Windows builds with Python 2 + in the case where a child process is spawned while a Python action has a + file open. Original author: Ryan Beasley. + - Fix CheckFunc detection code for Visual 2019. Some functions + (e.g. memmove) were incorrectly recognized as not available. + - Fix stacktrace when using SCons with Python 3.5+ and SunOS/Solaris related tools. + - Latex: Avoid crash with UnicodeDecodeError on Python 3 when a Latex log file in + non-UTF-8 encoding (e.g. containing umlauts in Latin-1 encoding when + the fontenc package is included with \usepackage[T1]{fontenc}) is read. + - CmdStringHolder fix from issue #3428 IMPROVEMENTS + - Improved threading performance by ensuring NodeInfo is shared + across threads. Results in ~13% improvement for parallel builds + (-j# > 1) with many shared nodes. + - Improve performance of Entry.disambiguate() by making check for + most common case first, preventing unnecessary IO. + - Improved DAG walk performance by reducing unnecessary work when + there are no un-visited children. - - 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 + - N/A 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) + - N/A DEVELOPMENT - - List visible changes in the way SCons is developed + - N/A + + +Thanks to the following developers for their contributions to this release. +git shortlog --no-merges -ns 3.1.1..HEAD + 59 Mats Wichmann + 21 William Deegan + 8 Edoardo Bezzeccheri + 5 Adam Gross + 5 maiphi + 4 Ivan Kravets + 4 Mathew Robinson + 2 Jakub Kulík + 2 Jacek Kuczera + 2 Rob Boehne + 2 Jason Kenny + 2 Tim Gates + 1 Jakub Kulik + 1 Theogen Ratkin + 1 jw0k - 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 +src/RELEASE.txt bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan diff --git a/src/engine/SCons/Action.py b/src/engine/SCons/Action.py index be4a5ff..b4310f6 100644 --- a/src/engine/SCons/Action.py +++ b/src/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 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" +__revision__ = "src/engine/SCons/Action.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan" import os import pickle diff --git a/src/engine/SCons/Action.xml b/src/engine/SCons/Action.xml index 9cb186c..f4adc72 100644 --- a/src/engine/SCons/Action.xml +++ b/src/engine/SCons/Action.xml @@ -1,4 +1,4 @@ - + +&f-SetOption; is not currently supported for +options added with &f-AddOption;. @@ -133,6 +146,22 @@ AddOption('--prefix', help='installation prefix') env = Environment(PREFIX = GetOption('prefix')) + + + +While &AddOption; behaves like +add_option, +from the optparse module, +the behavior of options added by &AddOption; +which take arguments is underfined in +scons if whitespace +(rather than an = sign) is used as +the separator on the command line when +the option is invoked. +Such usage should be avoided. + + + diff --git a/src/engine/SCons/Script/MainTests.py b/src/engine/SCons/Script/MainTests.py index ac673a6..188700a 100644 --- a/src/engine/SCons/Script/MainTests.py +++ b/src/engine/SCons/Script/MainTests.py @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Script/MainTests.py 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" +__revision__ = "src/engine/SCons/Script/MainTests.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan" import unittest diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py index ae08d41..e7a3fc1 100644 --- a/src/engine/SCons/Script/SConsOptions.py +++ b/src/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 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" +__revision__ = "src/engine/SCons/Script/SConsOptions.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan" import optparse import re @@ -584,9 +584,15 @@ def Parser(version): help="Print build actions for files from CacheDir.") def opt_invalid(group, value, options): + """report an invalid option from a group""" errmsg = "`%s' is not a valid %s option type, try:\n" % (value, group) return errmsg + " %s" % ", ".join(options) + def opt_invalid_rm(group, value, msg): + """report an invalid option from a group: recognized but removed""" + errmsg = "`%s' is not a valid %s option type " % (value, group) + return errmsg + msg + config_options = ["auto", "force" ,"cache"] opt_config_help = "Controls Configure subsystem: %s." \ @@ -604,9 +610,11 @@ def Parser(version): help="Search up directory tree for SConstruct, " "build all Default() targets.") - deprecated_debug_options = { + deprecated_debug_options = {} + + removed_debug_options = { "dtree" : '; please use --tree=derived instead', - "nomemoizer" : ' and has no effect', + "nomemoizer" : '; there is no replacement', "stree" : '; please use --tree=all,status instead', "tree" : '; please use --tree=all instead', } @@ -614,15 +622,16 @@ def Parser(version): debug_options = ["count", "duplicate", "explain", "findlibs", "includes", "memoizer", "memory", "objects", "pdb", "prepare", "presub", "stacktrace", - "time"] + "time", "action-timestamps"] def opt_debug(option, opt, value__, parser, debug_options=debug_options, - deprecated_debug_options=deprecated_debug_options): + deprecated_debug_options=deprecated_debug_options, + removed_debug_options=removed_debug_options): for value in value__.split(','): if value in debug_options: parser.values.debug.append(value) - elif value in list(deprecated_debug_options.keys()): + elif value in deprecated_debug_options: parser.values.debug.append(value) try: parser.values.delayed_warnings @@ -632,6 +641,9 @@ def Parser(version): w = "The --debug=%s option is deprecated%s." % (value, msg) t = (SCons.Warnings.DeprecatedDebugOptionsWarning, w) parser.values.delayed_warnings.append(t) + elif value in removed_debug_options: + msg = removed_debug_options[value] + raise OptionValueError(opt_invalid_rm('debug', value, msg)) else: raise OptionValueError(opt_invalid('debug', value, debug_options)) diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py index c0a75f2..97073ba 100644 --- a/src/engine/SCons/Script/SConscript.py +++ b/src/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 72ae09dc35ac2626f8ff711d8c4b30b6138e08e3 2019-08-08 14:50:06 bdeegan" +__revision__ = "src/engine/SCons/Script/SConscript.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan" import SCons import SCons.Action @@ -42,7 +42,7 @@ import SCons.Platform import SCons.SConf import SCons.Script.Main import SCons.Tool -import SCons.Util +from SCons.Util import is_List, is_String, is_Dict, flatten from . import Main @@ -98,7 +98,7 @@ def compute_exports(exports): retval = {} try: for export in exports: - if SCons.Util.is_Dict(export): + if is_Dict(export): retval.update(export) else: try: @@ -133,7 +133,7 @@ call_stack = [] def Return(*vars, **kw): retval = [] try: - fvars = SCons.Util.flatten(vars) + fvars = flatten(vars) for var in fvars: for v in var.split(): retval.append(call_stack[-1].globals[v]) @@ -420,7 +420,7 @@ class SConsEnvironment(SCons.Environment.Base): except KeyError: raise SCons.Errors.UserError("Invalid SConscript usage - no parameters") - if not SCons.Util.is_List(dirs): + if not is_List(dirs): dirs = [ dirs ] dirs = list(map(str, dirs)) @@ -441,13 +441,13 @@ class SConsEnvironment(SCons.Environment.Base): raise SCons.Errors.UserError("Invalid SConscript() usage - too many arguments") - if not SCons.Util.is_List(files): + if not is_List(files): files = [ files ] if kw.get('exports'): exports.extend(self.Split(kw['exports'])) - variant_dir = kw.get('variant_dir') or kw.get('build_dir') + variant_dir = kw.get('variant_dir') if variant_dir: if len(files) != 1: raise SCons.Errors.UserError("Invalid SConscript() usage - can only specify one SConscript with a variant_dir") @@ -577,9 +577,6 @@ class SConsEnvironment(SCons.Environment.Base): 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) def subst_element(x, subst=self.subst): if SCons.Util.is_List(x): x = list(map(subst, x)) @@ -589,15 +586,10 @@ class SConsEnvironment(SCons.Environment.Base): ls = list(map(subst_element, ls)) subst_kw = {} for key, val in kw.items(): - if SCons.Util.is_String(val): + if is_String(val): val = self.subst(val) elif SCons.Util.is_List(val): - result = [] - for v in val: - if SCons.Util.is_String(v): - v = self.subst(v) - result.append(v) - val = result + val = [self.subst(v) if is_String(v) else v for v in val] subst_kw[key] = val files, exports = self._get_SConscript_filenames(ls, subst_kw) diff --git a/src/engine/SCons/Script/SConscript.xml b/src/engine/SCons/Script/SConscript.xml index 2d77aa3..5b5e482 100644 --- a/src/engine/SCons/Script/SConscript.xml +++ b/src/engine/SCons/Script/SConscript.xml @@ -1,4 +1,4 @@ - +