rules_proto icon indicating copy to clipboard operation
rules_proto copied to clipboard

rules_cc dependency marked as dev causes rules_cc module visibility issues

Open steeve opened this issue 6 months ago • 5 comments

When trying to use the following code:

load("@rules_proto//proto:defs.bzl", "proto_descriptor_set")

proto_descriptor_set(
    name = "my_fdset",
    deps = ["...."],
)

This causes the following error:

ERROR: error loading package '@@rules_proto~6.0.0-rc2//tools/file_concat': Unable to find package for @@[unknown repo 'rules_cc' requested from @@rules_proto~6.0.0-rc2]//cc:defs.bzl: The repository '@@[unknown repo 'rules_cc' requested from @@rules_proto~6.0.0-rc2]' could not be resolved: No repository visible as '@rules_cc' from repository '@@rules_proto~6.0.0-rc2'.

steeve avatar Feb 08 '24 21:02 steeve

cc @alexeagle @thesayyn, please triage/fix

comius avatar Feb 09 '24 06:02 comius

Yup, that tool is written in C++ which is naughty since we only declare that as a devDep: https://github.com/bazelbuild/rules_proto/blob/f889a1b532fdca5f5051691f023a6a9f37ce494f/MODULE.bazel#L16 and many users have broken C++ toolchains.

The program itself is very small https://github.com/bazelbuild/rules_proto/blob/f889a1b532fdca5f5051691f023a6a9f37ce494f/tools/file_concat/main.cc

I think we should avoid having tools live in rules_proto.

alexeagle avatar Apr 22 '24 20:04 alexeagle

It looks like despite being reported against v6.0.0-rc2, this bug continued into both v6.0.0-rc3 and the final v6.0.0 release. Can we get a fix either in rules_proto itself (v6.0.1) or in BCR (6.0.0.bcr.1)?

SanjayVas avatar May 01 '24 19:05 SanjayVas

What do you propose as the fix? I suppose our only choice per semver is to make rules_cc a non-dev dependency, rather than remove this tool or ship pre-built binaries for it.

alexeagle avatar May 01 '24 22:05 alexeagle

I suppose our only choice per semver is to make rules_cc a non-dev dependency

Yes, exactly this for the short term as right now the module definition is just incorrect/broken. Anything like what was proposed in https://github.com/bazelbuild/rules_proto/issues/203#issuecomment-2070932477 would need to come later.

SanjayVas avatar May 01 '24 22:05 SanjayVas