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

nix/build: add `--rebuild` option #3761

Merged
merged 1 commit into from Jul 31, 2020
Merged

Conversation

@Ma27
Copy link
Member

Ma27 commented Jun 29, 2020

Occasionally, nix-build --check is fairly helpful and I'd like to be
able to use this feature for flakes that need to be built with nix build as well.

cc @edolstra

@FRidh
Copy link
Member

FRidh commented Jul 9, 2020

I think nix build --check (the new UI) would be confusing, since flakes have tests denoted as checks.

@bhipple
Copy link
Contributor

bhipple commented Jul 9, 2020

We could perhaps adopt the --challenge name from guix, which does the same thing.

@Ma27
Copy link
Member Author

Ma27 commented Jul 9, 2020

That's a nice suggestion! I just wanted to ask for a better idea since I couldn't come up with a non-verbose alternative to --check.

@FRidh @edolstra do you agree with --challenge? If yes, I'd change my PR accordingly.

@FRidh
Copy link
Member

FRidh commented Jul 9, 2020

In #3750 it is suggested to have a separate command for it, nix challenge.

@Ma27
Copy link
Member Author

Ma27 commented Jul 9, 2020

I'd be fine with this as well.

@Ma27
Copy link
Member Author

Ma27 commented Jul 11, 2020

I should note though that if we add a nix challenge-command we should try to reach feature-parity with guix challenge which also supports e.g. comparing build products to the results from binary caches. Also it's directly possible to introspect the differences of store-paths with tools such as diffoscope (https://guix.gnu.org/manual/en/html_node/Invoking-guix-challenge.html).

Thus I also have to revoke my 👍 for --challenge, using this name would IMHO create too much confusion for people who also know guix.

Implementing such a feature would cost fairly much additional time I cannot invest atm. However I'd like to have this feature for the nix-command as well (to test flakes) which is why I'd suggest to either merge this PR as-is or to rename --check to something more suitable first (e.g. to --rebuild, better suggestions are welcome).

@FRidh @edolstra thoughts?

@Ma27 Ma27 force-pushed the Ma27:nix-command-build-check branch from f3761d8 to 207cfa1 Jul 17, 2020
@Ma27 Ma27 changed the base branch from flakes to master Jul 17, 2020
@Ma27
Copy link
Member Author

Ma27 commented Jul 17, 2020

Rebased onto master and tested again. @edolstra anything missing to get this merged? :)

@Ma27
Copy link
Member Author

Ma27 commented Jul 26, 2020

@edolstra I think that nix build --check is the best solution for now (as it's consistent with nix-build --check) and as I've pointed out, we'd need to do way more stuff to implement nix challenge (I'm happy to do so, but in another PR), so can we merge this now?

@edolstra
Copy link
Member

edolstra commented Jul 31, 2020

@Ma27 Yeah, I think it's better to rename it to --rebuild, since "check" is rather ambiguous (check what? re-run the checkPhase?). It could even be a top-level command, i.e. nix rebuild.

@Ma27
Copy link
Member Author

Ma27 commented Jul 31, 2020

@edolstra I like --rebuild, will change it now.

It could even be a top-level command, i.e. nix rebuild.

I don't think that's a good idea. I'm fairly sure that people will start to confuse this with nixos-rebuild :-)

Also, rather than nix rebuild we probably want to implement sth. like nix challenge (see #3761 (comment) for that) with a few more features.

@domenkozar
Copy link
Member

domenkozar commented Jul 31, 2020

Note that challenge is really a bad name, I'm sure most people can't guess what it would do.

check is a bit vague, but at least it gives some constraints to what it could do.

@Ma27
Copy link
Member Author

Ma27 commented Jul 31, 2020

@domenkozar well, the challenge thing is something to be discussed when we're about to implement sth like #3750. Right now I only want something like nix-build --check for the new nix command.

Occasionally, `nix-build --check` is fairly helpful and I'd like to be
able to use this feature for flakes that need to be built with `nix
build` as well.
@Ma27 Ma27 force-pushed the Ma27:nix-command-build-check branch from 207cfa1 to 5a09eb8 Jul 31, 2020
@Ma27 Ma27 changed the title nix/build: add `--check` option nix/build: add `--rebuild` option Jul 31, 2020
@Ma27
Copy link
Member Author

Ma27 commented Jul 31, 2020

@edolstra updated accordingly.

@FRidh
FRidh approved these changes Jul 31, 2020
@edolstra edolstra merged commit 935723e into NixOS:master Jul 31, 2020
@edolstra
Copy link
Member

edolstra commented Jul 31, 2020

Thanks!

@Ma27 Ma27 deleted the Ma27:nix-command-build-check branch Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.