Repository navigation
build: Create output directory before generating resource_paths.py - #8009
Merged
Merged
Conversation
The resource_paths.py rule in python/grass/app/Makefile redirects sed output into the destination directory without depending on it. With parallel make, the redirect could run before the directory was created, failing with "Directory nonexistent" and breaking the Docker builds intermittently. Add the directory as an order-only prerequisite, as the pattern rule for the other files already does. Developed with AI assistance (Claude Code).
nilason
approved these changes
Oct 3, 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.
Problem
The Docker builds in CI intermittently fail, and often pass on rerun. The
make -j 4step fails inpython/grass/appwith:python/grass/appis then not installed, sog.extensionfails withModuleNotFoundError: No module named 'grass.app.runtime', and the build exits with code 2.Failing runs with this error: 37145943141, 37127864658 (passed on rerun), 37127518048.
Cause
The
$(DSTDIR)/resource_paths.pyrule redirectssedoutput into$(DSTDIR)but does not depend on it. With parallel make, the redirect can run before themkdir -pfor that directory (started for another target) has finished. The pattern rule for the other files already has| $(DSTDIR).Fix
Add
$(DSTDIR)as an order-only prerequisite of theresource_paths.pyrule.Testing
The race window is tiny, so it was reproduced and checked on a copy of
python/grass/app/Makefilewith the realPython.makeand a slowedmkdir(MKDIR='sleep 1; mkdir -p',make -j8):Directory nonexistenterror above.__init__.py,__main__.py,cli.py,data.py,runtime.py,resource_paths.py).Without the slowed
mkdir, neither version failed in 300 plain-j8runs, which matches the intermittent behavior in CI.The Docker workflow does not run on PRs that only touch this Makefile, so it was dispatched manually on this branch's fork: run 37152838494 built all four images (alpine, debian, ubuntu, ubuntu_wxgui) successfully. Since the failure is intermittent, one green run is supporting evidence. The
Dockerworkflow runs onmainafter merge will provide more.Developed with AI assistance (Claude Code).