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
Command plugins #4486
Command plugins #4486
Conversation
Alternative implementation of #4479 |
84a4f1e
to
d7fd8a0
Compare
@edolstra Thoughts on this one? |
@edolstra Ping. |
@edolstra if there are no objections I'll merge this soon. |
Please not, I'm not so happy about making it impossible to pass |
@edolstra It's not impossible, it's just a warning. The only option that can't be passed after the subcommand is plugin-files. We can remove the deprecation warning too. |
@edolstra Can we set up some time next week to talk through next steps? Maybe Monday in the EST morning? |
Is there any further read about this feature in general, about what plugins are supposed to do/access, and what not? I'm somewhat worried exposing the somewhat in flux internal Nix API, which was never stable or formalized to plugins either will lead to not being able to change internal API (cause people are afraid to break plugins), or changes in Nix suddenly causing breakages (cause there is no contract about what's stable). |
@flokli plugins predate this work, and in fact we thought command plugins already worked: https://nixos.org/manual/nix/stable/#conf-plugin-files There is no expectation of stability around these APIs, or there shouldn't be. This PR simply fixes when command plugins are loaded so they can take effect. |
@shlevy thanks for the clarification. The section in the manual isn't clear enough for my taste regarding stability guarantees, but that's probably out of scope for this PR. |
Thanks! |
We know the flag will be ignored but the user wants it to take effect.
This is technically a breaking change, since attempting to set plugin files after the first non-flag argument will now throw an error. This is acceptable given the relative lack of stability in a plugin interface and the need to tie the knot somewhere once plugins can actually define new subcommands.
d7fd8a0
to
f6c5b05
Compare
@edolstra Updated with removal of the deprecation. |
Thanks! |
What is the correct way to load plugins to avoid the error message?
These all emit the warning/error ( unsure of which it actually is since it's stated as being both a warning and an error ):
This one convinced me the error message was just completely bogus:
I can file a bug report but wanted to check to make sure I wasn't just using the flags incorrectly or something. |
@aakropotkin fixed in #7736 |
@aakropotkin Note that even without this fix nothing actually fails to work, you just get this erroneous warning message. The client does in fact load the plugin-files. |
Yeah luckily the plugins still work which is the most important thing. Out of curiosity @shlevy have you encountered crashes on exit using I've tried this block a dozen ways and always hit a syscall failure on exit : https://github.com/aakropotkin/floco/blob/54f5bf1bbff1f5d3dd81577ad258b46121aef05f/pkgs/nix-plugin/npm-wrap.cc#L138 |
@aakropotkin I haven't, but my usage has been very sporadic, sorry. |
This makes it possible to define and use external plugins that add new nix subcommands.
Tested both with the existing in-tree plugins test and with an external command-adding plugin.