[Bug 2009512] Re: cargo wrapper does not replace source of deps that are not from crates.io

Denison Barbosa 2009512 at bugs.launchpad.net
Mon Mar 27 12:33:28 UTC 2023


** Summary changed:

- dh-cargo does not replace source of deps that are not from crates.io
+ cargo wrapper does not replace source of deps that are not from crates.io

** Package changed: dh-cargo (Ubuntu) => cargo (Ubuntu)

** Description changed:

- dh-cargo version: 28ubuntu1
+ cargo version: 0.68.0+ds0ubuntu1-0ubuntu1
  
  In order to use vendored dependencies in Rust, you need to replace the source of the crate (commonly crates.io) by a local path which points to your vendored dependencies.
- dh-cargo auto generates the file config.toml, which is used to override said sources, with the following template:
+ The wrapper provided by the cargo package has a prepare-debian function that auto generates the file config.toml, which is used to override said sources, with the following template:
  "
  [source.crates-io]
  replace-with = "dh-cargo-registry"
  
  [source.dh-cargo-registry]
  directory = "{0}"
  ", where 0 corresponds to the path of the local dependencies.
  
- If the package has dependencies from sources other than crates.io, dh-cargo won't replace those sources by the vendored path and instead you need to manually patch the mentioned config file to replace your other sources, e.g.:
+ If the package has dependencies from sources other than crates.io, the wrapper won't replace those sources by the vendored path and instead you need to manually patch the mentioned config file to replace your other sources, e.g.:
  "
  [source.other-than-crates-io]
  replace-with = "dh-cargo-registry"
  "
  
  An example of this fix can be found at https://github.com/ubuntu/aad-
  auth/commit/e8583303402a79a72acaf97beb4c38ac80f858bb.
  
  All the dependencies of the project are listed in the Cargo.lock file.
- dh-cargo should consult this file in order to get the dependencies
+ The wrapper should consult this file in order to get the dependencies
  sources and then override them in the config.toml file to ensure that
  each source is replaced by its vendored counterpart.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to dh-cargo in Ubuntu.
https://bugs.launchpad.net/bugs/2009512

Title:
  cargo wrapper does not replace source of deps that are not from
  crates.io

Status in cargo package in Ubuntu:
  Triaged

Bug description:
  cargo version: 0.68.0+ds0ubuntu1-0ubuntu1

  In order to use vendored dependencies in Rust, you need to replace the source of the crate (commonly crates.io) by a local path which points to your vendored dependencies.
  The wrapper provided by the cargo package has a prepare-debian function that auto generates the file config.toml, which is used to override said sources, with the following template:
  "
  [source.crates-io]
  replace-with = "dh-cargo-registry"

  [source.dh-cargo-registry]
  directory = "{0}"
  ", where 0 corresponds to the path of the local dependencies.

  If the package has dependencies from sources other than crates.io, the wrapper won't replace those sources by the vendored path and instead you need to manually patch the mentioned config file to replace your other sources, e.g.:
  "
  [source.other-than-crates-io]
  replace-with = "dh-cargo-registry"
  "

  An example of this fix can be found at https://github.com/ubuntu/aad-
  auth/commit/e8583303402a79a72acaf97beb4c38ac80f858bb.

  All the dependencies of the project are listed in the Cargo.lock file.
  The wrapper should consult this file in order to get the dependencies
  sources and then override them in the config.toml file to ensure that
  each source is replaced by its vendored counterpart.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cargo/+bug/2009512/+subscriptions




More information about the foundations-bugs mailing list