Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into s3
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelzw committed Jan 28, 2025
2 parents 90fd779 + 803543b commit a41fdcb
Show file tree
Hide file tree
Showing 57 changed files with 1,771 additions and 288 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ jobs:
minio server --address 127.0.0.1:9000 ${{ runner.temp }}/minio-data &
sleep 5
curl -I http://localhost:9000/minio/health/live
cargo nextest run --workspace --features ${{ env.DEFAULT_FEATURES }} --target ${{ matrix.target }} ${{ steps.build-options.outputs.CARGO_BUILD_OPTIONS }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS }}
cargo nextest run --workspace --features ${{ env.DEFAULT_FEATURES }},experimental_extras --target ${{ matrix.target }} ${{ steps.build-options.outputs.CARGO_BUILD_OPTIONS}} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
- name: Run doctests
if: ${{ !matrix.skip-tests }}
Expand Down
14 changes: 7 additions & 7 deletions crates/rattler-bin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ clap = { workspace = true, features = ["derive"] }
console = { workspace = true, features = ["windows-console-colors"] }
indicatif = { workspace = true }
once_cell = { workspace = true }
rattler = { path="../rattler", version = "0.28.12", default-features = false, features = ["indicatif"] }
rattler_conda_types = { path="../rattler_conda_types", version = "0.29.10", default-features = false }
rattler_networking = { path="../rattler_networking", version = "0.21.10", default-features = false, features = ["gcs", "s3"] }
rattler_repodata_gateway = { path="../rattler_repodata_gateway", version = "0.21.32", default-features = false, features = ["gateway"] }
rattler_solve = { path="../rattler_solve", version = "1.3.4", default-features = false, features = ["resolvo", "libsolv_c"] }
rattler_virtual_packages = { path="../rattler_virtual_packages", version = "1.2.0", default-features = false }
rattler_cache = { path="../rattler_cache", version = "0.3.4", default-features = false }
rattler = { path="../rattler", version = "0.29.0", default-features = false, features = ["indicatif"] }
rattler_conda_types = { path="../rattler_conda_types", version = "0.30.0", default-features = false }
rattler_networking = { path="../rattler_networking", version = "0.22.0", default-features = false, features = ["gcs", "s3"] }
rattler_repodata_gateway = { path="../rattler_repodata_gateway", version = "0.21.33", default-features = false, features = ["gateway"] }
rattler_solve = { path="../rattler_solve", version = "1.3.5", default-features = false, features = ["resolvo", "libsolv_c"] }
rattler_virtual_packages = { path="../rattler_virtual_packages", version = "2.0.0", default-features = false }
rattler_cache = { path="../rattler_cache", version = "0.3.5", default-features = false }
reqwest = { workspace = true }
reqwest-middleware = { workspace = true }
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
Expand Down
43 changes: 30 additions & 13 deletions crates/rattler-bin/src/commands/create.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::{
borrow::Cow,
collections::HashMap,
env,
future::IntoFuture,
path::PathBuf,
Expand All @@ -18,8 +19,8 @@ use rattler::{
package_cache::PackageCache,
};
use rattler_conda_types::{
Channel, ChannelConfig, GenericVirtualPackage, MatchSpec, ParseStrictness, Platform,
PrefixRecord, RepoDataRecord, Version,
Channel, ChannelConfig, GenericVirtualPackage, MatchSpec, PackageName, ParseStrictness,
Platform, PrefixRecord, RepoDataRecord, Version,
};
use rattler_networking::{
s3_middleware::S3Config, AuthenticationMiddleware, AuthenticationStorage,
Expand Down Expand Up @@ -264,12 +265,14 @@ pub async fn create(opt: Opt) -> anyhow::Result<()> {
// Next, use a solver to solve this specific problem. This provides us with all
// the operations we need to apply to our environment to bring it up to
// date.
let required_packages =
let solver_result =
wrap_in_progress("solving", move || match opt.solver.unwrap_or_default() {
Solver::Resolvo => resolvo::Solver.solve(solver_task),
Solver::LibSolv => libsolv_c::Solver.solve(solver_task),
})?;

let required_packages: Vec<RepoDataRecord> = solver_result.records;

if opt.dry_run {
// Construct a transaction to
let transaction = Transaction::from_current_and_desired(
Expand All @@ -281,7 +284,7 @@ pub async fn create(opt: Opt) -> anyhow::Result<()> {
if transaction.operations.is_empty() {
println!("No operations necessary");
} else {
print_transaction(&transaction);
print_transaction(&transaction, solver_result.features);
}

return Ok(());
Expand Down Expand Up @@ -312,28 +315,42 @@ pub async fn create(opt: Opt) -> anyhow::Result<()> {
console::style(console::Emoji("✔", "")).green(),
install_start.elapsed()
);
print_transaction(&result.transaction);
print_transaction(&result.transaction, solver_result.features);
}

Ok(())
}

/// Prints the operations of the transaction to the console.
fn print_transaction(transaction: &Transaction<PrefixRecord, RepoDataRecord>) {
fn print_transaction(
transaction: &Transaction<PrefixRecord, RepoDataRecord>,
features: HashMap<PackageName, Vec<String>>,
) {
let format_record = |r: &RepoDataRecord| {
let direct_url_print = if let Some(channel) = &r.channel {
channel.clone()
} else {
String::new()
};

format!(
"{} {} {} {}",
r.package_record.name.as_normalized(),
r.package_record.version,
r.package_record.build,
direct_url_print,
)
if let Some(features) = features.get(&r.package_record.name) {
format!(
"{}[{}] {} {} {}",
r.package_record.name.as_normalized(),
features.join(", "),
r.package_record.version,
r.package_record.build,
direct_url_print,
)
} else {
format!(
"{} {} {} {}",
r.package_record.name.as_normalized(),
r.package_record.version,
r.package_record.build,
direct_url_print,
)
}
};

for operation in &transaction.operations {
Expand Down
6 changes: 6 additions & 0 deletions crates/rattler/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.29.0](https://github.com/conda/rattler/compare/rattler-v0.28.12...rattler-v0.29.0) - 2025-01-23

### Other

- Improve AuthenticationStorage (#1026)

## [0.28.12](https://github.com/conda/rattler/compare/rattler-v0.28.11...rattler-v0.28.12) - 2025-01-09

### Other
Expand Down
12 changes: 6 additions & 6 deletions crates/rattler/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rattler"
version = "0.28.12"
version = "0.29.0"
edition.workspace = true
authors = ["Bas Zalmstra <zalmstra.bas@gmail.com>"]
description = "Rust library to install conda environments"
Expand Down Expand Up @@ -32,12 +32,12 @@ memchr = { workspace = true }
memmap2 = { workspace = true }
once_cell = { workspace = true }
parking_lot = { workspace = true }
rattler_cache = { path = "../rattler_cache", version = "0.3.4", default-features = false }
rattler_conda_types = { path = "../rattler_conda_types", version = "0.29.10", default-features = false }
rattler_cache = { path = "../rattler_cache", version = "0.3.5", default-features = false }
rattler_conda_types = { path = "../rattler_conda_types", version = "0.30.0", default-features = false }
rattler_digest = { path = "../rattler_digest", version = "1.0.5", default-features = false }
rattler_networking = { path = "../rattler_networking", version = "0.21.10", default-features = false }
rattler_shell = { path = "../rattler_shell", version = "0.22.15", default-features = false }
rattler_package_streaming = { path = "../rattler_package_streaming", version = "0.22.23", default-features = false, features = ["reqwest"] }
rattler_networking = { path = "../rattler_networking", version = "0.22.0", default-features = false }
rattler_shell = { path = "../rattler_shell", version = "0.22.16", default-features = false }
rattler_package_streaming = { path = "../rattler_package_streaming", version = "0.22.24", default-features = false, features = ["reqwest"] }
rayon = { workspace = true }
reflink-copy = { workspace = true }
regex = { workspace = true }
Expand Down
6 changes: 6 additions & 0 deletions crates/rattler_cache/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.3.5](https://github.com/conda/rattler/compare/rattler_cache-v0.3.4...rattler_cache-v0.3.5) - 2025-01-23

### Other

- updated the following local packages: rattler_conda_types, rattler_networking

## [0.3.4](https://github.com/conda/rattler/compare/rattler_cache-v0.3.3...rattler_cache-v0.3.4) - 2025-01-09

### Other
Expand Down
8 changes: 4 additions & 4 deletions crates/rattler_cache/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rattler_cache"
version = "0.3.4"
version = "0.3.5"
description = "A crate to manage the caching of data in rattler"
categories.workspace = true
homepage.workspace = true
Expand All @@ -18,10 +18,10 @@ fs-err.workspace = true
fxhash.workspace = true
itertools.workspace = true
parking_lot.workspace = true
rattler_conda_types = { version = "0.29.10", path = "../rattler_conda_types", default-features = false }
rattler_conda_types = { version = "0.30.0", path = "../rattler_conda_types", default-features = false }
rattler_digest = { version = "1.0.5", path = "../rattler_digest", default-features = false }
rattler_networking = { version = "0.21.10", path = "../rattler_networking", default-features = false }
rattler_package_streaming = { version = "0.22.23", path = "../rattler_package_streaming", default-features = false, features = ["reqwest"] }
rattler_networking = { version = "0.22.0", path = "../rattler_networking", default-features = false }
rattler_package_streaming = { version = "0.22.24", path = "../rattler_package_streaming", default-features = false, features = ["reqwest"] }
reqwest.workspace = true
tokio = { workspace = true, features = ["macros"] }
tracing.workspace = true
Expand Down
6 changes: 6 additions & 0 deletions crates/rattler_conda_types/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.30.0](https://github.com/conda/rattler/compare/rattler_conda_types-v0.29.10...rattler_conda_types-v0.30.0) - 2025-01-23

### Added

- add linux-ppc (PPC32 BE) platform to rattler (#1024)

## [0.29.10](https://github.com/conda/rattler/compare/rattler_conda_types-v0.29.9...rattler_conda_types-v0.29.10) - 2025-01-09

### Added
Expand Down
3 changes: 2 additions & 1 deletion crates/rattler_conda_types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rattler_conda_types"
version = "0.29.10"
version = "0.30.0"
edition.workspace = true
authors = ["Bas Zalmstra <zalmstra.bas@gmail.com>"]
description = "Rust data types for common types used within the Conda ecosystem"
Expand All @@ -12,6 +12,7 @@ readme.workspace = true

[features]
default = ["rayon"]
experimental_extras = []

[dependencies]
chrono = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/rattler_conda_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub mod prefix_record;
#[cfg(test)]
use std::path::{Path, PathBuf};

pub use build_spec::{BuildNumber, BuildNumberSpec, ParseBuildNumberSpecError};
pub use build_spec::{BuildNumber, BuildNumberSpec, OrdOperator, ParseBuildNumberSpecError};
pub use channel::{Channel, ChannelConfig, ChannelUrl, NamedChannelOrUrl, ParseChannelError};
pub use channel_data::{ChannelData, ChannelDataPackage};
pub use environment_yaml::{EnvironmentYaml, MatchSpecOrSubSection};
Expand All @@ -53,7 +53,7 @@ pub use repo_data::{
ChannelInfo, ConvertSubdirError, PackageRecord, RecordFromPath, RepoData,
ValidatePackageRecordsError,
};
pub use repo_data_record::RepoDataRecord;
pub use repo_data_record::{RepoDataRecord, SolverResult};
pub use run_export::RunExportKind;
pub use version::{
Component, ParseVersionError, ParseVersionErrorKind, StrictVersion, Version, VersionBumpError,
Expand Down
12 changes: 12 additions & 0 deletions crates/rattler_conda_types/src/match_spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use crate::{
build_spec::BuildNumberSpec, GenericVirtualPackage, PackageName, PackageRecord, RepoDataRecord,
VersionSpec,
};
use itertools::Itertools;
use rattler_digest::{serde::SerializableHash, Md5Hash, Sha256Hash};
use serde::{Deserialize, Deserializer, Serialize};
use serde_with::{serde_as, skip_serializing_none};
Expand Down Expand Up @@ -135,6 +136,8 @@ pub struct MatchSpec {
pub build_number: Option<BuildNumberSpec>,
/// Match the specific filename of the package
pub file_name: Option<String>,
/// The selected optional features of the package
pub extras: Option<Vec<String>>,
/// The channel of the package
pub channel: Option<Arc<Channel>>,
/// The subdir of the channel
Expand Down Expand Up @@ -183,6 +186,10 @@ impl Display for MatchSpec {

let mut keys = Vec::new();

if let Some(extras) = &self.extras {
keys.push(format!("extras=[{}]", extras.iter().format(", ")));
}

if let Some(md5) = &self.md5 {
keys.push(format!("md5=\"{md5:x}\""));
}
Expand Down Expand Up @@ -221,6 +228,7 @@ impl MatchSpec {
build: self.build,
build_number: self.build_number,
file_name: self.file_name,
extras: self.extras,
channel: self.channel,
subdir: self.subdir,
namespace: self.namespace,
Expand Down Expand Up @@ -265,6 +273,8 @@ pub struct NamelessMatchSpec {
pub build_number: Option<BuildNumberSpec>,
/// Match the specific filename of the package
pub file_name: Option<String>,
/// Optional extra dependencies to select for the package
pub extras: Option<Vec<String>>,
/// The channel of the package
#[serde(deserialize_with = "deserialize_channel", default)]
pub channel: Option<Arc<Channel>>,
Expand Down Expand Up @@ -318,6 +328,7 @@ impl From<MatchSpec> for NamelessMatchSpec {
build: spec.build,
build_number: spec.build_number,
file_name: spec.file_name,
extras: spec.extras,
channel: spec.channel,
subdir: spec.subdir,
namespace: spec.namespace,
Expand All @@ -337,6 +348,7 @@ impl MatchSpec {
build: spec.build,
build_number: spec.build_number,
file_name: spec.file_name,
extras: spec.extras,
channel: spec.channel,
subdir: spec.subdir,
namespace: spec.namespace,
Expand Down
Loading

0 comments on commit a41fdcb

Please sign in to comment.