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

add MAGEFILE_HASHFAST to avoid rerunning go build #258

Merged
merged 1 commit into from
Jul 18, 2019
Merged

Conversation

natefinch
Copy link
Member

This is a feature that is mostly aimed at developers running on Windows. For some reason, the go build code that determines whether it needs to rebuild is slow on windows. For people running mage, that means that even if no code has changed, it can take a full second or longer for mage to figure out it can just reuse the binary it already built.

To solve that problem, this PR adds an environment variable you can set to tell mage to just use the hash of the magefiles themselves, and not run go build. This is the way mage used to work before moving to rely on go build's cache.

The one drawback of this method is that if a dependency of the magefile has changed (like your magefile imports a library that gets updated), mage won't detect the change and will just rerun the binary it has cached. You can force the rebuild by using the already-existing -f flag.

@natefinch natefinch merged commit e1fda1a into master Jul 18, 2019
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.

1 participant