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_cc dependency marked as dev causes rules_cc module visibility issues #203

Open
steeve opened this issue Feb 8, 2024 · 5 comments
Open
Assignees
Labels
bug Something isn't working P1 I'll work on this now. (Assignee required)

Comments

@steeve
Copy link

steeve commented Feb 8, 2024

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'.
@comius
Copy link
Collaborator

comius commented Feb 9, 2024

cc @alexeagle @thesayyn, please triage/fix

@thesayyn thesayyn added bug Something isn't working P1 I'll work on this now. (Assignee required) labels Feb 9, 2024
@thesayyn thesayyn self-assigned this Feb 9, 2024
SanjayVas added a commit to world-federation-of-advertisers/cross-media-measurement that referenced this issue Mar 11, 2024
Known EventGroup metadata types are types expected to be known by all callers. These need not be included in the EventGroupMetadataDescriptor FileDescriptorSet, and are instead loaded separately.

This also enforces uniqueness for EventGroupMetadataDescriptor message types. Note that this only affects the creation of new resources. Existing resources may exist that already violate this constraint.

Includes a workaround for bazelbuild/rules_proto#203.

Closes #1511
@alexeagle
Copy link
Collaborator

Yup, that tool is written in C++ which is naughty since we only declare that as a devDep:

bazel_dep(name = "rules_cc", version = "0.0.1", dev_dependency = True)

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.

@SanjayVas
Copy link

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)?

@alexeagle
Copy link
Collaborator

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.

@SanjayVas
Copy link

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 #203 (comment) would need to come later.

ple13 pushed a commit to world-federation-of-advertisers/cross-media-measurement that referenced this issue Aug 16, 2024
Known EventGroup metadata types are types expected to be known by all callers. These need not be included in the EventGroupMetadataDescriptor FileDescriptorSet, and are instead loaded separately.

This also enforces uniqueness for EventGroupMetadataDescriptor message types. Note that this only affects the creation of new resources. Existing resources may exist that already violate this constraint.

Includes a workaround for bazelbuild/rules_proto#203.

Closes #1511
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 I'll work on this now. (Assignee required)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants