-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 flake check
: skip derivations for foreign systems
#7759
nix flake check
: skip derivations for foreign systems
#7759
Conversation
If you want better backwards compatibility, you can do this opt-in and instead add the flag |
That's a good idea, I don't have an opinion one way or the other. Can somebody make a decision:
or
I assume the |
Personally I am in the "change the default behaviour" camp and only check the current system. This usually makes it easier to run a check on the terminal. Keeping the current behaviour as the default would usually end up in a workflow like the following:
Optionally replace 6 with "get a suceeding check". By changing the default, we can get this down to:
In worst case people had an older nix and they would google and should see, oh, new behaviour introduced in nix 2.30, I'm only on 2.15, so I have to update. CI that indeed relies on multi-arch checks would need to update their scripts, as they update their nix version. I think this is fine. At least they are relying on experimental software which is allowed to break or change its behaviour in subtle ways. We just need to be clear in the release notes that this is intended behaviour. Break things now! Once 3.0 got released we can not as easily! PS: I am a big fan of |
Okay, I will keep the current behavior then, default is current system only.
This is a good idea; can we review this PR now and implement that later in a subsequent PR? It can be done for both |
ab46217
to
b2e5a8a
Compare
nix flake check
skips derivations for foreign systemsnix flake check
: skip derivations for foreign systems
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-02-17-nix-team-meeting-minutes-33/25624/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-02-17-nix-team-meeting-minutes-33/25624/2 |
b2e5a8a
to
15d7393
Compare
Discussed in the Nix team meeting 2023-03-17: @peterbecich to answer your question from Discourse on behalf of the team (although I was not there, just inferring from the meeting notes): Yes, default behavior should stay the same. We could either have a Currently There was no clear decision on the priority and how to proceed though, and I suppose we will talk about it again some time soon, and post an update again. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-03-17-nix-team-meeting-minutes-41/26614/1 |
@fricklerhandwerk okay, thank you. I will keep the default behavior and implement IMO This will help
To make it consistent with If I'm not mistaken:
The choice to change the default behavior got 9 upvotes: #7759 (comment) I have no opinion. |
15d7393
to
581084d
Compare
1e63fe3
to
d00082f
Compare
Here are tests; default behavior maintained:
The
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-03-17-nix-team-meeting-minutes-41/26614/3 |
Discussed in Nix team meeting: @peterbecich we talked about this again and agree on changing the default behavior, and making @thufschmitt will shepherd the PR to the finish line. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2023-03-27-nix-team-meeting-minutes-44/26759/1 |
Great, thank you. |
d00082f
to
df8133f
Compare
The PR implements the behavior everyone has agreed to: #7759 (comment) |
Can this be merged? Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay @peterbecich, this fell down the cracks. Just one small comment on the message that gets printed, but good otherwise.
c3ebe84
to
96470b3
Compare
`nix flake show` now skips derivations for foreign systems: NixOS#6988 This commit borrows from that to implement the same behavior for `nix flake check`. See "nix flake check breaks on IFD in multi-platform flake" NixOS#4265
Flake with two systems intentionally fails with `nix flake check --all-systems`; the same flake succeeds with `nix flake check`. Previously, this flake intentionally failed with `nix flake check`.
…ystem-only` flag
…urrent-system-only` flag" This reverts commit d00082f.
96470b3
to
a395e48
Compare
Co-authored-by: Théophane Hufschmitt <[email protected]>
a395e48
to
567cb9b
Compare
@thufschmitt , thank you, I have checked and made a small fix to your commit, looks good to me.
|
Awesome, thanks |
This PR did not fix |
Context
This PR changes the default behavior of
nix flake check
.The same change was already approved for
nix flake show
: #6988Motivation
nix flake show
now skips derivations for foreign systems: #6988This PR borrows from that PR to implement the same behavior for
nix flake check
.Here is a Flake project which I believe uses IFD: https://github.com/srid/haskell-template
Using Nix 2.12.0 on a
x86_64-linux
, the result ofnix flake check
is:With this PR,
nix flake check
produces:With this PR and the
--all-systems
flag, it produces an error like before:The current system is acquired this way, copied from #6988:
nix/src/nix/flake.cc
Line 300 in 513d8a1
For a Nix system with remote builders, could this change to the default behavior of
nix flake check
be a problem?This PR copies the existing check
checkSystemName
.Wherever
checkSystemName
is applied innix flake check
, the system type is now also checked bycheckSystemType
. I have not thought very carefully about where these checks are placed. Example:nix/src/nix/flake.cc
Lines 528 to 542 in 8be71bc
Checklist for maintainers
Maintainers: tick if completed or explain if not relevant
tests/**.sh
src/*/tests
tests/nixos/*