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

rules_nodejs breaks with the Bazel flag --incompatible_disable_legacy_proto_provider, to be flipped in Bazel 1.0 #979

Closed
lberki opened this issue Aug 7, 2019 · 6 comments · Fixed by #1000

Comments

@lberki
Copy link
Contributor

lberki commented Aug 7, 2019

The error message is:

ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/cd827756b6c61ed02bbdf88318006735/external/io_bazel_rules_go/proto/wkt/BUILD.bazel:3:1: in proto attribute of go_proto_library rule @io_bazel_rules_go//proto/wkt:wrappers_go_proto: '@com_google_protobuf//:wrappers_proto' does not have mandatory providers: 'proto'. Since this rule was created by the macro 'gen_well_known_types', the error might have been caused by the macro implementation in /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/cd827756b6c61ed02bbdf88318006735/external/io_bazel_rules_go/proto/wkt/well_known_types.bzl:42:21

which indicates that it depends on an old version of rules_go which doesn't have bazel-contrib/rules_go@838f81d and bazel-contrib/rules_go@8670623 .

@alexeagle
Copy link
Collaborator

Just merged the renovate PR that updates rules_go - try again?

@lberki
Copy link
Contributor Author

lberki commented Aug 8, 2019

Nope... rules_nodejs still errors out @ 6367a1d with the same error message:

>> bazel build //... --nobuild --incompatible_disable_legacy_proto_provider
ERROR: /usr/local/google/home/lberki/.cache/bazel/_bazel_lberki/c4a7e9506f6e8648c818a41e88798dfc/external/io_bazel_rules_go/proto/wkt/BUILD.bazel:3:1: in proto attribute of go_proto_library rule @io_bazel_rules_go//proto/wkt:empty_go_proto: '@com_google_protobuf//:empty_proto' does not have mandatory providers: 'proto'. Since this rule was created by the macro 'gen_well_known_types', the error might have been caused by the macro implementation in /usr/local/google/home/lberki/.cache/bazel/_bazel_lberki/c4a7e9506f6e8648c818a41e88798dfc/external/io_bazel_rules_go/proto/wkt/well_known_types.bzl:42:21
INFO: Call stack for the definition of repository 'io_bazel' which is a http_archive (rule definition at /usr/local/google/home/lberki/.cache/bazel/_bazel_lberki/c4a7e9506f6e8648c818a41e88798dfc/external/bazel_tools/tools/build_defs/repo/http.bzl:237:16):
 - /usr/local/google/home/lberki/bazel/rules_nodejs/package.bzl:46:5
 - /usr/local/google/home/lberki/bazel/rules_nodejs/WORKSPACE:65:1
ERROR: Analysis of target '//packages/typescript:npm_package' failed; build aborted: Analysis of target '@io_bazel_rules_go//proto/wkt:empty_go_proto' failed; build aborted
INFO: Elapsed time: 1.900s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1363 packages loaded, 32917 targets configured)

@lberki
Copy link
Contributor Author

lberki commented Aug 12, 2019

ping. We'd like to flip this flag in Bazel 1.0, which means this should be resolved pretty soon.

@alexeagle
Copy link
Collaborator

@lberki oops, I was in a hurry. the PR I merged only updated rules_go for one of our example nested workspaces, not for the root workspace where it mattered. We are working on it now... some tests are failing after the rules_go upgrade.

@alexeagle
Copy link
Collaborator

@lberki the cross_compile jobs on buildkite fail after the rules_go upgrade:

(01:24:35) ERROR: While resolving toolchains for target @io_bazel_rules_go//:go_context_data: no matching toolchains found for types @bazel_tools//tools/cpp:toolchain_type

https://buildkite.com/bazel/rules-nodejs-nodejs/builds/3509

It looks like this was fixed in rules_go 0.19
bazel-contrib/rules_go#2090
however we can't go past 0.18.5 because of a breaking change in a library we depend on
#1001

so we are a bit stuck in dependency hell

@lberki
Copy link
Contributor Author

lberki commented Aug 13, 2019

Ow. It seems that @jayconrod has an idea:

bazel-contrib/rules_go#2076 (comment)

If not, is using the patches= attribute of http_archive to patch just the fix in (without updating all of rules_go) on the table? I did that for Envoy:

envoyproxy/envoy#7850

And it seems to work well. Of course, updating rules_go would be the principled approach...

alexeagle pushed a commit to nickbehrens/rules_nodejs that referenced this issue Aug 13, 2019
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 a pull request may close this issue.

2 participants