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

Makefile: Make it easier to re-generate everything #555

Merged
merged 5 commits into from
Jun 9, 2019

Conversation

LukeShu
Copy link
Contributor

@LukeShu LukeShu commented Jun 4, 2019

When I start looking at contributing to a project, one of the first things I try to answer is "how do I re-build/generate everything that is generated; am I actually able to re-build this?" This PR aims to lower that bar.

  • Modify make check_generated to check all generated files, not just README.md
  • Merge make gen, make readme, make update_deps, and make assets into a single make generate
  • Add make clean to remove non-commited (.gitignored) files that the Makefile generates
  • Add make maintainer-clean to remove committed files that the Makefile generates

This mostly aims to document how everything was generated, and the steps necessary to re-generate the same files verbatim; the goal is mostly to figure out how to reproduce the files as they currently are.

To re-generate just an individual file, like README.md, you can just make FILENAME; make README.md will work as expected.

The Makefile now does more work; it downloads the "Dracula" iTerm2 theme for generating demo.svg, it installs the correct version of mockgen for generating log_mock.go, et cetera. All of these "extra" things it puts in a .gitignored directory called tools/. I tried to keep the Makefile readable and understandable, though.

I rolled back the version of github.com/golang/mock from v1.1.1 to v1.0.0, since that's the version used to generate log_mock.go, and mixing versions of mockgen outputs vs mock libraries seemed unwise.

I adjusted the test suite to work with GO111MODULE=on, which the Makefile sets.

@CLAassistant
Copy link

CLAassistant commented Jun 4, 2019

CLA assistant check
All committers have signed the CLA.

@LukeShu LukeShu force-pushed the lukeshu/reproduce branch 3 times, most recently from a26baff to 1fd4816 Compare June 5, 2019 04:17
@LukeShu LukeShu force-pushed the lukeshu/reproduce branch from 1fd4816 to c9455da Compare June 5, 2019 05:00
This mostly aims to document how everything was generated, and the steps
necessary to re-generate the same files verbatim; the goal is to figure
out how to reproduce the files as they currently are.  The exception is
that we strip out the timestamp out of install.sh.
@LukeShu LukeShu force-pushed the lukeshu/reproduce branch from c9455da to 2508856 Compare June 5, 2019 05:04
@LukeShu
Copy link
Contributor Author

LukeShu commented Jun 5, 2019

The "GolangCI" check failure is "expected" and has nothing to do with the changes in this PR.

Commit 692dacb added dupImport, but since that commit isn't yet in a stable release, GolangCI isn't using it yet, so it complains. I guess that CI failure is expected until the next release happens.

@jirfag jirfag merged commit 88318cb into golangci:master Jun 9, 2019
@jirfag
Copy link
Contributor

jirfag commented Jun 9, 2019

the fantastic work, thank you very much!

jirfag added a commit that referenced this pull request Jun 9, 2019
@LukeShu LukeShu deleted the lukeshu/reproduce branch June 23, 2019 14:19
@ldez ldez added this to the v1.17 milestone Mar 6, 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.

4 participants