SCons - a software construction tool

Overview

SCons - a software construction tool

IRC Sourceforge Monthly Downloads Sourceforge Total Downloads Travis CI build status AppVeyor CI build Status CodeCov Coverage Status Github Actions

Welcome to the SCons development tree. The real purpose of this tree is to package SCons for production distribution in a variety of formats, not just to hack SCons code.

If all you want to do is install and run SCons, it will be easier for you to download and install the scons-{version}.tar.gz or scons-{version}.zip package rather than to work with the packaging logic in this tree.

To the extent that this tree is about building SCons packages, the full development cycle is not just to test the code directly, but to package SCons, unpack the package, "install" SCons in a test subdirectory, and then to run the tests against the unpacked and installed software. This helps eliminate problems caused by, for example, failure to update the list of files to be packaged.

For just working on making an individual change to the SCons source, however, you don't actually need to build or install SCons; you can actually edit and execute SCons in-place. See the following sections below for more information:

Making Changes
How to edit and execute SCons in-place.
Debugging
Tips for debugging problems in SCons.
Testing
How to use the automated regression tests.
Development Workflow
An example of how to put the edit/execute/test pieces together in a reasonable development workflow.

Latest Version

Before going further, you can check that the package you have is the latest version at the SCons download page:

http://www.scons.org/pages/download.html

Execution Requirements

Running SCons requires Python 3.5 or higher. There should be no other dependencies or requirements to run scons

The default SCons configuration assumes use of the Microsoft Visual C++ compiler suite on Win32 systems, and assumes a C compiler named 'cc', a C++ compiler named 'c++', and a Fortran compiler named 'gfortran' (such as found in the GNU C compiler suite) on any other type of system. You may, of course, override these default values by appropriate configuration of Environment construction variables.

By default, SCons knows how to search for available programming tools on various systems--see the SCons man page for details. You may, of course, override the default SCons choices made by appropriate configuration of Environment construction variables.

Installation Requirements

Nothing special.

Executing SCons Without Installing

You can execute the SCons directly from this repository. For Linux or UNIX:

$ python scripts/scons.py [arguments]

Or on Windows:

C:\scons>python scripts\scons.py [arguments]

If you run SCons this way, it will execute SConstruct file for this repo, which will build and pack SCons itself. Use the -C option to change directory to your project:

$ python scripts/scons.py -C /some/other/location [arguments]

Installation

Note: You don't need to build SCons packages or install SCons if you just want to work on developing a patch. See the sections about Making Changes and Testing below if you just want to submit a bug fix or some new functionality.

Assuming your system satisfies the installation requirements in the previous section, install SCons from this package by first populating the build/scons/ subdirectory. (For an easier way to install SCons, without having to populate this directory, use the scons-{version}.tar.gz or scons-{version}.zip package.)

Install the built SCons files

Any of the above commands will populate the build/scons/ directory with the necessary files and directory structure to use the Python-standard setup script as follows on Linux or UNIX:

# python setup.py install

Or on Windows:

C:\scons>python setup.py install

By default, the above commands will do the following:

  • Install scripts named "scons" and "sconsign" scripts in the default system script directory (/usr/bin or C:\Python*\Scripts, for example).
  • Install "scons-3.1.2.exe" and "scons.exe" executables in the Python prefix directory on Windows (C:\Python*, for example).
  • Install the SCons build engine (a Python module) in the standard Python library directory (/usr/lib/python*/site-packages or C:\Python*\Lib\site-packages).

Making Changes

Because SCons is implemented in a scripting language, you don't need to build it in order to make changes and test them.

Virtually all of the SCons functionality exists in the "build engine," the SCons subdirectory hierarchy that contains all of the modules that make up SCons. The scripts/scons.py wrapper script exists mainly to find the appropriate build engine library and then execute it.

In order to make your own changes locally and test them by hand, simply edit modules in the local SCons subdirectory tree and then running (see the section above about Executing SCons Without Installing):

$ python scripts/scons.py [arguments]

If you want to be able to just execute your modified version of SCons from the command line, you can make it executable and add its directory to your $PATH like so:

$ chmod 755 scripts/scons.py
$ export PATH=$PATH:`pwd`/scripts

You should then be able to run this version of SCons by just typing "scons.py" at your UNIX or Linux command line.

Note that the regular SCons development process makes heavy use of automated testing. See the Testing and Development Workflow sections below for more information about the automated regression tests and how they can be used in a development cycle to validate that your changes don't break existing functionality.

Debugging

Python comes with a good interactive debugger. When debugging changes by hand (i.e., when not using the automated tests), you can invoke SCons under control of the Python debugger by specifying the --debug=pdb option:

$ scons --debug=pdb [arguments]
> /home/knight/scons/SCons/Script/Main.py(927)_main()
-> default_warnings = [ SCons.Warnings.CorruptSConsignWarning,
(Pdb)

Once in the debugger, you can set breakpoints at lines in files in the build engine modules by providing the path name of the file relative to the top directory (that is, including the SCons/ as the first directory component):

(Pdb) b SCons/Tool/msvc.py:158

The debugger also supports single stepping, stepping into functions, printing variables, etc.

Trying to debug problems found by running the automated tests (see the Testing section, below) is more difficult, because the test automation harness re-invokes SCons and captures output. Consequently, there isn't an easy way to invoke the Python debugger in a useful way on any particular SCons call within a test script.

The most effective technique for debugging problems that occur during an automated test is to use the good old tried-and-true technique of adding statements to print tracing information. But note that you can't just use the "print" function, or even "sys.stdout.write()" because those change the SCons output, and the automated tests usually look for matches of specific output strings to decide if a given SCons invocation passes the test - so these additions may cause apparent failures different than the one you are trying to debug.

To deal with this, SCons supports a Trace() function that (by default) will print messages to your console screen ("/dev/tty" on UNIX or Linux, "con" on Windows). By adding Trace() calls to the SCons source code:

def sample_method(self, value):
    from SCons.Debug import Trace
    Trace('called sample_method(%s, %s)\n' % (self, value))

You can then run automated tests that print any arbitrary information you wish about what's going on inside SCons, without interfering with the test automation.

The Trace() function can also redirect its output to a file, rather than the screen:

def sample_method(self, value):
    from SCons.Debug import Trace
    Trace('called sample_method(%s, %s)\n' % (self, value),
          file='trace.out')

Where the Trace() function sends its output is stateful: once you use the "file=" argument, all subsequent calls to Trace() send their output to the same file, until another call with a "file=" argument is reached.

Testing

Tests are run by the runtest.py script in this directory.

There are two types of tests in this package:

  1. Unit tests for individual SCons modules live underneath the SCons subdirectory and have the same base name as the module with "Tests.py" appended--for example, the unit test for the Builder.py module is the BuilderTests.py script.
  2. End-to-end tests of SCons live in the test/ subdirectory.

You may specifically list one or more tests to be run:

$ python runtest.py SCons/BuilderTests.py

$ python runtest.py test/option-j.py test/Program.py

You also use the -f option to execute just the tests listed in a specified text file:

$ cat testlist.txt
test/option-j.py
test/Program.py
$ python runtest.py -f testlist.txt

One test must be listed per line, and any lines that begin with '#' will be ignored (allowing you, for example, to comment out tests that are currently passing and then uncomment all of the tests in the file for a final validation run).

The runtest.py script also takes a -a option that searches the tree for all of the tests and runs them:

$ python runtest.py -a

If more than one test is run, the runtest.py script prints a summary of how many tests passed, failed, or yielded no result, and lists any unsuccessful tests.

The above invocations all test directly the files underneath the SCons/ subdirectory, and do not require that a build be performed first.

Development Workflow

Caveat: The point of this section isn't to describe one dogmatic workflow. Just running the test suite can be time-consuming, and getting a patch to pass all of the tests can be more so. If you're genuinely blocked, it may make more sense to submit a patch with a note about which tests still fail, and how. Someone else may be able to take your "initial draft" and figure out how to improve it to fix the rest of the tests. So there's plenty of room for use of good judgement.

The various techniques described in the above sections can be combined to create simple and effective workflows that allow you to validate that patches you submit to SCons don't break existing functionality and have adequate testing, thereby increasing the speed with which they can be integrated.

For example, suppose your project's SCons configuration is blocked by an SCons bug, and you decide you want to fix it and submit the patch. Here's one possible way to go about doing that (using UNIX/Linux as the development platform, Windows users can translate as appropriate)):

  • Change to the top of your checked-out SCons tree.

  • Confirm that the bug still exists in this version of SCons by using the -C

    option to run the broken build:

    $ python scripts/scons.py -C /home/me/broken_project .
    
  • Fix the bug in SCons by editing appropriate module files underneath SCons.

  • Confirm that you've fixed the bug affecting your project:

    $ python scripts/scons.py -C /home/me/broken_project .
    
  • Test to see if your fix had any unintended side effects that break existing functionality:

    $ python runtest.py -a -o test.log
    

    Be patient, there are more than 1100 test scripts in the whole suite. If you are on UNIX/Linux, you can use:

    $ python runtest.py -a | tee test.log
    

    instead so you can monitor progress from your terminal.

    If any test scripts fail, they will be listed in a summary at the end of the log file. Some test scripts may also report NO RESULT because (for example) your local system is the wrong type or doesn't have some installed utilities necessary to run the script. In general, you can ignore the NO RESULT list, beyond having checked once that the tests that matter to your change are actually being executed on your test system!

  • Cut-and-paste the list of failed tests into a file:

    $ cat > failed.txt
    test/failed-test-1.py
    test/failed-test-2.py
    test/failed-test-3.py
    ^D
    $
    
  • Now debug the test failures and fix them, either by changing SCons, or by making necessary changes to the tests (if, for example, you have a strong reason to change functionality, or if you find that the bug really is in the test script itself). After each change, use the runtest.py -f option to examine the effects of the change on the subset of tests that originally failed:

    $ [edit]
    $ python runtest.py -f failed.txt
    

    Repeat this until all of the tests that originally failed now pass.

  • Now you need to go back and validate that any changes you made while getting the tests to pass didn't break the fix you originally put in, and didn't introduce any additional unintended side effects that broke other tests:

    $ python scripts/scons.py -C /home/me/broken_project .
    $ python runtest.py -a -o test.log
    

    If you find any newly-broken tests, add them to your "failed.txt" file and go back to the previous step.

Of course, the above is only one suggested workflow. In practice, there is a lot of room for judgment and experience to make things go quicker. For example, if you're making a change to just the Java support, you might start looking for regressions by just running the test/Java/*.py tests instead of running all of "runtest.py -a".

Building Packages

We use SCons (version 3.1.2 or later) to build its own packages. If you already have an appropriate version of SCons installed on your system, you can build everything by simply running it:

$ scons

If you don't have SCons already installed on your system, you can use the supplied bootstrap.py script (see the section above about Executing SCons Without Installing):

$ python scripts/scons.py build/scons

Depending on the utilities installed on your system, any or all of the following packages will be built:

SCons-4.0.0-py3-none-any.whl
SCons-4.2.0ayyyymmdd.tar.gz
SCons-4.2.0ayyyymmdd.zip
scons-doc-4.2.0ayyyymmdd.tar.gz
scons-local-4.2.0ayyyymmdd.tar.gz
scons-local-4.2.0ayyyymmdd.zip

The SConstruct file is supposed to be smart enough to avoid trying to build packages for which you don't have the proper utilities installed.

If you receive a build error, please report it to the scons-devel mailing list and open a bug report on the SCons bug tracker.

Note that in addition to creating the above packages, the default build will also unpack one or more of the packages for testing.

Contents of this Package

Not guaranteed to be up-to-date (but better than nothing):

bench/
A subdirectory for benchmarking scripts, used to perform timing tests to decide what specific idioms are most efficient for various parts of the code base. We check these in so they're available in case we have to revisit any of these decisions in the future.
bin/

Miscellaneous utilities used in SCons development. Right now, some of the stuff here includes:

  • a script that runs pychecker on our source tree;
  • a script that counts source and test files and numbers of lines in each;
  • a prototype script for capturing sample SCons output in xml files;
  • a script that can profile and time a packaging build of SCons itself;
  • a copy of xml_export, which can retrieve project data from SourceForge; and
  • scripts and a Python module for translating the SCons home-brew XML documentation tags into DocBook and man page format
