Skip to content

Commit

Permalink
release 0.35.2 (#1347)
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfv authored Jan 17, 2025
1 parent 0e1e737 commit 715f6b4
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["rust-tests"]

[package]
name = "rattler-build"
version = "0.35.1"
version = "0.35.2"
authors = ["rattler-build contributors <[email protected]>"]
repository = "https://github.com/prefix-dev/rattler-build"
edition = "2021"
Expand Down
9 changes: 8 additions & 1 deletion docs/variants.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ either:

To disable automatic discovery, use the `--ignore-recipe-variants` flag.
If you pass variant configuration files explicitly using `--variant-config / -m
<file>`, automatic discovery is disabled as well.
<file>`, the passed variants are loaded with higher priority.

### Custom Configuration Files

Expand All @@ -78,6 +78,13 @@ files, use the `--variant-config` or `-m` option:
rattler-build build --variant-config ~/user_variants.yaml --variant-config /opt/rattler-build/global_variants.yaml --recipe myrecipe.yaml
```

### Merging of multiple variant configuration files

When multiple variant configuration files are merged, the following rules apply:

- A key from a higher priority file will completely override a key from a lower priority file.
- Zip key lengths must still match.

### `conda-build` Compatibility

Since version 0.35.0, rattler-build supports conda_build_config.yaml files,
Expand Down
4 changes: 2 additions & 2 deletions py-rattler-build/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion py-rattler-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "py-rattler-build"
version = "0.35.1"
version = "0.35.2"
edition = "2021"
license = "BSD-3-Clause"
publish = false
Expand Down
9 changes: 3 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,9 @@ pub async fn get_build_output(
}

// If `-m foo.yaml` is passed as variant config, we should use that instead of
// the auto-detected one.
let variant_configs = if !build_data.variant_config.is_empty() {
build_data.variant_config.clone()
} else {
detected_variant_config.unwrap_or_default()
};
// the auto-detected one. For that reason we add them to the end of the list.
let mut variant_configs = detected_variant_config.unwrap_or_default();
variant_configs.extend(build_data.variant_config.clone());

let variant_config =
VariantConfig::from_files(&variant_configs, &selector_config).into_diagnostic()?;
Expand Down
10 changes: 5 additions & 5 deletions src/variant_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ impl VariantConfig {
/// [python=3.8, compiler=clang]
/// ```
pub fn from_files(
files: &Vec<PathBuf>,
files: &[PathBuf],
selector_config: &SelectorConfig,
) -> Result<Self, VariantConfigError> {
let mut variant_configs = Vec::new();
Expand Down Expand Up @@ -705,7 +705,7 @@ mod tests {
..Default::default()
};

let variant = VariantConfig::from_files(&vec![yaml_file], &selector_config).unwrap();
let variant = VariantConfig::from_files(&[yaml_file], &selector_config).unwrap();

insta::assert_yaml_snapshot!(variant);
}
Expand All @@ -725,7 +725,7 @@ mod tests {
let recipe_text =
std::fs::read_to_string(test_data_dir.join("recipes/variants/recipe.yaml")).unwrap();
let outputs = crate::recipe::parser::find_outputs_from_src(&recipe_text).unwrap();
let variant_config = VariantConfig::from_files(&vec![yaml_file], &selector_config).unwrap();
let variant_config = VariantConfig::from_files(&[yaml_file], &selector_config).unwrap();
let outputs_and_variants = variant_config
.find_variants(&outputs, &recipe_text, &selector_config)
.unwrap();
Expand Down Expand Up @@ -806,7 +806,7 @@ mod tests {
std::fs::read_to_string(test_data_dir.join("recipes/output_order/order_1.yaml"))
.unwrap();
let outputs = crate::recipe::parser::find_outputs_from_src(&recipe_text).unwrap();
let variant_config = VariantConfig::from_files(&vec![], &selector_config).unwrap();
let variant_config = VariantConfig::from_files(&[], &selector_config).unwrap();
let outputs_and_variants = variant_config
.find_variants(&outputs, &recipe_text, &selector_config)
.unwrap();
Expand Down Expand Up @@ -837,7 +837,7 @@ mod tests {
std::fs::read_to_string(test_data_dir.join("recipes/variants/boltons_recipe.yaml"))
.unwrap();
let outputs = crate::recipe::parser::find_outputs_from_src(&recipe_text).unwrap();
let variant_config = VariantConfig::from_files(&vec![yaml_file], &selector_config).unwrap();
let variant_config = VariantConfig::from_files(&[yaml_file], &selector_config).unwrap();
let outputs_and_variants = variant_config
.find_variants(&outputs, &recipe_text, &selector_config)
.unwrap();
Expand Down

0 comments on commit 715f6b4

Please sign in to comment.