-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
caddy: withPlugins
better error messages for untagged plugins
#368657
Conversation
echo " specified: \"$base@$specified\"" | ||
echo " got: \"$base@$expected\"" | ||
done < <($out/bin/caddy build-info) | ||
done |
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.
Does not display anything if a plugin is not found at all.
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.
Added a fall back but I don't think this will ever get triggered unless there's smth wrong with xcaddy
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/5021 |
lessThan | ||
sort | ||
toShellVar | ||
; |
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.
Out of curiosity, is that a best practice? Is it explained somewhere?
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.
Neither. I particularly don't like but it doesn't hurt (as long you're not using with lib
).
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've seen a few modules (in nixpkgs of course) pull in library functions right after getting arguments like these:
nixpkgs/nixos/modules/services/monitoring/metricbeat.nix
Lines 8 to 17 in 821e42c
let inherit (lib) attrValues literalExpression mkEnableOption mkPackageOption mkIf mkOption types ; nixpkgs/nixos/modules/services/networking/mtr-exporter.nix
Lines 8 to 23 in 4506ece
let inherit (lib) maintainers types literalExpression escapeShellArg escapeShellArgs mkEnableOption mkOption mkRemovedOptionModule mkIf mkPackageOption optionalString concatMapStrings concatStringsSep ; nixpkgs/nixos/modules/services/networking/ergo.nix
Lines 13 to 20 in 4506ece
inherit (lib) literalExpression mkEnableOption mkIf mkOption optionalString types ;
And I've taken quite a liking to this style, so yeah... Not sure if this is the "best practice" tho
Things done
Context:
#358586 (comment)
#358586 (comment)
Continuation of #358586, better error messages for untagged plugins
When using
pkgs.caddy.withPlugins
, if a plugin is untagged upstream, users usually provide a commit SHA to replace to the tag/version. This will result ininstallCheckPhase
failure ascaddy build-info
output uses pseudo-version number (e.g.v0.0.0-20170915032832-14c0d48ead0c
).Example error:
The error output will change to the following:
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.