-
Notifications
You must be signed in to change notification settings - Fork 15
Description
What I did
In trying to get this project up and running I followed the READMEs instructions. While I'm admittedly a complete Bazel noob, I am pretty sure theres some missing steps.
Initially upon running bazel build //... OR bazel run //cmd/xtoproto_web -- --addr ":8888" from the root of the project, I get the following error.
I see this project hasn't had any attention in over a year, so theres a good chance this doesn't get fixed, but I wanted to at least create trail for others to follow instead of having to figure it out like I have.
Error
$ bazel build //...
ERROR: /private/var/tmp/_bazel_user/<UUID>/external/io_bazel_rules_go/BUILD.bazel:56:5: in (an implicit dependency) attribute of nogo rule @@io_bazel_rules_go//:default_nogo: in $whitelist_function_transition attribute of nogo rule @@io_bazel_rules_go//:default_nogo: package group '@@bazel_tools//tools/whitelists/function_transition_whitelist:function_transition_whitelist' is misplaced here (they are only allowed in the visibility attribute)
ERROR: /private/var/tmp/_bazel_user/<UUID>/external/io_bazel_rules_go/BUILD.bazel:56:5: Analysis of target '@@io_bazel_rules_go//:default_nogo' failed
ERROR: Analysis of target '//cmd/xtoproto_web:xtoproto_web' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.164s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
FAILED:
Fetching repository @@com_github_stoewer_go_strcase; starting
Fetching repository @@com_github_golang_glog; startingNow these errors are kind of cryptic to me, but the best i can tell, theres some sort of rule defined somewhere by default that is causing the rest of the build to bork? It has something to do with external/io_bazel_rules_go/BUILD but since thats not located in the project, I'm not really sure where to look? So I'm off to google it I guess?
My next steps
I found some other issues on other projects that had some similar errors, they referenced needing to 'update the rules'? I'm still not sure how to do that, or where to go, so I tried running bazel fetch since that seems like the most likely built in 'update' option? It got me a bit further but still borked.
$ bazel build //...
ERROR: /path/to/dir/xtoproto/examples/example01/BUILD.bazel:28:20: in fail_with_message_test rule //examples/example01:write_generated_protos_test:
Traceback (most recent call last):
File "/private/var/tmp/_bazel_user/<UUID>/external/aspect_bazel_lib/lib/private/fail_with_message_test.bzl", line 4, column 9, in _fail_with_message_test_impl
fail(ctx.attr.message)
Error in fail:
@@//examples/example01:example01.pb.go does not exist. To create & update this file, run:
bazel run //examples/example01:write_generated_protos
ERROR: /path/to/dir/xtoproto/examples/example01/BUILD.bazel:28:20: Analysis of target '//examples/example01:write_generated_protos_test' failed
ERROR: Analysis of target '//examples/example01:write_generated_protos_test' failed; build aborted
INFO: Elapsed time: 0.471s, Critical Path: 0.01s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
FAILED:
Fetching repository @@com_github_mitchellh_go_wordwrap; starting
Fetching repository @@com_github_golang_glog; starting
Fetching repository @@org_golang_x_net; starting
Fetching repository @@org_golang_google_grpc; starting
Fetching repository @@bazel_gazelle_go_repository_config; starting
Fetching repository @@com_github_stoewer_go_strcase; starting
Fetching repository @@com_github_jhump_protoreflect; starting
Fetching repository @@com_github_google_go_cmp; starting ... (11 fetches)
This seems to be saying that Bazel is trying to run a test? I guess thats good? It also gives what appears to be a 'helpful' (spoilers) command to fix the error, so lets try that?
$ bazel run //examples/example01:write_generated_protos
ERROR: /private/var/tmp/_bazel_user/<UUID>/external/io_bazel_rules_go/BUILD.bazel:56:5: in (an implicit dependency) attribute of nogo rule @@io_bazel_rules_go//:default_nogo: in $whitelist_function_transition attribute of nogo rule @@io_bazel_rules_go//:default_nogo: package group '@@bazel_tools//tools/whitelists/function_transition_whitelist:function_transition_whitelist' is misplaced here (they are only allowed in the visibility attribute)
ERROR: /private/var/tmp/_bazel_user/<UUID>/external/io_bazel_rules_go/BUILD.bazel:56:5: Analysis of target '@@io_bazel_rules_go//:default_nogo' failed
ERROR: Analysis of target '//examples/example01:write_generated_protos' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.345s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
FAILED:
Fetching repository @@zlib; starting
Ok, so now it seems to be having what seems to be basically the same as the first issue again? I will continue to look into this and leave updates on this issue.
Other Info
bazel version
Build label: 7.3.1-homebrew
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Tue Jan 1 00:00:00 1980 (315532800)
Build timestamp: 315532800
Build timestamp as int: 315532800