-
Notifications
You must be signed in to change notification settings - Fork 15
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
RFC: Introduce "base-sets" for vendored dependencies #35
Comments
What's the difference with using the packaged libraries ( If they can use pinned versions in the base-sets, they can also use the packaged libraries. We just need to ensure these packaged libraries are aligned with the base-sets definition. I think for Go and Rust packages, they are able to use mixed libraries from both vendor directory and system packages. |
I think base-sets could be working pretty similarly to IMO, the final goal is to have properly packaged shared libraries, built from Rust or Golang sources, so we can consume them as we do with normal C libraries. But that's not yet fully supported by those ecosystems. The next better approach would be using the Next, having a base-set would allow for the toolchain maintainers to provide a set of common dependencies, using specific versions for their ecosystem. Those base-set .debs could even depend on already packaged The last resort would be for an application to vendor its own dependencies if they are not available otherwise. All of those stages try to provide a common set of dependencies + specific versions to be used across the archive, to ease long-term maintenance. I.e. we'd need to track and update only that single version. That is not a given if many applications pull in different versions of the same dependency. |
AFAIR one of the biggest reasons to generally go recommending vendored was the non-maturity and churn of rust dependency and updates usually leading to breakage. I remember discussions about a cases like:
Most likely (well, hopefully) things have evolved and I think what you mention as base-sets might very well be the more established libraries nowadays. In the go world we already go that way, one can use Hint: no one likes to own packages for the effort and responsibility it brings, so I'd expect everyone saying "nah let me vendor all mine they are not stable". Which does not lead to good re-use of code and maintenance effort. I'm afraid that I expect that the initial base-set would need to be owned by the toolchain team that owns rust itself and not by the first person that comes by having a kernel-cmdline-parser that need This certainly needs more discussion and deeper analysis, thanks for bringing it up @slyon |
See also https://bugs.debian.org/1049413 for a question about how strict we want to be with "rust dependencies must be vendored". |
In order to bootstrap the new ecosystems and reduce heavy vendoring, I think it would be a good idea if the Foundations Toolchain squad could research/identify the most used/common/important (top 10?) dependencies of their rust/go/.net/java/... ecosystem. Those could then be packaged(?), MIRed (incl transitive dependencies) and owned by the corresponding toolchian maintainers. This should cover a big & important part of new dependencies. So once a non-toolchain team wants to MIR a new tool, they do not need to be afraid of owning a huge tree of vendored core/base dependencies. Those would be covered by the Toolchain squad and remaining, less common dependencies could still be vendored. This topic is less important for more mature ecosystems (GCC/Python/Perl/...), as the most important dependencies got into main already over the years and are owned by one team or another. It still might make sense to identify the relevant base-set and take ownership into the toolchian squad. A "base-set" could either be implemented as a single package containing an ecosystem's Most important (+transitive) dependencies (vendored), or be maintained as a set of normal packages, tracked inside the "supported" seed. |
At the in-person MIR meeting, there was discussion about teams owning (or co-owning) specific vendored packages. Could someone explain what this would mean? |
Each package added to a base-set should receive a main inclusion like review. There are 564 vendored packages in the Possibly, packages which do not require |
If you make a simple hello world package with a dependency to This issue seems to be described on https://wiki.ubuntu.com/RustCodeInMain
Removing unnecessary vendored packages should be a high priority for quality and maintainability in main. Possibly an AST could determine which dependencies the base package actually uses, to debloat vendored packages. |
To replicate what I wrote on https://bugs.launchpad.net/ubuntu/+source/authd/+bug/2048781/comments/20: I continued exploring this topic myself last week and was able to rely on a tool developed for this: https://github.com/coreos/cargo-vendor-filterer/. This tool is not ideal in the sense that:
So basically, cargo and rustc still thinks the crate is available, it just happens to be empty. Consequently, we wouldn’t know if we are impacted or not by security issue before manual checking. However, I see this as a step in the right direction, so I implemented this in authd: https://github.com/ubuntu/authd/pull/270/files. Here, we are filtering to only keep Linux platform, on all our supported architectures (which is tier 1 and 2 in Rust world). This tool run during the package source build. I would feel better if this was packaged and maintained in ubuntu (as this injects potentially some code), and part of our standard tooling. I will reach out the Rust maintainer for the incoming engineering sprint. I think we can still trust this repository as it’s part of a well-known organization with multi-decades open source famous maintainers. |
Modern languages like Rust or Golang make heavy use of vendoring for their dependencies, therefore we cannot easily link applications against libraries from the Ubuntu archive, which are supported and covered by the security team. (cpaelzer#3)
Different applications might pull in different versions of the same vendored dependency, which need to be tracked and updated individually (https://wiki.ubuntu.com/RustCodeInMain).
I wonder if we could define some kind of base-sets ("base-crates"/"base-packages") similar to the nature of "base-snaps". Those would describe a bundle of specific crates/packages/dependencies using specific versions and might be uploaded to crates.io / pkg.go.dev or implemented as a .deb package in the Ubuntu archive and maintained & supported by the corresponding toolchain team / security team.
For Rust one "base-set"/"base-crate" might for example contain dependencies to specific versions of very common crates, such as:
A simple to use, efficient, and full-featured Command Line Argument Parser
Rust bindings to libcurl for making HTTP requests
Raw FFI bindings to platform libraries like libc.
OpenSSL bindings
A generic serialization/deserialization framework
Those dependencies (and probably more) are heavily used by many applications. When packaging Rust/Golang applications for "main" we could change their dependencies to make use of a base-set supported by Canonical, which should reduce the vendoring burden by a lot, as only additional dependencies (not part of the base-set in use) would need to be tracked individually.
I'd like to gauge your input on this thought. Also CC @liushuyu @zhsj @schopin-pro @samkamer
TODO:
vendoring/Rust.md
, to drop the recommendation to use vendoring for Rust packages, see: Import Rust vendoring document #66 (comment)The text was updated successfully, but these errors were encountered: