Skip to content

Conversation

magentaqin
Copy link
Collaborator

@magentaqin magentaqin commented Jul 23, 2025

This PR is to fix: #4116

What I changed

As self.features() would put "default" envs in the last item, but the "default" env priority should be the lowest.Here, we use rfold (reverse fold) to ensure later features override earlier features for environment variables. Processing features in reverse order means that features appearing later in the list will have higher precedence.
Example: If features: [override_feature, user_feature, default]
rfold processes as: [default, user_feature, override_feature]
Result: override_feature env vars take precedence over all others.
Code Details: https://github.com/prefix-dev/pixi/pull/4182/files#diff-a2d90b46ebb3debf0ba9dc9798401cf42ecd31371adddfd3849bf8758f0dfe20

Notice

This PR should be merged after #3940 is merged, as I worked based on the previous feature branch(My original thought was to avoid unnecessary conflicts resolving.)

@magentaqin magentaqin changed the title Bugfix: Feature environment variable should override environment variables in default activation.env fix: Feature environment variable should override environment variables in default activation.env Jul 23, 2025
@lucascolley lucascolley added bug Something isn't working env-vars Related to environment variables labels Jul 29, 2025
@magentaqin magentaqin closed this Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working env-vars Related to environment variables
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature environment variables not overriding environment variables in activation.env
2 participants