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

[flakes] Where do cross compiled packages go? #5157

Open
roberth opened this issue Aug 21, 2021 · 3 comments
Open

[flakes] Where do cross compiled packages go? #5157

roberth opened this issue Aug 21, 2021 · 3 comments
Labels

Comments

@roberth
Copy link
Member

roberth commented Aug 21, 2021

Is your feature request related to a problem? Please describe.

It's unclear where cross compiled packages should go.
The docs talk about system as if there is only one. With cross we have two or three.

Describe the solution you'd like
Describe alternatives you've considered

I don't care much about the convention chosen. Pretending that cross compiled packages have one system seems like a bad idea.

  • flake system == build system: packages can't be used properly as a dependency. Who knows what kind of binaries are in there.
  • flake system == host system: packages can't be filtered by build system without evaluating them to some degree

The latter seems like the lesser evil, but it's still awful. I think this should be done differently altogether. This would all be much more natural if flakes were functions from system and optional buildSystem to outputs. I know that this doesn't work with the current caching approach, which is too tightly coupled to the current flakes design. Did you consider an builtins.importApplyCached : path -> json -> value? It'd behave like f: a: import f a but with a persistent evaluation cache. It seems that current flakes design can be cached with it (and some Nixlang glue), but also allow dynamic uses where not all arguments are statically known and enumerated as attrs.

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-do-i-cross-compile-a-flake/12062/5

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/flakes-nix3-0-issues/15626/10

@roberth
Copy link
Member Author

roberth commented Mar 31, 2022

It seems that the ${system} attributes are usually about the runtime system.

NixOS/nixpkgs#160061 makes the Nixpkgs configurable for cross and other configs (and needs review).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants