-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
fix pkgsMusl.cargo via cargoSetupHook #198311
Conversation
@@ -70,13 +70,17 @@ in { | |||
|
|||
# Target platform | |||
rustTarget = '' | |||
[target."${rust.toRustTarget stdenv.buildPlatform}"] | |||
[host."${rust.toRustTarget stdenv.buildPlatform}"] |
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.
Do we need to specify the triple here, or can we just do [host]
?
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.
I think both work, do you prefer just [host]
?
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.
I'd have a mild preference for the former, just because it means we don't have to worry about what happens if e.g. using a custom build spec. But I don't think it's too important, and would understand if you wanted it to be consistent with what we were already doing for target
.
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.
done
@@ -70,13 +70,17 @@ in { | |||
|
|||
# Target platform | |||
rustTarget = '' |
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.
Might make sense to rename this, and probably expand the comment a bit to explain what's going on? You could probably just adapt what I wrote in the other PR if you want.
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.
done, please let me know if the comment is ok
are -Z flags allowed without RUSTC_BOOTSTRAP=1 ? |
The way we set it, in |
|
||
[unstable] | ||
host-config = true | ||
target-applies-to-host = true |
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.
I'm very puzzled as to why you set target-applies-to-host to true: the doc says
It requires the -Zhost-config and -Ztarget-applies-to-host command-line options to be set, and that target-applies-to-host = false is set in the Cargo configuration file.
https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#host-config
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.
There is two things here:
- Is the target-applies-to-host unstable feature enabled?
- If yes, this unlocks a new target-applies-to-host option
Also see, in the same section:
Setting -Zhost-config changes the default for target-applies-to-host to false from true.
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.
ok I understand. Then the change looks sensible to me, and if things build with it then go for it.
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.
I like this better than my approach, and in my testing, all the builds my version fixed are also fixed by this change.
It's still an open question what to do for rustc on Musl when used outside of Cargo, but that's orthogonal to this change. For Cargo this is the way to go.
This PR seems to have regressed packages being able to set
|
Ah, it's actually specifically the unstable.* options that cause this. Nevertheless, this causes some breakage of project cargo config files. |
Description of changes
This is a variant of #190796, which removes the need for patching rustc by always applying the unstable host-config flag in cargoSetupHook.
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