fix: allow variable expansion#1552
Merged
Hofer-Julian merged 2 commits intoconda:mainfrom Jul 24, 2025
Merged
Conversation
Contributor
|
Ahh, I wonder whether this explains something I was seeing with nushell and zsh also?? scipy/scipy#23361 (comment) |
Contributor
Author
|
You can try my fork to test this https://github.com/fecet/pixi/releases/download/v0.50.0/pixi-x86_64-unknown-linux-musl |
2 tasks
Hofer-Julian
approved these changes
Jul 24, 2025
Collaborator
Hofer-Julian
left a comment
There was a problem hiding this comment.
Thanks for the fix, I tried to think of a more general approach, but it's just a bit of a messy situation and your solution is a good one :)
Pushed a commit to make the shlex error case a bit nicer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix: Allow Variable Expansion in Bash Activation Scripts
Summary
This PR fixes an issue where environment variable values containing references like
${CONDA_PREFIX}were not being expanded correctly in bash activation scripts per prefix-dev/pixi#4122Problem
In #1392, environment variable values with
$symbols were quoted using single quotes. While this quoting ensures correctness for many shell values, it prevents variable expansion in bash:This breaks expected behavior for users relying on dynamic paths such as
${CONDA_PREFIX}/bin.Fix
Values containing variable references are now quoted using double quotes instead of single quotes in bash activation scripts. This preserves correct expansion while still protecting the value from word splitting or globbing.
Impact
pixi)Let me know if you'd like to include a test case or changelog entry as well.