Inconsistent Order of build_files in WriteAutoRegenerationRule Causes CI Failures
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.7k
- Forks
- 1.9k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 5
Description
Hey 👋
When running node-gyp, the Makefile generation process produces different outputs on subsequent runs due to the unordered nature of the build_files set in the WriteAutoRegenerationRule function. This inconsistency occurs because sets in Python do not maintain order, leading to varying order of dependencies in the generated Makefile.
This issue causes problems in CI pipelines that compare file hashes, as the differing order results in false positives for changes. To ensure a stable and consistent build process, the order of build_files should be explicitly sorted before being used in the Makefile generation.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in gyp/pylib/gyp/generator/make.py at WriteAutoRegenerationRule around the referenced line, and inspect how build_files is used when generating the Makefile. Confirm that repeated generation produces a stable dependency order and verify the relevant Makefile output or existing generator tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100