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

nixos/release.nix: Refactoring for better multi-system support #33749

Merged
merged 3 commits into from Jan 16, 2018

Conversation

dezgeg
Copy link
Contributor

@dezgeg dezgeg commented Jan 11, 2018

Currently, even if you pass supportedSystems = [ "aarch64-linux" ] you
end up with e.g. nixos.iso_graphical.x86_64-linux job. Using the new
forSubsetOfSystems avoids that.

This shouldn't affect the usual x86 trunk-combined jobset.

https://hydra.nixos.org/eval/1425558#tabs-removed for the effect on an aarch64-only jobset.

@@ -13,6 +13,8 @@ let

forAllSystems = genAttrs supportedSystems;

forSubsetOfSystems = systems: genAttrs (intersectLists supportedSystems systems);
Copy link
Member

Choose a reason for hiding this comment

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

Should this go in release-lib.nix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uff... There's apparently already an equivalent called forAllSupportedSystems in release-lib.nix, but nixos/release.nix is not importing release-lib.nix

Copy link
Member

Choose a reason for hiding this comment

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

I'd a) import it, b) move forAllSystems to release-lib c) use forAllSupportedSystems.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that seems the best (and forAllSystems could be implemented in terms of forAllSupportedSystems to reduce duplication).

I hate the name forAllSupportedSystems though... given that we have forAllSystems which does something for every system passed in supportedSystems... and then forAllSupportedSystems which does something else.

Copy link
Member

Choose a reason for hiding this comment

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

I have no problem with you renaming them. Maybe something like forAllSystems and forTheseSystems?

I'm going to move forAllSystems from nixos/release.nix, and these
functions sound too similar while doing different things.
There's already a similar forTheseSystems in release-lib, so be more
consistent.
Currently, even if you pass `supportedSystems = [ "aarch64-linux" ]` you
end up with e.g. `nixos.iso_graphical.x86_64-linux` job. Using
forTheseSystems from release-lib avoids that.

This shouldn't affect the usual x86 trunk-combined jobset.
@dezgeg
Copy link
Contributor Author

dezgeg commented Jan 16, 2018

Implemented the above suggestions.

@Ericson2314
Copy link
Member

Glad you liked them, and thanks for making them!

@Ericson2314 Ericson2314 merged commit 4dff3ee into NixOS:master Jan 16, 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