Skip to content

buildRustCrate: fix target config environment variables on 32-bit ARM#99066

Merged
Ericson2314 merged 2 commits intoNixOS:masterfrom
lopsided98:buildrustcrate-target-vars
Oct 11, 2020
Merged

buildRustCrate: fix target config environment variables on 32-bit ARM#99066
Ericson2314 merged 2 commits intoNixOS:masterfrom
lopsided98:buildrustcrate-target-vars

Conversation

@lopsided98
Copy link
Contributor

Motivation for this change

Followup to #99050, fixing issues I found while trying to cross-compile some other packages with crate2nix.

Because TARGET wasn't set correctly, the autocfg crate was unable to run its compile tests, and downstream crates didn't get features enabled correctly.

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.

cc @Ericson2314 @danieldk @kolloch @andir @symphorien

@ofborg ofborg bot added 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Sep 29, 2020
@andir
Copy link
Member

andir commented Sep 29, 2020

This is looking good! Can you also add a minimal cross compilation test for this? I'd hate to have this fail silently due to other changes/refactorings. It is a corner-case after all.

@andir
Copy link
Member

andir commented Sep 29, 2020

@GrahamcOfBorg build buildRustCrateTests

@lopsided98
Copy link
Contributor Author

I made buildRustCrateTests succeed when cross-compiling.

@ofborg build buildRustCrateTests pkgsCross.armv7l-hf-multiplatform.buildRustCrateTests

@Ericson2314
Copy link
Member

Ericson2314 commented Sep 29, 2020

Happy to merge once tests pass! (Or without if they take forever because things are not yet cached.)

@lopsided98
Copy link
Contributor Author

The test failure looks like a transient ofborg issue. I'll try to run it again.

@ofborg build buildRustCrateTests pkgsCross.armv7l-hf-multiplatform.buildRustCrateTests

@lopsided98
Copy link
Contributor Author

lopsided98 commented Sep 29, 2020

@ofborg build pkgsCross.armv7l-hf-multiplatform.buildRustCrateTests

@ofborg ofborg bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. and removed 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Sep 29, 2020
@lopsided98
Copy link
Contributor Author

@ofborg build buildRustCrateTests

@Ericson2314
Copy link
Member

OK screw it, merging.

@Ericson2314 Ericson2314 merged commit d3d55bc into NixOS:master Oct 11, 2020
@lopsided98 lopsided98 deleted the buildrustcrate-target-vars branch October 11, 2020 20:47
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: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants