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

Feature/nix from buildpackages #40636

Closed

Conversation

angerman
Copy link
Contributor

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@angerman
Copy link
Contributor Author

@Ericson2314 what do you think? Plausible?

@Ericson2314
Copy link
Member

Err these are runtime dependencies of cabal2nix, right? If so, I don't think this is the right approach. My guess is that there is a patchShebangs messing up the prefetch script build, and I think @dtzWill recently fixed something with the Nix cross compile but maybe did so on staging.

@angerman
Copy link
Contributor Author

When would I want to use the them not from the buildPackages? After all nix is run on the build machine, no?

@Ericson2314
Copy link
Member

After all nix is run on the build machine, no?

Ahhh. Yeah never think about where the current package will be used, because assumptions on the downstream will cripple composition. Instead, since cabal2nix depends on nix at run time, cabal2nix and cabal2nix's nix must come from the same bootstrapping stage. If we are doing a callCabal2nix on the current machine, yes cabal2nix and nix would come from buildPackages and run on the build machine. But if we are cross-compiling an entirely NixOS with cabal2nix pre-installed globally, both come from pkgs as both will run on the host machine.

In short, buildPackages.cabal2nix -> buildPackages.nix, pkgs.cabal2nix -> pkgs.nix, targetPackages.cabal2nix -> pkgs.nix.

@angerman angerman closed this Jul 27, 2018
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