Skip to content

Commit 4bafd27

Browse files
Merge pull request #718 from carolynvs/packr-tips
Add tips for packr to contributing
2 parents 5d8cd2d + ba44719 commit 4bafd27

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

CONTRIBUTING.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -272,10 +272,12 @@ mixins installed.
272272

273273
Here are the most common Makefile tasks
274274

275+
* `build` builds all binaries, porter and internal mixins.
275276
* `build-porter-client` just builds the porter client for your operating
276277
system. It does not build the porter-runtime binary. Useful when you just want
277278
to do a build and don't remember the proper way to call `go build` yourself.
278-
* `build-porter` builds both the porter client and runtime.
279+
* `build-porter` builds both the porter client and runtime. It does not clean
280+
up generated files created by packr, so you usually want to also run `clean-packr`.
279281
* `install-porter` installs just porter from your bin into **/usr/local/bin**.
280282
* `install-mixins` installs just the mixins from your bin into
281283
**/usr/local/bin**. This is useful when you are working on the exec or
@@ -292,7 +294,13 @@ Here are the most common Makefile tasks
292294
* `test` runs all the tests.
293295
* `clean-packr` removes extra packr files that were a side-effect of the build.
294296
Normally this is run automatically but if you run into issues with packr and
295-
dep, run this commmand.
297+
dep, run this command.
298+
* `dep-ensure` runs dep ensure for you while taking care of packr properly. Use
299+
this if your PRs are often failing on `verify-vendor` because of packr. This
300+
can be avoided entirely if you use `make build-porter-client` or `make build`.
301+
* `verify-vendor` cleans up packr generated files and verifies that dep's Gopkg.lock
302+
and vendor/ are up-to-date. Use this makefile target instead of running
303+
dep check manually.
296304

297305
## Install mixins
298306

Makefile

+5-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ build-porter: generate
3838

3939
build-porter-client: generate
4040
$(MAKE) $(MAKE_OPTS) build-client MIXIN=porter -f mixin.mk BINDIR=bin
41+
$(MAKE) $(MAKE_OPTS) clean-packr
4142

4243
build-mixins: $(addprefix build-mixin-,$(INT_MIXINS))
4344
build-mixin-%: generate
@@ -71,7 +72,10 @@ get-mixins:
7172
verify: verify-vendor
7273

7374
verify-vendor: clean-packr dep
74-
dep check
75+
@dep check || printf '\nRun "make dep-ensure" to fix this error\n\n'
76+
77+
dep-ensure: clean-packr
78+
dep ensure
7579

7680
HAS_DEP := $(shell command -v dep)
7781
dep:

0 commit comments

Comments
 (0)