bootstrap.py
Obsolete packaging logic.
debian/
Files needed to construct a Debian package. The contents of this directory are dictated by the Debian Policy Manual (http://www.debian.org/doc/debian-policy). The package will not be accepted into the Debian distribution unless the contents of this directory satisfy the relevant Debian policies.
doc/
SCons documentation. A variety of things here, in various stages of (in)completeness.
LICENSE
A copy of the copyright and terms under which SCons is distributed (the Open Source Initiative-approved MIT license).
LICENSE-local
A copy of the copyright and terms under which SCons is distributed for inclusion in the scons-local-{version} packages. This is the same as LICENSE with a preamble that specifies the licensing terms are for SCons itself, not any other package that includes SCons.
README.rst
What you're looking at right now.
README-local
A README file for inclusion in the scons-local-{version} packages. Similar to this file, but stripped down and modified for people looking at including SCons in their shipped software.
runtest.py
Script for running SCons tests. By default, this will run a test against the code in the local SCons tree, so you don't have to do a build before testing your changes.
SConstruct

The file describing to SCons how to build the SCons distribution.

(It has been pointed out that it's hard to find the SCons API in this SConstruct file, and that it looks a lot more like a pure Python script than a build configuration file. That's mainly because all of the magick we have to perform to deal with all of the different packaging formats requires a lot of pure Python manipulation. In other words, don't look at this file for an example of how easy it is to use SCons to build "normal" software.)

SCons/
Where the actual source code is kept, of course.
test/
End-to-end tests of the SCons utility itself. These are separate from the individual module unit tests, which live side-by-side with the modules under SCons.
testing/
SCons testing framework.

Documentation

See the RELEASE.txt file for notes about this specific release, including known problems. See the CHANGES.txt file for a list of changes since the previous release.

The doc/man/scons.1 man page is included in this package, and contains a section of small examples for getting started using SCons.

Additional documentation for SCons is available at:

http://www.scons.org/documentation.html

Documentation toolchain

For an overview see https://github.com/SCons/scons/blob/master/doc/overview.rst

Licensing

SCons is distributed under the MIT license, a full copy of which is available in the LICENSE file.

Reporting Bugs

The SCons project welcomes bug reports and feature requests.

Please make sure you send email with the problem or feature request to the SCons users mailing list, which you can join via the link below:

http://two.pairlist.net/mailman/listinfo/scons-users

Once you have discussed your issue on the users mailing list and the community has confirmed that it is either a new bug or a duplicate of an existing bug, then please follow the instructions the community provides to file a new bug or to add yourself to the CC list for an existing bug

You can explore the list of existing bugs, which may include workarounds for the problem you've run into on GitHub Issues:

https://github.com/SCons/scons/issues

Mailing Lists

An active mailing list for developers of SCons is available. You may send questions or comments to the list at:

[email protected]

You may subscribe to the developer's mailing list using form on this page:

http://two.pairlist.net/mailman/listinfo/scons-dev

Subscription to the developer's mailing list is by approval. In practice, no one is refused list membership, but we reserve the right to limit membership in the future and/or weed out lurkers.

There are other mailing lists available for SCons users, for notification of SCons code changes, and for notification of updated bug reports and project documents. Please see our mailing lists page for details.

Donations

If you find SCons helpful, please consider making a donation (of cash, software, or hardware) to support continued work on the project. Information is available at:

http://www.scons.org/donate.html

or

GitHub Sponsors button on https://github.com/scons/scons

For More Information

Check the SCons web site at:

http://www.scons.org/

Author Info

SCons was originally written by Steven Knight, knight at baldmt dot com. Since around 2010 it has been maintained by the SCons development team, co-managed by Bill Deegan and Gary Oberbrunner, with many contributors, including but not at all limited to:

  • Chad Austin
  • Dirk Baechle
  • Charles Crain
  • William Deegan
  • Steve Leblanc
  • Rob Managan
  • Greg Noel
  • Gary Oberbrunner
  • Anthony Roach
  • Greg Spencer
  • Tom Tanner
  • Anatoly Techtonik
  • Christoph Wiedemann
  • Russel Winder
  • Mats Wichmann

... and many others.

Copyright (c) 2001 - 2020 The SCons Foundation

Comments
  • MSVC suppress warning for no installed Visual Studio instances for default tools configuration

    MSVC suppress warning for no installed Visual Studio instances for default tools configuration

    This PR is a proposed fix for #2813.

    ~~Requisite documentation is incomplete.~~

    Contributor Checklist:

    • [x] I have created a new test or updated the unit tests to cover the new/changed functionality.
    • [x] I have updated CHANGES.txt (and read the README.rst)
    • [x] I have updated the appropriate documentation

    My TODO list:

    • [x] Code: Minor tweak to initialization/data structure (keep external symbol and internal value together)
    • [x] Code: Docstring above
    • [x] Docs: CHANGES.txt
    • [x] Docs: RELEASE.txt
    • [x] Docs: Documentation for environment variable MSVC_NOTFOUND_POLICY
    • [x] ~~Docs: Documentation for functions set_msvc_notfound_policy and get_msvc_notfound_policy (see below)?~~
    • [x] Docs: Add docstring for functions set_msvc_notfound_policy and get_msvc_notfound_policy
    • [x] Test: Test request below
    • [ ] Issue: File enhancement issue to set notfound policy as a command-line option

    Also need to test:

    What happens if the user runs the MSVC developer shell and does
    env=Environment(ENV=os.environ)
    Will this still work/not issue warnings for the defaulted MSVC_VERSION case?
    

    ~~Should and where would the set_msvc_notfound_policy and get_msvc_notfound_policy functions be documented?~~ Added docstrings for set_msvc_notfound_policy and get_msvc_notfound_policy as discussed below.

    Op Sys: Windows MSVC 
    opened by jcbrill 94
  • Ninja generation tool - experimental version

    Ninja generation tool - experimental version

    Summary This tool attempts to generically take a SCons build and generate a ninja file which is representative of the build and can be built by Ninja.

    Ninja is a very fast build system, which is meant to have its build files generated by other systems. Ninja is especially good at iterative rebuilds and quick traversing a build graph to determine what needs to be rebuilt.

    This PR is to introduce the ninja tool based off the ninja tool from mongodb's site tools.

    This PR scope is BETA functionality of the ninja tool. It will not work well with all other tools and is primarily aimed at cross platform (win32/linux/osx) C/C++ builds. The goal of this PR is to get the tool to a point that it can be integrated in beta form.

    Feature/Test List Test Name | Test Description | Implemented -- | -- | -- generate_and_build.py | Generate and build simple C program | X generate_and_build_cxx.py | Generate and build simple CPP program and check header deps | X generate_source.py | Generate source with built C program and build C program from generated source | X multi_env.py | Build two C programs with two seperate envs with one ninja file | X shell_commands.py | Simple shell command to take in sources and build targets | X copy_function_command.py | SCons "Copy" function action converted to command line for ninja | X build_libraries.py | Build and linking C shared and static libraries | X iterative_speedup.py | Make sure Ninja is faster than SCons in single file change rebuild (Would love to see this fail one day) | X output_orders.py | Make sure outputs are ordered correctly in ninja file |   existing_targets.py | Make sure response files generate correctly even if existing targets are already built |   unhandled_actions.py | Unhandled actions will reinvoke scons without ninja to build just those targets |   ninja_rule.py | Create and register a custom ninja rule |   command_line_targets.py | Specify Alias and targets from command to build |   non_ninja_nodes.py | Make sure Scons is reinvoked on nodes which are not FS or Alias |  

    Known Issues Known Issue Description | Github Issue -- | -- SCons doesn't have representive job pools to translate to ninja | #3667 Ninja tool is global, affects all environments regardless of what environment its invoked in |   Compilation Databases interactions between SCons and Ninja | Response files are always used even when not necessary | Targets and -j are not propagated to ninja correctly | TEMPLATE aggregation destroys order (need interactive mode) |

    Contributor Checklist:

    • [x] I have created a new test or updated the unit tests to cover the basic use.
    • [ ] I have created a new test or updated the unit tests to cover ninja specific Methods.
    • [ ] I have updated src/CHANGES.txt (and read the README.txt in that directory)
    • [ ] I have updated the appropriate documentation
    Ninja 
    opened by dmoody256 56
  • Tweak the MSVC environment vars cache

    Tweak the MSVC environment vars cache

    • Now performs a sanity check: if the retrieved tools path does not exist, consider the entry invalid so it will be recomputed.
    • The dictionary key, which is the name of a batch file, is computed a bit differently: the dashes are left off if there are no arguments.
    • The cachefile is changed to have a .json suffix, for better recognition on Windows systems.

    Since this feature is still marked experimental, and these aren't exactly earthshaking changes (basically, will recompute the cache data once), they should be okay without any kind of a transitional cycle.

    Questions for reviewers:

    • This looks at cache_data["VCToolsInstallDir"], which according to the comments isn't used by much, but it seemed to be the only place that had a distinct path value one could check to see if it still exists. Open to alternative suggestions.
    • should the cache file be named without a leading dot?
    • should the cache file by default be created in the user's home directory, or would somewhere project-relative be a better choice?

    Signed-off-by: Mats Wichmann [email protected]

    Contributor Checklist:

    • [ ] I have created a new test or updated the unit tests to cover the new/changed functionality.
    • [X] I have updated CHANGES.txt (and read the README.rst)
    • [X] I have updated the appropriate documentation
    MSVC 
    opened by mwichmann 52
  • MSVC enhancement to add all remaining msvc batch file command-line options as SCons variables

    MSVC enhancement to add all remaining msvc batch file command-line options as SCons variables

    Add all remaining msvc batch file command-line options as SCons environment variables.

    The intent of this PR is to enable all existing msvc batch arguments to be utilized with SCons auto-detection.

    This PR modifies and/or adds the following SCons construction variables

    • MSVC_UWP_APP [modifies]
    • MSVC_SDK_VERSION [adds]
    • MSVC_TOOLSET_VERSION [adds]
    • MSVC_SPECTRE_LIBS [adds]
    • MSVC_SCRIPT_ARGS [adds]

    With the exception of MSVC_SCRIPT_ARGS, all of the SCons variables have a one-to-one mapping with msvc batch file arguments.

    Note: the implementation of MSVC_TOOLSET_VERSION does not affect the selection of the msvc instances (i.e., "auto-detection") in any way. Similar to the msvc batch files: given an msvc instance, a toolset version may be specified. This distinction is important as it makes the implementation reasonably straightforward.

    All of the environment variables listed above are applied after the msvc instance is selected. This could be the default version of msvc if MSVC_VERSION is not specified.

    The MSVC_SCRIPTERROR_POLICY construction variable was added as a mechanism to report msvc batch file errors which could prove useful when attempting to diagnose mysterious build failures.

    Contributor Checklist:

    • [x] I have created a new test or updated the unit tests to cover the new/changed functionality.
    • [x] I have updated CHANGES.txt (and read the README.rst)
    • [x] I have updated the appropriate documentation

    Source Code Tasks

    • [x] Move proposed code into appropriate locations
    • [x] Rename and adjust some code added in recent PRs for consistency
    • [x] Finalize handling of batch file errors

    MSVC_UWP_APP

    • [x] Base functionality complete
    • [x] Argument validation complete
    • [x] I have created a new test or updated the unit tests to cover the new/changed functionality.
    • [x] I have updated CHANGES.txt (and read the README.rst)
    • [x] I have updated the appropriate documentation

    Known changes from the current main branch:

    • Boolean True is accepted in addition to string '1'
    • Attempting to use MSVC_UWP_APP in VS2013 and earlier results in an exception. Prior behavior was to silently ignore the UWP request.

    MSVC_SDK_VERSION

    • [x] Base functionality complete
    • [x] Argument validation complete
    • [x] Extended functionality complete
    • [x] I have created a new test or updated the unit tests to cover the new/changed functionality.
    • [x] I have updated CHANGES.txt (and read the README.rst)
    • [x] I have updated the appropriate documentation

    As currently implemented, the SDK version is passed to the msvc batch files without complete validation (i.e., that the SDK version is actually installed). This is planned.

    MSVC_TOOLSET_VERSION

    Addresses: #3265, #3664, #4149

    • [x] Base functionality complete
    • [x] Argument validation complete
    • [x] Extended functionality complete
    • [x] I have created a new test or updated the unit tests to cover the new/changed functionality.
    • [x] I have updated CHANGES.txt (and read the README.rst)
    • [x] I have updated the appropriate documentation

    Known differences between the implementation and the msvc batch files:

    • The msvc batch files accept toolset versions specified in the form XX.Y, XX.YY, XX.YY.ZZZZZ.
      The implementation accepts toolset versions in the form XX.Y, XX.YY, XX.YY.Z, XX.YY.ZZ, XX.YY.ZZZ, XX.YY.ZZZZ, XX.YY.ZZZZZ.

    The extended functionality consists of forcing the toolset version to be passed to the msvc batch files when not specified. Currently, there is an internal hard-coded value disabling this feature. By passing the toolset version to the batch files, the SCons cache would be impervious to toolset updates and would execute the batch files appropriately. This could be enabled via an internal-use only windows environment variable when running the test suite(s).

    MSVC_SPECTRE_LIBS

    • [x] Base functionality complete
    • [x] Argument validation complete
    • [x] I have created a new test or updated the unit tests to cover the new/changed functionality.
    • [x] I have updated CHANGES.txt (and read the README.rst)
    • [x] I have updated the appropriate documentation

    MSVC_SCRIPT_ARGS

    Closes: #4106

    • [x] Base functionality complete
    • [x] Argument validation complete (first-class arguments above and multiple declarations only)
    • [x] I have created a new test or updated the unit tests to cover the new/changed functionality.
    • [x] I have updated CHANGES.txt (and read the README.rst)
    • [x] I have updated the appropriate documentation

    MSVC_SCRIPTERROR_POLICY

    The msvc batch file error detection was modified to process all of the lines of stdout instead of first line. VS2017 and later, display a banner which means that no msvc batch file errors are detected if only the first line is inspected.

    If msvc batch file errors are detected, the msvc script error handler is called. The scons behavior is based on the construction variable value or the global policy setting if undefined or None.

    The policy values are:

    • Ignore or Suppress: ignore script error messages when detected.
    • Warn or Warning: issue a warning when script error messages are detected.
    • Error or Exception: raise and exception when script error messages are detected.

    The default policy is to ignore script error messages.

    If script error messages are detected and cl.exe is not detected on the path, an internal exception is raised.

    Prior behavior was when an error was detected to raise an internal exception. This was typically the case when querying host/target combinations.

    There are errors messages possible that are non-fatal and solely due to the difference between the "command-line environment" and the "scons shell environment" in which the batch file is invoked. These messages would be annoying and there would be no way to easily rectify the situation.

    For example, with VS2017 with Typescript installed and MSVC_SCRIPTERROR_POLICY='Warn', the following warning is produced:

        scons: warning: vc script errors detected:
        [ERROR:typescript.bat] TypeScript was not added to PATH since a valid installation was not found
        [ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. ***
        [ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run 
        [ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details.
        [ERROR:VsDevCmd.bat] Where [value] is:
        [ERROR:VsDevCmd.bat]    1 : basic debug logging
        [ERROR:VsDevCmd.bat]    2 : detailed debug logging
        [ERROR:VsDevCmd.bat]    3 : trace level logging. Redirection of output to a file when using this level is recommended.
        [ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3
        [ERROR:VsDevCmd.bat]          vsdevcmd.bat > vsdevcmd.trace.txt 2>&1
    
    MSVC 
    opened by jcbrill 45
  • Compilation fails when scons uses ninja, which may be related to the use of variant_dir

    Compilation fails when scons uses ninja, which may be related to the use of variant_dir

    git repository: https://github.com/liruncong/NinJaTest.git bsp: beaglebone mingw: https://download-sh-cmcc.rt-thread.org:9151/www/aozima/env_released_1%20.2.0.7z gcc position : env\tools\gnu_gcc\arm_gcc\mingw\bin python: 3.8.5(anaconda) platform: win11 scons: https://github.com/dmoody256/scons.git fix_ninja_mingw branch

    Directly using the "scons" command can compile successfully, but using "scons --experimental=ninja" will fail to compile, the log is as follows:

    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>cd /d D:\work\gitee\rt-thread_ninja\bsp\beaglebone
    
    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>set path=D:\MYBIN\scons-local;D:\MYBIN\Anaconda3\;D:\MYBIN\env\tools\gnu_gcc\arm_gcc\mingw\bin;%path%
    
    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>set RTT_EXEC_PATH=D:\MYBIN\env\tools\gnu_gcc\arm_gcc\mingw\bin
    
    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>set RTT_ROOT=D:\work\gitee\rt-thread_ninja
    
    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>scons --experimental=ninja
    scons: Reading SConscript files ...
    Newlib version:2.4.0
    scons: done reading SConscript files.
    scons: Building targets ...
    Generating:ninja: error:  build.ninja
    Executing: run_ninja_env.bat
    
    
    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>set SystemDrive=C:
    
    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>set SystemRoot=C:\Windows
    
    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>set TEMP=C:\Users\ARCHYI~1\AppData\Local\Temp
    
    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>set TMP=C:\Users\ARCHYI~1\AppData\Local\Temp
    
    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>set USERPROFILE=C:\Users\archyizimi
    
    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>set COMSPEC=C:\Windows\system32\cmd.exe
    
    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>set PATH=D:\MYBIN\env\tools\gnu_gcc\arm_gcc\mingw\bin;D:\MYBIN\scons-local\;D:\MYBIN;D:\MYBIN\Anaconda3\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Program Files\dotnet\;C:\Users\archyizimi\AppData\Local\Microsoft\WindowsApps;C:\Users\archyizimi\.dotnet\tools;c:\MinGW\bin
    
    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>set PATHEXT=.COM;.EXE;.BAT;.CMD
    
    D:\work\gitee\rt-thread_ninja\bsp\beaglebone>D:\MYBIN\Anaconda3\lib\site-packages\ninja\data\bin\ninja.exe -f D:\work\gitee\rt-thread_ninja\bsp\beaglebone\build.ninjascons: building terminated because of errors.
    'build/kernel/src/TestDir/Test.autogen.cpp', needed by 'build/kernel/src/TestDir/Test.autogen.o', missing and no known rule to make it
    scons: *** [build.ninja] CalledProcessError : Command 'ninja' returned non-zero exit status 1.
    Traceback (most recent call last):
      File "D:\MYBIN\scons-local\scons-local-4.3.1\SCons\Action.py", line 1295, in execute
        result = self.execfunction(target=target, source=rsources, env=env)
      File "D:\MYBIN\scons-local\scons-local-4.3.1\SCons\Tool\ninja\__init__.py", line 107, in ninja_builder
        for output in execute_ninja():
      File "D:\MYBIN\scons-local\scons-local-4.3.1\SCons\Tool\ninja\__init__.py", line 104, in execute_ninja
        raise subprocess.CalledProcessError(return_code, 'ninja')
    subprocess.CalledProcessError: Command 'ninja' returned non-zero exit status 1.
    
    Ninja 
    opened by liruncong 43
  • When running scons on a FIPS compliant machine scons still try to use md5 even if the C and python libraries are missing.

    When running scons on a FIPS compliant machine scons still try to use md5 even if the C and python libraries are missing.

    This issue was originally created at: 2014-05-24 07:57:52. This issue was reported by: bsucha. bsucha said at 2014-05-24 07:57:52

    When running scons on a FIPS compliant machine scons still try to use md5 even if the C and python libraries are missing. This causes scons to fail the at the first file it tries to compile.

    This can be easily solved by updating Util.py to try to initialize the md5 library before defining the functionality and catching the ValueError thrown when it doesn't exist.

    try:
       import hashlib
       hashlib.md5()  # add this line, this will try to cause the initialization of the md5 functionality.
    except ImportError:
       pass
    except ValueError: # add this line
       pass           # add this line
    

    This will allow scons to continue properly and fall back to its missing md5 mode.

    Specific machine: RHEL6 2.6.32-358.2.1.el6.x86_64 #1 SMP x86_64 x86_64 x86_64 GNU/Linux

    bug P4 Op Sys: UNIX-like 
    opened by bdbaddog 43
  • Can we export `compile_commands.json`?

    Can we export `compile_commands.json`?

    It is convenient for me to use cquery with compile_commands.json. It works quiet well for most of the c++ projects.

    • For CMake project, we can easily use CMAKE_EXPORT_COMPILE_COMMANDS option to export compile_commands.json
    • For Makefile project, compiledb can be used to generate a compile_commands.json

    So can we export compile_commands.json when using SCons? Thank you very much!

    enhancement 
    opened by tan-wei 41
  • Added

    Added "--experimental=ninja" to the command line, but nothing worked

    Added "--experimental=ninja" to the command line, but it has no effect, "build.ninja" is not generated.

    scons: scons-local-4.3.0 python: 3.8.5(anaconda) platform: win11 ninja: 1.10.2 test project: https://github.com/RT-Thread/rt-thread.git bsp: beaglebone

    Ninja 
    opened by liruncong 34
  • When windows installed non-english Visual Studio 2019 16.4 initialization/detection fails due to text locale.

    When windows installed non-english Visual Studio 2019 16.4 initialization/detection fails due to text locale.

    Describe the bug When Sconscript requires VS 2019 and you are still on Windows 7 it cannot be used. There are two problems:

    • vcvarsall.bat calls powershell to send telemetry, however on Windows 7 Scons for some reason cannot find Powershell folder in the path, so it cannot be invoked. This causes popup letting the user know about this to appear.
    • The message about Powershell not found is also written to sys.stderr or at least tries to be written there. On Python 3 sys.stderr requires string but subprocess returs bytes so the attempt at writing results in:
    TypeError: write() argument must be str, not bytes:
      File "D:\test\SConstruct", line 1:
        env = DefaultEnvironment(MSVC_VERSION="14.2", TARGET_ARCH="x86")
      File "c:\python37\lib\site-packages\scons\SCons\Defaults.py", line 88:
        _default_env = SCons.Environment.Environment(*args, **kw)
      File "c:\python37\lib\site-packages\scons\SCons\Environment.py", line 990:
        apply_tools(self, tools, toolpath)
      File "c:\python37\lib\site-packages\scons\SCons\Environment.py", line 102:
        env.Tool(tool)
      File "c:\python37\lib\site-packages\scons\SCons\Environment.py", line 1810:
        tool(self)
      File "c:\python37\lib\site-packages\scons\SCons\Tool\__init__.py", line 303:
        self.generate(env, *args, **kw)
      File "c:\python37\lib\site-packages\scons\SCons\Tool\default.py", line 41:
        SCons.Tool.Tool(t)(env)
      File "c:\python37\lib\site-packages\scons\SCons\Tool\__init__.py", line 303:
        self.generate(env, *args, **kw)
      File "c:\python37\lib\site-packages\scons\SCons\Tool\mslink.py", line 314:
        msvc_setup_env_once(env)
      File "c:\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py", line 695:
        msvc_setup_env(env)
      File "c:\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py", line 814:
        d = msvc_find_valid_batch_script(env,version)
      File "c:\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py", line 762:
        d = script_env(vc_script, args=arg)
      File "c:\python37\lib\site-packages\scons\SCons\Tool\MSCommon\vc.py", line 621:
        stdout = common.get_output(script, args)
      File "c:\python37\lib\site-packages\scons\SCons\Tool\MSCommon\common.py", line 238:
        sys.stderr.write(stderr)
    

    Curiously the same SConscript executed on Windows 10 with the same version of VS, Python and SCons works correctly. It is quite strange, because on both systems Powershell is located at C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

    Required information

    • Link to SCons Users thread discussing your issue. https://pairlist4.pair.net/pipermail/scons-users/2019-December/007920.html
    • Version of SCons
    SCons by Steven Knight et al.:
            script: v3.1.2.bee7caf9defd6e108fc2998a2520ddb36a967691, 2019-12-17 02:07:09, by bdeegan on octodog
            engine: v3.1.2.bee7caf9defd6e108fc2998a2520ddb36a967691, 2019-12-17 02:07:09, by bdeegan on octodog
    
    • Version of Python Python 3.7.5 32-bit

    • How you installed SCons python -m pip install scons

    • What Platform are you on? (Linux/Windows and which version) Windows 7 and Windows 10, both x64

    • How to reproduce your issue? Please include a small self contained reproducer. Likely a SConstruct should do for most issues.

    env = DefaultEnvironment(MSVC_VERSION="14.2", TARGET_ARCH="x86")
    config_context = Configure(env)
    
    • How you invoke scons (The command line you're using "scons --flags some_arguments") just scons in the folder where my SConscript is located
    Op Sys: Windows MSVC 
    opened by lukaszgo1 34
  • Initial support for virtualenv

    Initial support for virtualenv

    Currently, if one runs SCons in a virtualenv, SCons tools will invoke only system executables, instead of execs provided by virtualenv. If, for example, some tool invokes python interpreter, SCons will use the /usr/bin/python, not the one from virtualen's directory. Despite SCons is running under virtualenv's python interpreter, the tool switches to /usr/bin/python.

    With this patch SCons automatically picks'up execs from the current virtualenv. This is achieved by prepending to env['ENV']['PATH'] sub-directories of virtualenv's home found in os.environ['PATH']. This is done during platform initialization (SCons.Platform.Platform), so all Environments, including the DefaultEnvironment see this change.

    This patch, I hope, shall also simplify usage of pipenv in SCons based projects, SCons modules and tools could be distributed via pip and installed automatically with the use of Pipfile. Pipenv resolves most of the current problems with tool inter-dependencies and tool development requirements. At the moment I was successful in converting two or three of my tools to the form of pipenv-ready pip modules, but without this patch, end-to-end tests (under virtualenv) lead to inconsistent use of out-of-virtualenv executables.

    Contributor Checklist:

    • [x] I have created a new test or updated the unit tests to cover the new/changed functionality.
    • [x] I have updated master/src/CHANGES.txt directory (and read the README.txt in that directory)
    • [x] I have updated the appropriate documentation
    opened by ptomulik 32
  • SCons does not handle fortran submodules and type bound procedures correctly.

    SCons does not handle fortran submodules and type bound procedures correctly.

    SCons seems to think that the declaration of the interface of type bound procedures in a module declares a module named function. This happens when the definition of the procedures are in submodules.

    • Version of SCons I have tried both SCons 3.0.1 and the latest development version SCons 3.1.0.alpha.

    • Version of Python Python 2.7.12

    • Which python distribution if applicable (python.org, cygwin, anaconda, macports, brew,etc) OpenSuse

    • How you installed SCons For version SCons 3.0.1: Downloaded and unpacked the tar ball from SourceForge cd'ed into the scons-3.0.1 directory and did 'python setup.py install' as root. For Version SCons 3.1.0.alpha:
      Cloned the git repository (git clone https://github.com/SCons/scons.git) cd'ed into the scons directory and did 'python bootstrap.py', 'cd build/scons' and finally 'python setup.py install' as root.

    • What Platform are you on? (Linux/Windows and which version) Linux OpenSuse 42.1

    • How to reproduce your issue? Please include a small self contained reproducer. Likely a SConstruct should do for most issues. In the following zip-file, there are 3 fortran source files and an SConstruct file that shows the issue. scons-submodule.zip When I run scons I get: scons: *** Multiple ways to build the same target were specified for: function.mod (from ['test_1.f90'] and from ['test_2.f90']) File "/home/diener/TMP/SCons_Test/SConstruct", line 28, in <module>

    • Link to SCons Users thread discussing your issue. https://pairlist4.pair.net/pipermail/scons-users/2018-April/006893.html

    opened by pdiener 28
  • [WIP] Fix 4282 file dir conflict stacktrace

    [WIP] Fix 4282 file dir conflict stacktrace

    Handle dir or file where file or dir expected better than just a long stack trace.

    Contributor Checklist:

    • [ ] I have created a new test or updated the unit tests to cover the new/changed functionality.
    • [ ] I have updated CHANGES.txt (and read the README.rst)
    • [ ] I have updated the appropriate documentation
    opened by bdbaddog 0
  • Moving a target into a subdir of its current location with same name as target yields stacktrace

    Moving a target into a subdir of its current location with same name as target yields stacktrace

    Describe the bug Here's a sample SConstruct which demonstrates the issue.

    env=Environment()
    
    if ARGUMENTS.get('dir', 0):
        env.Program('dir1/main/main','main.c')
    else:
        env.Program('dir1/main','main.c')
    
    

    If you run as

    scons
    # followed by
    scons dir=1
    

    Or the reverse

    You'll get a stack trace.

    Required information

    • Link to SCons Users thread discussing your issue.
    • Version of SCons Any
    • Version of Python Any
    • Which python distribution if applicable (python.org, cygwin, anaconda, macports, brew,etc) Any
    • How you installed SCons N/A
    • What Platform are you on? (Linux/Windows and which version) N/A
    • How to reproduce your issue? Please include a small self contained reproducer. Likely a SConstruct should do for most issues. See description above
    • How you invoke scons (The command line you're using "scons --flags some_arguments") See description above
    mongodb 
    opened by bdbaddog 2
  • Java version checking gets in the way

    Java version checking gets in the way

    Describe the bug

    There's a whitelist of acceptable Java versions here: https://github.com/SCons/scons/blob/master/SCons/Tool/JavaCommon.py#L104. It's out-of-date (current JDK is 19.0), and particularly with the new release cadence this is very likely to get out-of-date again quickly. If a client tries to specify a JDK version that isn't in the list, the build fails! I think this is unnecessarily strict.

    Also, default_java_version is set to 1.4, which is laughably old. I would recommend at least 1.8 (11.0 would be better).

    Required information

    • Discord mention: https://discord.com/channels/571796279483564041/571796280146133047/1052541516314329128

    • Version of SCons: 4.4.0

    Java 
    opened by garfieldnate 5
  • possible race condition in msvc tools cache

    possible race condition in msvc tools cache

    This is not a well investigated issue, just dropping something here to get it "written down".

    A couple of builds on Windows have failed with what looks like corruption in the msvc cache file. This isn't confirmed to be consistently reproducible, but has been seen at least twice now, with an error that looks like this (this one is a real capture, the other one I saw wasn't saved, I just retried and it worked - which, if it was a race, would make sense, because unlike the CI setup where the cache is rebuilt for each new image spun up, mine stays around):

    [00:17:38] 605/1266 (47.79%) C:\Python36\python.exe test\MSVC\MSVC_SPECTRE_LIBS.py
    [00:17:38] C:\projects\scons\scripts\scons.py returned 2
    [00:17:38] STDOUT =========================================================================
    [00:17:38]
    [00:17:38] STDERR =========================================================================
    [00:17:38] JSONDecodeError: Expecting ',' delimiter: line 382 column 125 (char 24284):
    [00:17:38]   File "C:\Users\appveyor\AppData\Local\Temp\1\testcmd.4240.tmk0iejo\SConstruct", line 3:
    [00:17:38]     env = Environment(MSVC_VERSION='11.0', MSVC_SPECTRE_LIBS=None, tools=['msvc'])
    [00:17:38]   File "C:\projects\scons\SCons\Environment.py", line 1030:
    [00:17:38]     apply_tools(self, tools, toolpath)
    [00:17:38]   File "C:\projects\scons\SCons\Environment.py", line 116:
    [00:17:38]     _ = env.Tool(tool)
    [00:17:38]   File "C:\projects\scons\SCons\Environment.py", line 1911:
    [00:17:38]     tool(self)
    [00:17:38]   File "C:\projects\scons\SCons\Tool\__init__.py", line 265:
    [00:17:38]     self.generate(env, *args, **kw)
    [00:17:38]   File "C:\projects\scons\SCons\Tool\msvc.py", line 298:
    [00:17:38]     msvc_setup_env_once(env, tool=tool_name)
    [00:17:38]   File "C:\projects\scons\SCons\Tool\MSCommon\vc.py", line 1110:
    [00:17:38]     msvc_setup_env(env)
    [00:17:38]   File "C:\projects\scons\SCons\Tool\MSCommon\vc.py", line 1259:
    [00:17:38]     d = msvc_find_valid_batch_script(env,version) 
    [00:17:38]   File "C:\projects\scons\SCons\Tool\MSCommon\vc.py", line 1162:
    [00:17:38]     d = script_env(env, vc_script, args=arg)
    [00:17:38]   File "C:\projects\scons\SCons\Tool\MSCommon\vc.py", line 1009:
    [00:17:38]     script_env_cache = common.read_script_env_cache()
    [00:17:38]   File "C:\projects\scons\SCons\Tool\MSCommon\common.py", line 125:
    [00:17:38]     envcache_list = json.load(f)
    [00:17:38]   File "C:\Python36\lib\json\__init__.py", line 299:
    [00:17:38]     parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
    [00:17:38]   File "C:\Python36\lib\json\__init__.py", line 354:
    [00:17:38]     return _default_decoder.decode(s)
    [00:17:38]   File "C:\Python36\lib\json\decoder.py", line 339:
    [00:17:38]     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    [00:17:38]   File "C:\Python36\lib\json\decoder.py", line 355:
    [00:17:38]     obj, end = self.scan_once(s, idx)
    

    If it was a race, we could see one test creating the cache and another test come along, see the cache exists and proceed to read it, but catch it before it's all written. But I think many tests would already have run which would have caused the cache to be created, so maybe it's a different kind of race.

    Perhaps the code in Tool/MSCommon/common.py should be catching JSONDecodeError and doing something better with it than dying?

    opened by mwichmann 8
  • Split out CPPDEFINES handling in Append methods

    Split out CPPDEFINES handling in Append methods

    Rather than having lots of special-case code for CPPDEFINES in four separate routines, add a new _add_cppdefines function to handle it, paying attention to append/prepend, unique/duplicating, and keep-original/replace-original. The existing special case handing was then removed from Append and AppendUnique (it was never present in Prepend and PrependUnique anyway - see #3876, but these now get it due to a call to the new function).

    Tuple handling is now consistent with list handling: a single tuple is treated as macro names to add, not as a name=value pair. A tuple or list has to be a member of a containing tuple or list to get the macro=value treatment. This may affect some existing usage. macro=value tuples without a value can now be entered either in (macro,) form or (macro, None) form.

    Internally, whenever append/prepend is done, existing contents are forced to a deque, which allows efficient adding at either end without resorting to the tricks the Prepend functions currently do (they still do these tricks, but only in non-CPPDEFINES cases). As a result, values from a dict are not stored as a dict, which has some effect on ordering: values will be consistently ordered, but the ones from the dict are no longer necessarily sorted.

    In SCons/Defaults.py, processDefines no longer sorts a dict it is passed, since Python now preserves dict order. This does not affect the E2E test for CPPDEFINES - since those all call an Append routine, CPPDEFINES will always be a deque, and so processDefines never sees a dict in that case. It could well affect real-life usage - if the setup of CPPDEFINES was such that it used to contain a dict with multiple entries, the order might change (sorting would have presented the keys from that dict in alphabetical order). This would lead to a one-time rebuild for actions that change (after that it will remain consistent).

    In the E2E test CPPDEFINES/append.py some bits were reformatted, and the handler routine now accounts for the type being a deque - since the test does a text comparison of internally produced output, it failed if the word "deque" appeared. Some new test cases were also added to exercise strings with spaces embedded in them.

    Changes were made to the expected output of the E2E test. These reflect changes in the way data is now stored in CPPDEFINES, and in some cases in order. Most of these do not change the meaning (i.e. "result" changes, but "final" output is the same). These are the exceptions:

    • "appending a dict to a list-of-2lists", AppendUnique case: order now preserved as entered (previously took the order of the appended dict)

    • "appending a string to a dict", Append case: not stored as a dict, so ordering is as originally entered.

    • "appending a dict to a dict", Append case: no longer merge into a dict, so this is now an actual append rather than a merge of dicts which caused the uniquing effect even without calling AppendUnique (arguably the old way was incorrect).

    A new test/CPPDEFINES/prepend.py is added to test Prepend* cases.

    append.py and prepend.py are structured to fetch the SConstruct from a fixture file.

    append.py got an added test in the main text matrix, a string of the macro=value form. The same 5x5 maxtrix is used in the new prepend.py test as well ("expected" values for these had to be added as well).

    Cosmetically, append and prepend now print their test summary so strings have quotation marks - the "orig" lines in the expected output was adjusted. This change looks like:

    -   orig = FOO, append = FOO
    +   orig = 'FOO', append = 'FOO'
    

    The other tests in test/CPPDEFINES got copyright updating and reformatting, but otherwise do not change.

    Documentation updated to clarify behavior.

    Fixes #4254 Fixes #3876

    Signed-off-by: Mats Wichmann [email protected]

    Contributor Checklist:

    • [X] I have created a new test or updated the unit tests to cover the new/changed functionality.
    • [X] I have updated CHANGES.txt (and read the README.rst)
    • [X] I have updated the appropriate documentation
    Documentation maintenance Append 
    opened by mwichmann 0
  • Append and AppendUnique handle quoting differently

    Append and AppendUnique handle quoting differently

    Example on a Windows platform and current

    env1.Append(CCFLAGS = '/this /is /a /test')
    env2.AppendUnique(CCFLAGS = '/this /is /a /test')
    

    giving in one case three arguments and the other a single quoted argument:

    cl /Fotestfile.obj /c testfile.cpp /TP /nologo /this /is /a /test
    cl /Fotestfile.obj /c testfile.cpp /TP /nologo "/this /is /a /test"
    

    This was split out from #3876 as it is not specific to CPPDEFINES, and that issue was intended to be devoted to CPPDEFINES issues.

    Append 
    opened by mwichmann 0
Releases(4.4.0)
  • 4.4.0(Jul 30, 2022)

    A new SCons release, 4.4.0, is now available on the SCons download page:

      https://scons.org/pages/download.html
    

    Here is a summary of the changes since 4.3.0:

    NOTE: If you build with Python 3.10.0 and then rebuild with 3.10.1 (or higher), you may see unexpected rebuilds. This is due to Python internals changing which changed the signature of a Python Action Function.

    NEW FUNCTIONALITY

    • Added MSVC_USE_SCRIPT_ARGS Environment variable which specifies command line arguments to pass to the script specified by MSVC_USE_SCRIPT.
    • Added Configure.CheckMember() checker to check if struct/class has the specified member.
    • Added SHELL_ENV_GENERATORS construction variable. This variable should be set to a list (or an iterable) which contains functions to be called in order when constructing the execution environment (Generally this is the shell environment variables). This allows the user to customize how (for example) PATH is constructed. Note that these are called for every build command run by SCons. It could have considerable performance impact if not used carefully.
    • Added MSVC_USE_SETTINGS construction variable to pass a dictionary to configure the msvc compiler system environment as an alternative to bypassing Visual Studio autodetection entirely.
    • Added MSVC_SDK_VERSION construction variable which allows building with a specific Microsoft SDK version. This variable is used with the msvc batch file determined via autodetection. Refer to the documentation for additional requirements and validation details.
    • Added MSVC_TOOLSET_VERSION construction variable which allows building with a specific toolset version. This variable is used with the msvc batch file determined via autodetection. This variable does not affect the autodetection and selection of msvc instances. The toolset version is applied after an msvc instance is selected. This could be the default version of msvc. Refer to the documentation for additional requirements and validation details. Addresses issue #3265, issue #3664, and pull request #4149.
    • Added MSVC_SPECTRE_LIBS construction variable which allows building with spectre-mitigated Visual C++ libraries. This variable is used with the msvc batch file determined via autodetection. Refer to the documentation for additional requirements and validation details.
    • Added MSVC_SCRIPT_ARGS construction variable which specifies command line arguments that are passed to the msvc batch file determined via autodetection. Refer to the documentation for additional requirements and validation details. Addresses enhancement issue #4106.
    • Ninja: Added new alias "shutdown-ninja-scons-daemon" to allow ninja to shutdown the daemon. Also added cleanup to test framework to kill ninja scons daemons and clean ip daemon logs. NOTE: Test for this requires python psutil module. It will be skipped if not present.
    • Ninja: Added command line variable NINJA_CMD_ARGS that allows to pass through ninja command line args. This can also be set in your Environment().
    • Added a global policy setting and an environment construction variable for specifying the action to be taken when an msvc request cannot be satisfied. The available options are "error", "exception", "warning", "warn", "ignore", and "suppress". The global policy variable may be set and retrieved via the functions msvc_set_notfound_policy and msvc_get_notfound_policy, respectively. These two methods may be imported from SCons.Tool.MSCommon. The environment construction variable is MSVC_NOTFOUND_POLICY. When defined, the environment construction variable overrides the global policy setting for a given environment. When the active policy is "error" or "exception", an MSVCVersionNotFound exception is raised. When the active policy is "warning" or "warn", a VisualCMissingWarning warning is issued and the constructed environment is likely incomplete. When the active policy is "ignore" or "suppress", no action is taken and the constructed environment is likely incomplete. As implemented, the default global policy is "warning". The ability to set the global policy via an SCons command-line option may be added in a future enhancement.
    • Added a global policy setting and an environment construction variable for specifying the action to be taken when msvc script errors are detected. The available options are "error", "exception", "warning", "warn", "ignore", and "suppress". The global policy variable may be set and retrieved via the functions msvc_set_scripterror_policy and msvc_get_scripterror_policy, respectively. These two methods may be imported from SCons.Tool.MSCommon. The environment construction variable is MSVC_SCRIPTERROR_POLICY. When defined, the environment construction variable overrides the global policy setting for a given environment. When the active policy is "error" or "exception", an MSVCScriptExecutionError exception is raised when msvc batch file errors are detected. When the active policy is "warning" or "warn", an MSVCScriptExecutionWarning warning is issued when msvc batch file errors are detected. When the active policy is "ignore" or "suppress", msvc batch error messages are suppressed. As implemented, the default global policy is "ignore". The ability to set the global policy via an SCons command-line option may be added in a future enhancement.
    • Added experimental function msvc_query_version_toolset to SCons.Tool.MSCommon. Given a version specification, this function will return an msvc version and an msvc toolset version. The msvc toolset version may be None. The msvc version and msvc toolset version can be used in the environment construction variables MSVC_VERSION and MSVC_TOOLSET_VERSION, respectively. The version specification may be an msvc version or an msvc toolset version. This is a proxy for using an msvc toolset version to select an msvc instance. This function may be removed when an msvc toolset version is used during msvc instance selection.
    • Fortran: a new construction variable FORTRANCOMMONFLAGS is added which is applied to all Fortran dialects, to enable global (all-dialect) settings.
    • lex: two new construction variables are introduced (LEX_HEADER_ILE and LEX_TABLES_FILE) as the preferred way of specifying extra files that the tool can generate.
    • yacc: two new construction variables are introduced (YACC_HEADER_FILE and YACC_GRAPH_FILE) as the preferred way of specifying extra files that the tool can generate (applies only when using GNU flex and GNU bison).

    CHANGED/ENHANCED EXISTING FUNCTIONALITY

    • On Windows, %AllUsersProfile%\scons\site_scons is now the default "system" location for a site_scons directory. %AllUsersProfile%\Application Data\scons\site_scons will continue to work. There does not seem to be any existing convention to use an "Application Data" subdirectory here.

    • Action._subproc() can now be used as a python context manager to ensure that the POpen object is properly closed.

    • SCons help (-H) no longer prints the "ignored for compatibility" options, which are still listed in the manpage.

    • Help is now sensitive to the size of the terminal window: the width of the help text will scale to wider (or narrower) terminals than 80 characters.

    • Ninja: Changed generated build.ninja file to run SCons only build Actions via a SCons Deamon. Added logic for starting and connecting to SCons daemon (currently only used for ninja)

    • The change to "content" and "content-timestamp" Decider names is reflected in the User Guide as well, since the hash function may be other than md5 (tidying up from earlier change)

    • If the (experimental) SCONS_CACHE_MSVC_CONFIG feature is used, it will now attempt a sanity check for the cached compiler information, and regenerate it if needed. Previously, this cache would fail if a compiler upgrade caused a change to internal paths (e.g. upgrading from 17.1 to 17.2 causes a necessary path component in some of the cached vars to need to 14.32.31326 instead of 14.31.31103), and the cache file needed to be manually removed. The default cachefile name is now "scons_msvc_cache.json" rather than ".scons_msvc_cache" so there should be no transition problem if using the default; if using a custom cache file name, the cache should still be manually removed if there are problems to transition to the new style.

    • Ninja: Update ninja file generation to only create response files for build commands which exceed MAXLINELENGTH

    • Update the debug output written to stdout for MSVC initialization which is enabled by setting SCONS_MSCOMMON_DEBUG=- to use the logging module. Also changed the debug output format written to stdout to include more information about the source for each message of MSVC initialization debugging output. A single space was added before the message for all debugging output records written to stdout and to files.

    • Ninja: Made ninja tool force the ninja file as the only target. Also improved the default targets setup and made sure there is always a default target for the ninja file, which excludes targets that start and stop the daemon.

    • Ninja: Update ninja tool so targets passed to SCons are propgated to ninja when scons automatically executes ninja.

    • Add JavaScanner to include JAVACLASSPATH as a dependency when using the Java tool.

    • The build argument (i.e., x86) is no longer passed to the MSVC 6.0 to 7.1 batch files. This may improve the effectiveness of the internal msvc cache when using MSVC detection and when bypassing MSVC detection as the MSVC 6.0 to 7.1 batch files do not expect any arguments.

    • Propagate the OS and windir environment variables from the system environment to the msvc environment. The OS and windir environment variables are used in the MSVC 6.0 batch file and the SDK 6.0-7.1 SetEnv.cmd batch files. Inclusion of the OS and windir environment variables eliminates some partial paths and warnings generated by the MSVC 6.0 and SDK 6.0-7.1 batch files when the variables are not defined.

      • Note: Attempting to run the SDK 6.0-7.1 batch files directly via MSVC_USE_SCRIPT can lead to build failures and/or incomplete build environments. The SDK 6.0-7.1 batch files require delayed expansion to be enabled which is currently not supported and is typically not enabled by default on the host system. The batch files may also require environment variables that are not included by default in the msvc environment.
    • An exception is raised when MSVC_UWP_APP is enabled for Visual Studio 2013 and earlier. Previous behavior was to silently ignore MSVC_UWP_APP when enabled for Visual Studio 2013 and earlier. Refer to the documentation for additional requirements and validation details. MSVC_UWP_APP was extended to accept True, False, and None in addition to '1' and '0'.

    • Ninja: added option "--skip-ninja-regen" to enable skipping regeneration of the ninja file if scons can determine the ninja file doesnot need to be regenerated, which will also skip restarting the scons daemon. Note this option is could result in incorrect rebuilds if scons Glob or scons generated files are used in ninja build target's command lines.

    • Tool loading used to have a special case for Jython, it no longer does. This effectively means SCons doesn't work with Jython, which has in reality been the case ever since SCons dropped Python 2 support - there is still no timeline for Jython switching to Python 3 compatibility.

    FIXES

    • Fix a number of Python ResourceWarnings which are issued when running SCons and/or it's tests with python 3.9 (or higher)
    • Ninja: Fix issue where Configure files weren't being properly processed when build run via ninja.
    • Fixed crash in C scanner's dictify_CPPDEFINES() function which happens if AppendUnique is called on CPPPATH. (Issue #4108).
    • Added default values for source and target arguments to _defines() function. This is used to expand CPPDEFINES (and others). Previous change added those arguments with no defaults, so old usage where _defines() was called without source and target arguments would yield an exception. This issue was found via qt4 and qt5 tools in scons-contrib https://github.com/SCons/scons-contrib/issues/45
    • Fix issue where if you only had mingw installed on a Windows system and no MSVC compiler, and did not explicitly request the mingw tool, mingw tool initialization would fail and set the default compiler to MSVC which wasn't installed, yielding broken build. Updated mingw tool so that the generate and exists methods use the same mingw search paths (issue #4134).
    • Ninja: Added NINJA_GENERATED_SOURCE_ALIAS_NAME which allows user to specify an Alias() which the ninja tool can use to determine which files are generated sources. If this is not set by the user then the ninja tool will still dynamically determine which files are generated sources based on NINJA_GENERATED_SOURCE_SUFFIXES, and create a phony target _ninja_generated_sources. Generated sources will be built first by ninja. This is needed because ninja cannot determine which generated sources are required by other build targets. Code contributed by MongoDB.
    • Added special case for ninja scons daemon to work in win32 python3.6 environments. This particular environment does a bad job managing popen standard file handles, so some special workarounds are needed.
    • Added user configurable setting of ninja depfile format via NINJA_DEPFILE_PARSE_FORMAT. Now setting NINJA_DEPFILE_PARSE_FORMAT to [msvc,gcc,clang] can force the ninja expected format. Compiler tools will also configure the variable automatically.
    • Fix issue where Express versions of the MSVC compiler were not detected due to differences in initial msvc detection and msvc batch file determination when configuring the build environment. This could lead to build failures when only an MSVC Express instance is installed and the MSVC version is not explicitly specified (issue #2668 and issue #2697).
    • Restore the ability of the content-timestamp decider to see that a a source which is a symlink has changed if the file-system target of that link has been modified (issue #3880)
    • Fix typo in ninja scons daemon startup which causes ConnectionRefusedError to not retry to connect to the server during start up.
    • Fix incorrect Java classpath generation when a NodeList is used as part of any JAVA*PATH variables.
    • The system environment variable names imported for MSVC 7.0 and 6.0 were updated to be consistent with the variables names defined by their respective installers. This fixes an error caused when bypassing MSVC detection by specifying the MSVC 7.0 batch file directly.
    • lex: Fixed an issue with the lex tool where file arguments specified to either "--header-file=" or "--tables-file=" which included a space in the path to the file would be processed incorrectly
    • Modify the MSCommon logger configuration to be independent of the root logger. This fixes an issue when multiple loggers are created and the MSCommon logger added computed fields to the root logger that are not present in other logging instances.
    • Modify the MSVC_USE_SCRIPT_ARGS test fixture to disable the msvc cache. This fixes an issue where the MSVC_USE_SCRIPT_ARGS test for success relied on a debug log message that was not produced when the msvc cache file exists and the test keys are already in the cache as the msvc script invocation was bypassed.
    • Suppress issuing a warning when there are no installed Visual Studio instances for the default tools configuration (issue #2813). When msvc is the default compiler because there are no compilers installed, a build may fail due to the cl.exe command not being recognized. At present, there is no easy way to detect during msvc initialization if the default environment will be used later to build a program and/or library. There is no error/warning issued for the default tools as there are legitimate SCons uses that do not require a c compiler.

    IMPROVEMENTS

    • Verify that a user specified msvc script (via MSVC_USE_SCRIPT) exists and raise an exception immediately when the user specified msvc script does not exist.
    • Add cache-debug messages for push failures.
    • Ninja: Added ninja mingw support and improved ninja CommandGeneratorAction support.
    • Command-line help is now sensitive to the size of the terminal window: the width of the help text will scale for terminals other than 80 chars wide.
    • Refactor the msvc code so that the same data structures are used during initial msvc detection and msvc batch file determination when configuring the build environment. Simplify the msvc code by eliminating special case handling primarily due to the differences between the full versions and express versions of visual studio.
    • Small refactor of scons daemons using a shared StateInfo class for communication between the scons interactive thread and the http server thread. Added error handling for scons interactive failing to startup.
    • Ninja: Updated ninja scons daemon scripts to output errors to stderr as well as the daemon log.
    • Ninja: Ensure that all targets set as default via Default() in SConstruct/SConscripts are default targets in the generated ninja.build file.

    PACKAGING

    • Added project_url for mailing lists and Discord
    • Updated setup.cfg to remove Python 3.5 and add Python 3.10

    Thanks to the following contributors listed below for their contributions to this release.

    .. code-block:: text

    git shortlog --no-merges -ns 4.3.0..HEAD
    174  Joseph Brill
    126  Mats Wichmann
      93  William Deegan
      64  Daniel Moody
      4  SergBobrovsky
      2  dependabot[bot]
      1  djh
      1  Ivan Kravets
      1  Vishwajith-K
      1  Zhichang Yu
    

    .. _page: http://sourceforge.net/projects/scons/files/scons/4.4.0/ .. _ChangeLog: https://raw.githubusercontent.com/SCons/scons/rel_4.4.0/CHANGES.txt

    Source code(tar.gz)
    Source code(zip)
    CHANGES.txt(291.73 KB)
    README.rst(21.31 KB)
    RELEASE.txt(17.85 KB)
    SCons-4.4.0-py3-none-any.whl(4.03 MB)
    SCons-4.4.0.tar.gz(2.95 MB)
    SCons-4.4.0.zip(4.03 MB)
    scons-doc-4.4.0.tar.gz(10.32 MB)
    scons-local-4.4.0.tar.gz(5.82 MB)
    scons-local-4.4.0.zip(7.75 MB)
  • 4.3.0(Feb 15, 2022)

    A new SCons release, 4.3.0, is now available on the SCons download page:

      https://scons.org/pages/download.html
    

    NOTE: 4.3.0 now requires Python 3.6.0 and above. Python 3.5.x is no longer supported

    Here is a summary of the changes since 4.2.0:

    NEW FUNCTIONALITY

    • Ninja - Added ninja API 'NINJA_FORCE_SCONS_BUILD' to force a node to callback to scons.
    • Add support for Visual Studio 2022.

    DEPRECATED FUNCTIONALITY

    • The qt tool, which targets Qt version 3, is deprecated. Qt3 has been unsupported by upstream for many years. Qt4 and Qt5 tools are available from scons-contrib.

    CHANGED/ENHANCED EXISTING FUNCTIONALITY

    • Ninja - Expanded ninja Mkdir to also support Mkdir actions.
    • Further PCH updates. It's now recommended that env['PCH'] should always be a File node. Either via return value from env.PCH() or by explicitly using File('StdAfx.pch').
    • Change SCons.Platform.win32.get_architecture() to return platform.platform() when run in an environment where neither: PROCESSOR_ARCHITEW6432 nor PROCESSOR_ARCHITECTURE is set. This should fix platform tests which started failing when HOST_OS/HOST_ARCH changes introduced by Aaron Franke (listed below) were merged.
    • The Java tool now accepts more versions (up to 17.0), and is better able to detect the many builds of OpenJDK available since it became designated the reference Java implementation.

    FIXES

    • Fix reproducible builds. Restore logic respecting SOURCE_DATE_EPOCH when set.
    • Small fix to ensure CLVar default value is an empty list. See MongoDB bug report: https://jira.mongodb.org/browse/SERVER-59656 Code contributed by MongoDB.
    • Ninja - Fix ninja tool to never use for_sig substitution because ninja does not use signatures. This issue affected CommandGeneratorAction function actions specifically.
    • Fix PCH not being evaluated by subst() where necessary.
    • Fix issue #4021. Change the way subst() is used in Textfile() to not evaluate '$$(' -> '$', but instead it should yield '$('.
    • Ninja - Fix command line escaping for ninja dollar sign escape. Without escaping ninja properly,
    • Fix MSVS tests (vs-N.N-exec.py) for MSVS 6.0, 7.0, and 7.1 (import missing module).
    • Fix command line escaping for ninja dollar sign escape. Without escaping ninja properly, the ninja file scons regenerate and callback invocations will lose the $ characters used in the scons command line which ninja uses itself for escaping. For Example: scons BUILD=xyz OTHERVAR=$BUILD Prior to this fix, it would cause ninja to fail to escape the dollar sign, leading to the single dollar sign being used as a ninja escape character in the ninja file.
    • Ninja - Fixed an issue where if you control-c and/or killed ninja while it was running scons to regenerate build.ninja you would end up with no build.ninja file and have to rerun scons from scratch. Code contributed by MongoDB.

    DEVELOPMENT

    • Added --no-ignore-skips to runtest.py. Changed default to ignore skips when setting runtest.py's exit status. Previously would exit 2 if any tests were skipped. Now will only exit 2 if user specifies --no-ignore-skips and some tests were skipped.

    Thanks to the following contributors listed below for their contributions to this release.

    .. code-block:: text

    git shortlog --no-merges -ns 4.2.0..HEAD
    47  Mats Wichmann
    46  William Deegan
    14  Jacob Cassagnol
    11  Daniel Moody
     8  Ryan Egesdahl
     5  Joseph Brill
     4  Omar Polo
     2  Brian Quistorff
     1  Aaron Franke
    
    Source code(tar.gz)
    Source code(zip)
  • 4.2.0(Aug 5, 2021)

    A new SCons release, 4.2.0, is now available on the SCons download page:

      https://scons.org/pages/download.html
    

    Here is a summary of the changes since 4.1.0:

    NOTE: The 4.2.0 Release of SCons will deprecate Python 3.5 Support. Python 3.5 support will be dropped in the next major release.

    NEW FUNCTIONALITY

    - Add support for the (TARGET,SOURCE,TARGETS,SOURCES,CHANGED_TARGETS,CHANGED_SOURCES}.relpath property.
      This will provide a path relative to the top of the build tree (where the SConstruct is located)
      Fixes #396
    - Added --experimental flag, to enable various experimental features/tools.  You can specify
      'all', 'none', or any combination of available experimental features.
    - Added affect_signature flag to  _concat function.  If set to False, it will prepend and append $( and $).
      That way the various Environment variables can use that rather than "$( _concat(...) $)".
    

    DEPRECATED FUNCTIONALITY

    - Deprecate Python 3.5 as a supported version.
    

    CHANGED/ENHANCED EXISTING FUNCTIONALITY

    - SCons now supports the command-line parameter `--hash-format` to override the default
      hash format that SCons uses. It can also be set via `SetOption('hash_format')`. Supported
      values are: `md5`, `sha1`, and `sha256`. For all hash formats other than
      the default of `md5`, the SConsign database will include the name of the hash format.
      For example, `--hash-format=sha256` will create a SConsign with name
      `.sconsign_sha256.dblite.`.
    - Improve Subst()'s logic to check for proper callable function or class's argument list.
      It will now allow callables with expected args, and any extra args as long as they
      have default arguments. Additionally functions with no defaults for extra arguments
      as long as they are set using functools.partial to create a new callable which set them.
    - Internal has_key methods removed from SCons' dictionary-like objects
      SubstitutionEnvironment and OverrideEnvironment - in other words,
      an env - to match Python 3 which no longer has dict.has_key.
    - Removed long-deprecated construction variables PDFCOM, WIN32_INSERT_DEF,
      WIN32DEFPREFIX, WIN32DEFSUFFIX, WIN32EXPPREFIX, WIN32EXPSUFFIX.
      All have been replaced by other names since at least 1.0.
    - Added CACHEDIR_CLASS construction variable and expanded CacheDir method args
      to support SCons invoking CacheDir derived classes for CacheDir customization.
      Moved copy_from_cache attribute from the Environment class to CacheDir class.
      Code contributed by MongoDB.
    - Update BuildTask to pass all targets to the progress object fixing an issue
      where multi-target build nodes only got the first target passed to the progress
      object.
    - Change SConscript() missing SConscript behavior - if must_exist=False,
      the warning is suppressed.
    

    FIXES

    - The command-line parameter `--md5-chunksize` is now deprecated. Use `--hash-chunksize`
      instead.
    - Fix Issue #3906 - `IMPLICIT_COMMAND_DEPENDENCIES` was not properly disabled when
      set to any string value (For example ['none','false','no','off'])
      Also previously 'All' wouldn't have the desired affect.
    - DocbookXslt tool: The XSLT stylesheet file is now initialized to an env.File() Node, 
      such that dependencies work correctly in hierarchical builds (eg when using 
      DocbookXslt in SConscript('subdir/SConscript') context.
    - The Install builder will now set the writable mode on the file(s) it
      copies. This restores the (previously undocumented) SCons behavior
      that regressed as of 4.0.0.
    - Fix issue #3790: Generators in CPPDEFINES now have access to populated source
      and target lists
    - Fix a potential race condition in shared cache environments where the permissions are
      not writeable for a moment after the file has been renamed and other builds (users) will copy
      it out of the cacheSmall reorganization of logic to copy files from cachedir. Moved CacheDir 
      writeable permission code for copy to cache behind the atomic rename operation.
    - Fixed intermediate and and multi target nodes generated from SConf tests not being marked
      as is_conftest().
    

    Thanks to the following contributors listed below for their contributions to this release.

    .. code-block:: text

    git shortlog --no-merges -ns 4.1.0..HEAD
       177  William Deegan
       101  Daniel Moody
        95  Mats Wichmann
        25  Adam Gross
         4  greenbender
         4  Daniel
         4  Henrik Maier
         4  Mathew Robinson
         3  Andrew Morrow
         3  Ivan Kravets
         3  Dillan Mills
         1  WholesomeIsland
         1  dependabot[bot]
         1  djh
         1  Joseph Brill
    
    Source code(tar.gz)
    Source code(zip)
  • 4.1.0(Jan 19, 2021)

    SCons 4.1.0 is available

    Here is a summary of the changes since 4.0.1:

    NEW FUNCTIONALITY

    • Add COMPILATIONDB_PATH_FILTER env option for CompilationDatabase() builder which allows filtering of entries based on the output file paths using glob style file matching (issue #3742).
    • Add ZIP_OVERRIDE_TIMESTAMP env option to Zip builder which allows for overriding of the file modification times in the archive.
    • Raise an error if an option (not otherwise consumed) is used which looks like an abbreviation of one one added by AddOption. (#3653)

    CHANGED/ENHANCED EXISTING FUNCTIONALITY

    • Completely rewrote versioned shared libraries logic. Added support for SOVERSION via dmoody's initial PR #3733

    • No longer automatically disable setting SONAME on shared libraries on OpenBSD.

    • Environment.SideEffect() no longer adds duplicate side effects. NOTE: The list of returned side effect Nodes will not include any duplicate side effect Nodes.

    • /snap/bin is added to the default search path for the 'posix' platform.

    • Completely rewrote versioned shared libraries logic.

    • Added support for SOVERSION

    • No longer automatically disable setting SONAME on shared libraries on OpenBSD.

    • Switch to use ctypes instead of pywin32 (requiring an extra pip install) - Fixes Github Issue #2291

      • pywin32 no longer necessary for SCons install. (pip install SCons will no longer also require pywin32 on win32)
      • Remove pywin32 usage from SCons.Util where it was used for accessing the registry. Python native winreg library already includes this functionality.
      • Remove using pywin32 to retrieve peak memory usage on Win32 for --debug=memory
    • Tool module not found will now raise a UserError to more clearly indicate this is probably an SConscript problem, and to make the traceback more relevant.

    • Fix three issues with MergeFlags:

      • Signature/return did not match documentation or existing usage - the implementation now no longer returns the passed env
      • merging --param arguments did not work (issue #3107);
      • passing a dict to merge where the values are strings failed (issue #2961).
    • Only try to initialize the wix tool by default (or when tool default is explicitly installed) on Windows based systems.

    • Add /snap/bin to env['PATH'] on POSIX, although this is only really useful for a subset of POSIX systems that use snaps. Was needed for CI builds, which run on Ubuntu LTS images.

    FIXES

    • Fix yacc tool, not respecting YACC set at time of tool initialization.
    • Fix race condition bug when initializing a scons cache directory at the same time from multiple threads or processes. Problem described in PR #3114. This is a simpler fix which should avoid some problems identified with the initial PR. (Credit to Fredrik Medley for reporting the issue, the initial PR, and discussing and testing this solution)
    • Fix incorrect cache hits and/or misses when running in interactive mode by having SCons.Node.Node.clear() clear out all caching-related state.
    • Fix Zip builder not rebuilding when ZIPROOT env option was changed.
    • Fix python3 crash when Value node get_text_content when child content does not have decode() NOTE: If you depend on Value node's get_text_content returning concatenated contents of it's children. This may break your code. It now concatenates the csig() of all children.
    • Fix Zip tool to respect ZIPCOMSTR. Previously all zip builder calls would yield something like zip(["test.zip"], ["zip_scons.py"]) and ignore ZIPCOMSTR if ZIPCOM and ZIPCOMSTR weren't set after the Environment/Tool is initialized. (Explained in PR #3659)
    • Fix issue where java parsed a class incorrectly from lambdas used after a new.
    • Fix using TEMPFILE in multiple actions in an action list. Previously a builder, or command with an action list like the following could yield a single tempfile with the first TEMPFILE's contents, used by both steps in the action list.

    .. code-block:: text

    ['${TEMPFILE("xxx.py -otempfile $SOURCE")}', '${TEMPFILE("yyy.py -o$TARGET tempfile")}']

    • Cleanup in SCons.Util.AddMethod. If called with an environment instance as the object to modify, the method would not be correctly set up in any Clone of that instance. Now tries to detect this and calls MethodWrapper to set up the method the same way env.AddMethod does. MethodWrapper moved to Util to avoid a circular import. Fixes #3028.
    • Fix Issue #3014 - Empty file and missing file have same csig

    PACKAGING

    • Fix Issue #3759 - include scons.1, sconsign.1, scons-time.1 manpages in sdist and wheel packages.
    • Pick a better "Topic" Trove classifier for SCons: SW Dev / Build Tools

    DOCUMENTATION

    • Include previously-excluded SideEffect section in User Guide.

    DEVELOPMENT

    • Rework runtest.py to use argparse for arg handling (was a mix of hand-coded and optparse, with a stated intent to "gradually port").
    • Add options to runtest to generate/not generate a log of failed tests, and to rerun such tests. Useful when an error cascades through several tests, can quickly try if a change improves all the fails. Dropped runtest test for fallback from qmtest, not needed; added new tests.

    Thanks to the following contributors listed below for their contributions to this release.

    .. code-block:: text

    git shortlog --no-merges -ns 4.0.1..HEAD
      115  Mats Wichmann
        83  William Deegan
        14  Adam Gross
        4  Joseph Brill
        3  Joachim Kuebart
        2  GIT
        2  Daniel Moody
        2  James Benton
        1  Unknown
        1  Daniel
        1  anatoly techtonik
        1  Dirk Baechle
        1  dependabot[bot]
        1  David H
        1  Michał Górny
        1  Simon Tegelid
    

    .. _page: http://sourceforge.net/projects/scons/files/scons/4.1.0/ .. _ChangeLog: https://raw.githubusercontent.com/SCons/scons/rel_4.1.0/CHANGES.txt

    Source code(tar.gz)
    Source code(zip)
  • 3.0.5a2(Mar 5, 2019)

Python package used on Hardfight projects to make building, testing and deploying easy.

Hardfight Devtools Build, test and deploy Hardfight projects easly 💡 What is it Devtools is a Python tool to make building, testing and deploying int

Hardfight 1 Dec 05, 2021
Official project repository for the Setuptools build system

See the Installation Instructions in the Python Packaging User's Guide for instructions on installing, upgrading, and uninstalling Setuptools. Questio

Python Packaging Authority 1.9k Jan 08, 2023
The Pants Build System

Pants Build System Pants is a scalable build system for monorepos: codebases containing multiple projects, often using multiple programming languages

Pants Build 2.5k Jan 07, 2023
bitbake tool

Bitbake ======= BitBake is a generic task execution engine that allows shell and Python tasks to be run efficiently and in parallel while working wit

openembedded 336 Dec 27, 2022
Buildout is a deployment automation tool written in and extended with Python

Buildout Buildout is a project designed to solve 2 problems: Application-centric assembly and deployment Assembly runs the gamut from stitching togeth

buildout 552 Nov 26, 2022
Software build automation tool for Python.

PyBuilder — an easy-to-use build automation tool for Python PyBuilder is a software build tool written in 100% pure Python, mainly targeting Python ap

PyBuilder 1.5k Jan 04, 2023
Python-based project scripting.

Paver - Easy Scripting for Software Projects Web: https://pythonhosted.org/Paver/ Download: https://pypi.python.org/pypi/Paver/ Source: https://github

Paver community 452 Dec 09, 2022
task management & automation tool

README doit - automation tool doit comes from the idea of bringing the power of build-tools to execute any kind of task Sample Code Define functions r

doit 1.5k Dec 30, 2022
🔨🐍Make-like build automation tool for Python projects with extensive DSL features.

Pyke (WIP, Beta Release) Make-like build automation tool for Python projects with extensive DSL features. Features: Users can specify tasks, subtasks,

Ire 17 Jul 05, 2022
Python-based continuous integration testing framework; your pull requests are more than welcome!

Buildbot The Continuous Integration Framework Buildbot is based on original work from Brian Warner, and currently maintained by the Botherders. Visit

Buildbot 5k Jan 05, 2023
This is a python helper package for Telebirr H5 Web payment integration helper.

Project Glow Greetings, I see you have stumbled upon project glow. Project glow is an open source bot worked on by many people to create a good and sa

24 Dec 13, 2022
The Meson Build System

Meson® is a project to create the best possible next-generation build system. Status Dependencies Python (version 3.6 or newer) Ninja (version 1.8.2 o

The Meson Build System 4.4k Jan 02, 2023
A pynt of Python build.

A pynt of Python build. Raghunandan Rao Features Easy to learn. Build tasks are just python funtions. Manages dependencies between tasks. Automaticall

Raghunandan Rao 154 Jan 04, 2023
Utilities for interacting with PyPI

twine Twine is a utility for publishing Python packages on PyPI. It provides build system independent uploads of source and binary distribution artifa

Python Packaging Authority 1.4k Jan 05, 2023
Program for convert py & js file to exe

Converter JS & PY to Exe Converter Coded by Lamp Requirements : Node.js Python How to Use : Install latest python Dont forget to add path Install node

5 Oct 04, 2021
PlatformIO is a professional collaborative platform for embedded development :alien: A place where Developers and Teams have true Freedom! No more vendor lock-in!

PlatformIO Quick Links: Web | PlatformIO IDE | Project Examples | Docs | Donate | Contact Us Social: LinkedIn | Twitter | Facebook | Community Forums

PlatformIO 6.5k Jan 08, 2023
Pythonic task management & command execution.

Welcome to Invoke! Invoke is a Python (2.7 and 3.4+) library for managing shell-oriented subprocesses and organizing executable Python code into CLI-i

3.8k Jan 06, 2023
Package, distribute, and update any app for Linux and IoT.

Snapcraft Package, distribute, and update any app for Linux and IoT. Snaps are containerised software packages that are simple to create and install.

1.1k Jan 02, 2023
A Star Trek Online build tool in Python

SETS - STO Equipment and Trait Selector A Star Trek Online build tool in Python Description Pre-alpha version of build tool for STO Getting Started De

Star Trek Online Community Developers 7 Nov 12, 2022
The official binary distribution format for Python

wheel This library is the reference implementation of the Python wheel packaging standard, as defined in PEP 427. It has two different roles: A setupt

Python Packaging Authority 368 Dec 23, 2022