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
cask: Fix shebang of cask executable #123134
Conversation
Result of 1 package built:
|
Result of 1 package built successfully:
3 suggestions:
|
patchShebang replaced the shebang with the buildPlatform instead of the targetPlatform which means the script breaks when cross compiling. |
What can I do about that? |
@@ -19,6 +19,7 @@ stdenv.mkDerivation rec { | |||
|
|||
buildPhase = '' | |||
emacs --batch -L . -f batch-byte-compile cask.el cask-cli.el | |||
patchShebangs bin/cask |
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.
patchShebangs bin/cask | |
patchShebangs --host bin/cask |
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.
Thank you
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.
The suggested solution does not produce the expected result. As soon as I add the --host
argument to the patchShebangs command the resulting executable is not correctly patched anymore.
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.
🤔
https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/setup-hooks/patch-shebangs.sh#L21
You may need to add the package to buildInput that are added to the shebang.
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.
@SuperSandro2000 Thanks for the hint. Adding bash to the build inputs totally solved the problem. Instead of calling patchShebangs manually I added pre and post phase hooks to buildPhase and installPhase. This seems to be the preferred way of doing this kind of stuff in nixpkgs
.
c9f4bbf
to
294aec7
Compare
Suggestion of @SuperSandro2000 incorporated |
Add the pre and post phase hooks was done to fix the broken shebangs of the cask executable.
Result of 1 package built:
|
Hi, the cask executable was broken. To fix the issue the shebang was set correctly.
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)