Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deterministic compiled mainfile #348

Merged
merged 5 commits into from
Sep 27, 2021

Conversation

ClaudiaJ
Copy link
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 :)
mage/main_test.go Outdated Show resolved Hide resolved
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
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
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.

mage/main.go Outdated Show resolved Hide resolved
parse/parse.go Outdated Show resolved Hide resolved
parse/parse.go Outdated Show resolved Hide resolved
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
mage/main.go Show resolved Hide resolved
mirogta
mirogta previously approved these changes Sep 24, 2021
Copy link
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
Member

Lemme check this tonight and I can probably merge it.

Co-authored-by: Paul Burlumi <paul@burlumi.com>
Copy link
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