Skip to content

cargo2: Add a new cargo2 source plugin

This plugin started out as a merge request to add support for git dependencies to the plugin in the buildstream-plugins repo. However, it was rejected due to external git dependencies, especially dulwich.

These are the additions made to the original cargo plugin:

Cargo supports specifying sources as originating from git repositories instead of registries like crates.io.

This adds support for staging and fetching the dependencies. It adds an explicit "kind" key to the crate entries in elements that default to "registry" for backward compatibility.

The staging emulates cargo vendoring. It generates an empty checksum file to make cargo happy. It also has to do a bunch of work if the git repository contains cargo workspaces. Workspaces can define several properties like dependencies that are inherited by Cargo.toml files of crates that are workspace members. In that case, the inherited values have to be written into the Cargo.toml file during staging.

Closes https://github.com/apache/buildstream-plugins/issues/10

Merge request reports