-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
git: add missing deps for filter-branch etc #27221
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
Conversation
Patch of the differences in the shell scripts. |
eefd0f4
to
736ef3a
Compare
Several git commands are implemented as shell scripts that run awk, sed, grep and perl. There is some existing patching in the postinstall for perl to rewrite it to an absolute reference to pkgs.perl, but several other packages are both missing as a dependency and have no rewrite logic. In particular git filter-branch depends on sed and grep. Additionally, the perl logic also seds git-am, which is now a binary not a shell script anymore (see <github.com/git/git/blob/master/builtin/am.c>), so this part was obsolete. I tested this by grepping all shell scripts for the relevant commands and then comparing the diffs of the new version to what is produced in master. All changes in the scripts seem good to me.
# Fix references to the perl, sed, awk and various coreutil binaries used by | ||
# shell scripts that git calls (e.g. filter-branch) | ||
perl -0777 -i -pe \ | ||
"BEGIN{@a=('${perl}/bin/perl', '${gnugrep}/bin/grep', '${gnused}/bin/sed', '${gawk}/bin/awk',"\ |
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.
Odd indentation here. Is there a reason for that?
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.
@aschmolck nix strips the prefix on multi-line strings.
I pushed a change to make it a bit more readable in c6322fa. Needs testing
@zimbatm: thanks for cleaning up the formatting! |
@aschmolck cheers :) can you build and test the changes on linux to confirm that it's still working? |
@zimbatm broke something, debugging (must be trivial though). |
@zimbatm 2 hours of my life gone, but I found the problem and it was trivial: |
oh no, sorry for pushing that onto you. |
Thank you both for your work on this! Very much appreciated :) |
@zimbatm haha -- not your fault :) Was just tricky to debug because it looked OK, pasting it into the shell prompt (correcting for nix-double-single-quote-escapes) seemingly worked OK, but somehow it still blew up. |
Several git commands are implemented as shell scripts that run awk, sed, grep and perl. There is some existing patching in the postinstall for perl to rewrite it to an absolute reference to pkgs.perl, but several other packages are both missing as a dependency and have no rewrite logic. In particular git filter-branch depends on sed and grep. Additionally, the perl logic also seds git-am, which is now a binary not a shell script anymore (see <github.com/git/git/blob/master/builtin/am.c>), so this part was obsolete. I tested this by grepping all shell scripts for the relevant commands and then comparing the diffs of the new version to what is produced in master. All changes in the scripts seem good to me. (cherry picked from commit 2c1097a)
Several git commands are implemented as shell scripts that run awk, sed, grep and perl. There is some existing patching in the postinstall for perl to rewrite it to an absolute reference to pkgs.perl, but several other packages are both missing as a dependency and have no rewrite logic. In particular git filter-branch depends on sed and grep. Additionally, the perl logic also seds git-am, which is now a binary not a shell script anymore (see <github.com/git/git/blob/master/builtin/am.c>), so this part was obsolete. I tested this by grepping all shell scripts for the relevant commands and then comparing the diffs of the new version to what is produced in master. All changes in the scripts seem good to me. (cherry picked from commit 2c1097a)
Motivation for this change
Several git commands are implemented as shell scripts that run awk, sed, grep
and perl as well as coreutils such as cut, wc, basedir and dirname. There is some existing patching in the postinstall for perl to rewrite
it to an absolute reference to pkgs.perl, but several other packages are both
missing as a dependency and have no rewrite logic.
In particular git filter-branch depends on sed and grep.
Additionally, the perl logic also seds git-am, which is now a binary not a shell
script anymore (see <github.com/git/git/blob/master/builtin/am.c>), so this part
was obsolete.
I tested this by grepping all shell scripts for the relevant commands and then
comparing the diffs of the new version to what is produced in master. All
changes in the scripts seem good to me. I'll attach the patch in a comment. I als
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
(tried to but I got fatal: reference is not a tree: 3d89df6)./result/bin/
)