coredns: add support for plugins#256710
Conversation
de11n
left a comment
There was a problem hiding this comment.
Great work! I took a stab at this a while ago and came up with something very similar. I have a few small comments but largely LGTM.
|
I made the suggested changes. |
de11n
left a comment
There was a problem hiding this comment.
Small comments. Overall looking great.
pkgs/servers/dns/coredns/default.nix
Outdated
There was a problem hiding this comment.
Extreme nit: You can build the entire string in Nix and then only echo once. But this is fine and matches the loop below it.
de11n
left a comment
There was a problem hiding this comment.
I don't have merge bits, but looks great. You may want to squash your commits to make it easier for whoever does merge it.
4545f41 to
c8a014a
Compare
|
Thanks! I've squashed it into a single commit. |
bjornfor
left a comment
There was a problem hiding this comment.
Commit message typo: plugins tht are -> plugins that are
Solves NixOS#146603 CoreDNS has support for plugins that are added at compile time. This exposes an argument `externalPlugins` that will build coredns with the specified plugins. Example: ``` coredns-fanout = pkgs.coredns.override { externalPlugins = [ {name = "fanout"; repo = "github.com/networkservicemesh/fanout"; version = "v1.9.1";} ]; vendorHash = "<SRI hash>"; }; ```
c8a014a to
37eb1c9
Compare
KFearsoff
left a comment
There was a problem hiding this comment.
LGTM
Regarding the "newer CoreDNS rebuilds with older vendor": do we have a precedent for handling something like this in Nixpkgs? I don't believe we do, and there's no easy way to handle it, right?
|
When coredns gets updated, and I use externalPlugins, does the build continue with stale vendored code, or does it fail? |
|
My understanding (based on trying the 1.10.1 -> 1.11.0 upgrade and reading https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/go/module.nix ): The package version is part of the I was worried that it might be possible for a new version to build successfully against old modules if you had a cached |
Perfect. Thanks! |
|
Thanks! |
|
sry to barge in like this but coredns is failing in staging-next with the following, mite be related. Tried to upgrade to 1.11.1 but no luck. |
|
This looks like the same issue: quic-go/quic-go#4021 In that case the issue is that quic-go was incompatible with go 1.21. I see that the default version of go was bumped to 1.21 3 days ago: #254878 |
|
So, what mite be the correct approach here; we can just do buildGo120Module to build and it will succeed I guess. How about other options? |
|
coredns 1.11.1 is supposed to have the fix (coredns/coredns#6252). it builds successfully for me on staging-next: I can put up a PR for this tonight. |
|
Oh that's great, thnx! |
support for plugins was merged upstream NixOS/nixpkgs#256710
Description of changes
Solves #146603
Usage:
This PR is based on #205649 . I've made 3 changes:
go mod vendorto the end ofmodBuildPhaseexternalPluginsargument to take the plugin name, repo and versionexternal-plugins.nix)Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)