Opinions on packaging //platform2/common-mk/external_dependencies?

22 views
Skip to first unread message

Maksim Ivanov

unread,
Oct 27, 2022, 9:54:50 AM10/27/22
to Chromium OS Development, Sarthak Kukreti
Hi everyone,

Currently we have multiple packages linking libraries from common-mk/external_dependencies/BUILD.gn. For example, proto_library("install_attributes-proto") is linked from both Libbrillo and Cryptohome. This causes symbol clashes (especially in some cases, like in fuzzers) and, presumably, contributes to the ChromeOS image size issue.

I had a small "tactical" workaround uploaded: crrev.com/c/3980753 and its follow-ups move "install_attributes-proto" to Libbrillo's libinstallattributes.so. However, the review feedback was to look into a broader solution.

So what would people think about this - i.e., create a new package, maybe named like "chromeos-base/external-dep-bindings", which will provide .so library(ies) containing those bindings from common-mk/external_dependencies? Or would it be preferable to have separate packages per group of protos, like "chromeos-base/install-attributes-protos", "chromeos-base/policy-protos" (although the latter can probably be done in the existing "chromeos-base/protofiles")? Also what about Go bindings?

Curious to hear your opinions - I'm sure it's not the first time this topic is brought up.


Thanks,
Maksim

Allen Webb

unread,
Oct 27, 2022, 11:39:57 AM10/27/22
to Maksim Ivanov, Chromium OS Development, Sarthak Kukreti
This sounds good to me for a short-to-mid-term solution. There is already precedent for this because many first party projects have their protos or D-Bus bindings split out into a separate ebuild to avoid circular dependencies or depending on much more than was intended.

I think in the long run we might want to move toward a world in which building first party code and dependency checking is done by something like bazel that does a better job of making sure we don't have races in the build whenever there is a missing dependency. This would probably look something like one ebuild to cover first party code that would express all the third-party dependencies.
 

Curious to hear your opinions - I'm sure it's not the first time this topic is brought up.


Thanks,
Maksim

--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
https://groups.google.com/a/chromium.org/group/chromium-os-dev
---
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-d...@chromium.org.

Maksim Ivanov

unread,
Nov 3, 2022, 3:14:29 PM11/3/22
to Allen Webb, Chromium OS Development, Sarthak Kukreti, chromeos-chatty-eng
Thanks! Is there an opinion on whether policy protos should be compiled in chromeos-base/protofiles (the package that supplies the .proto files) or they should be compiled with all others in the new package?

Yi Chou

unread,
Nov 4, 2022, 4:40:30 AM11/4/22
to Maksim Ivanov, Allen Webb, Chromium OS Development, Sarthak Kukreti, chromeos-chatty-eng
Oh, and I forget another thing:

Besides cloud.policy.proto, the chrome_device_policy.proto & device_management_backend.proto are also a very big proto files:
https://source.chromium.org/chromium/chromium/src/+/main:components/policy/proto/chrome_device_policy.proto

Yi Chou <yi...@google.com> 於 2022年11月4日 週五 凌晨4:01寫道:
I have some experiences of the policy protos issue before:

The initial idea is to build the proto into a shared_library, but IIRC, that will result in a 10MB .so file...
Because the policy-proto will include the cloud.policy.proto, which is a very huge proto file:
And we enabled "standalone = true" & "use_pic = true"(which means we exported "all symbols").

I think we will need the upstream support to control the visibility(__attribute__((visibility("default")))) for functions/structures in the generated code.
Otherwise we will need to choose between a large .so file or ODR violations...




Maksim Ivanov <em...@google.com> 於 2022年11月4日 週五 凌晨3:14寫道:
--
You received this message because you are subscribed to the Google Groups "chromeos-chatty-eng" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromeos-chatty...@google.com.
To view this discussion on the web visit https://groups.google.com/a/google.com/d/msgid/chromeos-chatty-eng/CAH%3DwB8zDSrHi1h15HV_vHRkmdTb0_B8H70V8Tpu0MOb1tQw0XA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages