Skip to content

Conversation

@acozzette
Copy link

The cc_dist_library() rule originally included only the sources from direct dependencies. This resulted in a less than ideal developer experience, because if you ever added a new cc_library() then you would have to carefully update the necessary cc_dist_library() targets to ensure that the change was correctly reflected in the CMake build.

This commit addresses that issue by making cc_dist_library() include transitive sources. We have to be careful to avoid introducing ODR violations (e.g. from libprotoc duplicating sources from libprotobuf), so we introduce a new dist_deps attribute on cc_dist_library(). Anything in dist_deps is assumed to be covered by a separate cc_dist_library() and is not included. We also make sure to exclude anything that's not part of our repo (i.e. Abseil and zlib).

@acozzette acozzette force-pushed the cmake branch 6 times, most recently from 7b559a2 to ffb2ea2 Compare October 25, 2022 18:47
@acozzette acozzette marked this pull request as ready for review October 25, 2022 18:49
@acozzette acozzette force-pushed the cmake branch 3 times, most recently from 0734dc8 to 9b67bd5 Compare October 26, 2022 14:31
The cc_dist_library() rule originally included only the sources from
direct dependencies. This resulted in a less than ideal developer
experience, because if you ever added a new cc_library() then you would
have to carefully update the necessary cc_dist_library() targets to
ensure that the change was correctly reflected in the CMake build.

This commit addresses that issue by making cc_dist_library() include
transitive sources. We have to be careful to avoid introducing ODR
violations (e.g. from libprotoc duplicating sources from libprotobuf),
so we introduce a new dist_deps attribute on cc_dist_library(). Anything
in dist_deps is assumed to be covered by a separate cc_dist_library()
and is not included. We also make sure to exclude anything that's not
part of our repo (i.e. Abseil and zlib).
@acozzette acozzette closed this Nov 4, 2022
@acozzette acozzette reopened this Nov 4, 2022
@copybara-service copybara-service bot merged commit e51f4eb into protocolbuffers:main Nov 4, 2022
@acozzette acozzette deleted the cmake branch November 4, 2022 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants