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.
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.