Comments (11)
Does bazel clean --expunge
change the error for you?
The attached WORKSPACE file below works for me. metalinter runs and reports various linting issues (including linting issues in /vendor). I suggest adding config = "//:.gometalinter.json", to the gometalinter configuration in BUILD.bazel and use it to configure linting to ignore the vendor folder altogether.
from bazel-tools.
Hey, can you share the exact full WORKSPACE
and BUILD
files and also the exact full error message that bazel is giving you? I cannot help with just the information you have provided, sorry.
from bazel-tools.
Hi,
Attached are WORKSPACE and BUILD file contents:
After removing vendor directory from https://github.com/stretchr/testify, gometalinter target is unable to resolve symbols. Few sample errors:
bazel run //:gometalinter
INFO: Analysed target //:gometalinter (0 packages loaded).
INFO: Found 1 target...
Target //:gometalinter up-to-date:
bazel-bin/gometalinter.bash
INFO: Elapsed time: 0.294s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
assert/assertions.go:19:2:warning: could not import github.com/davecgh/go-spew/spew (cannot find package "github.com/davecgh/go-spew/spew" in any of: (unconvert)
assert/assertions.go:20:2:warning: could not import github.com/pmezard/go-difflib/difflib (cannot find package "github.com/pmezard/go-difflib/difflib" in any of: (unconvert)
mock/mock.go:13:2:warning: could not import github.com/davecgh/go-spew/spew (cannot find package "github.com/davecgh/go-spew/spew" in any of: (unconvert)
mock/mock.go:14:2:warning: could not import github.com/pmezard/go-difflib/difflib (cannot find package "github.com/pmezard/go-difflib/difflib" in any of: (unconvert)
mock/mock.go:15:2:warning: could not import github.com/stretchr/objx (cannot find package "github.com/stretchr/objx" in any of: (unconvert)
assert/assertions.go:19:2:warning: could not import github.com/davecgh/go-spew/spew (cannot find package "github.com/davecgh/go-spew/spew" in any of: (maligned)
assert/assertions.go:20:2:warning: could not import github.com/pmezard/go-difflib/difflib (cannot find package "github.com/pmezard/go-difflib/difflib" in any of: (maligned)
mock/mock.go:13:2:warning: could not import github.com/davecgh/go-spew/spew (cannot find package "github.com/davecgh/go-spew/spew" in any of: (maligned)
mock/mock.go:14:2:warning: could not import github.com/pmezard/go-difflib/difflib (cannot find package "github.com/pmezard/go-difflib/difflib" in any of: (maligned)
With bazel, all packages can be provided as dependency, so my requirement is to allow all external dependencies via target and not via vendor folder.
Thanks
Kailash
from bazel-tools.
Double checking: which version of bazel are you running?
from bazel-tools.
Hi,
I am using 0.16.0 version of bazel. Please find below output of version command.
bazel version
Build label: 0.16.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jul 31 17:01:24 2018 (1533056484)
Thanks
Kailash
from bazel-tools.
Can you paste the contents of those files rather than an image? (so I can attempt to reproduce the issue)
from bazel-tools.
I have uploaded the file in text format. Steps to reproduce:
go get -u github.com/stretchr/testify
cd $GOPATH/src/github.com/stretchr/testify
copy BUILD and WORKSPACE to root of testify repo.
execute gometalinter rule using bazel
Thanks
Kailash
from bazel-tools.
Is there a typo in the attached files?
bazel run //:gometalinter
ERROR: error loading package '': Encountered error while reading extension file 'go/def.bzl': no such package '@io_bazel_rules_go//go': Error downloading [https://github.com/bazelbuild/rules_go/releases/download/0.15.1/rules_go-0.15.1.tar.gz] to /home/amckague/.cache/bazel/_bazel_amckague/d1309ac1e2719cdf777c0d6e936fc92b/external/io_bazel_rules_go/rules_go-0.15.1.tar.gz: Checksum was 5f3b0304cdf0c505ec9e5b3c4fc4a87b5ca21b13d8ecc780c97df3d1809b9ce6 but wanted 5756a4ad75b3703eb68249d50e23f5d64eaf1593e886b9aa931aa6e938c4e301
ERROR: error loading package '': Encountered error while reading extension file 'go/def.bzl': no such package '@io_bazel_rules_go//go': Error downloading [https://github.com/bazelbuild/rules_go/releases/download/0.15.1/rules_go-0.15.1.tar.gz] to /home/amckague/.cache/bazel/_bazel_amckague/d1309ac1e2719cdf777c0d6e936fc92b/external/io_bazel_rules_go/rules_go-0.15.1.tar.gz: Checksum was 5f3b0304cdf0c505ec9e5b3c4fc4a87b5ca21b13d8ecc780c97df3d1809b9ce6 but wanted 5756a4ad75b3703eb68249d50e23f5d64eaf1593e886b9aa931aa6e938c4e301
INFO: Elapsed time: 5.107s
INFO: 0 processes.
Removing references to the this lib and it's rules doesn't help the above error.
from bazel-tools.
Another issue that I noticed is that go_rules_dependencies()
and go_register_toolchains()
are invoked twice. The second pair of calls can be removed.
from bazel-tools.
Hi,
The same WORKSPACE file is working fine for me.
In your case, line 4 in WORKSPACE file having sha256 can be replaced by 5f3b0304cdf0c505ec9e5b3c4fc4a87b5ca21b13d8ecc780c97df3d1809b9ce6.
This will ensure checksum validation completes.
I agree second pair is redundant and can be removed.
Also, please try bazel run command keeping vendor directory and then without any vendor directory in the git repo.
Thanks
Kailash
from bazel-tools.
Also see https://github.com/atlassian/smith/blob/master/.gometalinter.json and https://github.com/atlassian/smith/blob/master/BUILD.bazel#L68-L79 for inspiration =)
from bazel-tools.
Related Issues (20)
- Failed to send SIGTERM, sending SIGKILL HOT 1
- roadmap for nogo, go modules, and generated code HOT 4
- Golangci-lint on generated code HOT 2
- Do not hard code version HOT 2
- Action Required: Fix Renovate Configuration
- Silence output in serial mode HOT 2
- Symlink cycle HOT 1
- Multirun cannot find bash runfiles HOT 7
- golangci-lint rule should cache output results HOT 2
- golangcilint unable to load external deps HOT 1
- Run golangci-lint in a subfolder HOT 2
- Pick up default config file for golangci.yml HOT 1
- [multirun] ctrl-c will leave the started processes running HOT 3
- Fix $@ expansion
- [multirun] shorter labels HOT 3
- Support data attribute in multirun command HOT 2
- Support make variable substitution in command.args HOT 6
- Buildkite builds cannot report status
- use of multirun with ibazel HOT 2
- golangcilint: errors on generated file imports HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bazel-tools.