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

nix: Patch config.nix.in to reference host platform binaries #81317

Merged
merged 2 commits into from Mar 4, 2020

Conversation

eamsden
Copy link
Contributor

@eamsden eamsden commented Feb 28, 2020

Motivation for this change

Presently the stable version of nix (2.3.3), when cross-compiled from nixpkgs, will pull into its closure and attempt to invoke the build platform's version of bash. This works around some of the build system for nix to correct that, so that a cross-compiled nix binary can be used on the system it is compiled for.

See #81153

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.

@jonringer
Copy link
Contributor

@GrahamcOfBorg eval

@ofborg ofborg bot requested a review from edolstra February 29, 2020 01:24
@eamsden eamsden changed the title [nix] Patch config.nix.in to reference host platform binaries nix: Patch config.nix.in to reference host platform binaries Feb 29, 2020
@eamsden eamsden force-pushed the eamsden/nix23-fix-cross-compile branch from 6da46dc to e82f88c Compare February 29, 2020 03:32
Copy link
Contributor

@flokli flokli left a comment

Choose a reason for hiding this comment

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

Can you also split the patching of config.nix.in and the cleanup into two separate commits, so we can only backport the fix into 20.03?

pkgs/tools/package-management/nix/default.nix Outdated Show resolved Hide resolved
pkgs/tools/package-management/nix/default.nix Outdated Show resolved Hide resolved
pkgs/tools/package-management/nix/default.nix Outdated Show resolved Hide resolved
@eamsden eamsden force-pushed the eamsden/nix23-fix-cross-compile branch 2 times, most recently from 3d9e9db to 7e762d8 Compare March 2, 2020 12:12
@eamsden
Copy link
Contributor Author

eamsden commented Mar 2, 2020

@flokli I split into two commits and made sure no more tabs got in. Can you re-review?

@flokli
Copy link
Contributor

flokli commented Mar 2, 2020

I built this, and nix-store -qR $(nix-build -A pkgsCross.armv7l-hf-multiplatform.nix) seems to have references to native coreutils, glibc and whatnot, however, it seems to be an improvement.

Did you copy over the closure and see if nix behaves properly?

@eamsden
Copy link
Contributor Author

eamsden commented Mar 3, 2020

I have not yet. Odd that the closure still pulls in native stuff. I'll try it tomorrow when I can get my pi back out

@eamsden eamsden force-pushed the eamsden/nix23-fix-cross-compile branch from 7e762d8 to 3b72c55 Compare March 3, 2020 23:12
@flokli flokli merged commit d881de1 into NixOS:master Mar 4, 2020
@eamsden eamsden deleted the eamsden/nix23-fix-cross-compile branch March 4, 2020 02:04
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

3 participants