Skip to content

Commit e105ab2

Browse files
authored
feat: add conda/outputs and conda/build_v2 backend protocol (#241)
1 parent c8cdffd commit e105ab2

File tree

53 files changed

+3273
-810
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3273
-810
lines changed

Cargo.lock

Lines changed: 602 additions & 537 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ clap = "4.5.29"
1212
clap-verbosity-flag = "3.0.2"
1313
either = "1.15.0"
1414
fs-err = "3.1.0"
15+
hashlink = "0.10.0"
16+
insta = "1.43.1"
1517
indexmap = "2.7.1"
18+
ordermap = "0.5.7"
1619
itertools = "0.14.0"
1720
log = "0.4.25"
21+
marked-yaml = "0.8.0"
1822
miette = "7.5.0"
1923
minijinja = "2.7.0"
2024
parking_lot = "0.12.3"
@@ -35,19 +39,20 @@ url = "2.5.4"
3539
pyproject-toml = "0.13.4"
3640
dirs = "6.0.0"
3741
pathdiff = "0.2.3"
42+
thiserror = "2.0.12"
43+
strum = "0.27.2"
3844

3945
jsonrpc-stdio-server = "18.0.0"
4046
jsonrpc-http-server = "18.0.0"
4147
jsonrpc-core = "18.0.0"
4248

43-
rattler-build = { version = "*", default-features = false, features = [
49+
rattler-build = { git = "https://github.com/prefix-dev/rattler-build", branch = "main", default-features = false, features = [
4450
"rustls-tls",
4551
] }
4652

47-
48-
rattler_conda_types = { version = "0.32.0", default-features = false }
49-
rattler_package_streaming = { version = "0.22.35", default-features = false }
50-
rattler_virtual_packages = { version = "2.0.9", default-features = false }
53+
rattler_conda_types = { version = "0.35.3", default-features = false }
54+
rattler_package_streaming = { version = "0.22.42", default-features = false }
55+
rattler_virtual_packages = { version = "2.0.16", default-features = false }
5156

5257
pixi_build_types = { version = "*" }
5358
pixi_consts = { version = "*" }
@@ -80,6 +85,3 @@ pixi_build_type_conversions = { git = "https://github.com/prefix-dev/pixi", bran
8085
#rattler_virtual_packages = { path = "../rattler/crates/rattler_virtual_packages" }
8186
#rattler_repodata_gateway = { path = "../rattler/crates/rattler_repodata_gateway" }
8287
#simple_spawn_blocking = { path = "../rattler/crates/simple_spawn_blocking" }
83-
84-
rattler-build = { git = "https://github.com/prefix-dev/rattler-build", branch = "main" }
85-
#rattler-build = { path = "../rattler-build" }

crates/pixi-build-backend/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ clap = { workspace = true, features = ["derive", "env"] }
1010
clap-verbosity-flag = { workspace = true }
1111
fs-err = { workspace = true }
1212
indexmap = { workspace = true }
13+
ordermap = { workspace = true }
1314
itertools = { workspace = true }
1415
log = { workspace = true }
1516
miette = { workspace = true }
@@ -32,6 +33,7 @@ url = { workspace = true }
3233
pyproject-toml = { workspace = true }
3334
dirs = { workspace = true }
3435
pathdiff = { workspace = true }
36+
thiserror = { workspace = true }
3537

3638
pixi_build_types = { workspace = true }
3739
pixi_consts = { workspace = true }

crates/pixi-build-backend/src/cli.rs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use miette::{Context, IntoDiagnostic};
66
use pixi_build_types::{
77
BackendCapabilities, ChannelConfiguration, FrontendCapabilities, PlatformAndVirtualPackages,
88
procedures::{
9-
conda_build::CondaBuildParams,
9+
conda_build_v0::CondaBuildParams,
1010
conda_metadata::{CondaMetadataParams, CondaMetadataResult},
1111
initialize::InitializeParams,
1212
negotiate_capabilities::NegotiateCapabilitiesParams,
@@ -93,17 +93,33 @@ pub async fn main<T: ProtocolInstantiator, F: FnOnce(LoggingOutputHandler) -> T>
9393
Some(Commands::Capabilities) => {
9494
let backend_capabilities = capabilities::<T>().await?;
9595
eprintln!(
96-
"Supports conda metadata: {}",
96+
"Supports {}: {}",
97+
pixi_build_types::procedures::conda_metadata::METHOD_NAME,
9798
backend_capabilities
9899
.provides_conda_metadata
99100
.unwrap_or_default()
100101
);
101102
eprintln!(
102-
"Supports conda build: {}",
103+
"Supports {}: {}",
104+
pixi_build_types::procedures::conda_outputs::METHOD_NAME,
105+
backend_capabilities
106+
.provides_conda_outputs
107+
.unwrap_or_default()
108+
);
109+
eprintln!(
110+
"Supports {}: {}",
111+
pixi_build_types::procedures::conda_build_v0::METHOD_NAME,
103112
backend_capabilities
104113
.provides_conda_build
105114
.unwrap_or_default()
106115
);
116+
eprintln!(
117+
"Supports {}: {}",
118+
pixi_build_types::procedures::conda_build_v1::METHOD_NAME,
119+
backend_capabilities
120+
.provides_conda_build_v1
121+
.unwrap_or_default()
122+
);
107123
eprintln!(
108124
"Highest project model: {}",
109125
backend_capabilities
@@ -156,6 +172,7 @@ async fn initialize<T: ProtocolInstantiator>(
156172
// Initialize the backend
157173
let (protocol, _initialize_result) = factory
158174
.initialize(InitializeParams {
175+
source_dir: None,
159176
manifest_path: manifest_path.to_path_buf(),
160177
project_model,
161178
cache_directory: None,
@@ -232,7 +249,7 @@ async fn build<T: ProtocolInstantiator>(factory: T, manifest_path: &Path) -> mie
232249
.context("failed to create a temporary directory in the current directory")?;
233250

234251
let result = protocol
235-
.conda_build(CondaBuildParams {
252+
.conda_build_v0(CondaBuildParams {
236253
host_platform: None,
237254
build_platform_virtual_packages: None,
238255
channel_base_urls: None,

0 commit comments

Comments
 (0)