feat: parsing of build backend configuration #2624
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds parsing of build backend configuration to the manifest.
Description
Backends sometimes require explicit configuration for parameters that cannot be derived from the source or the manifest. Examples of these are additional CMake arguments, whether to build a noarch package for python and potentially many more settings that are configurable in a rattler-build recipe.
Design
To facilitate this we want to allow people to configure the backends in their
pixi.toml
/pyproject.toml
while retaining the following properties:With these requirements we designed the following:
Considerations and implementation
We add the
build-backend
section which has one key that should be equal to the name of the build backend. This allows us to write sub-schemas that match on that specific key.We choose to add an additional section because we are afraid otherwise the key becomes very long. E.g.
build-system.config.pixi-build-python
.Pixi reads the configuration verbatim and passes this over JSONRPC to the build backend. The immediate downside of this approach is that providing context-aware errors becomes much harder. This is because there is no direct mapping from the TOML config to the parameters passed in JSON. This PR does not provide any mechanism to facilitate this either.