Skip to content
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

buildRustPackage: avoid appending to source code's cargo config #65385

Closed
wants to merge 2 commits into from

Conversation

AtkinsChang
Copy link
Contributor

@AtkinsChang AtkinsChang commented Jul 25, 2019

Motivation for this change

Setting the linker at ${build_root}/.cargo/config instead of append in ${source}/.cargo/config
Appending to sources code's .cargo/config may cause malformed TOML format.

for example, origin config:

[target.x86_64-pc-windows-gnu]
rustflags = []

after appending:

[target.x86_64-pc-windows-gnu]
rustflags = []

[target.x86_64-unknown-linux-gnu]
linker = "/nix/store/7nvy9l5jcp1c6z6n96l1a5x1bwbvamqn-gcc-wrapper-7.4.0/bin/cc"
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@AtkinsChang
Copy link
Contributor Author

cc @Mic92

@@ -89,6 +81,13 @@ in stdenv.mkDerivation (args // {
''}
EOF
cat .cargo/config
Copy link
Member

@Mic92 Mic92 Jul 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why we have this cat actually :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cat exists in configurePhase since 912dca1.
Should we find someone to adopt this cat?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would take it, so please remove it from the expression.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed :)

@Mic92
Copy link
Member

Mic92 commented Jul 30, 2019

Pushed to staging in fb961d1 and 626ccd7

@Mic92 Mic92 closed this Jul 30, 2019
@AtkinsChang AtkinsChang deleted the fix-rustplatform branch August 8, 2021 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants