-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
rustBuildCrate: properly handle cargo env pragmas with spaces #199300
Conversation
Ah, this breaks on multiple variables being present: I guess splitting on spaces is what made it work before. I'll fix the patch. |
Aha, this patch actually prints empty line if nothing matches... Trying to figure out how to get it to work nicely while still producing escaped stuff... |
There are two problems: first that we end up splitting on spaces in the loop. Even when that is fixed, we still would split on spaces in the `export` inside the loop. We need to guard against both. Fixes NixOS#199298 Confirmed that it fixes the case mentioned in the ticket: ```console [nix-develop]$ $(nix-build -I nixpkgs=/home/shana/programming/nixpkgs Cargo.nix -A rootCrate.build --no-out-link)/bin/nix-rustc-env-escape-repro Expecting three words, got: first second third ``` I think this is going to cause a rebuild of every Rust package even if they were unaffected, not much we can do here.
db620b7
to
233205c
Compare
OK, now I think it's ready. I made a derp with escaping myself so it didn't work if multiple lines were present. I addressed the issue. |
I've tested this patch for a week with crate2nix, no problems so far 👍 @aanderse can you merge this one ? |
As another data point, we've been running it for 2 weeks on a medium(?) size workspace:
No issues. |
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.
Looks good to me. Thanks everyone!
There are two problems: first that we end up splitting on spaces in the loop. Even when that is fixed, we still would split on spaces in the
export
inside the loop. We need to guard against both.Fixes #199298
Confirmed that it fixes the case mentioned in the ticket:
I think this is going to cause a rebuild of every Rust package even if they were unaffected, not much we can do here.
Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes