Stop installing native extension build logs#9700
Open
hsbt wants to merge 3 commits into
Open
Conversation
mkmf.log and gem_make.out were written into the installed extension directory, polluting the install tree and breaking bit-for-bit reproducibility checks on distros like Guix and Nix. A successful build now leaves no logs behind, and a failed build writes them to build_info (<full_name>.mkmf.log / <full_name>.gem_make.out) for inspection. https://bugs.ruby-lang.org/issues/21995 #6259 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Clean up the per-gem mkmf.log and gem_make.out left in build_info by a failed extension build when the gem is uninstalled. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
These specs read the `make -jN` command line from `gem_make.out`, which a successful build no longer writes. The integration specs in `install_spec` now force the build to fail so the command lands in `build_info`, and the `parallel_installer` specs assert on the number of jobserver slots each gem's build acquired, which is exactly what becomes `make -jN`, instead of reading a build log. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Building a C extension writes
mkmf.logandgem_make.outinto the installed extension directory underextensions/. Those logs are noisy and non-reproducible, so they pollute the install tree and break bit-for-bit reproducibility checks on distributions like Guix and Nix that verify build output.A successful build now leaves no logs anywhere in the installation tree, neither in the extension directory nor in the unpacked gem source
extdirectory. A failed build still keeps the logs for inspection, but writes them to thebuild_infodirectory as<full_name>.mkmf.logand<full_name>.gem_make.out, next to the existing<full_name>.info. The build error message points at those new paths, and uninstalling the gem removes both files.This changes a long-standing behavior.
gem_make.outwas previously always present in the extension directory after a successful build. Anything that relied on reading that file on success will no longer find it, and on failure it now lives inbuild_inforather than the extension directory.A failed build now reports the log location like this.
Refs:
https://bugs.ruby-lang.org/issues/21995
#6259