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

Can flake-parts solve cross-system evaluation with IFD? #84

Open
shlevy opened this issue Dec 13, 2022 · 2 comments
Open

Can flake-parts solve cross-system evaluation with IFD? #84

shlevy opened this issue Dec 13, 2022 · 2 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@shlevy
Copy link
Contributor

shlevy commented Dec 13, 2022

Consider a Haskell project built with haskell.nix. We want flake outputs and hydra builds for Linux and Darwin. Flake outputs are fine, just use perSystem or the equivalent functionality in flake-utils. But Hydra presents a problem.

Hydra jobs are evaluated once for all systems, on a Linux machine. So if we have the hydraJobs just build all of the packages, we'll run into a problem with the IFD of haskell.nix: It will require a Darwin builder at evaluation time, which may not be available then and certainly will be slow. haskell.nix does allow you to specify an evalSystem for your project evaluation, but if we set the evalSystem unconditionally to Linux then local darwin users will not be able to evaluate the flake outputs.

My current approach to solving this is to define a function taking system and evalSystem, with the latter defaulting to the former, then call the function just setting system for each system's packages but call it setting each system but the Linux evalSystem when building hydraJobs.

Could flake-parts give us some general way to do this? Maybe some kind of general way to re-call self with an extra module, or alternatively have perSystem be callable twice somehow?

@roberth
Copy link
Member

roberth commented Dec 14, 2022

Yes, this is possible, but don't you want to make sure that IFD works on the native system?

@shlevy
Copy link
Contributor Author

shlevy commented Dec 14, 2022

We can have a job in the jobset that ensures all the deps build and even evaluate.

@roberth roberth added enhancement New feature or request question Further information is requested labels Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants