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

bazel build failes locally #5331

Closed
xiangpengzhao opened this issue Nov 3, 2017 · 9 comments · Fixed by #5411
Closed

bazel build failes locally #5331

xiangpengzhao opened this issue Nov 3, 2017 · 9 comments · Fixed by #5411
Assignees

Comments

@xiangpengzhao
Copy link
Contributor

Checkout the HEAD code of test-infra, bazel build fails. It works on my former branch.

cloud@ubuntu:~/go/src/k8s.io/test-infra$ bazel build //...
ERROR: /home/cloud/go/src/k8s.io/test-infra/vendor/gopkg.in/yaml.v2/BUILD:24:1: no such package 'vendor/gopkg.in/check.v1': BUILD file not found on package path and referenced by '//vendor/gopkg.in/yaml.v2:go_default_xtest'.
ERROR: Analysis of target '//vendor/gopkg.in/yaml.v2:go_default_xtest' failed; build aborted: no such package 'vendor/gopkg.in/check.v1': BUILD file not found on package path.
INFO: Elapsed time: 4.287s
@BenTheElder
Copy link
Member

hmm I think you need bazel build //... -//vendor... now after the switch to dep which includes these tests. (that's what the presubmits are doing). I'm not sure what the best option for making this easier is at the moment.

/cc @ixdy

@xiangpengzhao
Copy link
Contributor Author

@BenTheElder it throws another error:

cloud@ubuntu:~/go/src/k8s.io/test-infra$ bazel build //... -//vendor...
.................
ERROR: Invalid options syntax: -//vendor...

@BenTheElder
Copy link
Member

@xiangpengzhao my bad, the correct way is bazel build -- //... -//vendor..., bazel allows you to place args after the build target list so you have to put -- do disambiguate between flags and negative targets. 😕

@xiangpengzhao
Copy link
Contributor Author

cloud@ubuntu:~/go/src/k8s.io/test-infra$ bazel build -- //... -//vendor...
ERROR: no such package 'vendor...': BUILD file not found on package path.
INFO: Elapsed time: 0.423s

But I see the vendor package in code root dir. Sorry I'm not familiar with bazel rules...

@BenTheElder
Copy link
Member

facepalm x2, don't bazel late at night 😂: bazel build -- //... -//vendor/...
vendor... != vendor/...

@xiangpengzhao
Copy link
Contributor Author

@BenTheElder No worries :)

The new command works! Awesome! Thanks!

BTW, should I run the new command every time when I want to build? The command is a bit hard to remember...

@BenTheElder
Copy link
Member

@xiangpengzhao just for now, we should make it so that bazel build //... just works.

@xiangpengzhao
Copy link
Contributor Author

@BenTheElder thanks!

@BenTheElder
Copy link
Member

I can verify that bazel build //... and bazel test //... should work fine now without excluding vendor.

@BenTheElder BenTheElder self-assigned this Nov 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants