New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git: fix bad patch and fix run-time dependency on gcc #64395
git: fix bad patch and fix run-time dependency on gcc #64395
Conversation
Reduces gitMinimal closure size from 329.6M to 174.8M. Fixes the issue NixOS#64350. In git 2.22.0 git-stash is no longer a shell script and now it is just a symlink to git. `postInstall` assumed that it was a shell script, tried to patch it and ended up corrupting the file and made `strip` refuse stripping it.
I'm uncertain about second commit which adds a sanity check |
Might be a good idea to add this to avoid similar issues like this in the future. disallowedReferences = [ stdenv.cc ]; |
perl -0777 -i -pe "$SCRIPT" \ | ||
$out/libexec/git-core/git-{sh-setup,filter-branch,merge-octopus,mergetool,quiltimport,request-pull,submodule,subtree,web--browse} | ||
|
||
perl -0777 -i -pe "$SCRIPT" $out/libexec/git-core/git-sh-setup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come git-sh-setup
is handled separately now?
|
||
perl -0777 -i -pe "$SCRIPT" $out/libexec/git-core/git-sh-setup | ||
for git_script in $out/libexec/git-core/git-{filter-branch,merge-octopus,mergetool,quiltimport,request-pull,submodule,subtree,web--browse}; do | ||
isScript $git_script || (echo "$git_script is not a script. Can't patch it."; exit 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isScript $git_script || (echo "$git_script is not a script. Can't patch it."; exit 1) | |
isScript $git_script || (echo "$git_script is not a script. Can't patch it." >&2; exit 1) |
3b73121
to
ae2082a
Compare
@GrahamcOfBorg build git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened to the isScript check? I don't think it's a good idea to leave it out, given that this wasn't caught by the testsuite last time.
Motivation for this change
Fixes the issue #64350 .
Problem was that in previous version of git git-stash was a shell script, but now it's a symlink to git.
postInstall
tried to patch it (in-place) as if it was a script, but instead replaced symlink with a corrupted git copy.strip
refused to strip symbols from it, so debug information with references to gcc was left in the resulting package.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)@gloaming might want to take a look at it.