-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Register builtin builders #13138
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
Register builtin builders #13138
Conversation
| RegisterBuiltinBuilder(const std::string & name, BuiltinBuilder && fun) | ||
| { | ||
| if (!builtinBuilders) builtinBuilders = new BuiltinBuilders; | ||
| builtinBuilders->insert_or_assign(name, std::move(fun)); |
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.
Should registering multiple instances with the same name be ok and overwrite the value? Wouldn't that allow plugins to override standard builders?
We should do #9259 as a prerequisite so that
|
Is this blocking this PR in any way? I like that src/libstore/unix/build/derivation-builder.cc no has less knowledge over builtin builders. Also make potential plugins easier to build. |
|
@Mic92 No, that would be discussion for a future PR. This PR is just refactoring to provide the necessary infrastructure for registering builtin builders. |
Motivation
This makes the builtin builders (
builtin:fetchurletc) register themselves at runtime, so thatDerivationBuilderImpl::runChild()doesn't need to know about them.Context
I want to add a
builtin:fetch-treebuiltin builder (DeterminateSystems#49). However, this would requirelibstoreto depend onlibfetchers, which would be a cyclic dependency. So we need to be able to define builtin builders outside oflibstore.Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.