Skip to content

fix(global): clear conda stack env for prefix-ignore trampolines - #6188

Closed
sjh9714 wants to merge 1 commit into
prefix-dev:mainfrom
sjh9714:fix-global-ignore-conda-stack-env
Closed

sjh9714 wants to merge 1 commit into
prefix-dev:mainfrom
sjh9714:fix-global-ignore-conda-stack-env

Conversation

@sjh9714

@sjh9714 sjh9714 commented May 24, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #6002

When a package provides the global-ignore-conda-prefix marker, the trampoline configuration currently removes CONDA_PREFIX but can still keep Conda stack variables such as CONDA_SHLVL. That leaves a long-lived globally installed shell with an incomplete Conda activation state.

This change clears the related Conda stack variables together with CONDA_PREFIX for that marker, while preserving unrelated activation variables in the trampoline environment.

How Has This Been Tested?

  • PATH="$HOME/.cargo/bin:$PATH" cargo test -p pixi_global test_global_ignore_conda_prefix_removes_incomplete_conda_stack
  • PATH="$HOME/.cargo/bin:$PATH" cargo test -p pixi_global
  • PATH="$HOME/.cargo/bin:$PATH" cargo fmt --check
  • CARGO_TARGET_DIR=target/pixi PATH="$HOME/.cargo/bin:$PATH" cargo build -p pixi
  • uv run --python 3.12 --with pytest --with inline-snapshot --with pytest-timeout --with pytest-xdist --with pytest-rerunfailures --with dirty-equals --with filelock --with py-rattler --with pyyaml python -m pytest --pixi-build=debug tests/integration_python/pixi_global/test_trampoline.py -k test_trampoline_considers_global_config_json -q
  • git diff --check

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Codex

Prompt summary: inspect the reported trampoline environment bug, add focused regression coverage, keep the fix narrow, and verify locally.

Checklist:

  • I have performed a self-review of my own code
  • I have added sufficient tests to cover my changes.

@Hofer-Julian

Copy link
Copy Markdown
Member

Thank you!

I took your commit and re-applied it in a new PR since that's the only way to update trampolines for security reasons: #6210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

global-ignore-conda-prefix leaves CONDA_SHLVL in trampoline env, causing invalid Conda activation state

2 participants