Skip to content

Supporting transitive path dependencies #181

Description

@snowp

While rules_rs supports resolving local path Cargo dependencies it seems to not handle path dependencies transitively being brought in from a path dependency.

 # Run ./bazelw mod tidy

  failed with:

  Found a path dependency on bd-artifact-upload 1.0.0 but could not determine its path from Cargo.toml.
  Please declare it in [patch] or as a path dependency.

Here bd-artifact-upload is not a direct dependency of the bazel workspace, and is instead being included transitively from the path dependency.

This is from testing bitdriftlabs/capture-sdk#1057 and using the ./tools/swap_local.sh utility script for targeting a sibling repo for local development which is the typical flow used for Cargo-based workflows in this repo. In our case this is loading https://github.com/bitdriftlabs/shared-core from ../shared-core, relative to the bazel repo. The bd-artifact-upload crate is brought in via https://github.com/bitdriftlabs/shared-core/blob/main/bd-logger/Cargo.toml#L16 and not referenced directly from capture-sdk.

My agent came up with a solution that calls calls cargo metadata without --no-deps to detect these kind of dependencies and generate the correct cargo metadata for each. Happy to push through a patch for this if this seems like the right approach

Tested this on 0.0.96 and HEAD

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions