scons
AGENTS.md2.4k starsChanged 5 years agoMITView on GitHub
SCons builds itself. The repo root SConstruct is the build script for packaging. For more complete testing, the dependency set [dev] from pyproject.toml is useful. The test runner (runtest.py) adds SCons/ and testing/ to PYTHONPATH automatically. E2E tests create a temp workdir per run. Use SCons.Debug.Trace() for print debugging (won't interfere with test output capture). Core engine (SCons/): - Script/Main.py - entry point (main()). - Environment.py - Environment class; construction variable management. - Builder.py + Action.py - define how targets…
Files
SCons - Software Construction Tool
Build & Run
python scripts/scons.py # build packages (wheels, tarballs, zips → build/)
python scripts/scons.py doc # docs only
python scripts/scons.py [args] # run SCons from source (no install needed)SCons builds itself. The repo root SConstruct is the build script for packaging.
Testing
python runtest.py -a # all tests
python runtest.py SCons/SConfTests.py # unit test
python runtest.py test/Configure/ConfigureDryRunError.py # e2e test
python runtest.py --retry # re-run last failures (reads failed_tests.log)
python runtest.py -j 0 # parallel (cpu_count)
python runtest.py -t # print timingFor more complete testing, the dependency set [dev] from pyproject.toml
is useful.
python bin/docs-validate.py
python scripts/scons.py doc SKIP_DOC=pdf,api| Type | Location | Pattern |
| E2E | test/**/*.py | Custom TestSCons (subclass of TestCmd) with test.run() / test.pass_test() |
| Unit | SCons/*Tests.py | Standard unittest.TestCase, also use TestCmd/TestSCons for setup |
The test runner (runtest.py) adds SCons/ and testing/ to PYTHONPATH automatically. E2E tests create a temp workdir per run. Use SCons.Debug.Trace() for print debugging (won't interfere with test output capture).
Codebase Architecture
Core engine (SCons/):
Script/Main.py- entry point (main()).Environment.py-Environmentclass; construction variable management.Builder.py+Action.py- define how targets are built and what commands execute.Node/— dependency graph:FS.py(File, Dir, Entry),Alias.py,Python.py.Taskmaster/- parallel job scheduling and task execution.SConsign.py-.sconsign.dblitepersistence (single file at build top, keyed by dir path).Subst.py- variable substitution ($CC,$CFLAGS, etc.).Scanner/- dependency scanners (C/C++#include, etc.).CacheDir.py- shared build-artifact cache.SConf.py-Configure()logic.Warnings.py- warning hierarchy (stderr viawarn()).Tool/- compiler/linker integrations (CC, CXX, MSVC, Ninja, Docbook, etc.).Script/- CLI entry points, option parsing (SConsOptions.py).Platform/- OS-specific adaptations.Variables/-PathVariable,BoolVariable, etc., for build configuration.
Tests:
testing/framework/—TestSCons.py,TestCmd.py(e2e test base classes).test/— ~200+ e2e tests organized by feature.SCons/*Tests.py— unit tests alongside source, standardunittest.TestCase.
Documentation:
docdocumentation sources, tools, extended DocBook schemaSCons/*.xml- module-specific documentation sources
Documentation
The doc build requires the dependency set [doc] from pyproject.toml.
For validating just that the Docbook xml documents build, use
python bin/docs-validate.py
python scripts/scons.py doc SKIP_DOC=pdf,apiIndividual xml files are not syntactically complete DocBook,
they require the context of xincluded files (.mod and .gen
from doc and doc/generated), the SCons schema extension
(doc/xsd), and the framework from bin/SConsDoc.py,
which also contains information on some of the extensions.
The generated files can be built on demand
(python bin/docs-update-generated.py),
and should never be directly edited.
It is project convention not to commit the changes to generated
files as they happen, but rather to commit the accumulated changes
during the release process.
Lint & Type
python -m ruff check . # lint (target-version py37, skips test/ bench/ doc/ etc.)
python -m ruff format --check . # formatting check
python -m mypy SCons/ # type check.editorconfig enforces: indent 4 spaces, 88-char line limit (Python/SConstruct/SConscript), LF line endings, trailing comma, parentheses for multiline.
Conventions
- Git commits signed off (
git commit -s). AddAssisted-by:to message for AI-generated changes. - Version in
SCons/__init__.py(__version__) - automatically generated, do not edit. - CI: GitHub Actions (
runtest.yml- test suite;scons-package.yml— packaging), AppVeyor (Windows, legacy). - Python >= 3.9 required.
- Config log for
Configure()lives atconfig.login the build dir. .sconsign.dblitepersists across builds; deleting build dirs from disk doesn't clear sconsign entries.
Trending
More talk lately.about the whole repository
Who's talking about SCons/scons
- godotengine/godot“Compilation database support - clang, gcc, mingw”GitHub · Oct 15, 2019 · 28 reactions
- A Hacker News story“SCons is not slow”Hacker News · Sep 18, 2020 · 24 points
- godotengine/godot“SCons: Add `fast_unsafe` option for faster rebuilds”GitHub · Feb 8, 2022 · 14 reactions
- OpenXiangShan/GEM5“scons: explicitly define call arg in `CheckLibWithHeader`”GitHub · Jan 21, 2026 · 2 reactions
- Stack Overflow“Is it scons don't support LDFLAGS?”Stack Overflow · Oct 15, 2020 · 2 votes
The biggest 5 of 64 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 64
Talked about on GitHub, Stack Overflow and Hacker News (64 times).
On GitHub · 50
- Oct 15, 2019Compilation database support - clang, gcc, mingw — godotengine/godot28 reactions · 26 comments
- Feb 8, 2022SCons: Add `fast_unsafe` option for faster rebuilds — godotengine/godot14 reactions · 8 comments
- Jan 21, 2026scons: explicitly define call arg in `CheckLibWithHeader` — OpenXiangShan/GEM52 reactions · 2 comments
- Nov 19, 2025SCons 4.8.x + Python 3.11 UnboundLocalError Breaking All Builds — Alteriom/alteriom-docker-images1 reaction
- Oct 3, 2024SCons: Add patch for aarch64-darwin — NixOS/nixpkgs1 reaction · 3 comments
45 more on GitHub
- Apr 25, 2024Bump platformio from 6.1.13 to 6.1.15 — esphome/esphome1 reaction
- Nov 25, 2023Fix generating vsproj with SCons 4.6.0+ — godotengine/godot1 reaction · 4 comments
- Feb 7, 2022mapnik 3.1 Scons needs updating for Python 3.10 — mapnik/mapnik1 reaction
- Nov 4, 2020Installation instructions missing — cctbx/cctbx_project1 reaction · 2 comments
- Mar 14, 2020Allow developers to use different version of SCons than the one bundled in the repository — nvaccess/nvda1 reaction · 10 comments
- Jan 2, 2018Migration treats existing pull requests as issues — SCons/tigris-to-github1 reaction
- Oct 25, 2026Bump platformio from 6.1.19 to 6.2.0 — cxandy/transitink-os0 reactions
- Oct 19, 2026Bump platformio from 6.1.18 to 6.2.0 — KeyMelt/IOT_Project0 reactions
- Oct 6, 2026Bump platformio from 6.1.19 to 6.2.0 — EllaZhangCA/esp32-s3-adblock0 reactions
- Oct 1, 2026build(deps): bump scons from 4.8.1 to 4.11.1 in /requirements — retroSoC/retroSoC0 reactions
- Oct 1, 2026build: bump platformio from 6.1.19 to 6.2.0 — u64a/esp32-plane-radar-u640 reactions
- Oct 1, 2026Bump platformio from 6.1.19 to 6.2.0 — M1XZG/cyd-desk-dashboard0 reactions
- Sep 16, 2026Bump platformio from 6.1.19 to 6.2.0 — Cossid/esphome0 reactions
- Sep 15, 2026build(deps-dev): bump platformio from 6.1.19 to 6.2.0 — ashllll/T-Display-S3-fnos-monitor0 reactions
- Sep 14, 2026Bump platformio from 6.1.19 to 6.2.0 — Zerie55699/transitink-os0 reactions
- Sep 14, 2026chore(deps): bump platformio from 6.1.19 to 6.2.0 in /scripts — napolitano/eurorack-quantizer-firmware0 reactions · 1 comment
- Sep 13, 2026build(deps-dev): bump platformio from 6.1.19 to 6.2.0 in the python-development-tooling group — yoo0926/smalltv-agent-hub0 reactions
- Sep 12, 2026tools: Bump platformio from 6.1.19 to 6.2.0 in /tools — gregose/opensprinkler-panel0 reactions
- Sep 12, 2026chore(deps-dev): bump platformio from 6.1.19 to 6.2.0 — ashllll/xiao-esp32-platformio-idf0 reactions
- Sep 12, 2026build(deps-dev): bump platformio from 6.1.19 to 6.2.0 in /assets/project-template — ashllll/manage-xiao-esp32-projects0 reactions
- Sep 12, 2026Update platformio requirement from >=6.1 to >=6.2.0 — wtthornton/Core20 reactions · 1 comment
- Sep 11, 2026chore(deps): bump platformio from 6.1.19 to 6.2.0 in the nonbreaking group across 1 directory — mindflayer-vtt/mindflayer-keypad0 reactions
- Sep 11, 2026Bump platformio from 6.1.19 to 6.2.0 — Lam-Ting-Wai-Ivan/zectrix-note-4-vlm-emergency-detection0 reactions
- Sep 9, 2026Bump platformio from 6.1.19 to 6.2.0 — ionontelodico/GoldHEN-Loader-ESP320 reactions
- Sep 9, 2026Bump platformio from 6.1.19 to 6.2.0 — ssieb/esphome0 reactions
- Aug 31, 2026build(deps-dev): bump scons from 4.10.1 to 4.11.1 — dotincorp/nvda-addon-store0 reactions · 1 comment
- Aug 31, 2026Bump scons from 4.11.0 to 4.11.1 — VIPnytt/Frekvens0 reactions
- Aug 31, 2026chore(deps): bump scons from 4.11.0 to 4.11.1 — PovertyAction/ipa-stata-template0 reactions
- Aug 28, 2026Bump platformio from 6.1.11 to 6.1.19 — KlaysDe/klays-esp-home-components0 reactions
- Aug 25, 2026Bump platformio from 6.0.2 to 6.1.19 — rtward/esphome0 reactions
- Aug 18, 2026build(deps-dev): update scons requirement from ~=4.10 to ~=4.11 in /tools — mmaulwurff/doom-toolbox0 reactions · 1 comment
- Aug 14, 2026Bump scons from 4.10.1 to 4.11.0 — VIPnytt/Frekvens0 reactions · 1 comment
- Jun 15, 2026Bump platformio from 6.1.13 to 6.1.19 — rspaargaren/esphome0 reactions
- Feb 6, 2026Bump platformio from 6.1.5 to 6.1.19 — vzijden/esphome-opentherm0 reactions
- Oct 30, 2025[Icon request] scons — PapirusDevelopmentTeam/papirus-icon-theme0 reactions · 11 comments
- Mar 13, 2025Update SCons dependency to 4.11 — platformio/platformio-core0 reactions
- Mar 12, 2025Bump platformio from 6.0.2 to 6.1.18 — johnime/esphome0 reactions
- Feb 13, 2025porn18.com — mypdns/matrix0 reactions
- Feb 10, 2025netpass.tv — mypdns/matrix0 reactions
- Apr 25, 2024Bump platformio from 6.1.11 to 6.1.15 — mrkvo/esphome0 reactions
- Mar 20, 2023Build flags -include ... does not update dependency tree — platformio/platformio-core0 reactions · 4 comments
- Aug 3, 2022自动生成工程的工具 — supperthomas/bluetoothlover_doc0 reactions · 2 comments
- Jan 25, 2021Building from source does not support non-standard Visual Studio installs — godotengine/godot0 reactions · 2 comments
- Oct 15, 2018SCons clang tool — ptomulik/scons-tool-clang0 reactions · 3 comments
- Feb 7, 2018speed up compilation time for large codegen-ed models — pymoca/pymoca0 reactions · 1 comment
On Stack Overflow · 13
- Oct 15, 2020Is it scons don't support LDFLAGS?2 votes
- May 12, 2020Windows - "The command line is too long" when building .obj files2 votes
- Mar 28, 2023SCons VariantDir and isystem include paths1 vote
- Jan 2, 2021how to update scons .98 syntax for deprecated Options class to current 4.01 vote
- Aug 6, 2020How to manage importing an SCons project1 vote
8 more on Stack Overflow
- Feb 19, 2019Does scons cache supports hard links?1 vote
- Jan 22, 2016How do I set up scons to build a project that has generated source files?1 vote
- Dec 14, 2015How to add pre and post-process actions to SCons build?1 vote
- May 20, 2022How to use SCons lex builder with variant directories0 votes
- Aug 28, 2020How does SCons build content signature about a function?0 votes
- May 17, 2020Cross compilation for gpsd shows "unrecognized option"0 votes
- Feb 26, 2019Having a problem trying to setup a simple Sconstruct 'Hello World' script0 votes
- Jan 22, 2016How do I set up scons to build a project that has generated source files?0 votes
On Hacker News · 1
- Sep 18, 2020SCons is not slow24 points · 73 comments
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

