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

stdenv: introduce meta.supported #38544

Closed
wants to merge 2 commits into from
Closed

Conversation

LnL7
Copy link
Member

@LnL7 LnL7 commented Apr 7, 2018

Motivation for this change

Fixes enableIfAvailable when config.allowBroken is set.

/cc @shlevy

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

This is similar to meta.available but is not influenced by things like
allowBroken.
@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: stdenv

Partial log (click to expand)

/nix/store/6kz2vbh98s2r1pfshidkzhiy2s2qdw0a-stdenv-linux

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: stdenv

Partial log (click to expand)

/nix/store/gv82dganjyq4mv42pxf0571g9b5azz31-stdenv-darwin

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: stdenv

Partial log (click to expand)

/nix/store/yq16vcdl95kfqjzq23lxhin38i3whlyj-stdenv-linux

@LnL7
Copy link
Member Author

LnL7 commented Apr 7, 2018

Hrm, this shouldn't rebuild anything...

Copy link
Member

@shlevy shlevy left a comment

Choose a reason for hiding this comment

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

I think really we need to move to a tristate model as @7c6f434c and @edolstra suggest: There's a difference between "this thing is not known to work on this platform" and "this thing is known not to work on this platform" and allowBroken shouldn't affect the latter.

lib/meta.nix Outdated
@@ -87,5 +87,5 @@ rec {
else { parsed = elem; };
in lib.matchAttrs pattern platform;

enableIfAvailable = p: if p.meta.available or true then [ p ] else [];
enableIfSupported = p: lib.optional p.meta.supported or true p;
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if parens are literally required here but lib.optional (p.meta.supported or true) p seems much better IMO.

@@ -241,6 +241,7 @@ rec {
&& (if config.checkMetaRecursively or false
then lib.all (d: d.meta.available or true) references
else true);
supported = validity.supported or false;
Copy link
Member

Choose a reason for hiding this comment

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

I think this does the wrong thing in case of unfree license.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, should allowUnfree influence the enable condition or not?

@LnL7
Copy link
Member Author

LnL7 commented Apr 7, 2018

My main goal here is to fix the nix build, I'm fine with closing or reverting this if somebody implements the allowBroken changes.

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: stdenv

Partial log (click to expand)

/nix/store/gv82dganjyq4mv42pxf0571g9b5azz31-stdenv-darwin

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: stdenv

Partial log (click to expand)

/nix/store/yq16vcdl95kfqjzq23lxhin38i3whlyj-stdenv-linux

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: stdenv

Partial log (click to expand)

/nix/store/6kz2vbh98s2r1pfshidkzhiy2s2qdw0a-stdenv-linux

@shlevy
Copy link
Member

shlevy commented Apr 9, 2018

#38639

@LnL7
Copy link
Member Author

LnL7 commented Apr 9, 2018

Closing in favour of #38639.

@LnL7 LnL7 closed this Apr 9, 2018
@LnL7 LnL7 deleted the meta-supported branch April 9, 2018 22:55
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