Skip to content

Conversation

@wking
Copy link
Member

@wking wking commented Sep 26, 2018

Because go run ignores vendor/ otherwise (golang/go#20406). Also vendor shurcooL/httpfs/vfsutil, although I did this manually because I haven't been able to talk Glide into doing it right ;). This should address our:

$ ./hack/build.sh 
++ dirname ./hack/build.sh
+ cd ./hack/..
+ MODE=release
+ TAGS=
+ case "${MODE}" in
+ TAGS=release
+ GOPATH=/home/trking/src/openshift/installer/vendor:/home/trking/.local/lib/go
+ go generate ./data
../vendor/github.com/shurcooL/vfsgen/generator.go:18:2: cannot find package "github.com/shurcooL/httpfs/vfsutil" in any of:
  /home/trking/.local/lib/go/src/github.com/openshift/installer/vendor/github.com/shurcooL/httpfs/vfsutil (vendor tree)
  /home/trking/.local/go/src/github.com/shurcooL/httpfs/vfsutil (from $GOROOT)
  /home/trking/src/openshift/installer/vendor/src/github.com/shurcooL/httpfs/vfsutil (from $GOPATH)
  /home/trking/.local/lib/go/src/github.com/shurcooL/httpfs/vfsutil
../../../.local/lib/go/src/github.com/openshift/installer/data/assets.go:2: running "go": exit status 1

CC @abhinavdahiya, @sallyom, @crawford

Because 'go run' ignores vendor/ otherwise [1].

[1]: golang/go#20406
Generated with:

  $ git clone git://github.com/shurcooL/httpfs.git vendor/github.com/shurcooL/httpfs
  Cloning into 'vendor/github.com/shurcooL/httpfs'...
  remote: Enumerating objects: 197, done.
  remote: Total 197 (delta 0), reused 0 (delta 0), pack-reused 197
  Receiving objects: 100% (197/197), 32.35 KiB | 0 bytes/s, done.
  Resolving deltas: 100% (82/82), done.
  $ (cd vendor/github.com/shurcooL/httpfs && git log -1 --oneline)
  809bece vfsutil: Remove x/tools/godoc/vfs dependency.
  $ git add vendor/github.com/shurcooL/httpfs/vfsutil/{file,vfsutil,walk}.go

I haven't been able to find the invocation to get Glide to do this for
me.
@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 26, 2018
@crawford
Copy link
Contributor

Works for me.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 26, 2018
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: crawford, wking

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit 1017c95 into openshift:master Sep 26, 2018
@wking wking deleted the use-vendor-dir-during-generate branch September 26, 2018 20:04
wking added a commit to wking/openshift-installer that referenced this pull request Sep 28, 2018
Generated with:

  $ glide remove github.com/AlecAivazis/survey
  $ glide get --strip-vendor gopkg.in/AlecAivazis/survey
  [INFO]Preparing to install 1 package.
  [INFO]Attempting to get package gopkg.in/AlecAivazis/survey.v1
  [INFO]--> Gathering release information for gopkg.in/AlecAivazis/survey.v1
  [INFO]The package gopkg.in/AlecAivazis/survey.v1 appears to have Semantic Version releases (http://semver.org).
  [INFO]The latest release is v1.6.2. You are currently not using a release. Would you like
  [INFO]to use this release? Yes (Y) or No (N)
  y
  [INFO]The package gopkg.in/AlecAivazis/survey.v1 appears to use semantic versions (http://semver.org).
  [INFO]Would you like to track the latest minor or patch releases (major.minor.patch)?
  [INFO]The choices are:
  [INFO] - Tracking minor version releases would use '>= 1.6.2, < 2.0.0' ('^1.6.2')
  [INFO] - Tracking patch version releases would use '>= 1.6.2, < 1.7.0' ('~1.6.2')
  [INFO] - Skip using ranges
  [INFO]For more information on Glide versions and ranges see https://glide.sh/docs/versions
  [INFO]Minor (M), Patch (P), or Skip Ranges (S)?
  m
  [INFO]--> Adding gopkg.in/AlecAivazis/survey.v1 to your configuration with the version ^1.6.2
  ...
  $ glide-vc --use-lock-file --no-tests --only-code
  $ git checkout HEAD -- vendor/github.com/shurcooL/httpfs

using:

  $ glide --version
  glide version 0.13.2-dev
  $ (cd $GOPATH/src/github.com/Masterminds/glide && git describe)
  v0.13.1-7-g3e13fd1
  $ (cd $GOPATH/src/github.com/sgotti/glide-vc && git describe)
  v0.1.0-2-g6ddf6ee

The httpfs works around our busted vfsutil vendor, see
a8cce08 (vendor: Add shurcooL/httpfs/vfsutil, 2018-09-26, openshift#340).

The formatting change unwinds ff9e547 (*: format all yaml files,
2018-09-27, openshift#342), but it doesn't seem to be worth fighting Glide on
this front.
wking added a commit to wking/openshift-installer that referenced this pull request Oct 2, 2018
I'd added this in f230c3e (hack/build: Add the local vendor directory
for generate, 2018-09-26, openshift#340), citing [1].  But:

* vendor/ is not a useful GOPATH addition, because it lacks the src/
  that Go requires.  Go might look in vendor/src/github.com/... with
  our GOPATH stuffing, but that won't help it find our vendored
  libraries.

* All that really seems to matter is whether the repository as a whole
  is checked out into your GOPATH.

I'm really looking forward to Go 1.11's modules killing the GOPATH
idea.

[1]: golang/go#20406

Reported-by: Stephen Augustus <[email protected]>
wking added a commit to wking/openshift-installer that referenced this pull request Oct 2, 2018
I'd added this in f230c3e (hack/build: Add the local vendor directory
for generate, 2018-09-26, openshift#340), citing [1].  But:

* vendor/ is not a useful GOPATH addition, because it lacks the src/
  that Go requires.  Go might look in vendor/src/github.com/... with
  our GOPATH stuffing, but that won't help it find our vendored
  libraries.

* All that really seems to matter is whether the repository as a whole
  is checked out into your GOPATH.

I'm really looking forward to Go 1.11's modules killing the GOPATH
idea.

[1]: golang/go#20406

Reported-by: Stephen Augustus <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants