• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

SCons/H01-Aug-2021-433,562360,545

SCons.egg-info/H03-May-2022-172119

LICENSEH A D05-Jul-20211.1 KiB2318

MANIFEST.inH A D14-Jun-2021155 115

PKG-INFOH A D01-Aug-20215.3 KiB172119

README.rstH A D01-Aug-202122 KiB638441

scons-time.1H A D01-Aug-202124.4 KiB760730

scons.1H A D01-Aug-2021573.7 KiB22,49622,200

sconsign.1H A D01-Aug-20215.6 KiB199173

setup.cfgH A D03-May-20221.8 KiB7363

setup.pyH A D14-Jun-20211.2 KiB4633

README.rst

1SCons - a software construction tool
2####################################
3
4.. image:: https://img.shields.io/badge/IRC-scons-blue.svg
5   :target: https://web.libera.chat/#scons
6   :alt: IRC
7
8.. image:: https://img.shields.io/sourceforge/dm/scons.svg
9   :target: https://sourceforge.net/projects/scons
10   :alt: Sourceforge Monthly Downloads
11
12.. image:: https://img.shields.io/sourceforge/dt/scons.svg
13   :target: https://sourceforge.net/projects/scons
14   :alt: Sourceforge Total Downloads
15
16.. image:: https://travis-ci.com/SCons/scons.svg?branch=master
17   :target: https://travis-ci.com/SCons/scons
18   :alt: Travis CI build status
19
20.. image:: https://ci.appveyor.com/api/projects/status/github/SCons/scons?svg=true&branch=master
21   :target: https://ci.appveyor.com/project/SCons/scons
22   :alt: AppVeyor CI build Status
23
24.. image:: https://codecov.io/gh/SCons/scons/branch/master/graph/badge.svg
25   :target: https://codecov.io/gh/SCons/scons
26   :alt: CodeCov Coverage Status
27
28.. image:: https://github.com/SCons/scons/workflows/SCons%20Build/badge.svg
29   :target: https://github.com/SCons/scons/actions?query=workflow%3A%22SCons+Build%22
30   :alt: Github Actions
31
32
33Welcome to the SCons development tree.  The real purpose of this tree is to
34package SCons for production distribution in a variety of formats, not just to
35hack SCons code.
36
37If all you want to do is install and run SCons, it will be easier for you to
38download and install the scons-{version}.tar.gz or scons-{version}.zip package
39rather than to work with the packaging logic in this tree.
40
41To the extent that this tree is about building SCons packages, the *full*
42development cycle is not just to test the code directly, but to package SCons,
43unpack the package, "install" SCons in a test subdirectory, and then to run
44the tests against the unpacked and installed software.  This helps eliminate
45problems caused by, for example, failure to update the list of files to be
46packaged.
47
48For just working on making an individual change to the SCons source, however,
49you don't actually need to build or install SCons; you *can* actually edit and
50execute SCons in-place.  See the following sections below for more
51information:
52
53    `Making Changes`_
54        How to edit and execute SCons in-place.
55
56    `Debugging`_
57        Tips for debugging problems in SCons.
58
59    `Testing`_
60        How to use the automated regression tests.
61
62    `Development Workflow`_
63        An example of how to put the edit/execute/test pieces
64        together in a reasonable development workflow.
65
66
67Latest Version
68==============
69
70Before going further, you can check that the package you have is the latest
71version at the SCons download page:
72
73        http://www.scons.org/pages/download.html
74
75
76Execution Requirements
77======================
78
79Running SCons requires Python 3.5 or higher. There should be no other
80dependencies or requirements to run scons
81
82As of SCons 4.2.0 support for Python 3.5 is deprecated and will be removed
83with the next major release.
84
85
86The default SCons configuration assumes use of the Microsoft Visual C++
87compiler suite on Win32 systems, and assumes a C compiler named 'cc', a C++
88compiler named 'c++', and a Fortran compiler named 'gfortran' (such as found
89in the GNU C compiler suite) on any other type of system.  You may, of course,
90override these default values by appropriate configuration of Environment
91construction variables.
92
93By default, SCons knows how to search for available programming tools on
94various systems--see the SCons man page for details.  You may, of course,
95override the default SCons choices made by appropriate configuration of
96Environment construction variables.
97
98
99Installation Requirements
100=========================
101
102Nothing special.
103
104
105Executing SCons Without Installing
106==================================
107
108You can execute the SCons directly from this repository. For Linux or UNIX::
109
110    $ python scripts/scons.py [arguments]
111
112Or on Windows::
113
114    C:\scons>python scripts\scons.py [arguments]
115
116If you run SCons this way, it will execute `SConstruct` file for this repo,
117which will build and pack SCons itself. Use the -C option to change directory
118to your project::
119
120    $ python scripts/scons.py -C /some/other/location [arguments]
121
122
123Installation
124============
125
126    Note: You don't need to build SCons packages or install SCons if you just
127    want to work on developing a patch.  See the sections about `Making
128    Changes`_ and `Testing`_ below if you just want to submit a bug fix or
129    some new functionality.
130
131Assuming your system satisfies the installation requirements in the previous
132section, install SCons from this package by first populating the build/scons/
133subdirectory.  (For an easier way to install SCons, without having to populate
134this directory, use the scons-{version}.tar.gz or scons-{version}.zip
135package.)
136
137
138Install the built SCons files
139-----------------------------
140
141Any of the above commands will populate the build/scons/ directory with the
142necessary files and directory structure to use the Python-standard setup
143script as follows on Linux or UNIX::
144
145        # python setup.py install
146
147Or on Windows::
148
149        C:\scons>python setup.py install
150
151By default, the above commands will do the following:
152
153- Install scripts named "scons" and "sconsign" scripts in the default system
154  script directory (/usr/bin or C:\\Python\*\\Scripts, for example).
155
156- Install "scons-3.1.2.exe" and "scons.exe" executables in the Python
157  prefix directory on Windows (C:\\Python\*, for example).
158
159- Install the SCons build engine (a Python module) in the standard Python library directory
160  (/usr/lib/python\*/site-packages or C:\\Python*\\Lib\\site-packages).
161
162Making Changes
163==============
164
165Because SCons is implemented in a scripting language, you don't need to build
166it in order to make changes and test them.
167
168Virtually all of the SCons functionality exists in the "build engine," the
169SCons subdirectory hierarchy that contains all of the modules that
170make up SCons.  The scripts/scons.py wrapper script exists mainly to find
171the appropriate build engine library and then execute it.
172
173In order to make your own changes locally and test them by hand, simply edit
174modules in the local SCons subdirectory tree and then running
175(see the section above about `Executing SCons Without Installing`_)::
176
177    $ python scripts/scons.py [arguments]
178
179If you want to be able to just execute your modified version of SCons from the
180command line, you can make it executable and add its directory to your $PATH
181like so::
182
183    $ chmod 755 scripts/scons.py
184    $ export PATH=$PATH:`pwd`/scripts
185
186You should then be able to run this version of SCons by just typing "scons.py"
187at your UNIX or Linux command line.
188
189Note that the regular SCons development process makes heavy use of automated
190testing.  See the `Testing`_ and `Development Workflow`_ sections below for more
191information about the automated regression tests and how they can be used in a
192development cycle to validate that your changes don't break existing
193functionality.
194
195
196Debugging
197=========
198
199Python comes with a good interactive debugger.  When debugging changes by hand
200(i.e., when not using the automated tests), you can invoke SCons under control
201of the Python debugger by specifying the --debug=pdb option::
202
203    $ scons --debug=pdb [arguments]
204    > /home/knight/scons/SCons/Script/Main.py(927)_main()
205    -> default_warnings = [ SCons.Warnings.CorruptSConsignWarning,
206    (Pdb)
207
208Once in the debugger, you can set breakpoints at lines in files in the build
209engine modules by providing the path name of the file relative to the
210top directory (that is, including the SCons/ as the first directory
211component)::
212
213    (Pdb) b SCons/Tool/msvc.py:158
214
215The debugger also supports single stepping, stepping into functions, printing
216variables, etc.
217
218Trying to debug problems found by running the automated tests (see the
219`Testing`_ section, below) is more difficult, because the test automation
220harness re-invokes SCons and captures output. Consequently, there isn't an
221easy way to invoke the Python debugger in a useful way on any particular SCons
222call within a test script.
223
224The most effective technique for debugging problems that occur during an
225automated test is to use the good old tried-and-true technique of adding
226statements to print tracing information.  But note that you can't just use
227the "print" function, or even "sys.stdout.write()" because those change the
228SCons output, and the automated tests usually look for matches of specific
229output strings to decide if a given SCons invocation passes the test -
230so these additions may cause apparent failures different than the one you
231are trying to debug.
232
233To deal with this, SCons supports a Trace() function that (by default) will
234print messages to your console screen ("/dev/tty" on UNIX or Linux, "con" on
235Windows).  By adding Trace() calls to the SCons source code::
236
237    def sample_method(self, value):
238        from SCons.Debug import Trace
239        Trace('called sample_method(%s, %s)\n' % (self, value))
240
241You can then run automated tests that print any arbitrary information you wish
242about what's going on inside SCons, without interfering with the test
243automation.
244
245The Trace() function can also redirect its output to a file, rather than the
246screen::
247
248    def sample_method(self, value):
249        from SCons.Debug import Trace
250        Trace('called sample_method(%s, %s)\n' % (self, value),
251              file='trace.out')
252
253Where the Trace() function sends its output is stateful: once you use the
254"file=" argument, all subsequent calls to Trace() send their output to the
255same file, until another call with a "file=" argument is reached.
256
257
258Testing
259=======
260
261Tests are run by the runtest.py script in this directory.
262
263There are two types of tests in this package:
264
2651. Unit tests for individual SCons modules live underneath the SCons
266   subdirectory and have the same base name as the module with "Tests.py"
267   appended--for example, the unit test for the Builder.py module is the
268   BuilderTests.py script.
269
2702. End-to-end tests of SCons live in the test/ subdirectory.
271
272You may specifically list one or more tests to be run::
273
274        $ python runtest.py SCons/BuilderTests.py
275
276        $ python runtest.py test/option-j.py test/Program.py
277
278You also use the -f option to execute just the tests listed in a specified
279text file::
280
281        $ cat testlist.txt
282        test/option-j.py
283        test/Program.py
284        $ python runtest.py -f testlist.txt
285
286One test must be listed per line, and any lines that begin with '#' will be
287ignored (allowing you, for example, to comment out tests that are currently
288passing and then uncomment all of the tests in the file for a final validation
289run).
290
291The runtest.py script also takes a -a option that searches the tree for all of
292the tests and runs them::
293
294        $ python runtest.py -a
295
296If more than one test is run, the runtest.py script prints a summary of how
297many tests passed, failed, or yielded no result, and lists any unsuccessful
298tests.
299
300The above invocations all test directly the files underneath the SCons/
301subdirectory, and do not require that a build be performed first.
302
303Development Workflow
304====================
305
306    Caveat: The point of this section isn't to describe one dogmatic workflow.
307    Just running the test suite can be time-consuming, and getting a patch to
308    pass all of the tests can be more so.  If you're genuinely blocked, it may
309    make more sense to submit a patch with a note about which tests still
310    fail, and how.  Someone else may be able to take your "initial draft" and
311    figure out how to improve it to fix the rest of the tests.  So there's
312    plenty of room for use of good judgement.
313
314The various techniques described in the above sections can be combined to
315create simple and effective workflows that allow you to validate that patches
316you submit to SCons don't break existing functionality and have adequate
317testing, thereby increasing the speed with which they can be integrated.
318
319For example, suppose your project's SCons configuration is blocked by an SCons
320bug, and you decide you want to fix it and submit the patch.  Here's one
321possible way to go about doing that (using UNIX/Linux as the development
322platform, Windows users can translate as appropriate)):
323
324- Change to the top of your checked-out SCons tree.
325
326- Confirm that the bug still exists in this version of SCons by using the -C
327   option to run the broken build::
328
329      $ python scripts/scons.py -C /home/me/broken_project .
330
331- Fix the bug in SCons by editing appropriate module files underneath
332  SCons.
333
334- Confirm that you've fixed the bug affecting your project::
335
336      $ python scripts/scons.py -C /home/me/broken_project .
337
338- Test to see if your fix had any unintended side effects that break existing
339  functionality::
340
341      $ python runtest.py -a -o test.log
342
343  Be patient, there are more than 1100 test scripts in the whole suite.  If you
344  are on UNIX/Linux, you can use::
345
346      $ python runtest.py -a | tee test.log
347
348  instead so you can monitor progress from your terminal.
349
350  If any test scripts fail, they will be listed in a summary at the end of the
351  log file.  Some test scripts may also report NO RESULT because (for example)
352  your local system is the wrong type or doesn't have some installed utilities
353  necessary to run the script.  In general, you can ignore the NO RESULT list,
354  beyond having checked once that the tests that matter to your change are
355  actually being executed on your test system!
356
357- Cut-and-paste the list of failed tests into a file::
358
359      $ cat > failed.txt
360      test/failed-test-1.py
361      test/failed-test-2.py
362      test/failed-test-3.py
363      ^D
364      $
365
366- Now debug the test failures and fix them, either by changing SCons, or by
367  making necessary changes to the tests (if, for example, you have a strong
368  reason to change functionality, or if you find that the bug really is in the
369  test script itself).  After each change, use the runtest.py -f option to
370  examine the effects of the change on the subset of tests that originally
371  failed::
372
373      $ [edit]
374      $ python runtest.py -f failed.txt
375
376  Repeat this until all of the tests that originally failed now pass.
377
378- Now you need to go back and validate that any changes you made while getting
379  the tests to pass didn't break the fix you originally put in, and didn't
380  introduce any *additional* unintended side effects that broke other tests::
381
382      $ python scripts/scons.py -C /home/me/broken_project .
383      $ python runtest.py -a -o test.log
384
385  If you find any newly-broken tests, add them to your "failed.txt" file and
386  go back to the previous step.
387
388Of course, the above is only one suggested workflow.  In practice, there is a
389lot of room for judgment and experience to make things go quicker.  For
390example, if you're making a change to just the Java support, you might start
391looking for regressions by just running the test/Java/\*.py tests instead of
392running all of "runtest.py -a".
393
394
395Building Packages
396=================
397
398We use SCons (version 3.1.2 or later) to build its own packages.  If you
399already have an appropriate version of SCons installed on your system, you can
400build everything by simply running it::
401
402        $ scons
403
404If you don't have SCons already installed on your
405system, you can use the supplied bootstrap.py script (see the section above
406about `Executing SCons Without Installing`_)::
407
408        $ python scripts/scons.py build/scons
409
410Depending on the utilities installed on your system, any or all of the
411following packages will be built::
412
413    SCons-4.0.0-py3-none-any.whl
414    SCons-4.2.0.tar.gz
415    SCons-4.2.0.zip
416    scons-doc-4.2.0.tar.gz
417    scons-local-4.2.0.tar.gz
418    scons-local-4.2.0.zip
419
420The SConstruct file is supposed to be smart enough to avoid trying to build
421packages for which you don't have the proper utilities installed.
422
423If you receive a build error, please report it to the scons-devel mailing list
424and open a bug report on the SCons bug tracker.
425
426Note that in addition to creating the above packages, the default build will
427also unpack one or more of the packages for testing.
428
429
430Contents of this Package
431========================
432
433Not guaranteed to be up-to-date (but better than nothing):
434
435bench/
436    A subdirectory for benchmarking scripts, used to perform timing tests
437    to decide what specific idioms are most efficient for various parts of
438    the code base.  We check these in so they're available in case we have
439    to revisit any of these decisions in the future.
440
441bin/
442    Miscellaneous utilities used in SCons development.  Right now,
443    some of the stuff here includes:
444
445    - a script that runs pychecker on our source tree;
446
447    - a script that counts source and test files and numbers of lines in each;
448
449    - a prototype script for capturing sample SCons output in xml files;
450
451    - a script that can profile and time a packaging build of SCons itself;
452
453    - a copy of xml_export, which can retrieve project data from SourceForge;
454      and
455
456    - scripts and a Python module for translating the SCons home-brew XML
457      documentation tags into DocBook and man page format
458
459
460bootstrap.py
461    Obsolete packaging logic.
462
463
464debian/
465    Files needed to construct a Debian package. The contents of this directory
466    are dictated by the Debian Policy Manual
467    (http://www.debian.org/doc/debian-policy). The package will not be
468    accepted into the Debian distribution unless the contents of this
469    directory satisfy the relevant Debian policies.
470
471doc/
472    SCons documentation.  A variety of things here, in various stages of
473    (in)completeness.
474
475LICENSE
476    A copy of the copyright and terms under which SCons is distributed (the
477    Open Source Initiative-approved MIT license).
478
479LICENSE-local
480    A copy of the copyright and terms under which SCons is distributed for
481    inclusion in the scons-local-{version} packages.  This is the same as
482    LICENSE with a preamble that specifies the licensing terms are for SCons
483    itself, not any other package that includes SCons.
484
485README.rst
486    What you're looking at right now.
487
488README-local
489    A README file for inclusion in the scons-local-{version} packages.
490    Similar to this file, but stripped down and modified for people looking at
491    including SCons in their shipped software.
492
493runtest.py
494    Script for running SCons tests.  By default, this will run a test against
495    the code in the local SCons tree, so you don't have to do a build before
496    testing your changes.
497
498SConstruct
499    The file describing to SCons how to build the SCons distribution.
500
501    (It has been pointed out that it's hard to find the SCons API in this
502    SConstruct file, and that it looks a lot more like a pure Python script
503    than a build configuration file.  That's mainly because all of the magick
504    we have to perform to deal with all of the different packaging formats
505    requires a lot of pure Python manipulation.  In other words, don't look at
506    this file for an example of how easy it is to use SCons to build "normal"
507    software.)
508
509SCons/
510    Where the actual source code is kept, of course.
511
512test/
513    End-to-end tests of the SCons utility itself.  These are separate from the
514    individual module unit tests, which live side-by-side with the modules
515    under SCons.
516
517testing/
518    SCons testing framework.
519
520Documentation
521=============
522
523See the RELEASE.txt file for notes about this specific release, including
524known problems.  See the CHANGES.txt file for a list of changes since the
525previous release.
526
527The doc/man/scons.1 man page is included in this package, and contains a
528section of small examples for getting started using SCons.
529
530Additional documentation for SCons is available at:
531
532        http://www.scons.org/documentation.html
533
534Documentation toolchain
535=======================
536
537For an overview see https://github.com/SCons/scons/blob/master/doc/overview.rst
538
539Licensing
540=========
541
542SCons is distributed under the MIT license, a full copy of which is available
543in the LICENSE file.
544
545
546Reporting Bugs
547==============
548
549The SCons project welcomes bug reports and feature requests.
550
551Please make sure you send email with the problem or feature request to
552the SCons users mailing list, which you can join via the link below:
553
554        http://two.pairlist.net/mailman/listinfo/scons-users
555
556Once you have discussed your issue on the users mailing list and the
557community has confirmed that it is either a new bug or a duplicate of an
558existing bug, then please follow the instructions the community provides
559to file a new bug or to add yourself to the CC list for an existing bug
560
561You can explore the list of existing bugs, which may include workarounds
562for the problem you've run into on GitHub Issues:
563
564        https://github.com/SCons/scons/issues
565
566
567Mailing Lists
568=============
569
570An active mailing list for developers of SCons is available.  You may
571send questions or comments to the list at:
572
573        scons-dev@scons.org
574
575You may subscribe to the developer's mailing list using form on this page:
576
577        http://two.pairlist.net/mailman/listinfo/scons-dev
578
579Subscription to the developer's mailing list is by approval.  In practice, no
580one is refused list membership, but we reserve the right to limit membership
581in the future and/or weed out lurkers.
582
583There are other mailing lists available for SCons users, for notification of
584SCons code changes, and for notification of updated bug reports and project
585documents.  Please see our mailing lists page for details.
586
587
588Donations
589=========
590
591If you find SCons helpful, please consider making a donation (of cash,
592software, or hardware) to support continued work on the project.  Information
593is available at:
594
595        http://www.scons.org/donate.html
596
597or
598
599GitHub Sponsors button on https://github.com/scons/scons
600
601
602For More Information
603====================
604
605Check the SCons web site at:
606
607        http://www.scons.org/
608
609
610Author Info
611===========
612
613SCons was originally written by Steven Knight, knight at baldmt dot com.
614Since around 2010 it has been maintained by the SCons
615development team, co-managed by Bill Deegan and Gary Oberbrunner, with
616many contributors, including but not at all limited to:
617
618- Chad Austin
619- Dirk Baechle
620- Charles Crain
621- William Deegan
622- Steve Leblanc
623- Rob Managan
624- Greg Noel
625- Gary Oberbrunner
626- Anthony Roach
627- Greg Spencer
628- Tom Tanner
629- Anatoly Techtonik
630- Christoph Wiedemann
631- Russel Winder
632- Mats Wichmann
633
634\... and many others.
635
636Copyright (c) 2001 - 2021 The SCons Foundation
637
638