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

use of meta.tests causes evaluation errors #50230

Closed
peti opened this issue Nov 11, 2018 · 8 comments
Closed

use of meta.tests causes evaluation errors #50230

peti opened this issue Nov 11, 2018 · 8 comments
Labels
0.kind: regression Something that worked before working no longer

Comments

@peti
Copy link
Member

peti commented Nov 11, 2018

#44439 adds meta.tests to dovecot, but that attribute is not supported by Nix and causes evaluation errors, i.e.:

$ nix-env -qaP --meta --json  >/dev/null
derivation 'dovecot-2.3.3' has invalid meta attribute 'tests'
derivation 'opensmtpd-6.4.0p1' has invalid meta attribute 'tests'

This output breaks several scripts of mine (for updating the Haskell package set) and I would kindly request to make those warnings disappear one way or another.

Ping: @Ekleog, @timokau

@peti peti added the 0.kind: regression Something that worked before working no longer label Nov 11, 2018
peti added a commit that referenced this issue Nov 11, 2018
@timokau
Copy link
Member

timokau commented Nov 11, 2018

This is weird since @Ekleog did add the tests attribute to metaTypes in pkgs/stdenv/generic/check-meta.nix.

@grahamc
Copy link
Member

grahamc commented Nov 11, 2018

My guess is a derivations' meta can't contain derivations, but I'm not sure. I think this may be true because it raises this question: when evaluating and querying meta fields about a package (which is possible,) should the derivations be built or not? Yes, for consistency it should, but running a bunch of tests when querying packages doesn't make sense.

@Ekleog
Copy link
Member

Ekleog commented Nov 11, 2018

@timokau It appears to be also checked a second time in nix itself for some (but not all) operations: https://github.com/NixOS/nix/blob/f6a3dfe4e06980b2d060fd1a646cb5ca20f29779/src/nix-env/nix-env.cc#L872

This means either we need to change nix, or we need to use passthru. I'm opening an issue on nix for more thought on this.

@grahamc
Copy link
Member

grahamc commented Nov 11, 2018

Probably should just use passthru.

@Ekleog
Copy link
Member

Ekleog commented Nov 11, 2018

OK, I'll include the switch to passthru in the refactoring I'm doing to address the cross-building issues.

Ekleog added a commit to Ekleog/nixpkgs that referenced this issue Nov 11, 2018
Nix currently rejects derivations in `meta` values. This works around
that limitation by using `passthru` instead.

Closes NixOS#50230
@Ekleog
Copy link
Member

Ekleog commented Nov 11, 2018

This should be fixed in #50233

@timokau
Copy link
Member

timokau commented Nov 11, 2018

Checking this in nix itself seems out of place to me, but using patthru is probably the best quick fix.

@Ekleog
Copy link
Member

Ekleog commented Nov 11, 2018

Feel free to react to NixOS/nix#2532, which I opened as the issue seen from the nix point of view :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: regression Something that worked before working no longer
Projects
None yet
Development

No branches or pull requests

4 participants