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-generic: add meta attribute checking #25304
Conversation
@copumpkin, thanks for your PR! By analyzing the history of the files in this pull request, we identified @edolstra, @pikajude and @wmertens to be potential reviewers. |
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.
🚢 🚢 🚢
This is turned off by default but I think we should fix all packages to respect it and then turn it on by default
Okay, now that this is merged, if anyone wants to join me in making small commits to fix meta attributes, please feel free 😄 |
I ran |
The thing is that |
Also, what's the impact of this on Nixpkgs evaluation speed? There has been a worrying slowdown in the last few releases, probably due to the increased complexity of stdenv... |
@edolstra my sense is that the reason you'd add stuff to meta rather than a comment is that you want it to be structured for some form of machine consumption. If you want a machine to consume it, you generally want it to have a reasonably well defined schema. So it doesn't seem too burdensome to ask people wanting to add a new meta attribute to add it to the central schema first (and it'll be easy for them to tell if they miss it because it'll fail eagerly now) On the evaluation speed, I don't know and haven't measured yet. Where can I find evaluation times in Hydra? I guess if it slows it down excessively we can turn it off, but given the literally dozens of edits I made to |
@copumpkin speed of evaluation is something visible via If you want a quick measurement, try measuring By the way, maybe the check should be done inside the tarball build, like the warning checks? Tarball failures block the channel, so they do get noticed… (I did have to do some fixes because of this check being introduced, and I do like this check in general) |
We could put it in the tarball I guess but feedback loop time makes a
difference. People still won't ever notice if they wrote maitnainers
instead of maintainers (or home/website instead of homepage), as someone
else will probably notice the tarball is blocked and fix it. Of course we
can use more human ways of spreading the message around like adding
instructions for turning this on in the PR template but I'd rather default
to a mode that doesn't silently ignore silly mistakes if we can.
Anyway, I'm not near my computer now but will try to measure eval time
later, if Hydra isn't already doing it somewhere.
…On Mon, May 1, 2017 at 11:47 Michael Raskin ***@***.***> wrote:
@copumpkin <https://github.com/copumpkin> speed of evaluation is
something visible via nix-env -qa; and also nix-env -i which shouldn't be
used ever but oh well…
If you want a quick measurement, try measuring test-eval-release.sh, I
think it should be a close proxy.
By the way, maybe the check should be done inside the tarball build, like
the warning checks? Tarball failures block the channel, so they do get
noticed…
(I did have to do some fixes because of this check being introduced, and I
do like this check in general)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#25304 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAKP7_mIqhHowMeiigYamcK8ZADkyfJks5r1f6MgaJpZM4NMBSF>
.
|
can use more human ways of spreading the message around like adding
instructions for turning this on in the PR template but I'd rather default
Also tagging people who broke tarball eval with an explanation of the
problem seems to create some progress.
Maybe a special environment variable that makes stdenv return strict or
lax mkDerivation could be a good solution? If we set the lax variable
value for Hydra and `nix-env -qa`, but not `test-eval-release.sh`,
tarball build or `nix-build`/`nix-env -iA`, we could have the best of
both worlds…
|
http://hydra.nixos.org/job/nixpkgs/trunk/metrics#tabs-charts Note the jump for e.g. |
@7c6f434c Yeah, doing this kind of lint check in the Nixpkgs tarball job sounds good. |
Yeah, so I guess it did go up a bit. The real question to me is what we're optimizing for. I'd obviously prefer what I'd call "developer efficiency", but I'm not the one paying for or maintaining Hydra hardware. At the same time, losing a few seconds (or <100MB of RAM) with each full-nixpkgs hydra evaluation when builds take hours or even days still seems pretty small. I do realize that the evaluation time matters every time we do Anyway, I can't really make the call and it's a trade-off like everything, but if I were running the project, I'd probably leave this turned on by default and accept slightly slower Hydra eval times. |
@copumpkin @edolstra and what about environment-variable-controlled middle ground? |
It's already controlled by a config flag. The question is more whether we want it on by default or not. |
My point is that On Hydra the check should be just switched off in evaluation and moved to the tarball build. |
Ah, so we'd have |
I would set an environment variable; and There would be some slight difference in behaviour, true, but at least in case of success the hashes would be the same, so not that bad… I doubt we can go more confusing that the current |
Oh, you mean developers would need to set an environment variable when developing? That feels like defaulting it to off, which I didn't want. I was hoping for something a bit like My issue is just that the people who are typoing all their meta tags (often in consistently bad ways, like |
I'll just turn it off by default for now, since I think I missed some broken @edolstra where are you leaning? Did my "unstructured random data in Trying to gauge how controversial this is, basically, to decide whether an RFC is worthwhile. To be clear, this is what I'm proposing:
|
I switched the default to |
No-no, I meant that |
Distinguishing mass operations and targeted operations would be also useful for deprecation warnings. For example, @oxij wonders is there a way to display notices that there are two different |
For example, @oxij wonders is there a way to display notices that there are two different `torbrowser` packages (from source and binary) now.
While my wishes are related, its not exactly the same use case, AFAICS.
E.g. I don't want users of `tor-browser-bundle-bin` to see the warning,
only those who use the old `torbrowser` attr.
On a second thought, though, its probably possible to do something like
~~~~
torbrowser = withWarning "..." tor-browser-bundle-bin;
~~~~
in `all-packages.nix` with `withWarning` generating new derivation with
a warning in meta. Then I would even vote for evaluating such warning in
`nix-env -i`.
On a related note. Having a way to catch `assert` failures in
derivations would be nice too.
I want to fuzz boolean package options and check that packages build
with all possible combinations of them, directly in nix, but nix has no
`catch`.
Rewriting assertions to be a list in `meta` that gets inspected only on
derivation build attempt would work for that use case too.
|
branch = str; | ||
homepage = str; | ||
downloadPage = str; | ||
license = either (listOf lib.types.attrs) lib.types.attrs; |
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.
The current documentation says that using strings for license
is "valid", though "frowned upon". I suppose the manual should be updated?
|
||
# Weirder stuff that doesn't appear in the documentation? | ||
version = str; | ||
updateWalker = bool; |
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.
updateWalker
seems to be documented.
The invalid meta.outputsToInstall has been blocking channel updates. https://mailman.science.uu.nl/pipermail/nix-dev/2017-June/023991.html
- Enable metadata checking by default, see NixOS#25304 (comment) - Check metadata before any other package issues, see NixOS#191124 (comment) - Document that type checks only apply to the top level of nested values. Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
This is turned off by default but I think we should fix all packages to respect it and then turn it on by default. To turn it on, just put
checkMeta = true;
into your nixpkgs config.cc @shlevy @dezgeg @edolstra
Motivation for this change
I got sick of constantly seeing typos and accidental type errors in our meta tags, and people never notice them until Hydra complains. I'd probably eventually start adding a few more checks (like that
platforms
members are in an enum and so on) but this should get us 95% of the value.It's turned off by default because there are tons of violations, which I'd propose fixing incrementally in separate commits. The very first failure is in binutils, which has a
priority
field as a string 😄Things done
Nothing. I just tried evaluating
stdenv
and got some failures, so there's work to be done 😁N.B: this is not a mass rebuild, and only affects evaluation