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

Remove grpc sources from runfiles trees #262

Merged

Conversation

william-smith-skydio
Copy link
Contributor

If a C++ binary uses grpc code generated with cpp_grpc_library, the resulting runfiles tree includes the generated grpc sources.

Reproducer here:
https://gist.github.com/william-smith-skydio/e3b630f7cc826ad33f283b8017a88cc7

> tree bazel-bin/test.runfiles/__main__/
bazel-bin/test.runfiles/__main__/
├── grpc_test_proto_cpp_pb
│   ├── grpc_test.grpc.pb.cc -> ...
│   ├── grpc_test.grpc.pb.h -> ...
│   ├── grpc_test_mock.grpc.pb.h -> ...
│   ├── grpc_test.pb.cc -> ...
│   └── grpc_test.pb.h -> ...
└── test -> ...

With this patch applied, I get the expected behavior:

tree bazel-bin/test.runfiles
bazel-bin/test.runfiles
├── __main__
│   └── test -> ...
└── MANIFEST

This issue does not affect cpp_proto_library since that was already using the split srcs/hdrs targets.

If a C++ binary uses grpc code generated with cpp_grpc_library,
the resulting runfiles tree includes the generated grpc sources.

Reproducer here:
https://gist.github.com/william-smith-skydio/e3b630f7cc826ad33f283b8017a88cc7

```bash
> tree bazel-bin/test.runfiles/__main__/
bazel-bin/test.runfiles/__main__/
├── grpc_test_proto_cpp_pb
│   ├── grpc_test.grpc.pb.cc -> ...
│   ├── grpc_test.grpc.pb.h -> ...
│   ├── grpc_test_mock.grpc.pb.h -> ...
│   ├── grpc_test.pb.cc -> ...
│   └── grpc_test.pb.h -> ...
└── test -> ...
```

With this patch applied, I get the expected behavior:

```bash
tree bazel-bin/test.runfiles
bazel-bin/test.runfiles
├── __main__
│   └── test -> ...
└── MANIFEST
```

This issue does not affect cpp_proto_library since that was
already using the split srcs/hdrs targets.
@github-actions github-actions bot added the lang-cpp C++ rules specific label May 31, 2023
@aaliddell aaliddell merged commit fbcd2cb into rules-proto-grpc:master Jun 4, 2023
1 of 3 checks passed
@aaliddell
Copy link
Member

Thanks

aaliddell added a commit that referenced this pull request Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-cpp C++ rules specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants