Skip to content

Keep environment variables in order when merging - #2339

Open
deadcaf3 wants to merge 1 commit into
apple:mainfrom
deadcaf3:fix/deterministic-env-order
Open

deadcaf3 wants to merge 1 commit into
apple:mainfrom
deadcaf3:fix/deterministic-env-order

Conversation

@deadcaf3

@deadcaf3 deadcaf3 commented Oct 3, 2026

Copy link
Copy Markdown

Type of Change

  • Bug fix

Motivation and Context

Fixes #2338.

Parser.allEnv removed duplicate variables through a dictionary and returned its values, so container run and exec passed them in a different order on every run. Names now keep their first-seen order and the last value wins, as in Docker.

Testing

  • Tested locally
  • Added/updated tests

The new test fails before the fix and passes after. Three runs of container run --rm -e ALPHA=1 -e BRAVO=2 -e CHARLIE=3 -e DELTA=4 alpine env gave three orders on 1.5.0 and one stable order on this branch.

This branch has not been deployed

No deployments
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.

[Bug]: container run passes environment variables in a different order on every run

2 participants