DM-55791: Ignore bin.src Glob results with no source file (workaround SCons 4.11) - #150
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #150 +/- ##
=======================================
Coverage 79.48% 79.48%
=======================================
Files 3 3
Lines 39 39
Branches 4 4
=======================================
Hits 31 31
Misses 4 4
Partials 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mwittgen
approved these changes
Aug 12, 2026
Glob() is documented to report the entries SCons knows about in a directory, whether or not a file is present. Only a file can have its shebang rewritten, so ask the file system instead. SCons 4.11 made this distinction matter. Variables.Update() now resolves each saved-variables file through env.File(), which creates the node whether or not the file is there, relative to the directory of the SConscript being read. sconsUtils always offers an optional buildOpts.py to Variables, so importing it from bin.src/SConscript, as a package that does not use BasicSConstruct may do, left a node in bin.src for a file that has never existed. Glob() duly reported it and the build failed: scons: *** [bin/buildOpts.py] Source `bin.src/buildOpts.py' not found, needed by target `bin/buildOpts.py'. SCons upstream confirm in SCons/scons#4893 that Glob() is behaving as intended and that code wanting the files on disk should use the glob module. Every entry in bin.src is a file checked in with the package, so nothing is lost by ignoring the build graph here. A caller passing src explicitly is unaffected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
|
@mwittgen based on feedback from my scons ticket I've changed the PR to use |
timj
commented
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SCons 4.11 changed
Variables.Update()to resolve each saved-variables file throughenv.File()instead of testing it withos.path.exists().File()creates the node whether or not the file is there, relative to the directory of theSConscriptbeing read, so importingsconsUtilscreates a node for thebuildOpts.pythatstate._initVariables()always asks for.Glob()reports the nodesSConsknows about in a directory as well as the files on disk, so when a package first importssconsUtilsfrombin.src/SConscript, the node lands inbin.srcandshebang()builds a rewrite target for a source that does not exist:Only rewrite entries backed by a readable file. Resolve through
rexists()and the source node so a script found in a repository or a separate source directory is still rewritten.