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

setup.sh: add dontConfigure #63520

Merged
merged 6 commits into from Jul 3, 2019
Merged

Conversation

worldofpeace
Copy link
Contributor

Motivation for this change

People have been using dontConfigure in expressions expecting that it would disable the configurePhase.
Let's make this actually do something.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@worldofpeace
Copy link
Contributor Author

Screenshot of rendered doc change (built on master)
Screenshot from 2019-06-19 09 11 52

@@ -1283,6 +1283,7 @@ genericBuild() {
fi

for curPhase in $phases; do
if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then continue; fi
if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then continue; fi
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we should have doBuild, dontCheck, etc. for completeness?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well we have doCheck so there's this interesting use of polarities here.
I'm under the impression that doCheck exists to enable because it's default skipped.
Other phases should not be skipped and be explicitly disabled otherwise.

So I'd think dontUnpack would be the only other one to complete this.

@worldofpeace
Copy link
Contributor Author

If you don't mind I think I'll eliminate a lot of expressions doing

somethingPhase = ":";

and use the proper dontPhase = true;

@worldofpeace
Copy link
Contributor Author

@matthewbauer ping

@edolstra
Copy link
Member

I'm not sure this is preferrable over configurePhase = ":".

@worldofpeace
Copy link
Contributor Author

I personally very much dislike doing that. Feels more intuitive to me for it actually to be skipped.
There's the use of dont* for plenty other things already.

Any opinion on the perception in #63520 (comment)?

There's already 21 occurences of this and I've
expected this to exist without knowing it had no affect for a while.
Copy link
Member

@Mic92 Mic92 left a comment

Choose a reason for hiding this comment

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

I prefer theses options over overriding phases. It is easier to read and documented over what unpackPhase = ":"; does. To people not so familiar with shell, it might be not clear what : does.

@worldofpeace worldofpeace merged commit cb278f7 into NixOS:staging Jul 3, 2019
@worldofpeace worldofpeace deleted the dontConfigure branch July 3, 2019 00:05
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

4 participants