Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allowing solving for different platforms #1101

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ pub async fn get_task_env<'p>(
lock_file_derived_data: &mut LockFileDerivedData<'p>,
environment: &Environment<'p>,
) -> miette::Result<HashMap<String, String>> {
// Make sure the system requirements are met
verify_current_platform_has_required_virtual_packages(environment).into_diagnostic()?;

// Ensure there is a valid prefix
lock_file_derived_data.prefix(environment).await?;

Expand Down
3 changes: 3 additions & 0 deletions src/cli/shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use crate::unix::PtySession;

use crate::cli::LockFileUsageArgs;
use crate::project::manifest::EnvironmentName;
use crate::project::virtual_packages::verify_current_platform_has_required_virtual_packages;
#[cfg(target_family = "windows")]
use rattler_shell::shell::CmdExe;

Expand Down Expand Up @@ -208,6 +209,8 @@ pub async fn execute(args: Args) -> miette::Result<()> {
.environment(&environment_name)
.ok_or_else(|| miette::miette!("unknown environment '{environment_name}'"))?;

verify_current_platform_has_required_virtual_packages(&environment).into_diagnostic()?;

let prompt_name = match environment_name {
EnvironmentName::Default => project.name().to_string(),
EnvironmentName::Named(name) => format!("{}:{}", project.name(), name),
Expand Down
5 changes: 0 additions & 5 deletions src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::{
project::{
grouped_environment::GroupedEnvironment,
manifest::{EnvironmentName, SystemRequirements},
virtual_packages::verify_current_platform_has_required_virtual_packages,
Environment,
},
Project,
Expand Down Expand Up @@ -117,10 +116,6 @@ pub fn sanity_check_project(project: &Project) -> miette::Result<()> {
// Sanity check of prefix location
verify_prefix_location_unchanged(project.default_environment().dir().as_path())?;

// Make sure the system requirements are met
verify_current_platform_has_required_virtual_packages(&project.default_environment())
.into_diagnostic()?;

// TODO: remove on a 1.0 release
// Check for old `env` folder as we moved to `envs` in 0.13.0
let old_pixi_env_dir = project.pixi_dir().join("env");
Expand Down
Loading