Skip to content

Ensure build env is sorted on input to config hash#3279

Merged
peterebden merged 2 commits intothought-machine:masterfrom
peterebden:order-build-env
Oct 18, 2024
Merged

Ensure build env is sorted on input to config hash#3279
peterebden merged 2 commits intothought-machine:masterfrom
peterebden:order-build-env

Conversation

@peterebden
Copy link
Copy Markdown
Collaborator

Looks like we can get nondeterminism if there are multiple build env vars specified.

Fixes #3278

@peterebden peterebden requested a review from Tatskaari October 18, 2024 12:29
Comment thread src/core/config.go
Comment on lines +763 to +764
h.Write([]byte(k))
h.Write([]byte(env[k]))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe have a delimiter between them? There's a degenerate case in which two environments could still produce the same hash this way (e.g. TEST=TEST, TES=TTEST). = is probably the safest bet.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, makes sense!

Copy link
Copy Markdown
Contributor

@Tatskaari Tatskaari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got there before me

@peterebden peterebden merged commit 653b203 into thought-machine:master Oct 18, 2024
@peterebden peterebden deleted the order-build-env branch October 18, 2024 13:56
@peterebden peterebden mentioned this pull request Oct 24, 2024
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.

Please often rebuilding when no change was made

3 participants