Skip to content

Update CONTRIBUTING.md#32

Merged
alexmt merged 4 commits intoargoproj:masterfrom
merenbach:update-contributing
Mar 13, 2018
Merged

Update CONTRIBUTING.md#32
alexmt merged 4 commits intoargoproj:masterfrom
merenbach:update-contributing

Conversation

@merenbach
Copy link
Contributor

@merenbach merenbach commented Mar 12, 2018

Summary

Fix a tiny typo and ensure that errgroup is installed.

Problem

When trying to run make for the first time, the following error appears on my machine:

CGO_ENABLED=0 go run vendor/github.com/gobuffalo/packr/packr/main.go build -v -i -ldflags '-X github.com/argoproj/argo-cd.version=0.1.0 -X github.com/argoproj/argo-cd.buildDate=2018-03-12T22:29:44Z -X github.com/argoproj/argo-cd.gitCommit=1247c2264dace02a81bf474a2a7a5eea3be9962a -X github.com/argoproj/argo-cd.gitTreeState=clean -X github.com/argoproj/argo-cd/install.imageTag=latest -extldflags "-static"' -o /Users/amerenbach/go/src/github.com/argoproj/argo-cd/dist/argocd ./cmd/argocd
vendor/github.com/gobuffalo/packr/builder/builder.go:12:2: cannot find package "golang.org/x/sync/errgroup" in any of:
	/Users/amerenbach/go/src/github.com/argoproj/argo-cd/vendor/golang.org/x/sync/errgroup (vendor tree)
	/usr/local/Cellar/go/1.10/libexec/src/golang.org/x/sync/errgroup (from $GOROOT)
	/Users/amerenbach/go/src/golang.org/x/sync/errgroup (from $GOPATH)
make: *** [cli] Error 1

Solution

errgroup is required by https://github.com/gobuffalo/packr, which is installed with install/install.go. For some reason this is not recursively installed with dep ensure. Adding it to install/install.go had the effect of ensuring it would be installed with dep ensure, but then make errors out with an imported-but-not-used error since this then constitutes a direct import.

This looks like a simple missing library, so I've added errgroup to the list of prerequisites in the README. @alexmt Please let me know if I may refactor this.

@alexmt
Copy link
Collaborator

alexmt commented Mar 13, 2018

Nice catch @merenbach ! Looks like we forgot to add 'errgroup' dependency. Can you please add errgroup package into Gopkg.toml and Gopkg.lock instead of documenting it?

Following command should regenerate both Gopkg.toml and Gopkg.lock :

add dep ensure -add golang.org/x/sync/errgroup

@merenbach
Copy link
Contributor Author

@alexmt Thank you for the update! When I run that command, Gopkg.lock and Gokpkg.toml update as expected. I receive the following output:

$ dep ensure -add golang.org/x/sync/errgroup
Fetching sources...

"golang.org/x/sync/errgroup" is not imported by your project, and has been temporarily added to Gopkg.lock and vendor/.
If you run "dep ensure" again before actually importing it, it will disappear from Gopkg.lock and vendor/.

I tried running dep ensure again afterward and while my changes were not reverted, I received the following output that says the import may be ignored:

Warning: the following project(s) have [[constraint]] stanzas in Gopkg.toml:

  ✗  golang.org/x/sync

However, these projects are not direct dependencies of the current project:
they are not imported in any .go files, nor are they in the 'required' list in
Gopkg.toml. Dep only applies [[constraint]] rules to direct dependencies, so
these rules will have no effect.

Either import/require packages from these projects so that they become direct
dependencies, or convert each [[constraint]] to an [[override]] to enforce rules
on these projects, if they happen to be transitive dependencies, [sic]

(The message ends with a comma, oddly.)

This comment on a tangentially related dep issue suggests adding to the required list instead might be a good way to go, so I've updated my code with that. Please let me know if I may explore any further avenues of consideration.

@alexmt alexmt self-requested a review March 13, 2018 16:49
@alexmt
Copy link
Collaborator

alexmt commented Mar 13, 2018

LGTM

@alexmt alexmt merged commit d256256 into argoproj:master Mar 13, 2018
@merenbach merenbach deleted the update-contributing branch March 16, 2018 17:39
leoluz pushed a commit to leoluz/argo-cd that referenced this pull request Sep 29, 2023
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.

2 participants

Comments