Skip to content

Commit

Permalink
Merge pull request #15 from nichmor/feat/add-rattler-build-backend
Browse files Browse the repository at this point in the history
feat: add new pixi-build-backend
  • Loading branch information
tdejager authored Nov 22, 2024
2 parents f25655d + a57e542 commit edb0468
Show file tree
Hide file tree
Showing 12 changed files with 897 additions and 232 deletions.
353 changes: 171 additions & 182 deletions Cargo.lock

Large diffs are not rendered by default.

50 changes: 10 additions & 40 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ clap-verbosity-flag = "2.2.1"
tracing-subscriber = "0.3.18"
serde_yaml = "0.9.33"
serde = "1.0"
indexmap = "2.6.0"
minijinja = "2.3.0"

parking_lot = "0.12.3"
Expand All @@ -28,40 +29,16 @@ jsonrpc-stdio-server = "18.0.0"
jsonrpc-http-server = "18.0.0"
jsonrpc-core = "18.0.0"

url = "2.5.3"

rattler-build = { git = "https://github.com/nichmor/rattler-build", branch = "feat/pixi-build", default-features = false }
# rattler_conda_types = "0.28.2"
rattler_package_streaming = "0.22.10"
# rattler_virtual_packages = "1.1.7"

file_url = "0.1.4"
rattler = { version = "0.28.1", default-features = false }
rattler_cache = { version = "0.2.9", default-features = false }
rattler_conda_types = { version = "0.29.1", default-features = false }
rattler_digest = { version = "1.0.3", default-features = false }
rattler_lock = { version = "0.22.30", default-features = false }
rattler_networking = { version = "0.21.5", default-features = false, features = [
"google-cloud-auth",
] }
rattler_repodata_gateway = { version = "0.21.21", default-features = false }
rattler_shell = { version = "0.22.6", default-features = false }
rattler_solve = { version = "1.2.2", default-features = false }
rattler_virtual_packages = { version = "1.1.9", default-features = false }
rattler_package_streaming = { version = "0.22.14", default-features = false }
rattler_virtual_packages = { version = "1.1.10", default-features = false }
rattler_lock = { version = "0.22.31", default-features = false }

# rattler = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
# rattler_conda_types = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
# rattler_digest = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
# rattler_lock = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
# rattler_networking = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
# rattler_package_streaming = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
# rattler_repodata_gateway = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
# rattler_shell = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
# rattler_solve = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
# rattler_virtual_packages = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }

#pixi_build_types = { path = "../pixi-build-branch/crates/pixi_build_types" }
#pixi_consts = { path = "../pixi-build-branch/crates/pixi_consts" }
#pixi_manifest = { path = "../pixi-build-branch/crates/pixi_manifest" }
#pixi_spec = { path = "../pixi-build-branch/crates/pixi_spec" }

pixi_build_types = { git = "https://github.com/prefix-dev/pixi", branch = "feature/pixi-build" }
pixi_consts = { git = "https://github.com/prefix-dev/pixi", branch = "feature/pixi-build" }
Expand All @@ -70,14 +47,7 @@ pixi_spec = { git = "https://github.com/prefix-dev/pixi", branch = "feature/pixi


[patch.crates-io]
file_url = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
rattler = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
rattler_conda_types = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
rattler_digest = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
rattler_lock = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
rattler_networking = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
rattler_package_streaming = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
rattler_repodata_gateway = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
rattler_shell = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
rattler_solve = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
rattler_virtual_packages = { git = "https://github.com/conda/rattler", branch = "feat/pixi-build" }
rattler_conda_types = { git = "https://github.com/conda/rattler", branch = "main"}
rattler_package_streaming = { git = "https://github.com/conda/rattler", branch = "main"}
rattler_virtual_packages = { git = "https://github.com/conda/rattler", branch = "main"}
rattler_lock = { git = "https://github.com/conda/rattler", branch = "main"}
2 changes: 2 additions & 0 deletions crates/pixi-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ serde_yaml = { workspace = true }
serde = { workspace = true, features = ["derive"] }
minijinja = { workspace = true }
itertools = { workspace = true }
url = { workspace = true }
indexmap = { workspace = true }

parking_lot = { workspace = true }

Expand Down
4 changes: 2 additions & 2 deletions crates/pixi-build/src/bin/pixi-build-cmake/cmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl CMakeBuildBackend {
.expect("the project manifest must reside in a directory");

// Parse the package name from the manifest
let Some(name) = self.manifest.parsed.project.name.clone() else {
let Some(name) = self.manifest.workspace.workspace.name.clone() else {
miette::bail!("a 'name' field is required in the project manifest");
};
let name = PackageName::from_str(&name).into_diagnostic()?;
Expand Down Expand Up @@ -294,7 +294,7 @@ impl CMakeBuildBackend {
work_directory: &Path,
) -> miette::Result<BuildConfiguration> {
// Parse the package name from the manifest
let Some(name) = self.manifest.parsed.project.name.clone() else {
let Some(name) = self.manifest.workspace.workspace.name.clone() else {
miette::bail!("a 'name' field is required in the project manifest");
};
let name = PackageName::from_str(&name).into_diagnostic()?;
Expand Down
4 changes: 2 additions & 2 deletions crates/pixi-build/src/bin/pixi-build-python/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl PythonBuildBackend {
.expect("the project manifest must reside in a directory");

// Parse the package name from the manifest
let Some(name) = self.manifest.parsed.project.name.clone() else {
let Some(name) = self.manifest.workspace.workspace.name.clone() else {
miette::bail!("a 'name' field is required in the project manifest");
};
let name = PackageName::from_str(&name).into_diagnostic()?;
Expand Down Expand Up @@ -267,7 +267,7 @@ impl PythonBuildBackend {
work_directory: &Path,
) -> miette::Result<BuildConfiguration> {
// Parse the package name from the manifest
let Some(name) = self.manifest.parsed.project.name.clone() else {
let Some(name) = self.manifest.workspace.workspace.name.clone() else {
miette::bail!("a 'name' field is required in the project manifest");
};
let name = PackageName::from_str(&name).into_diagnostic()?;
Expand Down
11 changes: 11 additions & 0 deletions crates/pixi-build/src/bin/pixi-build-rattler-build/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
mod rattler_build;

use rattler_build::RattlerBuildBackend;

#[tokio::main]
pub async fn main() {
if let Err(err) = pixi_build_backend::cli::main(RattlerBuildBackend::factory).await {
eprintln!("{err:?}");
std::process::exit(1);
}
}
Loading

0 comments on commit edb0468

Please sign in to comment.