diff options
author | William Deegan <bill@baddogconsulting.com> | 2020-07-01 16:04:29 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-01 16:04:29 (GMT) |
commit | 9eba5ef435b0acd2406ea3b1b3151d2589c89f5e (patch) | |
tree | 029f87baa415dcc3b9e38507bd8d5dd55dd014f8 | |
parent | fff379e68cbdf7eb35ea2827ed5e8f8beaa2b514 (diff) | |
parent | ecb9741551fa0276fccd7d8d6f1df03a4e338082 (diff) | |
download | SCons-9eba5ef435b0acd2406ea3b1b3151d2589c89f5e.zip SCons-9eba5ef435b0acd2406ea3b1b3151d2589c89f5e.tar.gz SCons-9eba5ef435b0acd2406ea3b1b3151d2589c89f5e.tar.bz2 |
Merge pull request #3712 from bdbaddog/restore_scons_local
Re-implement scons-local build + travis ci updates for build
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | .travis.yml | 18 | ||||
-rwxr-xr-x | Announce.txt | 1348 | ||||
-rw-r--r-- | MANIFEST.in | 2 | ||||
-rw-r--r-- | SCons/Script/Main.py | 7 | ||||
-rw-r--r-- | SCons/Tool/textfile.py | 4 | ||||
-rw-r--r-- | SCons/Utilities/ConfigureCache.py | 13 | ||||
-rw-r--r-- | SCons/Utilities/sconsign.py | 12 | ||||
-rw-r--r-- | SCons/__init__.py | 56 | ||||
-rw-r--r-- | SConstruct | 50 | ||||
-rw-r--r-- | doc/Makefile | 11 | ||||
-rw-r--r-- | doc/SConscript | 160 | ||||
-rw-r--r-- | doc/generated/builders.gen | 289 | ||||
-rw-r--r-- | doc/generated/tools.gen | 2 | ||||
-rw-r--r-- | doc/generated/variables.gen | 54 | ||||
-rw-r--r-- | doc/sphinx/conf.py | 7 | ||||
-rw-r--r-- | requirements.txt | 4 | ||||
-rw-r--r-- | scripts/scons.bat | 1 | ||||
-rw-r--r-- | setup.cfg | 12 | ||||
-rw-r--r-- | setup.py | 22 | ||||
-rw-r--r-- | site_scons/scons_local_package.py | 100 | ||||
-rw-r--r-- | site_scons/site_init.py | 5 | ||||
-rw-r--r-- | site_scons/update_build_info.py | 16 | ||||
-rw-r--r-- | site_scons/zip_utils.py | 2 | ||||
-rw-r--r-- | template/__init__.py | 40 | ||||
-rw-r--r-- | test/Interactive/version.py | 15 | ||||
-rw-r--r-- | test/option-v.py | 15 |
27 files changed, 517 insertions, 1749 deletions
@@ -9,6 +9,7 @@ __pycache__/ # Distribution / packaging .Python /build/** +/dist/** /bootstrap/** .idea/ src/build/** diff --git a/.travis.yml b/.travis.yml index 9fa9376..21548c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ os: install: # needed for Docbook tests, must be in virtualenv context - - pip install lxml==4.5.0 + - pip install -r requirements.txt # do the rest of the image setup - ./.travis/install.sh @@ -76,4 +76,18 @@ jobs: - coverage combine - coverage report - coverage xml -i -o coverage_xml.xml - - codecov -X gcov --file coverage_xml.xml
\ No newline at end of file + - codecov -X gcov --file coverage_xml.xml + + - &scons_build_job + name: SCons Build + python: 3.7 + install: + - sudo apt-get -y install docbook-xml docbook-xsl xsltproc libxml2-dev libxslt-dev fop docbook-xsl-doc-pdf + - sudo apt-get -y --no-install-recommends install texlive texlive-latex3 biber texmaker ghostscript texlive-bibtex-extra texlive-latex-extra texlive-font-utils latexmk + - pip install -r requirements.txt + script: + - python bin/docs-update-generated.py + - python bin/docs-validate.py + - python bin/docs-create-example-outputs.py + - python scripts/scons.py + - ls -l build/dist diff --git a/Announce.txt b/Announce.txt deleted file mode 100755 index 17b3093..0000000 --- a/Announce.txt +++ /dev/null @@ -1,1348 +0,0 @@ - - - SCons - a software construction tool - - Release Notes - - -This is SCons, a tool for building software (and other files). SCons is -implemented in Python, and its "configuration files" are actually Python -scripts, allowing you to use the full power of a real scripting language -to solve build problems. You do not, however, need to know Python to -use SCons effectively. - -Please go to http://scons.org/pages/download.html to get the latest production -release of SCons. - -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 VERSION/DATE TO BE FILLED IN LATER - - 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) - - Add lex construction variable LEXUNISTD for turning off unix headers on windows - - Update lex tool to use win_flex on windows if available - - Add the textfile tool to the default tool list - - The mingw tool now respects SHCCCOMSTR, SHLINKCOMSTR and LDMODULECOMSTR - - Add support for finding vswhere under 32 bit Windows installs - - - Please note the following important changes since release 3.0.3: - - Added TEMPFILESUFFIX to allow user to specify suffix for tempfiles used for long command lines - - Initial support for ARM architectures with Microsoft Visual Studio 2017. You must set TARGET_ARCH - to arm or arm64 to enable. - - Fixed issue detecting installs of Microsoft Visual Studio 2017 as well as Microsoft build tools 2017. - - Please note the following important changes since release 2.5.1: - - This is the initial release supporting both python 3.5+ and 2.7.x and pypy - There are some important changes: - - - Properly support versioned shared libraries for MacOS. We've also introduced two - new env variables APPLELINK_CURRENT_VERSION and APPLELINK_COMPATIBILITY_VERSION which will specify - what is passed to the linkers -current_version and -compatibility_version flags. If not specified - they will be derived from SHLIBVERSION as such: - - APPLELINK_CURRENT_VERSION = SHLIBVERSION - - APPLELINK_COMPATIBILITY_VERSION = all but the last digit in SHLIBVERSION with .0 appended. - Note that the values of the above will be validated. Valid format for either APPLELINK variable is - X[.Y[.Z]] where 0 <= X <= 65535, 0 <= Y <= 255, 0 <= Z <= 255. - - Fix issue #2980 with credit to Piotr Bartosik (and William Blevins). This is an issue where using - TimeStamp-MD5 Decider and CacheDir can yield incorrect md5's being written into the .sconsign. - The difference between Piotr Bartosik's patch and the current code is that the more complicated - creation of file to csig map is only done when the count of children for the current node doesn't - match the previous count which is loaded from the sconsign. - - Add flag must_exist to SConscript() call to fail on missing script. - Not failing on missing script is now considered deprecated, and the first instance will print a - deprecation message. - - Add xz compression format to packaging choices. - - Add Textfile/Substfile to default environment. (issue #3147) - - Remove long deprecated SCons.Options which have been replaced by *Variable() - many years ago. - - Updated logic for mingw and clang on win32 to search default tool install paths if not - found in normal SCons PATH. If the user specifies PATH or tool specific paths they - will be used and the default paths below will be ignored. - - Default path for clang/clangxx : C:\Program Files\LLVM\bin - - Default path for mingw : C:\MinGW\bin and/or C:\mingw-w64\*\mingw64\bin - - Key program to locate mingw : mingw32-make (as the gcc with mingw prefix has no fixed name) - - Added virtualenv support. A new function Virtualenv() determines whether - SCons runs in a virtualenv. The search PATH may also be extended to - prefer executables from the current virtualenv over the ones provided by - base environment. New option --enable-virtualenv provided to import some - virtualenv-related variables to SCons and extend every env['ENV']['PATH'] - automatically. New option --ignore-virtualenv disables this. Two - environment variables, SCONS_ENABLE_VIRTUALENV and - SCONS_IGNORE_VIRTUALENV are supported for the same purpose. - - Recognize new java 9, 10, 11 (as 9.0 and 10.0, 11.0) - - All node content should be in bytes. This is the default in python 2.7.x, - in Python 3 all strings are by default unicode. byte and/or bytearray - should be used if you construct content for return by a custom node type's - get_content() method. - - There are some (as yet unresolved issue) using Literal()'s in some context with - Python 3 - - pypy should be supported, please report any issues to the user's mailing list. - - Currently if you switch back and forth between python 2.7.x and 3.5+ you will - need to remove your sconsign file. This should be resolves shortly, but - regardless switching between python 2.7.x and 3.5+ will not use compatible - sconsigns and as such incremental builds should be expected to rebuild - anything changed since the previous scons run with the same version of python. - - It is likely that migrating from 2.5.1 -> 3.0.0 alpha will cause rebuilds due - to the significant number of changes in the codebase. - - - Removed deprecated tools CVS, Perforce, BitKeeper, RCS, SCCS, Subversion. - - Removed deprecated module SCons.Sig - - See CHANGES.txt for more details on other changes - - 3.0.0 should be slightly faster than 2.5.1. Changes yielded a 15% speed up for - null incremental builds. - - Updated D language scanner support to latest: 2.071.1. - - python -m SCons should now run SCons if it's installed PYTHONPATH - - - Please note the following important changes since release 2.4.1: - We're enhancing implicit language scanning functionality to improve - correctness. SCons now honors scanner keys for implicit dependencies - and correctly changes scanner type (if necessary) when traversing - implicit dependency trees. - - This enhancement resolves missing dependencies - with built-in scanners including SWIG (#2264) and QT: - * http://scons.tigris.org/issues/show_bug.cgi?id=2264 - - - This enhancement broadens the horizon for handling heterogeneous - data flow environments (E.G. software builds): - - http://article.gmane.org/gmane.comp.programming.tools.scons.user/26596 - - - SCons may find new (and correct) dependencies in cross-langauge contexts. - - Update may cause rebuilds, especially in heterogeneous data environments. - - Update may find previously missed dependencies errors (E.G. cycles). - - Discovered in some QT test cases. - - SCons handles the SCANNERS variable differently. - - Previously, the Install builder would scan implicit dependencies for - a scanner found in SCANNERS (but not for built-in scanners), but now - the Install builder will not scan recursively regardless in order - to optimize Install behaviour and bring orthogonality to previous behaviour. - - - SCons handles cache directories a bit differently/ - - Cache files are now stored in 256 subdirectories in the cache directory by - default (this stresses NFS less). Existing cache directories will remain as - current, but SCons will prompt you to run scons-configure-cache which will - allow you to migrate to the new layout, or confirm you want to use the - existing layout. - - - New external tool scons-configurecache which allows some configuration of - how files in the cache are controlled. - - Please note the following important changes since release 2.4.0: - - Fix to swig tool - pick-up 'swig', 'swig3.0' and 'swig2.0' (in order). - - Fix to swig tool - respect env['SWIG'] provided by user. - - Fix for Bug # 2791 - Setup.py fails unnecessarily under Jython. - - Fixed license of SVG titlepage files in the context of Debian - packaging, such that they allow for commercial use too (#2985). - - InstallVersionedLib now available in the DefaultEnvironment context. - - Improves orthogonality of use cases between different Install functions. - - Added new configure check, CheckProg, to check for - existence of a program. - - Fix for issue #2840 - Fix for two environments specifying same target with different - actions not throwing hard error. Instead SCons was incorrectly issuing a warning - and continuing. - - Add support `Microsoft Visual C++ Compiler for Python 2.7' - Compiler can be obtained at: https://www.microsoft.com/en-us/download/details.aspx?id=44266 - - Fixed tigris issue #3011: Glob() excludes didn't work when used with VariantDir(duplicate=0) - - Fix bug 2831 and allow Help() text to be appended to AddOption() help. - - Reimplemented versioning for shared libraries, with the following effects - - Fixed tigris issues #3001, #3006. - - Fixed several other issues not reported to tigris, including: - issues with versioned libraries in subdirectories with tricky names, - issues with versioned libraries and variant directories, - issue with soname not being injected to library when using D linkers, - - Switched to direct symlinks instead of daisy-chained ones -- soname and - development symlinks point directly to the versioned shared library now), - for rationale see: - https://www.debian.org/doc/debian-policy/ch-sharedlibs.html - https://fedoraproject.org/wiki/Packaging:Guidelines#Devel_Packages - https://bitbucket.org/scons/scons/pull-requests/247/new-versioned-libraries-gnulink-cyglink/diff#comment-10063929 - - New construction variables to allow override default behavior: SONAME, - SHLIBVERSIONFLAGS, _SHLIBVERSIONFLAGS, SHLIBNOVERSIONSYMLINKS, - LDMODULEVERSION, LDMODULEVERSIONFLAGS, _LDMODULEVERSIONFLAGS, - LDMODULENOVERSIONSYMLINKS. - - Changed logic used to configure the versioning machinery from - platform-centric to linker-oriented. - - The SHLIBVERSION/LDMODULEVERSION variables are no longer validated by - SCons (more freedom to users). - - InstallVersionedLib() doesn't use SHLIBVERSION anymore. - - Enchanced docs for the library versioning stuff. - - New tests for versioned libraries. - - Library versioning is currently implemented for the following linker - tools: 'cyglink', 'gnulink', 'sunlink'. - - Please note the following important changes since release 2.3.6: - - Switch several core classes to use "slots" to reduce memory - usage. (PR #2180, #2178, #2198) - - Please note the following important changes since release 2.3.5: - - Support for Visual Studio 2015 - - Please note the following important changes since release 2.3.4: - - Documentation fixes for libraries.xml and - builders-writing.xml (#2989 and #2990) - - Extended docs for InstallVersionedLib/SharedLibrary, - and added SKIP_WIN_PACKAGES argument to build script - bootstrap.py (PR #230, #3002). - - Fixed symlink support (PR #227, #2395). - - Updated debug-count test case (PR #229). - - Fixed incomplete LIBS flattening and substitution in - Program scanner(PR #205, #2954). - - Added new method rentry_exists_on_disk to Node.FS (PR #193). - - Fixed several D tests under the different OS. - - Add support for f08 file extensions for Fortran 2008 code. - - Show --config choices if no argument is specified (PR #202). - - Fixed build crash when XML toolchain isn't installed, and - activated compression for ZIP archives. - - Fix for VersionedSharedLibrary under 'sunos' platform. - - Fixed dll link with precompiled headers on MSVC 2012 - - Added an 'exclude' parameter to Glob() - - Support for multiple cmdargs (one per variant) in VS project files. - - Various improvements for TempFileMunge class. - - Added an implementation for Visual Studio users files (PR #209). - - Added support for the 'PlatformToolset' tag in VS project files (#2978). - - Added support for '-isystem' to ParseFlags. - - - Please note the following important changes since release 2.3.3: - - -- Fix for EnsureSConsVersion regression in 2.3.3. - - -- Fix for interactive mode with Configure contexts - - Please note the following important changes since release 2.3.2: - - -- On Windows, .def files did not work as sources to shared - libraries or executables, due to a regression which is - corrected in 2.3.3. - - Please note the following important changes since release 2.3.0: - - -- BitKeeper, CVS, Perforce, RCS, SCCS are deprecated from the - default toolset and will be removed from the default toolset - in future SCons versions to speed up SCons initialization. - The tools themselves continue to be supported. - - -- Support for Visual Studio 12.0Exp and 2013 - - -- Revamp of D language support, focusing on D v2. - D v1 is now deprecated. - - -- Fixed NoClean() for multi-target builders. - - -- RPM and m4 are no longer in the default toolset on Windows. - Should improve startup speed. - - -- TeX fixes: -synctex=1 and cleaning auxiliary files. - - -- Fixes to the Docbook tool. - - Please note the following important changes since release 2.3.0: - - -- Fix failure to relink when LINKCOM or libs change, introduced in - 2.3.0. - - -- Fix MSVC defaulting TARGET_ARCH to HOST_ARCH and other MSVC - issues. - - -- Reduced memory consumption in large builds, which should speed - them up as well. - - -- Add new cyglink linker for use with cygwin. - - -- Fix leaking file handles to subprocesses - - -- Support read-only cache (--cache-readonly) - - -- Add Pseudo command to mark targets that shouldn't exist after building - - Please note the following important changes since release 2.2.0: - - -- SUPPORT FOR PYTHON VERSIONS BEFORE 2.7 IS NOW DEPRECATED - - ***IMPORTANT***: This release is the last version of SCons to support - Python versions older than 2.7. This release will warn if you are - running on Python 2.6 or older; future releases will probably not - work at all, as we are moving toward supporting Python 3. - Use --warn=no-python-version to suppress the warning if needed. - - -- A lot of python pre-2.4 compatibility code was removed - in this release. 2.4 is the official floor for SCons, - but this release will likely enforce it more rigidly. - - -- Spawning subprocesses on Windows should now be more reliable with -jN - - -- MSVC10 and MSVC11 support improved, and fixed MSVS11 solution generation. - - -- Various TeX/LaTeX builder improvements - - -- Support for versioned shared libs on Linux and Mac, via - SHLIBVERSION and InstallVersionedLib. - - -- WiX builder updates - - Please note the following important changes since release 2.1.0: - - -- New gettext toolset for internationalization - - -- Support for Visual Studio 11 - - -- Support for Intel C/C++ compiler v12 on Linux and Mac - - -- LaTeX support for multibib, biblatex and biber - - Please note the following important changes since release 2.0.0: - - -- Support for Windows manifest generation - - -- SCons now searches sitewide dirs for site_scons - - -- Support for Latex bibunits package has been added along with - support for tex files generated by other builders - - - Please note the following important changes since release 1.3.0: - - -- SUPPORT FOR PYTHON VERSIONS PRIOR TO 2.4 HAS BEEN REMOVED - - Although SCons is still tested with Python 2.3, use of Python - versions prior to 2.4 is deprecated. - - -- DEPRECATED FEATURES WILL GENERATE MANDATORY WARNINGS IN 2.0.0 - - In keeping with our deprecation cycle, the following deprecated - features will still be supported in 2.0.0 but will generate - mandatory, non-disableable warnings: - - -- The overrides= keyword argument to the Builder() call. - -- The scanner= keyword argument to the Builder() call. - -- The BuildDir() function and env.BuildDir() method. - -- The env.Copy() method. - -- The SourceSignatures() function and - env.SourceSignatures() method. - -- The TargetSignatures() function and - env.TargetSignatures() method. - -- The Sig module (now an unnused stub). - -- The --debug=dtree, --debug=stree and --debug=tree options. - -- The --debug=nomemoizer option. - -- The Options object and the related BoolOption(), - EnumOption(), ListOption(), PackageOption() and - PathOption() functions. - - The mandatory warnings will be issued in order to make sure - users of 1.3.0 notice *prior* to the release of SCons 2.0.0, that - these features will be removed. In SCons 2.0.0 these features - will no longer work at all, and will instead generate specific - fatal errors when anyone tries to use them. - - Please note the following important changes since release 1.2.0: - - -- MICROSOFT VISUAL STUDIO VERSION/ARCH DETECTION HAS CHANGED - - The way SCons detects Visual Studio on Windows has changed in - 1.3. By default, it should now use the latest installed - Visual Studio version on your machine, and compile for 32 or - 64 bits according to whether your OS is 32 or 64 bits (32/64 - bit Python makes no difference). - - Two new variables control Visual Studio: MSVC_VERSION and - TARGET_ARCH. These variables ONLY take effect when passed to - the Environment() constructor; setting them later has no - effect. To use a non-default Visual Studio version, set - MSVC_VERSION to e.g. "8.0" or "7.1". Setting it to "xxx" (or - any nonexistent value) will make it print out the valid - versions on your system. To use a non-default architecture, - set TARGET_ARCH to "x86" or "x86_64" (various synonyms are - accepted). - - Note that if you use MSVS_VERSION to build Visual Studio - projects from your SConstructs, MSVS_VERSION must be set to - the same version as MSVC_VERSION. - - Support for HOST_OS,HOST_ARCH,TARGET_OS, TARGET_ARCH has been - added to allow specifying different target arch than the host - system. This is only supported for Visual Studio/Visual C++ - at this time. - - -- Support for Latex glossaries and acronyms has been added - - -- VISUAL C/C++ PRECOMPILED HEADERS WILL BE REBUILT - - Precompiled header files built with Visual C/C++ will be - rebuilt after upgrading from 1.2.0 to a later release. - - This rebuild is normal and will occur because the command line - defined by the $PCHCOM construction variable has had the $CCFLAGS - variable added, and has been rearranged to put the "/Fo" output - flag towards the beginning of the line, consistent with the - related command lines for $CCCOM, $CXXCOM, etc. - - -- CHANGES TO SOME LINKER COMMAND LINES WILL CAUSE RELINKING - - Changes to the command line definitions for the Microsoft link.exe - linker, the OS/2 ilink linker and the Phar Lap linkloc linker - will cause targets built with those tools be to be rebuilt after - upgrading from 1.2.0 to a later release. - - This relink is normal and will occur because the command lines for - these tools have been redefined to remove unnecessary nested $( - and $) character strings. - - -- MSVS_USE_MFC_DIRS and MSVS_IGNORE_IDE_PATHS are obsoleted and - have no effect. - - Please note the following important changes since release 1.1.0: - - -- THE $CHANGED_SOURCES, $CHANGED_TARGETS, $UNCHANGED_SOURCES - AND $UNCHANGED_TARGETS VARIABLES WILL BECOME RESERVED - - A future release (probably 1.3.0) will make the construction - variable names $CHANGED_SOURCES, $CHANGED_TARGETS, - $UNCHANGED_SOURCES and $UNCHANGED_TARGETS into reserved - construction variable names controlled by SCons itself (like - the current $SOURCE, $TARGETS, etc.). - - Setting these variable names in the current release will generate - a warning but still set the variables. When they become reserved - variable names, they will generate a different warning message - and attempts to set these variables will be ignored. - - SCons configurations that happen to use these variable names - should be changed to use different variable names, in order - to ensure that the configuration continues to work with future - versions of SCons. - - -- THE Options OBJECT AND RELATED FUNCTIONS NOW GENERATE WARNINGS - - Use of the Options object, and related functions BoolOption(), - EnumOption(), ListOption(), PackageOption() and PathOption() - were announced as deprecated in release 0.98.1. Since then, - however, no warning messages were ever implemented for the - use of these deprecated functions. - - By default, release 1.2.0 prints warning messages when these - deprecated features are used. Warnings about all deprecated - features may be suppressed by using the --warn=no-deprecated - command-line option: - - $ scons --warn=no-deprecated - - Or by using the appropriate SetOption() call in any SConscript - file: - - SetOption('warn', 'no-deprecated') - - You may optionally disable just warnings about the deprecation - of the Options object and its related functions as follows: - - SetOption('warn', 'no-deprecated-options') - - The current plan is for these warnings to become mandatory - (non-suppressible) in release 1.3.0, and for the use of Options - and its related functions to generate errors in release 2.0. - - Please note the following important changes since release 0.98.4: - - -- scons.bat NOW RETURNS THE REAL SCONS EXIT STATUS - - The scons.bat script shipped with SCons used to exit with - a status of 1 when it detected any failed (non-zero) exit - status from the underlying Python execution of SCons itself. - The scons.bat script now exits with the actual status - returned by SCons. - - -- SCONS NOW WARNS WHEN TRYING TO LINK C++ AND FORTRAN OBJECT FILES - - Some C++ toolchains do not understand Fortran runtimes and create - unpredictable executables when linking C++ and Fortran object - files together. SCons now issues a warning if you try to link - C++ and Fortran object files into the same executable: - - scons: warning: Using $CXX to link Fortran and C++ code together. - This may generate a buggy executable if the '/usr/bin/gcc' - compiler does not know how to deal with Fortran runtimes. - - The warning may be suppressed with either the --warning=no-link - or --warning=no-fortran-cxx-mix command line options, or by - adding either of the following lines to a SConscript file: - - SetOption('warn', 'no-link') - SetOption('warn', 'no-fortran-cxx-mix') - - Please note the following important changes since release 0.98: - - -- SCONS NO LONGER SETS THE GNU TOOLCHAIN -fPIC FLAG IN $SHCXXFLAGS - - The GNU toolchain support in previous versions of SCons would - add the -fPIC flag to the $SHCXXFLAGS construction variable. - The -fPIC flag has now been removed from the default - $SHCXXFLAGS setting. Instead, the $SHCXXCOM construction variable - (the default SCons command line for compiling shared objects - from C++ source files) has been changed to add the $SHCCFLAGS - variable, which contains the -fPIC flag. - - This change was made in order to make the behavior of the default - C++ compilation line including $SHCCFLAGS consistent with the - default C compilation line including $CCFLAGS. - - This change should have no impact on configurations that use - the default $SHCXXCOM command line. It may have an impact on - configurations that were using the default $SHCXXFLAGS value - *without* the $SHCCFLAGS variable to get the -fPIC flag into a - custom command line. You can fix these by adding the $SHCCFLAGS - to the custom command line. - - Adding $SHCCFLAGS is backwards compatible with older SCons - releases, although it might cause the -fPIC flag to be repeated - on the command line if you execute it on an older version of - SCons that sets -fPIC in both the $SHCCLAFGS and $SHCXXFLAGS - variables. Duplicating the -fPIC flag on the g++ command line - will not cause any compilation problems, but the change to the - command line may cause SCons to rebuild object files. - - -- FORTRAN NOW COMPILES .f FILES WITH gfortran BY DEFAULT - - The Fortran Tool modules have had a major overhaul with the intent - of making them work as-is for most configurations. In general, - most configurations that use default settings should not see - any noticeable difference. - - One configuration that has changed is if you have both a gfortran - and g77 compiler installed. In this case, previous versions of - SCons would, by default, use g77 by default to compile files with - a .f suffix, while SCons 0.98.1 will use the gfortran compiler - by default. The old behavior may be preserved by explicitly - initializing construction environments with the 'g77' Tool module: - - env = Environment(tools = ['g77', 'default']) - - The above code is backwards compatible to older versions of SCons. - - If you notice any other changes in the behavior of default - Fortran support, please let us know so we can document them in - these release notes for other users. - - Please note the following important changes since release 0.97.0d20071212: - - -- SUPPORT FOR PYTHON VERSIONS BEFORE 2.2 IS NOW DEPRECATED - - SCons now prints the following warning when it is run by any - Python 1.5, 2.0 or 2.1 release or sub-release: - - scons: warning: Support for pre-2.2 Python (VERSION) is deprecated. - If this will cause hardship, contact scons-dev@scons.org - - You may disable all warnings about deprecated features by adding - the option "--warn=no-deprecated" to the command line or to the - $SCONSFLAGS environment variable: - - $ scons --warn=no-deprecated - - Using '--warn=no-deprecated' is compatible with earlier versions - of SCons. - - You may also, as of this version of SCons, disable all warnings - about deprecated features by adding the following to any - SConscript file: - - SetOption('warn', 'no-deprecated') - - You may disable only the specific warning about running under - a deprecated Python version by adding the following to any - SConscript file: - - SetOption('warn', 'no-python-version') - - The warning may also be suppressed on the command line: - - $ scons --warn=no-python-version - - Or by specifying the --warn=no-python-version option in the - $SCONSFLAGS environment variable. - - Using SetOption('warn', ...), and the 'no-python-version' - command-line option for suppressing this specific warning, - are *not* backwards-compatible to earlier versions of SCons. - - -- THE env.Copy() METHOD IS NOW OFFICIALLY DEPRECATED - - The env.Copy() method is now officially deprecated and will - be removed in a future release. Using the env.Copy() method - now generates the following message: - - scons: warning: The env.Copy() method is deprecated; use the env.Clone() method instead. - - You may disable all warnings about deprecated features by adding - the option "--warn=no-deprecated" to the command line or to the - $SCONSFLAGS environment variable: - - $ scons --warn=no-deprecated - - Using '--warn=no-deprecated' is compatible with earlier versions - of SCons. - - You may also, as of this version of SCons, disable all warnings - about deprecated features by adding the following to any - SConscript file: - - SetOption('warn', 'no-deprecated') - - You may disable only the specific warning about the deprecated - env.Copy() method by adding the following to any SConscript - file: - - SetOption('warn', 'no-deprecated-copy') - - The warning may also be suppressed on the command line: - - $ scons --warn=no-deprecated-copy - - Or by specifying the --warn=no-deprecated-copy option in the - $SCONSFLAGS environment variable. - - Using SetOption('warn', ...), and the 'no-deprecated-copy' - command-line option for suppressing this specific warning, - are *not* backwards-compatible to earlier versions of SCons. - - -- THE --debug=dtree, --debug=stree AND --debug=tree OPTIONS ARE DEPRECATED - - The --debug=dtree, --debug=stree and --debug=tree methods - are now officially deprecated and will be removed in a - future release. Using these options now generate a warning - message recommending use of the --tree=derived, --tree=all,status - and --tree=all options, respectively. - - You may disable these warnings, and all warnings about - deprecated features, by adding the option "--warn=no-deprecated" - to the command line or to the $SCONSFLAGS environment - variable: - - $ scons --warn=no-deprecated - - Using '--warn=no-deprecated' is compatible with earlier versions - of SCons. - - -- THE TargetSignatures() AND SourceSignatures() FUNCTIONS ARE DEPRECATED - - The TargetSignatures() and SourceSignatures() functions, - and their corresponding env.TargetSignatures() and - env.SourceSignatures() methods, are now officially deprecated - and will be be removed in a future release. Using ahy of - these functions or methods now generates a message - similar to the following: - - scons: warning: The env.TargetSignatures() method is deprecated; - convert your build to use the env.Decider() method instead. - - You may disable all warnings about deprecated features by adding - the option "--warn=no-deprecated" to the command line or to the - $SCONSFLAGS environment variable: - - $ scons --warn=no-deprecated - - Using '--warn=no-deprecated' is compatible with earlier versions - of SCons. - - You may also, as of this version of SCons, disable all warnings - about deprecated features by adding the following to any - SConscript file: - - SetOption('warn', 'no-deprecated') - - You may disable only the specific warning about the use of - TargetSignatures() or SourceSignatures() by adding the - following to any SConscript file: - - SetOption('warn', 'no-deprecated-target-signatures') - SetOption('warn', 'no-deprecated-source-signatures') - - The warnings may also be suppressed on the command line: - - $ scons --warn=no-deprecated-target-signatures --warn=no-deprecated-source-signatures - - Or by specifying these options in the $SCONSFLAGS environment - variable. - - Using SetOption('warn', ...), or the command-line options - for suppressing these warnings, is *not* backwards-compatible - to earlier versions of SCons. - - -- File(), Dir() and Entry() NOW RETURN A LIST WHEN THE INPUT IS A SEQUENCE - - Previously, if these methods were passed a list, the list was - substituted and stringified, then passed as a single string to - create a File/Dir/Entry Node. This rarely if ever worked with - more than one element in the list. They now return a list of - Nodes when passed a list. - - One case that works differently now is a passing in a - single-element sequence; that formerly was stringified - (returning its only element) and then a single Node would be - returned. Now a single-element list containing the Node will - be returned, for consistency. - - -- THE env.subst() METHOD NOW RETURNS A LIST WHEN THE INPUT IS A SEQUENCE - - The env.subst() method now returns a list with the elements - expanded when given a list as input. Previously, the env.subst() - method would always turn its result into a string. - - This behavior was changed because it interfered with being able - to include things like lists within the expansion of variables - like $CPPPATH and then have SCons understand that the elements - of the "internal" lists still needed to be treated separately. - This would cause a $CPPPATH list like ['subdir1', 'subdir'] - to show up in a command line as "-Isubdir1 subdir". - - -- THE Jar() BUILDER NOW USES THE Java() BUILDER CLASSDIR BY DEFAULT - - By default, the Jar() Builder will now use the class directory - specified when the Java() builder is called. So the following - input: - - classes = env.Java('classes', 'src') - env.Jar('out.jar', classes) - - Will cause "-C classes" to be passed the "jar" command invocation, - and the Java classes in the "out.jar" file will not be prefixed - "classes/". - - Explicitly setting the $JARCHDIR variable overrides this default - behavior. The old behavior of not passing any -C option to the - "jar" command can be preserved by explicitly setting $JARCHDIR - to None: - - env = Environment(JARCHDIR = None) - - The above setting is compatible with older versions of SCons. - - Please note the following important changes since release 0.97.0d20070918: - - -- SCons REDEFINES PYTHON open() AND file() ON Windows TO NOT PASS - ON OPEN FILE HANDLES TO CREATED PROCESSES - - On Windows systems, SCons now redefines the Python open() - and file() functions so that, if the Python Win32 extensions - are available, the file handles for any opened files will *not* - be inherited by subprocesses, such as the spawned compilers and - other tools invoked to build the software. - - This prevents certain race conditions where a file handle for - a file opened by Python (either in a Python function action, - or directly in a SConscript file) could be inherited and help - open by a subprocess, interfering with the ability of other - processes to create or modify the file. - - In general, this should not cause problems for the vast majority - of configurations. The only time this would be a problem would be - in the unlikely event that a process spawned by SCons specifically - *expected* to use an inherited file handle opened by SCons. - - If the Python Win32 extensions are not installed or are an - earlier version that does not have the ability to disable file - handle inheritance, SCons will print a warning message when the - -j option is used. The warning message may be suppressed by - specifying --warn=no-parallel-support. - - Please note the following important changes since release 0.97.0d20070809: - - -- "content" SIGNATURES ARE NOW THE DEFAULT BEHAVIOR - - The default behavior of SCons is now to use the MD5 checksum of - all file contents to decide if any files have changed and should - cause rebuilds of their source files. This means that SCons may - decide not to rebuild "downstream" targets if a a given input - file is rebuilt to the exact same contents as the last time. - The old behavior may preserved by explicity specifying: - - TargetSignatures("build") - - In any of your SConscript files. - - -- TARGETS NOW IMPLICITLY DEPEND ON THE COMMAND THAT BUILDS THEM - - For all targets built by calling external commands (such as a - compiler or other utility), SCons now adds an implicit dependency - on the command(s) used to build the target. - - This will cause rebuilds of all targets built by external commands - when running SCons in a tree built by previous version of SCons, - in order to update the recorded signatures. - - The old behavior of not having targets depend on the external - commands that build them can be preserved by setting a new - $IMPLICIT_COMMAND_DEPENDENCIES construction variable to a - non-True value: - - env = Environment(IMPLICIT_COMMAND_DEPENDENCIES = 0) - - or by adding Ignore() calls for any targets where the behavior - is desired: - - Ignore('/usr/bin/gcc', 'foo.o') - - Both of these settings are compatible with older versions - of SCons. - - -- CHANGING SourceSignature() MAY CAUSE "UNECESSARY" REBUILDS - - If you change the SourceSignature() value from 'timestamp' to - 'MD5', SCons will now rebuild targets that were already up-to-date - with respect to their source files. - - This will happen because SCons did not record the content - signatures of the input source files when the target was last - built--it only recorded the timestamps--and it must record them - to make sure the signature information is correct. However, - the content of source files may have changed since the last - timestamp build was performed, and SCons would not have any way to - verify that. (It would have had to open up the file and record - a content signature, which is one of the things you're trying to - avoid by specifying use of timestamps....) So in order to make - sure the built targets reflect the contents of the source files, - the targets must be rebuilt. - - Change the SourceSignature() value from 'MD5' to 'timestamp' - should correctly not rebuild target files, because the timestamp - of the files is always recorded. - - In previous versions of SCons, changing the SourceSignature() - value would lead to unpredictable behavior, usually including - rebuilding targets. - - -- THE Return() FUNCTION NOW ACTUALLY RETURNS IMMEDIATELY - - The Return() function now immediately stops processing the - SConscript file in which it appears and returns the values of the - variables named in its arguments. It used to continue processing - the rest of the SConscript file, and then return the values of the - specified variables at the point the Return() function was called. - - The old behavior may be requested by adding a "stop=False" - keyword argument to the Return() call: - - Return('value', stop=False) - - The "stop=" keyword argument is *not* compatible with SCons - versions 0.97.0d20070809 or earlier. - - Please note the following important changes since release 0.97: - - -- env.CacheDir() NOW ONLY AFFECTS CONSTRUCTION ENVIRONMENT TARGETS - - The env.CacheDir() method now only causes derived files to be - retrieved from the specified cache directory for targets built - with the specified specified construction environment ("env"). - - Previously, any call to env.CacheDir() or CacheDir() would modify - a global setting and cause all built targets to be retrieved - from the specified cache directory. This behavior was changed so - that env.CacheDir() would be consistent with other construction - environment methods, which only affect targets built with the - specified construction environment. - - The old behavior of changing the global behavior may be preserved - by changing any env.CacheDir() calls to: - - CacheDir('/path/to/cache/directory') - - The above change is backwards-compatible and works in all earlier - versions of SCons that support CacheDir(). - - -- INTERPRETATION OF SUFFIX-LESS SOURCE ARGUMENTS HAS CHANGED - - The interpretation of source arguments (files) without suffixes - has changed in one specific configuration. - - Previously, if a Builder had a src_suffix specified (indicating - that source files without suffixes should have that suffix - appended), the suffix would only be applied to suffix-less source - arguments if the Builder did *not* have one or more attached - source Builders (that is, the Builder was not a "multi-stage" - Builder). So in the following configuration: - - build_foo = Builder(src_suffix = '.foo') - build_bar = Builder(src_suffix = '.bar', - src_builder = build_bar) - - env = Environment(BUILDERS = { - 'Foo' : build_foo, - 'Boo' : build_bar, - }) - - env.Foo('tgt1', 'src1') - env.Bar('tgt2', 'src2') - - SCons would have expected to find a source file 'src1.foo' for the - env.Foo() call, but a source file 'src2' for the env.Bar() call. - - This behavior has now been made consistent, so that the two - above calls would expect source files named 'src1.foo' and - 'src2.bar', respectively. - - Note that, if genuinely desired, the old behavior of building - from a source file without a suffix at all (when the Builder has - a src_suffix *and* a src_builder) can be specified explicity by - turning the string into a File Node directly: - - env.Bar('tgt2', File('src2')) - - The above use of File() is backwards-compatible and will work - on earlier versions of SCons. - - -- THE DEFAULT EXECUTION PATH FOR Solaris HAS CHANGED - - On Solaris systems, SCons now adds the "/opt/SUNWspro/bin" - directory to the default execution $PATH variable before the - "/usr/ccs/bin" directory. This was done to reflect the fact - that /opt/SUNWspro/ is the default for SUN tools, but it may - cause a different compiler to be used if you have compilers - installed in both directories. - - -- GENERATED config.h FILES NOW SAY "#define HAVE_{FEATURE} 1" - - When generating a "config.h" file, SCons now defines values that - record the existence of a feature with a "1" value: - - #define HAVE_FEATURE 1 - - Instead of printing the line without a "1", as it used to: - - #define HAVE_FEATURE - - This should not cause any problems in the normal use of "#ifdef - HAVE_{FEATURE}" statements interpreted by a C preprocessor, but - might cause a compatibility issue if a script or other utility - looks for an exact match of the previous text. - - Please note the following planned, future changes: - - -- THE Options OBJECT AND RELATED FUNCTIONS WILL BE DEPRECATED - - The Options object is being replaced by a new Variables - object, which uses a new Variables.AddVariable() method - where the previous interface used Options.AddOptions(). - - Similarly, the following utility functions are being replaced - by the following similarly-named functions: - - BoolOption() BoolVariable() - EnumOption() EnumVariable() - ListOption() ListVariable() - PackageOption() PackageVariable() - PathOption() PathVariable() - - And also related, the options= keyword argument when creating - construction environments with the Environment() functions is - being replaced with a variables= keyword argument. - - In some future release a deprecation warning will be added to - existing uses of the Options object, its methods, the above - utility functions, and the options= keyword argument of the - Environment() function. At some point after the deprecation - warning is added, the Options object, related functions and - options= keyword argument will be removed entirely. - - You can prepare for this by changing all your uses of the Options - object and related functions to the Variables object and the new - function names, and changing any uses of the options= keyword - argument to variables=. - - NOTE: CONVERTING TO USING THE NEW Variables OBJECT OR THE - RELATED *Variable() FUNCTIONS, OR USING THE NEW variable= - KEYWORD ARGUMENT, IS NOT BACKWARDS COMPATIBLE TO VERSIONS OF - SCons BEFORE 0.98. YOUR SConscript FILES WILL NOT WORK ON - EARLIER VERSIONS OF SCons AFTER MAKING THIS CHANGE. - - If you change SConscript files in software that you make available - for download or otherwise distribute, other users may try to - build your software with an earlier version of SCons that does - not have the Variables object or related *Variable() functions. - We recommend preparing for this in one of two ways: - - -- Make your SConscript files backwards-compatible by - modifying your calls with Python try:-except: blocks - as follows: - - try: - vars = Variables('custom.py', ARGUMENTS) - vars.AddVariables( - BoolVariable('WARNINGS', 'cmopile with -Wall', 1), - EnumVariable('DEBUG', 'debug version', 'no' - allowed_values=('yes', 'no', 'full'), - map={}, ignorecase=0), - ListVariable('SHAREDLIBS', - 'libraries to build shared', - 'all', - names = list_of_libs), - PackageVariable('X11', - 'use X11 from here', - '/usr/bin/X11'), - PathVariable('QTDIR', 'root of Qt', qtdir), - ) - except NameError: - vars = Options('custom.py', ARGUMENTS) - vars.AddOptions( - BoolOption('WARNINGS', 'cmopile with -Wall', 1), - EnumOption('DEBUG', 'debug version', 'no' - allowed_values=('yes', 'no', 'full'), - map={}, ignorecase=0), - ListOption('SHAREDLIBS', - 'libraries to build shared', - 'all', - names = list_of_libs), - PackageOption('X11', - 'use X11 from here', - '/usr/bin/X11'), - PathOption('QTDIR', 'root of Qt', qtdir), - ) - - Additionally, you can check for availability of the new - variables= keyword argument as follows: - - try: - env = Environment(variables=vars) - except TypeError: - env = Environment(options=vars) - - (Note that we plan to maintain the existing Options object - name for some time, to ensure backwards compatibility, - so in practice it may be easier to just continue to use - the old name until you're reasonably sure you won't have - people trying to build your software with versions of - SCons earlier than 0.98.1.) - - -- Use the EnsureSConsVersion() function to provide a - descriptive error message if your SConscript files - are executed by an earlier version of SCons: - - EnsureSConsVersion(0, 98, 1) - - -- THE BuildDir() METHOD AND FUNCTION WILL BE DEPRECATED - - The env.BuildDir() method and BuildDir() function are being - replaced by the new env.VariantDir() method and VariantDir() - function. - - In some future release a deprecation warning will be added - to existing uses of the env.BuildDir() method and BuildDir() - function. At some point after the deprecation warning, the - env.Builder() method and BuildDir() function will either - be removed entirely or have their behavior changed. - - You can prepare for this by changing all your uses of the - env.BuildDir() method to env.VariantDir() and uses of the - global BuildDir() function to VariantDir(). If you use a - named keyword argument of "build_dir" when calling - env.BuildDir() or BuildDir(): - - env.BuildDir(build_dir='opt', src_dir='src') - - The keyword must be changed to "variant_dir": - - env.VariantDir(variant_dir='opt', src_dir='src') - - NOTE: CHANGING USES OF env.BuildDir() AND BuildDir() to - env.VariantDir() AND VariantDir() IS NOT BACKWARDS COMPATIBLE - TO VERSIONS OF SCons BEFORE 0.98. YOUR SConscript FILES - WILL NOT WORK ON EARLIER VERSIONS OF SCons AFTER MAKING - THIS CHANGE. - - If you change SConscript files in software that you make - available for download or otherwise distribute, other users - may try to build your software with an earlier version of - SCons that does not have the env.VariantDir() method or - VariantDir() fnction. We recommend preparing for this in - one of two ways: - - -- Make your SConscript files backwards-compatible by - including the following code near the beginning of your - top-level SConstruct file: - - import SCons.Environment - try: - SCons.Environment.Environment.VariantDir - except AttributeError: - SCons.Environment.Environment.VariantDir = \ - SCons.Environment.Environment.BuildDir - - -- Use the EnsureSConsVersion() function to provide a - descriptive error message if your SConscript files - are executed by an earlier version of SCons: - - EnsureSConsVersion(0, 98) - - -- THE SConscript() "build_dir" KEYWORD ARGUMENT WILL BE DEPRECATED - - The "build_dir" keyword argument of the SConscript function - and env.SConscript() method are being replaced by a new - "variant_dir" keyword argument. - - In some future release a deprecation warning will be added - to existing uses of the SConscript()/env.SConscript() - "build_dir" keyword argument. At some point after the - deprecation warning, support for this keyword argument will - be removed entirely. - - You can prepare for this by changing all your uses of the - SConscript()/env.SConscript() 'build_dir" keyword argument: - - SConscript('src/SConscript', build_dir='opt') - - To use the new "variant_dir" keyword argument: - - SConscript('src/SConscript', variant_dir='opt') - - NOTE: USING THE NEW "variant_dir" KEYWORD IS NOT BACKWARDS - COMPATIBLE TO VERSIONS OF SCons BEFORE 0.98. YOUR SConscript - FILES WILL NOT WORK ON EARLIER VERSIONS OF SCons AFTER - MAKING THIS CHANGE. - - If you change SConscript files in software that you make - available for download or otherwise distribute, other users - may try to build your software with an earlier version of - SCons that does not support the "variant_dir" keyword. - - If you can insist that users use a recent version of SCons - that supports "variant_dir", we recommend using the - EnsureSConsVersion() function to provide a descriptive error - message if your SConscript files are executed by an earlier - version of SCons: - - EnsureSConsVersion(0, 98) - - If you want to make sure that your SConscript files will - still work with earlier versions of SCons, then your best - bet is to continue to use the "build_dir" keyword until the - support is removed (which, in all likelihood, won't happen - for quite some time). - - -- SCANNER NAMES HAVE BEEN DEPRECATED AND WILL BE REMOVED - - Several internal variable names in SCons.Defaults for various - pre-made default Scanner objects have been deprecated and will - be removed in a future revision. In their place are several new - global variable names that are now part of the publicly-supported - interface: - - NEW NAME DEPRECATED NAME - -------- ---------------------------- - CScanner SCons.Defaults.CScan - DSCanner SCons.Defaults.DScan - SourceFileScanner SCons.Defaults.ObjSourceScan - ProgramScanner SCons.Defaults.ProgScan - - Of these, only ObjSourceScan was probably used at all, to add - new mappings of file suffixes to other scanners for use by the - Object() Builder. This should now be done as follows: - - SourceFileScanner.add_scanner('.x', XScanner) - - -- THE env.Copy() METHOD WILL CHANGE OR GO AWAY ENTIRELY - - The env.Copy() method (to make a copy of a construction - environment) is being replaced by the env.Clone() method. - - As of SCons 0.98, a deprecation warning has been added to - current uses of the env.Copy() method. At some point in - the future, the env.Copy() method will either be removed - entirely or have its behavior changed. - - You can prepare for this by changing all your uses of env.Copy() - to env.Clone(), which has the exact same calling arguments. - - NOTE: CHANGING USES OF env.Copy() TO env.Clone() WILL MAKE - YOUR SConscript FILES NOT WORK ON VERSIONS OF SCons BEFORE - 0.96.93. - - If you change SConscript files in software that you make - available for download or otherwise distribute, other users - may try to build your software with an earlier version of - SCons that does not have the env.Clone() method. We recommend - preparing for this in one of two ways: - - -- Make your SConscript files backwards-compatible by - including the following code near the beginning of your - top-level SConstruct file: - - import SCons.Environment - try: - SCons.Environment.Environment.Clone - except AttributeError: - SCons.Environment.Environment.Clone = \ - SCons.Environment.Environment.Copy - - -- Use the EnsureSConsVersion() function to provide a - descriptive error message if your SConscript files - are executed by an earlier version of SCons: - - EnsureSConsVersion(0, 96, 93) - - -- THE CheckLib Configure TEST WILL CHANGE BEHAVIOR - - The CheckLib() Configure test appends the lib(s) to the - Environment's LIBS list in 1.3 and earlier. In 1.3 there is a - new CheckLib argument, append, which defaults to True to - preserve the old behavior. In a future release, append will - be changed to default to False, to conform with autoconf and - user expectations, since it is usually used to build up - library lists in a right-to-left way. - - - - SCons is developed with an extensive regression test suite, and a - rigorous development methodology for continually improving that suite. - Because of this, SCons is of sufficient quality that you can use it - for real work. - - The interfaces in release 1.0 will *not* be knowingly changed in - any new, future 1.x release. If an interface change should ever - become necessary due to extraordinary circumstances, the change - and an appropriate transition strategy will be documented in these - RELEASE notes. - - As you use SCons, please heed the following: - - - Please report any bugs or other problems that you find to our bug - tracker at our SourceForge project page: - - http://sourceforge.net/tracker/?func=add&group_id=30337&atid=398971 - - We have a reliable bug-fixing methodology already in place and - strive to respond to problems relatively quickly. - - - Documentation is spottier than we'd like. You may need to dive - into the source code to figure out how to do something. Asking - questions on the scons-users mailing list is also welcome. We - will be addressing the documentation in upcoming releases, but - would be more than glad to have your assistance in correcting this - problem... :-) - - - The "SCons Design" documentation on the SCons web site is very - out of date, as we made significant changes to portions of the - interface as we figured out what worked and what didn't during the - extensive beta implementation. The "SCons Design" document should - be used only for historical purposes, or for just an extremely - general understanding of SCons' architectural goals. - - - There may be performance issues. Improving SCons performance - is an ongoing priority. If you still find the performance - unacceptable, we would very much like to hear from you and learn - more about your configuration so we can optimize the right things. - - - Error messages don't always exist where they'd be helpful. - Please let us know about any errors you ran into that would - have benefitted from a (more) descriptive message. - - KNOWN PROBLEMS IN THIS RELEASE: - - For a complete list of known problems, consult the SCons Issue Tracker - at tigris.org: - - http://scons.tigris.org/project_issues.html - - - Support for parallel builds (-j) does not work on WIN32 systems - prior to *official* Python release 2.2 (not 2.2 pre-releases). - - Prior to Python 2.2, there is a bug in Python's Win32 - implementation such that when a thread spawns an external command, - it blocks all threads from running. This breaks the SCons - multithreading architecture used to support -j builds. - - We have included a patch file, os_spawnv_fix.diff, that you can - use if you you want to fix your version of Python to support - parallel builds in SCons. - - - Again, the "SCons Design" documentation on the SCons web site is - out of date. Take what you read there with a grain of salt. - - - On Win32 systems, you must put a space between the redirection - characters < and >, and the specified files (or construction - variable expansions): - - command < $SOURCE > $TARGET - - If you don't supply a space (for example, "<$SOURCE"), SCons will - not recognize the redirection. - - - MSVC .res files are not rebuilt when icons change. - - - The -c option does not clean up .sconsign files or directories - created as part of the build, and also does not clean up - SideEffect files (for example, Visual Studio .pdb files). - - - When using multiple Repositories, changing the name of an include - file can cause an old version of the file to be used. - - - There is currently no way to force use of a relative path (../*) - for directories outside the top-level SConstruct file. - - - The Jar() Builder will, on its second or subsequent invocation, - package up the .sconsign files that SCons uses to track signatures. - You can work around this by using the SConsignFile() function - to collect all of the .sconsign information into a single file - outside of the directory being packaged by Jar(). - - - SCons does not currently have a way to detect that an intermediate - file has been corrupted from outside and should be rebuilt. - - - Unicode characters in path names do not work in all circumstances. - - - SCons does not currently automatically check out SConstruct or - SConscript files from SCCS, RCS or BitKeeper. - - - No support yet for the following planned command-line options: - - -d -e -l --list-actions --list-derived --list-where - -o --override -p -r -R -w --write-filenames - -W --warn-undefined-variables - - - -Thank you for your interest, and please let us know how we can help -improve SCons for your needs. - --- The SCons Development Team - Gary Oberbrunner and Bill Deegan, maintainers - Thanks to all the contributors for all your help! diff --git a/MANIFEST.in b/MANIFEST.in index b5fa177..e509c38 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,3 @@ -global-exclude **Tests.py - recursive-include SCons/Tool/docbook * # For license file diff --git a/SCons/Script/Main.py b/SCons/Script/Main.py index d7b07a2..7aa3779 100644 --- a/SCons/Script/Main.py +++ b/SCons/Script/Main.py @@ -1371,14 +1371,13 @@ def main(): parts = ["SCons by Steven Knight et al.:\n"] try: import __main__ - parts.append(version_string("script", __main__)) + parts.append(version_string("SCons", __main__)) except (ImportError, AttributeError): # On Windows there is no scons.py, so there is no # __main__.__version__, hence there is no script version. pass - parts.append(version_string("engine", SCons)) - parts.append(path_string("engine", SCons)) - parts.append("__COPYRIGHT__") + parts.append(path_string("SCons", SCons)) + parts.append(SCons.__copyright__) version = ''.join(parts) from . import SConsOptions diff --git a/SCons/Tool/textfile.py b/SCons/Tool/textfile.py index b404304..bb8a0f9 100644 --- a/SCons/Tool/textfile.py +++ b/SCons/Tool/textfile.py @@ -124,8 +124,8 @@ def _action(target, source, env): # write the file try: target_file = open(target[0].get_path(), TEXTFILE_FILE_WRITE_MODE, newline='') - except (OSError, IOError): - raise SCons.Errors.UserError("Can't write target file %s" % target[0]) + except (OSError, IOError) as e: + raise SCons.Errors.UserError("Can't write target file %s [%s]" % (target[0],e)) # separate lines by 'linesep' only if linesep is not empty lsep = None diff --git a/SCons/Utilities/ConfigureCache.py b/SCons/Utilities/ConfigureCache.py index 80783a9..08faeae 100644 --- a/SCons/Utilities/ConfigureCache.py +++ b/SCons/Utilities/ConfigureCache.py @@ -36,19 +36,6 @@ import glob import json import os -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - -__version__ = "__VERSION__" - -__build__ = "__BUILD__" - -__buildsys__ = "__BUILDSYS__" - -__date__ = "__DATE__" - -__developer__ = "__DEVELOPER__" - - def rearrange_cache_entries(current_prefix_len, new_prefix_len): """Move cache files if prefix length changed. diff --git a/SCons/Utilities/sconsign.py b/SCons/Utilities/sconsign.py index 21aaabc..76a8233 100644 --- a/SCons/Utilities/sconsign.py +++ b/SCons/Utilities/sconsign.py @@ -23,18 +23,6 @@ # 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__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - -__version__ = "__VERSION__" - -__build__ = "__BUILD__" - -__buildsys__ = "__BUILDSYS__" - -__date__ = "__DATE__" - -__developer__ = "__DEVELOPER__" - import getopt import os import sys diff --git a/SCons/__init__.py b/SCons/__init__.py index 1cbe18b..8520fe0 100644 --- a/SCons/__init__.py +++ b/SCons/__init__.py @@ -1,49 +1,9 @@ -"""SCons - -The main package for the SCons software construction utility. - -""" - -# -# __COPYRIGHT__ -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files (the -# "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to -# permit persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# - -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - -__version__ = "__VERSION__" - -__build__ = "__BUILD__" - -__buildsys__ = "__BUILDSYS__" - -__date__ = "__DATE__" - -__developer__ = "__DEVELOPER__" - +__version__="3.9.9a996" +__copyright__="Copyright (c) 2001 - 2020 The SCons Foundation" +__developer__="bdbaddog" +__date__="2020-06-30 23:00:35" +__buildsys__="ProDog2020" +__revision__="8e18d0c324c2605936198e64d349c89082b1463d" +__build__="8e18d0c324c2605936198e64d349c89082b1463d" # make sure compatibility is always in place -import SCons.compat - -# Local Variables: -# tab-width:4 -# indent-tabs-mode:nil -# End: -# vim: set expandtab tabstop=4 shiftwidth=4: +import SCons.compat # noqa
\ No newline at end of file @@ -2,11 +2,15 @@ # SConstruct file to build scons packages during development. # # See the README.rst file for an overview of how SCons is built and tested. +import os.path +import sys +import textwrap +from time import strftime -copyright_years = '2001 - 2019' +copyright_years = strftime('2001 - %Y') # This gets inserted into the man pages to reflect the month of release. -month_year = 'December 2019' +month_year = strftime('%B %Y') # # __COPYRIGHT__ @@ -31,13 +35,9 @@ month_year = 'December 2019' # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -import os.path -import sys -import textwrap - project = 'scons' -default_version = '3.9.9' +default_version = '3.9.9a996' copyright = "Copyright (c) %s The SCons Foundation" % copyright_years # @@ -46,10 +46,10 @@ copyright = "Copyright (c) %s The SCons Foundation" % copyright_years # people to still do SCons packaging work even if they don't have all # of the utilities installed # -print("git :%s"%git) -print("gzip :%s"%gzip) -print("unzip :%s"%unzip) -print("zip :%s"%zip_path) +print("git :%s" % git) +print("gzip :%s" % gzip) +print("unzip :%s" % unzip) +print("zip :%s" % zip_path) # # Adding some paths to sys.path, this is mainly needed @@ -65,12 +65,10 @@ for a in addpaths: command_line = BuildCommandLine(default_version) command_line.process_command_line_vars() - Default('.', command_line.build_dir) # Just make copies, don't symlink them. SetOption('duplicate', 'copy') - packaging_flavors = [ ('tar-gz', "The normal .tar.gz file for end-user installation."), ('local-tar-gz', "A .tar.gz file for dropping into other software " + @@ -96,12 +94,12 @@ unpack_zip_dir = os.path.join(command_line.build_dir, "unpack-zip") if is_windows(): tar_hflag = '' - python_project_subinst_dir = os.path.join("Lib", "site-packages", project) - project_script_subinst_dir = 'Scripts' +# python_project_subinst_dir = os.path.join("Lib", "site-packages", project) +# project_script_subinst_dir = 'Scripts' else: tar_hflag = 'h' - python_project_subinst_dir = os.path.join("lib", project) - project_script_subinst_dir = 'bin' +# python_project_subinst_dir = os.path.join("lib", project) +# project_script_subinst_dir = 'bin' indent_fmt = ' %-26s ' @@ -139,7 +137,6 @@ revaction = SCons_revision revbuilder = Builder(action=Action(SCons_revision, varlist=['COPYRIGHT', 'VERSION'])) - env = Environment( ENV=command_line.ENV, @@ -163,7 +160,8 @@ env = Environment( UNZIP=unzip, UNZIPFLAGS='-o -d $UNPACK_ZIP_DIR', - ZCAT=zcat, + # ZCAT=zcat, + # ZIPID=zipit, TEST_SRC_TAR_GZ_DIR=test_src_tar_gz_dir, TEST_SRC_ZIP_DIR=test_src_zip_dir, @@ -182,7 +180,9 @@ env = Environment( Version_values = [Value(command_line.version), Value(command_line.build_id)] +installed_local_files = create_local_packages(env) +update_init_file(env) # # # @@ -193,3 +193,15 @@ Export('command_line', 'env', 'whereis', 'revaction') SConscript('doc/SConscript') + +# Build packages for pypi +env.Command('$DISTDIR/SCons-${VERSION}-py3-none-any.whl', ['setup.cfg', 'setup.py', 'SCons/__init__.py'], + '$PYTHON setup.py bdist_wheel') + +env.Command('$DISTDIR/SCons-${VERSION}.zip', ['setup.cfg', 'setup.py', 'SCons/__init__.py'], + '$PYTHON setup.py sdist --format=zip') +env.Command('$DISTDIR/SCons-${VERSION}.tar.bz2', ['setup.cfg', 'setup.py', 'SCons/__init__.py'], + '$PYTHON setup.py sdist --format=bztar') + +# TODO add auto copyright date to README.rst, LICENSE +# TODO build API DOCS diff --git a/doc/Makefile b/doc/Makefile index 4da19e3..87c9643 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -7,14 +7,21 @@ SPHINXBUILD = sphinx-build SPHINXPROJ = SCons SOURCEDIR = sphinx BUILDDIR = ../build/doc/api +DOCTREES = ../build/doc/api # Put it first so that "make" without argument is like "make help". help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) .PHONY: help Makefile + # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + $(SPHINXBUILD) -M $@ -d "$(DOCTREES)" "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + + + +# For macports need +# sudo port install texlive-latex-recommended texlive-fonts-recommended texlive-latex-extra diff --git a/doc/SConscript b/doc/SConscript index 46fb5ff..cebb9bd 100644 --- a/doc/SConscript +++ b/doc/SConscript @@ -54,7 +54,6 @@ if not fop and not xep: print("doc: No PDF renderer found (fop|xep)!") skip_doc = True - skip_doc_arg = ARGUMENTS.get('SKIP_DOC') if skip_doc_arg is not None: skip_doc = skip_doc_arg in ['True', '1', 'true'] @@ -66,7 +65,6 @@ env = env.Clone() build = os.path.join(command_line.build_dir, 'doc') - gs = whereis('gs') lynx = whereis('lynx') @@ -76,7 +74,8 @@ tar_deps = [] tar_list = [] orig_env = env -env = orig_env.Clone(SCONS_PY = File('#/scripts/scons.py').rfile()) +env = orig_env.Clone(SCONS_PY=File('#/scripts/scons.py').rfile()) + # # --- Helpers --- @@ -86,12 +85,12 @@ def writeVersionXml(verfile, date, ver, rev): try: os.unlink(verfile) except OSError: - pass # okay if the file didn't exist + pass # okay if the file didn't exist dir, f = os.path.split(verfile) try: os.makedirs(dir) except OSError: - pass # okay if the directory already exists + pass # okay if the directory already exists with open(verfile, "w") as vf: vf.write("""<!-- THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. @@ -103,7 +102,7 @@ THIS IS AN AUTOMATICALLY-GENERATED FILE. DO NOT EDIT. # The names of the target files for the MAN pages -man_page_list = ['scons.1','scons-time.1','sconsign.1'] +man_page_list = ['scons.1', 'scons-time.1', 'sconsign.1'] # Template for the MAN page texts when we can't properly # create them because the skip_doc flag is set (required @@ -135,16 +134,17 @@ if skip_doc: os.makedirs(scdir) import time + today = time.strftime("%Y-%m-%d", - time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))) + time.gmtime(int(os.environ.get('SOURCE_DATE_EPOCH', time.time())))) version = env.subst('$VERSION') for m in man_page_list: man, _ = os.path.splitext(m) fman = open(os.path.join(scdir, m), "w") - fman.write(man_replace_tpl % {'uctitle' : man.upper().replace("-", "\\-"), - 'today' : today, - 'title' : man, - 'version' : version}) + fman.write(man_replace_tpl % {'uctitle': man.upper().replace("-", "\\-"), + 'today': today, + 'title': man, + 'version': version}) fman.close() else: if not lynx: @@ -162,6 +162,8 @@ else: import shutil import SCons.Builder import SCons.Util + + # # Builder for copying files to an Install dir, based # on their extension (better: glob matching pattern)... @@ -173,6 +175,8 @@ else: source = [source] for t, s in zip(target, source): shutil.copy(str(s), str(t)) + + def _glob_install_emitter(target, source, env): if not SCons.Util.is_List(target): target = [target] @@ -187,10 +191,13 @@ else: res.append(os.path.join(str(tdir), tail)) res_src.append(g) return res, res_src + + _glob_install_builder = SCons.Builder.Builder(action=_glob_install_action, emitter=_glob_install_emitter) env['BUILDERS']['GlobInstall'] = _glob_install_builder + # # Builder for copying ChunkedHTML files to an Install dir... # @@ -204,6 +211,7 @@ else: for g in glob.glob(spattern): shutil.copy(g, tdir) + def _chunked_install_emitter(target, source, env): if not SCons.Util.is_List(target): target = [target] @@ -213,6 +221,8 @@ else: tdir = env.Dir(target[0]) head, tail = os.path.split(str(source[0])) return os.path.join(str(tdir), tail), source + + _chunked_install_builder = SCons.Builder.Builder(action=_chunked_install_action, emitter=_chunked_install_emitter) env['BUILDERS']['ChunkedInstall'] = _chunked_install_builder @@ -230,15 +240,17 @@ else: sys.exit(1) print("Checking whether all example names are unique...") - if SConsExamples.exampleNamesAreUnique(os.path.join('doc','user')): + if SConsExamples.exampleNamesAreUnique(os.path.join('doc', 'user')): print("OK") else: - print("Not all example names and suffixes are unique! Please correct the errors listed above and try again.") + print( + "Not all example names and suffixes are unique! Please correct the errors listed above and try again.") sys.exit(1) # List of prerequisite files in the build/doc folder buildsuite = [] + def copy_dbfiles(env, toolpath, paths, fpattern, use_builddir=True): """ Helper function, copies a bunch of files matching the given fpattern to a target directory. @@ -252,20 +264,21 @@ else: fpattern = [fpattern] if use_builddir: - target_dir = env.Dir(os.path.join(command_line.build_dir, *(toolpath+paths))) + target_dir = env.Dir(os.path.join(command_line.build_dir, *(toolpath + paths))) buildsuite.extend(env.GlobInstall(target_dir, - os.path.join('..', *(toolpath+paths+fpattern)))) + os.path.join('..', *(toolpath + paths + fpattern)))) else: - target_dir = env.Dir(os.path.join(*(toolpath+paths))) + target_dir = env.Dir(os.path.join(*(toolpath + paths))) buildsuite.extend(env.GlobInstall(target_dir, os.path.join(*(paths + fpattern)))) + # # Copy generated files (.gen/.mod/.xml) to the build folder # copy_dbfiles(env, build, 'generated', '*.gen', False) copy_dbfiles(env, build, 'generated', '*.mod', False) - copy_dbfiles(env, build, ['generated','examples'], '*', False) + copy_dbfiles(env, build, ['generated', 'examples'], '*', False) # # Copy XSLT files (.xslt) to the build folder @@ -316,13 +329,13 @@ else: DOCTARGETS = 0 DOCDEPENDS = 1 DOCNODES = 2 - docs = {'design' : (['chunked','pdf'], [], []), - #'python10' : (['chunked','html','pdf'], [], []), - 'reference' : (['chunked','html','pdf'], [], []), - #'developer' : (['chunked','html','pdf'], [], []), - 'user' : (['chunked','html','pdf','epub','text'], [], []), - 'man' : (['man','epub','text'], [], []) - } + docs = {'design': (['chunked', 'pdf'], [], []), + # 'python10' : (['chunked','html','pdf'], [], []), + 'reference': (['chunked', 'html', 'pdf'], [], []), + # 'developer' : (['chunked','html','pdf'], [], []), + 'user': (['chunked', 'html', 'pdf', 'epub', 'text'], [], []), + 'man': (['man', 'epub', 'text'], [], []) + } # # We have to tell SCons to scan the top-level XML files which @@ -368,13 +381,12 @@ else: target_dir = os.path.join(build, doc) if ext in ['.fig', '.jpg', '.svg']: docs[doc][DOCDEPENDS].extend(env.Command(build_s, doc_s, - Copy("$TARGET", "$SOURCE"))) + Copy("$TARGET", "$SOURCE"))) else: btarget = env.File(build_s) docs[doc][DOCDEPENDS].append(btarget) revaction([btarget], [env.File(doc_s)], env) - # # For each document, build the document itself in HTML, # and PDF formats. @@ -407,7 +419,7 @@ else: sctargets.append(os.path.join(scdir, 'scons-%s.html' % man)) docs[doc][DOCNODES].extend(env.Command(sctargets, buildsuite + docs[doc][DOCDEPENDS], - "cd %s && $PYTHON ${SCONS_PY.abspath}%s" % (scdir, cleanopt))) + "cd %s && $PYTHON ${SCONS_PY.abspath}%s" % (scdir, cleanopt))) install_css = False for doc in docs: @@ -421,7 +433,7 @@ else: text = os.path.join(build, 'TEXT', 'scons-%s.txt' % doc) if 'chunked' in docs[doc][DOCTARGETS]: installed_chtml = env.ChunkedInstall(env.Dir(htmldir), - os.path.join(build, doc,'scons-%s' % doc, 'index.html')) + os.path.join(build, doc, 'scons-%s' % doc, 'index.html')) installed_chtml_css = env.Install(env.Dir(htmldir), os.path.join(build, doc, 'scons.css')) env.Depends(installed_chtml, docs[doc][DOCNODES]) @@ -433,7 +445,7 @@ else: env.Ignore(htmlindex, version_xml) if 'html' in docs[doc][DOCTARGETS]: - env.InstallAs(env.File(html), env.File(os.path.join(build, doc,'index.html'))) + env.InstallAs(env.File(html), env.File(os.path.join(build, doc, 'index.html'))) tar_deps.extend([html]) tar_list.extend([html]) Local(html) @@ -441,7 +453,7 @@ else: install_css = True if 'pdf' in docs[doc][DOCTARGETS]: - env.InstallAs(env.File(pdf), env.File(os.path.join(build, doc,'scons-%s.pdf' % doc))) + env.InstallAs(env.File(pdf), env.File(os.path.join(build, doc, 'scons-%s.pdf' % doc))) Local(pdf) env.Ignore(pdf, version_xml) @@ -449,7 +461,7 @@ else: tar_list.append(pdf) if 'epub' in docs[doc][DOCTARGETS] and gs: - env.InstallAs(env.File(epub), env.File(os.path.join(build, doc,'scons-%s.epub' % doc))) + env.InstallAs(env.File(epub), env.File(os.path.join(build, doc, 'scons-%s.epub' % doc))) Local(epub) env.Ignore(epub, version_xml) @@ -457,8 +469,8 @@ else: tar_list.append(epub) if ('text' in docs[doc][DOCTARGETS] and lynx and - (('html' in docs[doc][DOCTARGETS]) or (doc == 'man'))): - texthtml = os.path.join(build, doc,'index.html') + (('html' in docs[doc][DOCTARGETS]) or (doc == 'man'))): + texthtml = os.path.join(build, doc, 'index.html') if doc == 'man': # Special handling for single MAN file texthtml = os.path.join(build, doc, 'scons-scons.html') @@ -471,7 +483,6 @@ else: tar_deps.append(text) tar_list.append(text) - if 'man' in docs[doc][DOCTARGETS]: # # Man page(s) @@ -480,84 +491,51 @@ else: man, _1 = os.path.splitext(m) pdf = os.path.join(build, 'PDF', '%s-man.pdf' % man) - html = os.path.join(build, 'HTML' , '%s-man.html' % man) + html = os.path.join(build, 'HTML', '%s-man.html' % man) - env.InstallAs(env.File(pdf), env.File(os.path.join(build, 'man','scons-%s.pdf' % man))) - env.InstallAs(env.File(html), env.File(os.path.join(build, 'man','scons-%s.html' % man))) + env.InstallAs(env.File(pdf), env.File(os.path.join(build, 'man', 'scons-%s.pdf' % man))) + env.InstallAs(env.File(html), env.File(os.path.join(build, 'man', 'scons-%s.html' % man))) tar_deps.extend([pdf, html]) tar_list.extend([pdf, html]) - # Install CSS file, common to all single HTMLs if install_css: css_file = os.path.join(build, 'HTML', 'scons.css') env.InstallAs(env.File(css_file), - env.File(os.path.join(build, 'user','scons.css'))) + env.File(os.path.join(build, 'user', 'scons.css'))) tar_deps.extend([css_file]) tar_list.extend([css_file]) Local(css_file) if not skip_doc: - if True: #not epydoc_cli and not epydoc: - print("doc: epydoc not found, skipping building API documentation.") - else: - # XXX Should be in common with reading the same thing in - # the SConstruct file. - # bootstrap.py runs outside of SCons, so need to process the path - e = Dir('#').rstr() - sources = bootstrap.parseManifestLines(e, os.path.join(e, 'MANIFEST.in')) - - # Omit some files: - # - # Don't omit Platform as we need Platform.virtualenv for the examples to be run - # sources = [x for x in sources if x.find('Platform') == -1] - sources = [x for x in sources if x.find('Tool') == -1] - sources = [x for x in sources if x.find('Options') == -1] - - e = os.path.join(build, '..', 'scons', 'engine') - sources = [os.path.join(e, x) for x in sources] - - htmldir = os.path.join(build, 'HTML', 'scons-api') - env.Command('${OUTDIR}/index.html', sources, epydoc_commands, - EPYDOC=epydoc_cli, EPYDOCFLAGS='--html', OUTDIR=htmldir) - tar_deps.append(htmldir) - tar_list.append(htmldir) - - if sys.platform == 'darwin' or not epydoc_cli: - print("doc: command line epydoc is not found, skipping PDF/PS/Tex output") - else: - # PDF and PostScript and TeX are built from the - # same invocation. - api_dir = os.path.join(build, 'scons-api') - api_pdf = os.path.join(api_dir, 'api.pdf') - api_ps = os.path.join(api_dir, 'api.ps') - api_tex = os.path.join(api_dir, 'api.tex') - api_targets = [api_pdf, api_ps, api_tex] - env.Command(api_targets, sources, epydoc_commands, - EPYDOC=epydoc_cli, EPYDOCFLAGS='--pdf', OUTDIR=api_dir) - Local(api_targets) - - pdf_install = os.path.join(build, 'PDF', 'scons-api.pdf') - env.InstallAs(pdf_install, api_pdf) - tar_deps.append(pdf_install) - tar_list.append(pdf_install) - Local(pdf_install) - - ps_install = os.path.join(build, 'PS', 'scons-api.ps') - env.InstallAs(ps_install, api_ps) - tar_deps.append(ps_install) - tar_list.append(ps_install) - Local(ps_install) + # Build API DOCS + # TODO: Better specify dependencies on source files + pdf_file = env.Command('#/build/doc/api/scons-api.pdf', + env.Glob('#/SCons/*'), + [Delete("#/build/doc/api"), + "cd doc && make pdf"]) + pdf_install = os.path.join(build, 'PDF', 'scons-api.pdf') + env.InstallAs(pdf_install, pdf_file) + tar_deps.append(pdf_install) + tar_list.append(pdf_install) + + htmldir = os.path.join(build, 'HTML', 'scons-api') + html_files = env.Command('#/build/doc/HTML/scons-api/index.html', + env.Glob('#/SCons/*'), + "cd doc && make dirhtml BUILDDIR=${HTMLDIR}", + HTMLDIR=htmldir) + tar_deps.append(htmldir) + tar_list.append(htmldir) # # Now actually create the tar file of the documentation, # for easy distribution to the web site. # if tar_deps: - tar_list = ' '.join([x.replace(build+'/', '') for x in tar_list]) + tar_list = ' '.join([x.replace(build + '/', '') for x in tar_list]) t = env.Command(dist_doc_tar_gz, tar_deps, - "tar cf${TAR_HFLAG} - -C %s %s | gzip > $TARGET" % (build, tar_list)) + "tar cf${TAR_HFLAG} - -C %s %s | gzip > $TARGET" % (build, tar_list)) AddPostAction(dist_doc_tar_gz, Chmod(dist_doc_tar_gz, 0o644)) Local(t) Alias('doc', t) diff --git a/doc/generated/builders.gen b/doc/generated/builders.gen index 77f9bfb..94c8eff 100644 --- a/doc/generated/builders.gen +++ b/doc/generated/builders.gen @@ -18,7 +18,7 @@ <listitem><para> Builds a C source file given a lex (<filename>.l</filename>) or yacc (<filename>.y</filename>) input file. -The suffix specified by the &cv-link-CFILESUFFIX; construction variable +The suffix specified by the &cv-link-CFILESUFFIX; &consvar; (<filename>.c</filename> by default) is automatically added to the target if it is not already present. @@ -90,7 +90,7 @@ env.CompilationDatabase('my_output.json') Builds a C++ source file given a lex (<filename>.ll</filename>) or yacc (<filename>.yy</filename>) input file. -The suffix specified by the &cv-link-CXXFILESUFFIX; construction variable +The suffix specified by the &cv-link-CXXFILESUFFIX; &consvar; (<filename>.cc</filename> by default) is automatically added to the target if it is not already present. @@ -1737,18 +1737,19 @@ builder method; see that builder method's description for a list of legal source file suffixes and how they are interpreted. -The target executable file prefix -(specified by the &cv-link-PROGPREFIX; construction variable; nothing by default) -and suffix -(specified by the &cv-link-PROGSUFFIX; construction variable; -by default, <filename>.exe</filename> on Windows systems, -nothing on POSIX systems) +The target executable file prefix, +specified by the &cv-link-PROGPREFIX; &consvar; +(nothing by default), +and suffix, +specified by the &cv-link-PROGSUFFIX; &consvar; +(by default, <filename>.exe</filename> on Windows systems, +nothing on POSIX systems), are automatically added to the target if not already present. Example: </para> <example_commands> -env.Program(target = 'foo', source = ['foo.o', 'bar.c', 'baz.f']) +env.Program(target='foo', source=['foo.o', 'bar.c', 'baz.f']) </example_commands> </listitem> </varlistentry> @@ -1925,30 +1926,28 @@ or C, C++, D or Fortran source files. If any source files are given, then they will be automatically compiled to object files. -The static library prefix and suffix (if any) -are automatically added to the target. -The target library file prefix -(specified by the &cv-link-SHLIBPREFIX; construction variable; -by default, <filename>lib</filename> on POSIX systems, -nothing on Windows systems) -and suffix -(specified by the &cv-link-SHLIBSUFFIX; construction variable; -by default, <filename>.dll</filename> on Windows systems, -<filename>.so</filename> on POSIX systems) +The target library file prefix, +specified by the &cv-link-SHLIBPREFIX; &consvar; +(by default, <filename>lib</filename> on POSIX systems, +nothing on Windows systems), +and suffix, +specified by the &cv-link-SHLIBSUFFIX; &consvar; +(by default, <filename>.dll</filename> on Windows systems, +<filename>.so</filename> on POSIX systems), are automatically added to the target if not already present. Example: </para> <example_commands> -env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o']) +env.SharedLibrary(target='bar', source=['bar.c', 'foo.o']) </example_commands> <para> On Windows systems, the &b-SharedLibrary; -builder method will always build an import -(<filename>.lib</filename>) library -in addition to the shared (<filename>.dll</filename>) library, +builder method will always build an import library +(<filename>.lib</filename>) +in addition to the shared library (<filename>.dll</filename>), adding a <filename>.lib</filename> library with the same basename if there is not already a <filename>.lib</filename> file explicitly listed in the targets. @@ -1957,9 +1956,9 @@ listed in the targets. <para> On Cygwin systems, the &b-SharedLibrary; -builder method will always build an import -(<filename>.dll.a</filename>) library -in addition to the shared (<filename>.dll</filename>) library, +builder method will always build an import library +(<filename>.dll.a</filename>) +in addition to the shared library (<filename>.dll</filename>), adding a <filename>.dll.a</filename> library with the same basename if there is not already a <filename>.dll.a</filename> file explicitly listed in the targets. @@ -1967,7 +1966,7 @@ listed in the targets. <para> Any object files listed in the -<literal>source</literal> +<parameter>source</parameter> must have been built for a shared library (that is, using the &b-SharedObject; @@ -1980,37 +1979,37 @@ will raise an error if there is any mismatch. On some platforms, there is a distinction between a shared library (loaded automatically by the system to resolve external references) and a loadable module (explicitly loaded by user action). -For maximum portability, use the &b-LoadableModule; builder for the latter. +For maximum portability, use the &b-link-LoadableModule; builder for the latter. </para> <para> -When the &cv-link-SHLIBVERSION; construction variable is defined a versioned -shared library is created. This modifies the &cv-link-SHLINKFLAGS; as required, -adds the version number to the library name, and creates the symlinks that -are needed. +When the &cv-link-SHLIBVERSION; &consvar; is defined, a versioned +shared library is created. This modifies &cv-link-SHLINKFLAGS; as required, +adds the version number to the library name, and creates any +symbolic links that are needed. </para> <example_commands> -env.SharedLibrary(target = 'bar', source = ['bar.c', 'foo.o'], SHLIBVERSION='1.5.2') +env.SharedLibrary(target='bar', source=['bar.c', 'foo.o'], SHLIBVERSION='1.5.2') </example_commands> <para> On a POSIX system, versions with a single token create exactly one symlink: -libbar.so.6 would have symlinks libbar.so only. +<filename>libbar.so.6</filename> would have symlink <filename>libbar.so</filename> only. On a POSIX system, versions with two or more -tokens create exactly two symlinks: libbar.so.2.3.1 would have symlinks -libbar.so and libbar.so.2; on a Darwin (OSX) system the library would be -libbar.2.3.1.dylib and the link would be libbar.dylib. +tokens create exactly two symlinks: <filename>libbar.so.2.3.1</filename> would have symlinks +<filename>libbar.so</filename> and <filename>libbar.so.2</filename>; on a Darwin (OSX) system the library would be +<filename>libbar.2.3.1.dylib</filename> and the link would be <filename>libbar.dylib</filename>. </para> <para> On Windows systems, specifying -<literal>register=1</literal> +<parameter>register=1</parameter> will cause the <filename>.dll</filename> to be -registered after it is built using REGSVR32. -The command that is run -("regsvr32" by default) is determined by &cv-link-REGSVR; construction -variable, and the flags passed are determined by &cv-link-REGSVRFLAGS;. By +registered after it is built. +The command that is run is determined by the &cv-link-REGSVR; &consvar; +(<command>regsvr32</command> by default), +and the flags passed are determined by &cv-link-REGSVRFLAGS;. By default, &cv-link-REGSVRFLAGS; includes the <option>/s</option> option, to prevent dialogs from popping up and requiring user attention when it is run. If you change @@ -2019,9 +2018,7 @@ For example, </para> <example_commands> -env.SharedLibrary(target = 'bar', - source = ['bar.cxx', 'foo.obj'], - register=1) +env.SharedLibrary(target='bar', source=['bar.cxx', 'foo.obj'], register=1) </example_commands> <para> @@ -2034,7 +2031,7 @@ when it is done linking it. <term><function>SharedObject</function>()</term> <term><replaceable>env</replaceable>.<methodname>SharedObject</methodname>()</term> <listitem><para> -Builds an object file for +Builds an object file intended for inclusion in a shared library. Source files must have one of the same set of extensions specified above for the @@ -2042,7 +2039,7 @@ specified above for the builder method. On some platforms building a shared object requires additional compiler option -(e.g. <option>-fPIC</option> for gcc) +(e.g. <option>-fPIC</option> for <command>gcc</command>) in addition to those needed to build a normal (static) object, but on some platforms there is no difference between a shared object and a normal (static) one. When there is a difference, SCons @@ -2052,25 +2049,25 @@ difference, SCons will allow both normal (static) and shared objects to be linked into a shared library, and will use the same suffix for shared and normal (static) objects. -The target object file prefix -(specified by the &cv-link-SHOBJPREFIX; construction variable; -by default, the same as &cv-link-OBJPREFIX;) -and suffix -(specified by the &cv-link-SHOBJSUFFIX; construction variable) +The target object file prefix, +specified by the &cv-link-SHOBJPREFIX; &consvar; +(by default, the same as &cv-link-OBJPREFIX;), +and suffix, +specified by the &cv-link-SHOBJSUFFIX; &consvar;, are automatically added to the target if not already present. Examples: </para> <example_commands> -env.SharedObject(target = 'ddd', source = 'ddd.c') -env.SharedObject(target = 'eee.o', source = 'eee.cpp') -env.SharedObject(target = 'fff.obj', source = 'fff.for') +env.SharedObject(target='ddd', source='ddd.c') +env.SharedObject(target='eee.o', source='eee.cpp') +env.SharedObject(target='fff.obj', source='fff.for') </example_commands> <para> Note that the source files will be scanned according to the suffix mappings in the -<literal>SourceFileScanner</literal> +<classname>SourceFileScanner</classname> object. See the section "Scanner Objects," below, for more information. @@ -2086,27 +2083,25 @@ or C, C++, D or Fortran source files. If any source files are given, then they will be automatically compiled to object files. -The static library prefix and suffix (if any) -are automatically added to the target. -The target library file prefix -(specified by the &cv-link-LIBPREFIX; construction variable; -by default, <filename>lib</filename> on POSIX systems, -nothing on Windows systems) -and suffix -(specified by the &cv-link-LIBSUFFIX; construction variable; -by default, <filename>.lib</filename> on Windows systems, -<filename>.a</filename> on POSIX systems) +The static library file prefix, +specified by the &cv-link-LIBPREFIX; &consvar; +(by default, <filename>lib</filename> on POSIX systems, +nothing on Windows systems), +and suffix, +specified by the &cv-link-LIBSUFFIX; &consvar; +(by default, <filename>.lib</filename> on Windows systems, +<filename>.a</filename> on POSIX systems), are automatically added to the target if not already present. Example: </para> <example_commands> -env.StaticLibrary(target = 'bar', source = ['bar.c', 'foo.o']) +env.StaticLibrary(target='bar', source=['bar.c', 'foo.o']) </example_commands> <para> Any object files listed in the -<literal>source</literal> +<parameter>source</parameter> must have been built for a static library (that is, using the &b-StaticObject; @@ -2157,26 +2152,27 @@ Source files must have one of the following extensions: </example_commands> <para> -The target object file prefix -(specified by the &cv-link-OBJPREFIX; construction variable; nothing by default) -and suffix -(specified by the &cv-link-OBJSUFFIX; construction variable; -<filename>.obj</filename> on Windows systems, -<filename>.o</filename> on POSIX systems) +The target object file prefix, +specified by the &cv-link-OBJPREFIX; &consvar; +(nothing by default), +and suffix, +specified by the &cv-link-OBJSUFFIX; &consvar; +(<filename>.obj</filename> on Windows systems, +<filename>.o</filename> on POSIX systems), are automatically added to the target if not already present. Examples: </para> <example_commands> -env.StaticObject(target = 'aaa', source = 'aaa.c') -env.StaticObject(target = 'bbb.o', source = 'bbb.c++') -env.StaticObject(target = 'ccc.obj', source = 'ccc.f') +env.StaticObject(target='aaa', source='aaa.c') +env.StaticObject(target='bbb.o', source='bbb.c++') +env.StaticObject(target='ccc.obj', source='ccc.f') </example_commands> <para> Note that the source files will be scanned -according to the suffix mappings in -<literal>SourceFileScanner</literal> +according to the suffix mappings in the +<classname>SourceFileScanner</classname> object. See the section "Scanner Objects," below, for more information. @@ -2187,28 +2183,35 @@ below, for more information. <term><function>Substfile</function>()</term> <term><replaceable>env</replaceable>.<methodname>Substfile</methodname>()</term> <listitem><para> -The &b-Substfile; builder creates a single text file from another file or set of -files by concatenating them with &cv-LINESEPARATOR; and replacing text -using the &cv-SUBST_DICT; construction variable. Nested lists of source files -are flattened. See also &b-Textfile;. +The &b-Substfile; builder creates a single text file from +a template consisting of a file or set of files (or nodes), +replacing text using the &cv-link-SUBST_DICT; &consvar; (if set). +If a set, they are concatenated into the target file +using the value of the +&cv-link-LINESEPARATOR; &consvar; as a separator between contents; +the separator is not emitted after the contents of the last file. +Nested lists of source files +are flattened. See also &b-link-Textfile;. </para> <para> -If a single source file is present with an <filename>.in</filename> suffix, -the suffix is stripped and the remainder is used as the default target name. +If a single source file name is specified and has a <filename>.in</filename> suffix, +the suffix is stripped and the remainder of the name is used as the default target name. </para> <para> -The prefix and suffix specified by the &cv-SUBSTFILEPREFIX; -and &cv-SUBSTFILESUFFIX; construction variables +The prefix and suffix specified by the &cv-link-SUBSTFILEPREFIX; +and &cv-link-SUBSTFILESUFFIX; &consvars; (an empty string by default in both cases) are automatically added to the target if they are not already present. </para> <para> -If a construction variable named &cv-SUBST_DICT; is present, -it may be either a Python dictionary or a sequence of (key,value) tuples. -If it is a dictionary it is converted into a list of tuples in an arbitrary order, +If a construction variable named &cv-link-SUBST_DICT; is present, +it may be either a Python dictionary or a sequence of +(<replaceable>key</replaceable>, <replaceable>value</replaceable>) tuples. +If it is a dictionary it is converted into a list of tuples +with unspecified order, so if one key is a prefix of another key or if one substitution could be further expanded by another subsitition, it is unpredictable whether the expansion will occur. @@ -2228,42 +2231,40 @@ env = Environment(tools=['default']) env['prefix'] = '/usr/bin' script_dict = {'@prefix@': '/bin', '@exec_prefix@': '$prefix'} -env.Substfile('script.in', SUBST_DICT = script_dict) +env.Substfile('script.in', SUBST_DICT=script_dict) conf_dict = {'%VERSION%': '1.2.3', '%BASE%': 'MyProg'} -env.Substfile('config.h.in', conf_dict, SUBST_DICT = conf_dict) +env.Substfile('config.h.in', conf_dict, SUBST_DICT=conf_dict) # UNPREDICTABLE - one key is a prefix of another bad_foo = {'$foo': '$foo', '$foobar': '$foobar'} -env.Substfile('foo.in', SUBST_DICT = bad_foo) +env.Substfile('foo.in', SUBST_DICT=bad_foo) # PREDICTABLE - keys are applied longest first good_foo = [('$foobar', '$foobar'), ('$foo', '$foo')] -env.Substfile('foo.in', SUBST_DICT = good_foo) +env.Substfile('foo.in', SUBST_DICT=good_foo) # UNPREDICTABLE - one substitution could be futher expanded bad_bar = {'@bar@': '@soap@', '@soap@': 'lye'} -env.Substfile('bar.in', SUBST_DICT = bad_bar) +env.Substfile('bar.in', SUBST_DICT=bad_bar) # PREDICTABLE - substitutions are expanded in order good_bar = (('@bar@', '@soap@'), ('@soap@', 'lye')) -env.Substfile('bar.in', SUBST_DICT = good_bar) +env.Substfile('bar.in', SUBST_DICT=good_bar) # the SUBST_DICT may be in common (and not an override) substutions = {} subst = Environment(tools=['textfile'], SUBST_DICT=substitutions) substitutions['@foo@'] = 'foo' subst['SUBST_DICT']['@bar@'] = 'bar' -subst.Substfile('pgm1.c', [Value('#include "@foo@.h"'), - Value('#include "@bar@.h"'), - "common.in", - "pgm1.in" - ]) -subst.Substfile('pgm2.c', [Value('#include "@foo@.h"'), - Value('#include "@bar@.h"'), - "common.in", - "pgm2.in" - ]) +subst.Substfile( + 'pgm1.c', + [Value('#include "@foo@.h"'), Value('#include "@bar@.h"'), "common.in", "pgm1.in"], +) +subst.Substfile( + 'pgm2.c', + [Value('#include "@foo@.h"'), Value('#include "@bar@.h"'), "common.in", "pgm2.in"], +) </example_commands> </listitem> @@ -2313,66 +2314,70 @@ env.Tar('foo') <term><function>Textfile</function>()</term> <term><replaceable>env</replaceable>.<methodname>Textfile</methodname>()</term> <listitem><para> -The &b-Textfile; builder generates a single text file. -The source strings constitute the lines; -nested lists of sources are flattened. -&cv-LINESEPARATOR; is used to separate the strings. -</para> - -<para> -If present, the &cv-SUBST_DICT; construction variable -is used to modify the strings before they are written; -see the &b-Substfile; description for details. -</para> - -<para> -The prefix and suffix specified by the &cv-TEXTFILEPREFIX; -and &cv-TEXTFILESUFFIX; construction variables -(an empty string and <filename>.txt</filename> by default, respectively) +The &b-Textfile; builder generates a single text file from +a template consisting of a list of strings, replacing text +using the &cv-link-SUBST_DICT; &consvar; (if set) - +see &b-link-Substfile; for a description of replacement. +The strings will be separated in the target file using the +value of the +&cv-link-LINESEPARATOR; &consvar;; +the line separator is not emitted after the last string. +Nested lists of source strings +are flattened. +Source strings need not literally be Python strings: +they can be Nodes or Python objects that convert cleanly +to &f-link-Value; nodes +</para> + +<para> +The prefix and suffix specified by the &cv-link-TEXTFILEPREFIX; +and &cv-link-TEXTFILESUFFIX; &consvars; +(by default an empty string and <filename>.txt</filename>, respectively) are automatically added to the target if they are not already present. Examples: </para> <example_commands> # builds/writes foo.txt -env.Textfile(target = 'foo.txt', source = ['Goethe', 42, 'Schiller']) +env.Textfile(target='foo.txt', source=['Goethe', 42, 'Schiller']) # builds/writes bar.txt -env.Textfile(target = 'bar', - source = ['lalala', 'tanteratei'], - LINESEPARATOR='|*') +env.Textfile(target='bar', source=['lalala', 'tanteratei'], LINESEPARATOR='|*') # nested lists are flattened automatically -env.Textfile(target = 'blob', - source = ['lalala', ['Goethe', 42 'Schiller'], 'tanteratei']) +env.Textfile(target='blob', source=['lalala', ['Goethe', 42, 'Schiller'], 'tanteratei']) # files may be used as input by wraping them in File() -env.Textfile(target = 'concat', # concatenate files with a marker between - source = [File('concat1'), File('concat2')], - LINESEPARATOR = '====================\n') +env.Textfile( + target='concat', # concatenate files with a marker between + source=[File('concat1'), File('concat2')], + LINESEPARATOR='====================\n', +) +</example_commands> -Results are: -foo.txt - ....8<---- +<para>Results:</para> + +<para><filename>foo.txt</filename></para> +<screen> Goethe 42 Schiller - ....8<---- (no linefeed at the end) +</screen> -bar.txt: - ....8<---- +<para><filename>bar.txt</filename></para> +<screen> lalala|*tanteratei - ....8<---- (no linefeed at the end) +</screen> -blob.txt - ....8<---- +<para><filename>blob.txt</filename></para> +<screen> lalala Goethe 42 Schiller tanteratei - ....8<---- (no linefeed at the end) -</example_commands> +</screen> + </listitem> </varlistentry> <varlistentry id="b-Translate"> diff --git a/doc/generated/tools.gen b/doc/generated/tools.gen index 794b553..6353c6f 100644 --- a/doc/generated/tools.gen +++ b/doc/generated/tools.gen @@ -964,7 +964,7 @@ Sets construction variables for the TeX formatter and typesetter. <varlistentry id="t-textfile"> <term>textfile</term> <listitem><para> -Set construction variables for the &b-Textfile; and &b-Substfile; builders. +Set &consvars; for the &b-Textfile; and &b-Substfile; builders. </para> <para>Sets: &cv-link-LINESEPARATOR;, &cv-link-SUBSTFILEPREFIX;, &cv-link-SUBSTFILESUFFIX;, &cv-link-TEXTFILEPREFIX;, &cv-link-TEXTFILESUFFIX;.</para><para>Uses: &cv-link-SUBST_DICT;.</para></listitem> </varlistentry> diff --git a/doc/generated/variables.gen b/doc/generated/variables.gen index 6f23d98..e100939 100644 --- a/doc/generated/variables.gen +++ b/doc/generated/variables.gen @@ -1361,7 +1361,7 @@ PDF renderer <literal>fop</literal> or <literal>xep</literal>. <listitem><para> The path to the external executable <literal>xmllint</literal>, if it's installed. Note, that this is only used as last fallback for resolving -XIncludes, if no libxml2 or lxml Python binding can be imported +XIncludes, if no lxml Python binding can be imported in the current system. </para> </listitem> @@ -1405,7 +1405,7 @@ The path to the external executable <literal>xsltproc</literal> (or <literal>saxon</literal>, <literal>xalan</literal>), if one of them is installed. Note, that this is only used as last fallback for XSL transformations, if -no libxml2 or lxml Python binding can be imported in the current system. +no lxml Python binding can be imported in the current system. </para> </listitem> </varlistentry> @@ -3038,6 +3038,14 @@ is <quote><literal>-dNOPAUSE -dBATCH -sDEVICE=pdfwrite</literal></quote> <envar>HOST_ARCH</envar> </term> <listitem><para> + The name of the host hardware architecture used to create the Environment. + If a platform is specified when creating the Environment, then + that Platform's logic will handle setting this value. + This value is immutable, and should not be changed by the user after + the Environment is initialized. + Currently only set for Win32. +</para> + <para> Sets the host architecture for Visual Studio compiler. If not set, default to the detected host architecture: note that this may depend on the python you are using. @@ -3053,15 +3061,7 @@ Valid values are the same as for &cv-TARGET_ARCH;. This is currently only used on Windows, but in the future it will be used on other OSes as well. </para> -<para> - The name of the host hardware architecture used to create the Environment. - If a platform is specified when creating the Environment, then - that Platform's logic will handle setting this value. - This value is immutable, and should not be changed by the user after - the Environment is initialized. - Currently only set for Win32. -</para> - </listitem> +</listitem> </varlistentry> <varlistentry id="cv-HOST_OS"> <term> @@ -3810,7 +3810,7 @@ the same as $SHLIBSUFFIX. <envar>LDMODULEVERSION</envar> </term> <listitem><para> -When this construction variable is defined, a versioned loadable module +When this &consvar; is defined, a versioned loadable module is created by &b-link-LoadableModule; builder. This activates the &cv-link-_LDMODULEVERSIONFLAGS; and thus modifies the &cv-link-LDMODULECOM; as required, adds the version number to the library name, and creates the symlinks @@ -4165,7 +4165,7 @@ for a list of license names and SPDX codes. <envar>LINESEPARATOR</envar> </term> <listitem><para> -The separator used by the &b-Substfile; and &b-Textfile; builders. +The separator used by the &b-link-Substfile; and &b-link-Textfile; builders. This value is used between sources when constructing the target. It defaults to the current system line separator. </para> @@ -7111,7 +7111,7 @@ The suffix used for shared library file names. <envar>SHLIBVERSION</envar> </term> <listitem><para> -When this construction variable is defined, a versioned shared library +When this &consvar; is defined, a versioned shared library is created by the &b-link-SharedLibrary; builder. This activates the &cv-link-_SHLIBVERSIONFLAGS; and thus modifies the &cv-link-SHLINKCOM; as required, adds the version number to the library name, and creates the symlinks @@ -7320,9 +7320,9 @@ in which the command should be executed. <envar>SUBST_DICT</envar> </term> <listitem><para> -The dictionary used by the &b-Substfile; or &b-Textfile; builders +The dictionary used by the &b-link-Substfile; or &b-link-Textfile; builders for substitution values. -It can be anything acceptable to the dict() constructor, +It can be anything acceptable to the <function>dict()</function> constructor, so in addition to a dictionary, lists of tuples are also acceptable. </para> @@ -7333,7 +7333,7 @@ lists of tuples are also acceptable. <envar>SUBSTFILEPREFIX</envar> </term> <listitem><para> -The prefix used for &b-Substfile; file names, +The prefix used for &b-link-Substfile; file names, an empty string by default. </para> </listitem> @@ -7343,7 +7343,7 @@ an empty string by default. <envar>SUBSTFILESUFFIX</envar> </term> <listitem><para> -The suffix used for &b-Substfile; file names, +The suffix used for &b-link-Substfile; file names, an empty string by default. </para> </listitem> @@ -7651,6 +7651,12 @@ for more information). <envar>TARGET_ARCH</envar> </term> <listitem><para> + The name of the target hardware architecture for the compiled objects + created by this Environment. + This defaults to the value of HOST_ARCH, and the user can override it. + Currently only set for Win32. +</para> + <para> Sets the target architecture for Visual Studio compiler (i.e. the arch of the binaries generated by the compiler). If not set, default to &cv-HOST_ARCH;, or, if that is unset, to the architecture of the @@ -7681,13 +7687,7 @@ and <literal>ia64</literal> (Itanium). For example, if you want to compile 64-bit binaries, you would set <literal>TARGET_ARCH='x86_64'</literal> in your SCons environment. </para> -<para> - The name of the target hardware architecture for the compiled objects - created by this Environment. - This defaults to the value of HOST_ARCH, and the user can override it. - Currently only set for Win32. -</para> - </listitem> +</listitem> </varlistentry> <varlistentry id="cv-TARGET_OS"> <term> @@ -7823,7 +7823,7 @@ directories for \include and \import files. <envar>TEXTFILEPREFIX</envar> </term> <listitem><para> -The prefix used for &b-Textfile; file names, +The prefix used for &b-link-Textfile; file names, an empty string by default. </para> </listitem> @@ -7833,7 +7833,7 @@ an empty string by default. <envar>TEXTFILESUFFIX</envar> </term> <listitem><para> -The suffix used for &b-Textfile; file names; +The suffix used for &b-link-Textfile; file names; <filename>.txt</filename> by default. </para> </listitem> diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index 9469e06..91b511d 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -39,6 +39,7 @@ extensions = [ 'sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinx_rtd_theme', + 'rst2pdf.pdfbuilder', ] autosummary_generate = True @@ -201,3 +202,9 @@ texinfo_documents = [ # -- Options for Epub output ------------------------------------------------- + + +# -- for PDF +# Grouping the document tree into PDF files. List of tuples +# (source start file, target name, title, author, options). +pdf_documents = [('index', u'scons-api', u'SCons API Docs', u'SCons Project'),] diff --git a/requirements.txt b/requirements.txt index 5608edf..cc94763 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,7 @@ # Can be used with twinecheck # See: https://github.com/pypa/readme_renderer readme-renderer +sphinx +sphinx_rtd_theme +lxml==4.5.0 +rst2pdf
\ No newline at end of file diff --git a/scripts/scons.bat b/scripts/scons.bat index 10b8637..65c919e 100644 --- a/scripts/scons.bat +++ b/scripts/scons.bat @@ -1,5 +1,4 @@ @REM __COPYRIGHT__
-@REM __FILE__ __REVISION__ __DATE__ __DEVELOPER__
@echo off
set SCONS_ERRORLEVEL=
if "%OS%" == "Windows_NT" goto WinNT
@@ -1,6 +1,6 @@ [metadata] name = SCons -version=3.9.9a993 +;version=3.9.9a993 license = MIT author = William Deegan author_email =bill@baddogconsulting.com @@ -8,7 +8,7 @@ long_description = file: README.rst long_description_content_type = text/x-rst description = Open Source next-generation build tool. group = Development/Tools -license_files = LICENSE +license_file = LICENSE url = http://www.scons.org/ @@ -48,7 +48,7 @@ packages = find: [options.packages.find] - include=SCons + include=SCons.* exclude=template [options.entry_points] @@ -62,6 +62,10 @@ console_scripts = * = *.txt, *.rst SCons.Tool.docbook = *.* +[sdist] + dist-dir=build/dist [bdist_wheel] -universal=true + ; We're now py3 only +;universal=true +dist-dir=build/dist
\ No newline at end of file @@ -1,7 +1,26 @@ +#!python3 + import fnmatch from setuptools import setup from setuptools.command.build_py import build_py as build_py_orig +import codecs +import os.path + +def read(rel_path): + here = os.path.abspath(os.path.dirname(__file__)) + with codecs.open(os.path.join(here, rel_path), 'r') as fp: + return fp.read() + +def get_version(rel_path): + for line in read(rel_path).splitlines(): + if line.startswith('__version__'): + delim = '"' if '"' in line else "'" + return line.split(delim)[1] + else: + raise RuntimeError("Unable to find version string.") + + exclude = ['*Tests'] @@ -21,5 +40,6 @@ class build_py(build_py_orig): setup( cmdclass={ 'build_py': build_py, - } + }, + version=get_version('SCons/__init__.py'), )
\ No newline at end of file diff --git a/site_scons/scons_local_package.py b/site_scons/scons_local_package.py new file mode 100644 index 0000000..445dc05 --- /dev/null +++ b/site_scons/scons_local_package.py @@ -0,0 +1,100 @@ +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +from glob import glob +import os.path +from zip_utils import zipit +from Utilities import is_windows + + +def get_local_package_file_list(): + """ + Get list of all files which should be included in scons-local package + """ + s_files = glob("SCons/**", recursive=True) + + # import pdb; pdb.set_trace() + + non_test = [f for f in s_files if "Tests.py" not in f] + non_test_non_doc = [f for f in non_test if '.xml' not in f or "SCons/Tool/docbook" in f] + filtered_list = [f for f in non_test_non_doc if 'pyc' not in f] + filtered_list = [f for f in filtered_list if '__pycache__' not in f ] + filtered_list = [f for f in filtered_list if not os.path.isdir(f)] + + return filtered_list + + +def install_local_package_files(env): + + all_local_installed = [] + files = get_local_package_file_list() + target_dir = '#/build/scons-local/scons-local-$VERSION' + for f in files: + all_local_installed.extend(env.Install(os.path.join(target_dir, os.path.dirname(f)), + f)) + + basedir_files = ['scripts/scons.bat', + 'scripts/scons.py', + 'scripts/scons-configure-cache.py', + 'scripts/sconsign.py', + 'bin/scons-time.py'] + all_local_installed.extend(env.Install('#/build/scons-local', basedir_files)) + + rename_files = [('scons-${VERSION}.bat', 'scripts/scons.bat'), + ('scons-README', 'README-local'), + ('scons-LICENSE', 'LICENSE-local')] + for t, f in rename_files: + target_file = "#/build/scons-local/%s"%t + all_local_installed.append(env.SCons_revision(target_file, f)) + + return all_local_installed + + +def create_local_packages(env): + # Add SubstFile builder + env.Tool('textfile') + [env.Tool(x) for x in ['packaging', 'filesystem', 'zip']] + installed_files = install_local_package_files(env) + + build_local_dir = 'build/scons-local' + package = env.Command('#build/dist/scons-local-${VERSION}.zip', + installed_files, + zipit, + CD=build_local_dir, + PSV='.', + ) + + if is_windows(): + # avoid problem with tar interpreting c:/ as a remote machine + tar_cargs = '-cz --force-local -f' + else: + tar_cargs = '-czf' + + env.Command('#build/dist/scons-local-${VERSION}.tar.gz', + installed_files, + "cd %s && tar %s $( ${TARGET.abspath} $) *" % (build_local_dir, tar_cargs)) + + print("Package:%s"%package) + + + + + diff --git a/site_scons/site_init.py b/site_scons/site_init.py index 81c4753..336cad6 100644 --- a/site_scons/site_init.py +++ b/site_scons/site_init.py @@ -1,11 +1,14 @@ +# flake8: noqa import os.path from SConsRevision import SCons_revision from Utilities import is_windows, whereis, platform, deb_date -from zip_utils import unzipit, zipit, zcat +# from zip_utils import unzipit, zipit, zcat from soe_utils import soelim, soscan, soelimbuilder # from epydoc import epydoc_cli, epydoc_commands from BuildCommandLine import BuildCommandLine +from scons_local_package import install_local_package_files, create_local_packages +from update_build_info import update_init_file gzip = whereis('gzip') git = os.path.exists('.git') and whereis('git') diff --git a/site_scons/update_build_info.py b/site_scons/update_build_info.py new file mode 100644 index 0000000..b9d565a --- /dev/null +++ b/site_scons/update_build_info.py @@ -0,0 +1,16 @@ +def update_init_file(env): + substitutions = { + '__version__': env['VERSION'], + "__copyright__": env['COPYRIGHT'], + "__developer__": env['DEVELOPER'], + "__date__": env['DATE'], + "__buildsys__": env['BUILDSYS'], + "__revision__": env['REVISION'], + "__build__": env['BUILD'], + } + si = env.Textfile('#SCons/__init__.py', + ["%s=\"%s\"" % (k, v) for k, v in substitutions.items()] + + ['# make sure compatibility is always in place', + 'import SCons.compat # noqa'], + ) + env.Precious(si) diff --git a/site_scons/zip_utils.py b/site_scons/zip_utils.py index 3d5821e..1a0f843 100644 --- a/site_scons/zip_utils.py +++ b/site_scons/zip_utils.py @@ -21,7 +21,7 @@ try: # default ZipFile compression is ZIP_STORED zf = zipfile.ZipFile(str(target[0]), 'w', compression=zipfile.ZIP_DEFLATED) olddir = os.getcwd() - os.chdir(env['CD']) + os.chdir(env.Dir(env['CD']).abspath) try: for dirname, dirnames, filenames in os.walk(env['PSV']): visit(zf, dirname, filenames) diff --git a/template/__init__.py b/template/__init__.py index 1399f0b..caae1ba 100644 --- a/template/__init__.py +++ b/template/__init__.py @@ -1,12 +1,35 @@ -"""${subst '/' '.' ${subst '^src/' '' ${subst '/[^/]*$' '' $filename}}} +# +# __COPYRIGHT__ +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject to +# the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# + +"""SCons -XXX +The main package for the SCons software construction utility. """ # # __COPYRIGHT__ -# +# # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including @@ -27,9 +50,16 @@ XXX # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - +__revision__ = "__REVISION__" __version__ = "__VERSION__" +__build__ = "__BUILD__" +__buildsys__ = "__BUILDSYS__" +__date__ = "__DATE__" +__developer__ = "__DEVELOPER__" +__copyright__ = "__COPYRIGHT__" + +# make sure compatibility is always in place +import SCons.compat # noqa # Local Variables: # tab-width:4 diff --git a/test/Interactive/version.py b/test/Interactive/version.py index 6609ad7..76718c7 100644 --- a/test/Interactive/version.py +++ b/test/Interactive/version.py @@ -55,23 +55,14 @@ scons>>> test.run(arguments='-Q --interactive', stdin="version\nexit\n") -# Windows may or may not print a line for the script version -# depending on whether it's invoked through scons.py or scons.bat. -expect1 = r"""scons>>> SCons by Steven Knight et al\.: -\tengine: v\S+, [^,]*, by \S+ on \S+ -\tengine path: \[.*\] -%(copyright_line)sscons>>> -""" % locals() - expect2 = r"""scons>>> SCons by Steven Knight et al\.: -\tscript: v\S+, [^,]*, by \S+ on \S+ -\tengine: v\S+, [^,]*, by \S+ on \S+ -\tengine path: \[.*\] +\tSCons: v\S+, [^,]*, by \S+ on \S+ +\tSCons path: \[.*\] %(copyright_line)sscons>>> """ % locals() stdout = test.stdout() + '\n' -if not test.match_re(stdout, expect1) and not test.match_re(stdout, expect2): +if not test.match_re(stdout, expect2): print(repr(stdout)) test.fail_test() diff --git a/test/option-v.py b/test/option-v.py index ec20b20..49dd84d 100644 --- a/test/option-v.py +++ b/test/option-v.py @@ -36,28 +36,21 @@ copyright_line = """\ (_{2}COPYRIGHT__|Copyright \\(c\\) 2001[-\\d, ]+ The SCons Foundation) """ -# Windows may or may not print a line for the script version -# depending on whether it's invoked through scons.py or scons.bat. -expect1 = r"""SCons by Steven Knight et al.: -\tengine: v\S+, [^,]*, by \S+ on \S+ -\tengine path: \[.*\] -""" + copyright_line expect2 = r"""SCons by Steven Knight et al.: -\tscript: v\S+, [^,]*, by \S+ on \S+ -\tengine: v\S+, [^,]*, by \S+ on \S+ -\tengine path: \[.*\] +\tSCons: v\S+, [^,]*, by \S+ on \S+ +\tSCons path: \[.*\] """ + copyright_line test.run(arguments = '-v') stdout = test.stdout() -if not test.match_re(stdout, expect1) and not test.match_re(stdout, expect2): +if not test.match_re(stdout, expect2): print(stdout) test.fail_test() test.run(arguments = '--version') stdout = test.stdout() -if not test.match_re(stdout, expect1) and not test.match_re(stdout, expect2): +if not test.match_re(stdout, expect2): print(stdout) test.fail_test() |