filllabs / dependi

Dependi (formerly crates)
https://dependi.io
130 stars 9 forks source link

Cargo.toml (Rust) dependency for git repository is not shown correctly in the VS Code UI #183

Open palcoo42 opened 1 week ago

palcoo42 commented 1 week ago

Describe the bug I have a rust library called 'advent-of-code' which I have hosted in GitHub https://github.com/palcoo42/advent-of-code. I plan to use this library as a basic building block for my 'Advent Of Code' solutions.

Cargo.toml looks like this:

[package]
name = "day_01_no_time_for_a_taxicab"
version = "0.1.0"
edition = "2021"

[dependencies]
advent-of-code = { git = "https://github.com/palcoo42/advent-of-code.git", version = "1.0.*" }

The issue is that Dependi plugin shows me this dependency with invalid version 2022.0.66. The compilation and execution of the application however works so Cargo.toml is correct from cargo point of view.

Root cause: In the official crates.io is available the same package 'advent-of-code' https://crates.io/crates/advent-of-code. Dependi is looking into crates.io anyway ignoring git specification in [dependencies] section.

To Reproduce Steps to reproduce the behavior:

  1. In Rust project edit [dependencies] section of Cargo.toml to refer to 'advent-of-code' package. As a dependency use following line (i.e. specific git repository):
[dependencies]
advent-of-code = { git = "https://github.com/palcoo42/advent-of-code.git",   version = "1.0.0" }
  1. Check the output in the UI where failed version X 2022.0.66 is shown (refer to the screenshot below)

Expected behavior Dependi should search for a package in git repository instead of official Rust crates.io showing versions from the git instead of crates.io.

Screenshots dependi_vs_code

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

MOzanGul commented 6 days ago

Hi @palcoo42, We checked this issue and found some valuable information in the Cargo documentations. Also we've seen that there are many types of declaring these git dependencies. In the light of this information, we plan to implement git dependency checks in a more generalized solution that will change the way we check dependencies in all languages. Since it is a big change we will not be doing this in the very near future. But we will try to implement it as fast as we can.

We will deploy a code that makes Dependi ignore the lines with git dependency declarations for the new version 0.7.13. Just to not have any issues regarding this. But as I said we will try to implement git dependency checks as fast as we can and we will delete the code that ignores the lines with git dependencies.

You can check these links in Cargo documentation: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#the-role-of-the-version-key https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#multiple-locations

palcoo42 commented 6 days ago

Hi,

Thanks for info. This issue is not that huge deal for me as I can live with it, but hearing that you will fix it in the future version is great.

Thanks, palcoo