Skip to content
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

This crate does not work with the new workspace dependencies #140

Open
Jasperav opened this issue Sep 23, 2022 · 8 comments
Open

This crate does not work with the new workspace dependencies #140

Jasperav opened this issue Sep 23, 2022 · 8 comments

Comments

@Jasperav
Copy link

The new workspace deps feature is explained here: https://betterprogramming.pub/workspace-inheritance-in-rust-65d0bb8f9424

Reproduction path:

  1. Add random dependencies to your root Cargo.toml
  2. Run this library
  3. 'All deps seem to be used' is shown, although the deps are not used.
@domenicquirl
Copy link

When using

[package]
version.workspace = true

in a workspace crate, I'm getting

error: failed to load manifest for workspace member `<path>`

Caused by:
  failed to parse manifest at `<path>/Cargo.toml`

Caused by:
  invalid type: map, expected SemVer version for key `package.version`

with both a nightly from 1.64 (rustc 1.64.0-nightly (7425fb293 2022-06-30)) and current (rustc 1.66.0-nightly (ce7f0f1aa 2022-09-28)).

@larry0x
Copy link

larry0x commented Oct 18, 2022

I can confirm latest version works with workspace deps

@est31
Copy link
Owner

est31 commented Oct 18, 2022

It would be nice to have a test for this.

@woshilapin
Copy link

I also tested that it works fine on version 0.1.34. However, the release of the binaries never happened. The tag is present here, the crate is published here, but there is no release here.

It seems like the Github Actions on the job somewhat failed (see here).

@est31
Copy link
Owner

est31 commented Oct 27, 2022

@woshilapin yeah I have botched that update a little, unfortunately, forgot to check in the lockfile changes. As there is a Rust release next week however, there would also be a new cargo release, which means that it's also time for a new cargo-udeps release. The train model definitely has its advantages :).

@est31
Copy link
Owner

est31 commented Nov 3, 2022

0.1.35 is out: https://github.com/est31/cargo-udeps/releases/tag/v0.1.35

@Jasperav
Copy link
Author

@est31 It does work when you reference a lib from the root Cargo.toml in another project in your workspace and it is not used. However, libs that are inside the root Cargo.toml file but nowhere referenced in other projects in the workspace are not picked up. Can this be fixed?

@est31
Copy link
Owner

est31 commented Nov 20, 2022

@Jasperav that's interesting, thanks for the feedback. I guess it should be possible to support that, it's more of a feature request than a bug however. The reason why I'm keeping this issue open is because there is no test yet for unused workspace dependencies that cargo builds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants