[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Interested in Debian Bazel efforts



Hi Jesse,

On Mon, Apr 5, 2021 at 9:53 AM Jesse Chan <jc@linux.com> wrote:

I will try it with larger and more complex projects next, and see how
things go.

Please do share!
 
Subscribed. I have a question regarding Debian packaging, though. All
Bazel projects seem to manage their own dependencies, and binaries are
generally (shared) linked against libc only. If I remember correctly,

Bazel defaults to `linkstatic=True` for cc_binary targets. [1] I believe that's what you're talking about? That's certainly not required however. The Bazel C++ components in the bazel-bootstrap package, for example, are dynamically linked.

Debian does not prefer the approach. How would a Bazel project/package
comply with Debian practices?

Correct, Debian Policy [2] requires software to use dynamic linking wherever possible. That is mostly due to distribution-wide security considerations.

Switching to dynamic linking in a Bazel build is easy but there are numerous other considerations for Debian packaging. The most important being that nothing external to Debian is allowed to be downloaded during the build. We are currently working with Bazel upstream to determine the best generic solution for that. Without a generic solution, any software that you wanted to package for Debian would need to specify local versions of dependencies, such as with Bazel's distrib_cc_binary rule [3]. Note that the distrib_cc_binary rule and distrib_* friends are a very effective interim solution and much better than trying to create your own!

-Olek

[1] https://docs.bazel.build/versions/master/be/c-cpp.html 
[2] https://www.debian.org/doc/debian-policy/
[3] https://github.com/bazelbuild/bazel/pull/11793

Reply to: