Skip to content

fix: deterministic compiled mainfile#348

Merged
natefinch merged 5 commits into
magefile:masterfrom
ClaudiaJ:fix/determanistic-compile
Sep 27, 2021
Merged

fix: deterministic compiled mainfile#348
natefinch merged 5 commits into
magefile:masterfrom
ClaudiaJ:fix/determanistic-compile

Conversation

@ClaudiaJ
Copy link
Copy Markdown
Contributor

@ClaudiaJ ClaudiaJ commented May 18, 2021

sort template data so resulting mainfile is consistantly reproducible,
which is important to leverage build cache and results in a consistent
build id on output (given identical build parameters, e.g. sorted ldflags, etc.)

Result of mage -compile ./mage_static && go tool buildid ./mage_static
should now always be identical on repeated invocation.

Results in a probably imperceptible build time quickening, but solves a
minor peave of mine, and adds a test as protection from regression :)

also a couple minor formatting fixes from gopls courtesy of format on save.

sort template data so resulting mainfile is consistantly reproducible,
which is important to leverage build cache and results in a consistent
build id on output (given identical build parameters, e.g. ldflags,
output file name, etc.)

Result of `mage -compile ./mage_static && go tool buildid ./mage_static`
should now always be identical on repeated invocation.

Results in a probably imperceptible build time quickening, but solves a
minor peave of mine, and adds a test as protection from regression :)
Comment thread mage/main_test.go Outdated
Co-authored-by: Nate Finch <nate.finch@gmail.com>
@ClaudiaJ ClaudiaJ changed the title fix: determanistic compiled mainfile fix: deterministic compiled mainfile May 18, 2021
natefinch
natefinch previously approved these changes May 18, 2021
Copy link
Copy Markdown
Member

@natefinch natefinch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Copy link
Copy Markdown
Contributor

@paulburlumi paulburlumi left a comment

Choose a reason for hiding this comment

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

A few more spelling fixes.

Comment thread mage/main.go Outdated
Comment thread parse/parse.go Outdated
Comment thread parse/parse.go Outdated
got caught out not using vim's spellcheck

Co-authored-by: Paul Burlumi <paul@burlumi.com>
got caught out not using vim's spellcheck

Co-authored-by: Paul Burlumi <paul@burlumi.com>
@ClaudiaJ ClaudiaJ requested a review from natefinch September 9, 2021 13:28
Comment thread mage/main.go
mirogta
mirogta previously approved these changes Sep 24, 2021
Copy link
Copy Markdown
Member

@mirogta mirogta left a comment

Choose a reason for hiding this comment

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

@natefinch LGTM too after the changes :-)
(just looking at PR's and issues to help with after seeing your msg to make this group-owned)

@natefinch
Copy link
Copy Markdown
Member

Lemme check this tonight and I can probably merge it.

Co-authored-by: Paul Burlumi <paul@burlumi.com>
Copy link
Copy Markdown
Member

@natefinch natefinch left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@natefinch natefinch merged commit d9e2e41 into magefile:master Sep 27, 2021
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.

4 participants