-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
check meta, treewide #32365
check meta, treewide #32365
Conversation
/cc @grahamc. |
and /cc @copumpkin who started |
For now I used |
For some weird GitHub bug I cannot leave a line comment; wouldn't it be more consistent to also add the current platform to the message for Parallels tools? I guess perfect consistency w.r.t. system/platform and colon/no-colon is too annoying to ensure across all the changes (for little gain). In general looks good, but not sure if GitHub hides some part of diff because it is too large… |
@@ -5,15 +5,15 @@ stdenv.mkDerivation { | |||
builder = ./builder.sh; | |||
|
|||
src = fetchurl { | |||
url = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2006_linux.tar.gz; | |||
homepage = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2006_linux.tar.gz; |
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 one isn't right
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.
Oh, aangifte-* were the only not done fully manually and they got wrong without me noticing :-/
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.
looks great other than these very minor issues :)
@@ -5,7 +5,7 @@ stdenv.mkDerivation { | |||
builder = ./builder.sh; | |||
|
|||
src = fetchurl { | |||
url = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2007_linux.tar.gz; | |||
homepage = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2007_linux.tar.gz; |
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.
url / homepage confusion
@@ -6,7 +6,7 @@ stdenv.mkDerivation { | |||
builder = ./builder.sh; | |||
|
|||
src = fetchurl { | |||
url = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2008_linux.tar.gz; | |||
homepage = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2008_linux.tar.gz; |
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.
url / homepage confusion
@@ -4,7 +4,7 @@ stdenv.mkDerivation { | |||
name = "aangifte2009-1"; | |||
|
|||
src = fetchurl { | |||
url = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2009_linux.tar.gz; | |||
homepage = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2009_linux.tar.gz; |
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.
url / homepage confusion
@@ -4,7 +4,7 @@ stdenv.mkDerivation { | |||
name = "aangifte2010-1"; | |||
|
|||
src = fetchurl { | |||
url = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2010_linux.tar.gz; | |||
homepage = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2010_linux.tar.gz; |
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.
url / homepage confusion
@@ -4,7 +4,7 @@ stdenv.mkDerivation { | |||
name = "aangifte2011-1"; | |||
|
|||
src = fetchurl { | |||
url = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2011_linux.tar.gz; | |||
homepage = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2011_linux.tar.gz; |
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.
url / homepage confusion
@@ -4,7 +4,7 @@ stdenv.mkDerivation { | |||
name = "aangifte2012-1"; | |||
|
|||
src = fetchurl { | |||
url = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2012_linux.tar.gz; | |||
homepage = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2012_linux.tar.gz; |
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.
url / homepage confusion
@@ -4,7 +4,7 @@ stdenv.mkDerivation { | |||
name = "aangifte2013-wa"; | |||
|
|||
src = fetchurl { | |||
url = http://download.belastingdienst.nl/belastingdienst/apps/linux/wa2013_linux.tar.gz; | |||
homepage = http://download.belastingdienst.nl/belastingdienst/apps/linux/wa2013_linux.tar.gz; |
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.
url / homepage confusion
@@ -4,7 +4,7 @@ stdenv.mkDerivation { | |||
name = "aangifte2013-1"; | |||
|
|||
src = fetchurl { | |||
url = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2013_linux.tar.gz; | |||
homepage = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2013_linux.tar.gz; |
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.
url / homepage confusion
@@ -4,7 +4,7 @@ stdenv.mkDerivation { | |||
name = "aangifte2014-wa"; | |||
|
|||
src = fetchurl { | |||
url = http://download.belastingdienst.nl/belastingdienst/apps/linux/wa2014_linux.tar.gz; | |||
homepage = http://download.belastingdienst.nl/belastingdienst/apps/linux/wa2014_linux.tar.gz; |
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.
url / homepage confusion
@@ -4,7 +4,7 @@ stdenv.mkDerivation { | |||
name = "aangifte2014-1"; | |||
|
|||
src = fetchurl { | |||
url = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2014_linux.tar.gz; | |||
homepage = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2014_linux.tar.gz; |
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.
url / homepage confusion
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.
I think I don't fully grok the implications around abort vs. throw but I strongly approve of this!
We could add something like |
pkgs/stdenv/generic/check-meta.nix
Outdated
@@ -126,7 +126,7 @@ let | |||
''; | |||
|
|||
throwEvalHelp = { reason , errormsg ? "" }: | |||
throw ('' | |||
(if reason != "unknown-meta" then throw else (x : builtins.trace x true)) ('' |
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.
I'd be tempted to make this configurable so we can highlight or ignore certain conditions depending on what we're testing for:
updated
diff --git a/pkgs/stdenv/generic/check-meta.nix b/pkgs/stdenv/generic/check-meta.nix
index 03a85633ed6..6e97ca7534d 100644
--- a/pkgs/stdenv/generic/check-meta.nix
+++ b/pkgs/stdenv/generic/check-meta.nix
@@ -125,11 +125,17 @@ let
'';
- throwEvalHelp = { reason , errormsg ? "" }:
- throw (''
- Package ‘${attrs.name or "«name-missing»"}’ in ${pos_str} ${errormsg}, refusing to evaluate.
+ handleEvalIssue = { reason , errormsg ? "" }:
+ let
+ msg = ''
+ Package ‘${attrs.name or "«name-missing»"}’ in ${pos_str} ${errormsg}, refusing to evaluate.
- '' + ((builtins.getAttr reason remediation) attrs));
+ '' + (builtins.getAttr reason remediation) attrs;
+
+ handler = if config ? "handleEvalIssue"
+ then config.handleEvalIssue reason
+ else throw;
+ in handler msg;
metaTypes = with lib.types; rec {
# These keys are documented
@@ -192,7 +198,7 @@ let
validityCondition =
let v = checkValidity attrs;
in if !v.valid
- then throwEvalHelp (removeAttrs v ["valid"])
+ then handleEvalIssue (removeAttrs v ["valid"])
else true;
in
usage:
handleEvalIssue = reason: errormsg:
if reason == "unknown-meta"
then abort errormsg
else builtins.trace errormsg true;
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.
If we play our cards right, we could take evaluation aborted with the following error message: ‘Package ‘aangifte2006-1’ in /home/grahamc/projects/nixpkgs/pkgs/applications/taxes/aangifte-2006/default.nix:15 has an invalid meta attrset:
parse the path an line, and leave in-line feedback on PRs..........
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.
I'm also tempted by this.
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.
Oh, I think this will be a good way to clean https://hydra.nixos.org/jobset/nixpkgs/trunk#tabs-errors 👍
If I were you I would squash 374eba46ee9488e242b0dae5cec163bcc8cf27bf
and ba940713764d43bb3f735d4c74fbc5162e83726a (they LGTM) and cherry-pick
the result to master and 17.09 as soon as possible. The leftover diff
would get much smaller and users which don't really care about the
frameworkization part (e.g. me) would instantly get happy.
|
- tracing seems annoying enough - we get errors for all packages instead of aborting on the first one - easier to differentiate from unwanted packages (broken, unfree, etc.)
They aren't meant to be critical (uncatchable) errors. Tested with nix-env + checkMeta: [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ]
ba94071
to
f33a513
Compare
Plan:
?: add into the tarball job, simple pre-push hook for direct pushers, more meta checks, ...