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
buildRustPackages: Fix postPatch phase. #89531
buildRustPackages: Fix postPatch phase. #89531
Conversation
Please test this with a patch that contains a |
I am not sure I understand what you are asking for. The workaround to this issue is to use |
yes because
Is not enough. |
@SuperSandro2000 Sorry for the confusion. I tested this and these are the results:
Notice that the user's postPatch is on the same line.
which is now correct. I can also confirm that this PR fixes the issue correctly. Sorry for the confusion and late reply! |
pkgs/build-support/rust/default.nix
Outdated
@@ -72,6 +72,7 @@ let | |||
# inputs do not cause us to find the wrong `diff`. | |||
diff = "${diffutils}/bin/diff"; | |||
|
|||
userPostPatch = args.postPatch or ""; |
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.
userPostPatch = args.postPatch or ""; |
pkgs/build-support/rust/default.nix
Outdated
@@ -119,7 +120,8 @@ stdenv.mkDerivation (args // { | |||
# After unpacking and applying patches, check that the Cargo.lock matches our | |||
# src package. Note that we do this after the patchPhase, because the | |||
# patchPhase may create the Cargo.lock if upstream has not shipped one. | |||
postPatch = (args.postPatch or "") + stdenv.lib.optionalString validateCargoDeps '' | |||
postPatch = stdenv.lib.optionalString validateCargoDeps '' | |||
${userPostPatch} |
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.
${userPostPatch} | |
${args.postPatch or ""} |
I think that should work.
Since the user's postPatch is simply concatenated to `buildRustPackage`'s postPatch, it can lead to an invalid command being run unless the user's postPatch contains a `;`.
@SuperSandro2000 thanks for the suggestions, I squashed those changes into my original commit |
/rebase-staging |
I marked this as stale due to inactivity. → More info |
Not stale AFAIK. |
This PR needs to be rebased against staging and since that didn't happen for 11 months now it is stale. |
fixed |
Since the user's postPatch is simply concatenated to
buildRustPackage
's postPatch, it can lead to an invalid commandbeing run unless the user's postPatch contains a
;
. Hopefully thispatch fixes the issue.
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)