Skip to content

buildRustCrate: do not overlay OUT_PATH on src/#78706

Merged
andir merged 2 commits into
NixOS:masterfrom
andir:buildRustCrate-no-out-path-overlaying
Jan 30, 2020
Merged

buildRustCrate: do not overlay OUT_PATH on src/#78706
andir merged 2 commits into
NixOS:masterfrom
andir:buildRustCrate-no-out-path-overlaying

Conversation

@andir

@andir andir commented Jan 28, 2020

Copy link
Copy Markdown
Member
Motivation for this change

build.rs files might create files during the configurePhaes. Those files are supposed to go into
OUT_DIR (envirionment variable) and not be overlayed onto the source
tree. So far we did both. With this change we will only use the OUT_PATH.

fixes #78412

cc @kolloch

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-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.

andir added 2 commits January 28, 2020 14:07
`build.rs` files might create files. Those files are supposed to go into
`OUT_DIR` (envirionment variable) and not be overlayed onto the source
tree.
@andir

andir commented Jan 28, 2020

Copy link
Copy Markdown
Member Author

@GrahamcOfBorg build buildRustCrateTests

@kolloch

kolloch commented Jan 28, 2020

Copy link
Copy Markdown
Contributor

This should also fix #74071. Just hoping that nothing depends on the old, odd behavior. Good luck! :)

@andir

andir commented Jan 28, 2020

Copy link
Copy Markdown
Member Author

This should also fix #74071. Just hoping that nothing depends on the old, odd behavior. Good luck! :)

One of my short-term goals is going to be a topN rust crates build against latest crate2nix & buildRustCrate to have a bit more visibility on the impact of such changes. I compiled a few projects with this change and they all didn't fail. I am very confident (right now) that this change will not break more then what was broken before.

@ofborg ofborg Bot added 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jan 28, 2020
@andir andir merged commit 23593e4 into NixOS:master Jan 30, 2020
anna328p pushed a commit to anna328p/nixpkgs that referenced this pull request Feb 2, 2020
…overlaying

buildRustCrate: do not overlay OUT_PATH on src/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buildRustCrate fails to build rustversion 1.0.2

2 participants