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

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

Merged
merged 2 commits into from Oct 11, 2020

Conversation

@lopsided98
Copy link
Contributor

@lopsided98 lopsided98 commented Sep 29, 2020

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

@andir
Copy link
Member

@andir 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 andir commented Sep 29, 2020

@GrahamcOfBorg build buildRustCrateTests

@lopsided98
Copy link
Contributor Author

@lopsided98 lopsided98 commented Sep 29, 2020

I made buildRustCrateTests succeed when cross-compiling.

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

@Ericson2314
Copy link
Member

@Ericson2314 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

@lopsided98 lopsided98 commented Sep 29, 2020

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 lopsided98 commented Sep 29, 2020

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

@lopsided98
Copy link
Contributor Author

@lopsided98 lopsided98 commented Sep 30, 2020

@ofborg build buildRustCrateTests

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Oct 11, 2020

OK screw it, merging.

@Ericson2314 Ericson2314 merged commit d3d55bc into NixOS:master Oct 11, 2020
23 checks passed
@lopsided98 lopsided98 deleted the buildrustcrate-target-vars branch Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants