feat: add conda/outputs backend protocol#4056
feat: add conda/outputs backend protocol#4056baszalmstra wants to merge 27 commits intoprefix-dev:mainfrom
conda/outputs backend protocol#4056Conversation
| @@ -0,0 +1,211 @@ | |||
| //! Describes the `conda/outputs` request and its parameters. | |||
There was a problem hiding this comment.
Please take a very close look at this file. This describes the conda/outputs protocol. We want to make sure we dont have to change this.
| // #[serde_as] | ||
| // #[derive(Debug, Serialize, Deserialize, Clone, Hash, Eq, PartialEq)] | ||
| // #[serde(rename_all = "camelCase")] | ||
| // pub struct CondaCacheMetadata { |
There was a problem hiding this comment.
I explicitly left this in
|
|
||
| // Determine the cache key for the environment. | ||
| let cache_key = self.cache_key(); | ||
| let name = self.requirement.0.as_source().to_string(); |
There was a problem hiding this comment.
I changed the code below because I always want to solve the environment to ensure we get the latest versions.
Hofer-Julian
left a comment
There was a problem hiding this comment.
Another part of the review :)
| /// subdir) or for the current architecture if the target is `noarch`. | ||
| /// | ||
| /// For C++ packages these would be libraries to link against. | ||
| pub host_dependencies: Option<CondaOutputDependencies>, |
There was a problem hiding this comment.
Really like the way you write docs :)
Co-authored-by: Hofer-Julian <[email protected]>
Hofer-Julian
left a comment
There was a problem hiding this comment.
I had a look at all code changes now, but didn't try it out locally yet
crates/pixi_command_dispatcher/src/command_dispatcher_processor/build_backend_metadata.rs
Outdated
Show resolved
Hide resolved
crates/pixi_command_dispatcher/src/solve_pixi/source_metadata_collector.rs
Show resolved
Hide resolved
…r/build_backend_metadata.rs Co-authored-by: Hofer-Julian <[email protected]>
|
First observations while testing: context of testing: On pixi side, I'm running ``PIXI_BUILD_BACKEND_OVERRIDE_ALL=1 cargo run -- install` The first time it builds fine. Then if I modify:
|
|
|
||
| impl BuildEnvironment { | ||
| /// Constructs a new build environment where the host environment is the same as the build environment. | ||
| pub fn to_build_from_build(&self) -> Self { |
There was a problem hiding this comment.
maybe rename from_host_env?
|
|
||
| // Determine the cache key for the environment. | ||
| let cache_key = self.cache_key(); | ||
| let name = self.requirement.0.as_source().to_string(); |
| #[serde(rename_all = "camelCase")] | ||
| pub struct CondaOutputMetadata { | ||
| /// The identifier of the output. | ||
| pub identifier: CondaOutputIdentifier, |
There was a problem hiding this comment.
maybe we can rename it to metadata ? I would expect identifier to be an id or something, but here it is more like a subset of some metadata kind
| @@ -1,3 +1,5 @@ | |||
| //! This API was introduced in Pixi Build API version 0. | |||
There was a problem hiding this comment.
this will be deprecated in a way that we will not use conda-getmetadata but conda-outputs?
|
|
||
| // Try to acquire a lock on the cache file. | ||
| let cache_file_path = cache_dir.join(input.hash_key()).with_extension("json"); | ||
| let cache_file_path = cache_dir.join("metadata.json"); |
There was a problem hiding this comment.
why it is metadata.json? I can't find a place where this file is created/written
There was a problem hiding this comment.
It will be created in something like .pixi/build/meta-v0/<hash>/metadata.json
This PR only modifies locking so installing with the new backends does not work yet. Thats also likely why you dont see a change. Changes to the host section should cause a relock though. So if you add |
|
Continued in #4118 |
This PR adds the
conda/outputsbackend protocol method. Instead of letting the build backends solve the host and build environments, with this PR pixi itself takes care of that. We do this to allow pixi to act as the build orchestrator and to allow host and build environments of packages to also contain source dependencies.The protocol method is not finalized since we already identified some weaknesses. Im putting this PR up now so we can already start doing initial reviews.
Some notable changes:
Nameless)MatchSpecas much as possible in favour ofPixiSpec/BinarySpec. This provides a more homogeneous API on the pixi side.