serayuzgur / crates

crates is an extension aims to help people to manage their dependencies for rust (crates.io & TOML).
https://marketplace.visualstudio.com/items?itemName=serayuzgur.crates
MIT License
238 stars 37 forks source link

Failed to find crates version with metadata #195

Closed inflation closed 1 year ago

inflation commented 1 year ago

Describe the bug I'm using the metadata part of SemVer to keep tracking of the linked C library version, e.g., jpegxl-sys 0.8.2+libjxl-0.8.2, after a certain version, 0.6.1. Now, the plugin only recognized versions before the change.

To Reproduce Steps to reproduce the behavior:

  1. Depend on jpegxl-sys = 0.8.2
  2. The plugin suggests the latest version is 0.6.1

Expected behavior The plugin should suggests 0.8.2 and show versions after 0.6.1

Screenshots

CleanShot 2023-07-04 at 20 23 54@2x image

Desktop (please complete the following information):

JohnScience commented 1 year ago

@inflation Check the value of crates.localCargoIndexHash configuration key. It must be index.crates.io-6f17d22bba15001f instead of github.com-1ecc6299db9ec823. It's related to usage of sparse protocol.

inflation commented 1 year ago

@JohnScience Still happens after the changes, but I found out that enable crates.listPreReleases would show those versions. However, they're not pre-release per se.

serayuzgur commented 1 year ago

Since there are many issues going related with this, we have our own index server now. No more local checks with v0.6.0. Please check again since prerelase option only filters according to the "-" in the version and nothing to do with name

inflation commented 1 year ago

Now I can't even retrieve the versions:

Completed with errors
derive_builder: Error: read ECONNRESET
image: Error: read ECONNRESET
thiserror: Error: read ECONNRESET
half: Error: read ECONNRESET
byteorder: Error: read ECONNRESET
jpegxl-sys: Error: read ECONNRESET
image: Error: read ECONNRESET
lcms2: Error: read ECONNRESET
testresult: Error: read ECONNRESET
criterion: Error: read ECONNRESET
ssrlive commented 1 year ago

Me too @inflation

Completed with errors
as-any: Error: connect ETIMEDOUT 24.199.121.34:443
async-trait: Error: connect ETIMEDOUT 24.199.121.34:443
byteorder: Error: connect ETIMEDOUT 24.199.121.34:443
bytes: Error: connect ETIMEDOUT 24.199.121.34:443
thiserror: Error: connect ETIMEDOUT 24.199.121.34:443
tokio: Error: connect ETIMEDOUT 24.199.121.34:443
clap: Error: connect ETIMEDOUT 24.199.121.34:443
dotenvy: Error: connect ETIMEDOUT 24.199.121.34:443
env_logger: Error: connect ETIMEDOUT 24.199.121.34:443
log: Error: connect ETIMEDOUT 24.199.121.34:443
rand: Error: connect ETIMEDOUT 24.199.121.34:443
tokio: Error: connect ETIMEDOUT 24.199.121.34:443
trust-dns-proto: Error: connect ETIMEDOUT 24.199.121.34:443

image

serayuzgur commented 1 year ago

What is the current status?

inflation commented 1 year ago

What is the current status?

Same as before. The path should be the same so I could at least try to use the official URL or a mirror. But now it's 404 if I manually set the URL.

serayuzgur commented 1 year ago

What is the current status?

Same as before. The path should be the same so I could at least try to use the official URL or a mirror. But now it's 404 if I manually set the URL.

API is not and will not be same with crates.io, due to some optimizations.

The question is why you are having this issue and lets focus on this. please try to access to a sample URL like https://api.crates-vsc.space/index/versions/weld from browser. If you fail try with a VPN. If it succeeds it means it is ISP

Can you please share your cargo TOML or, share the dependency count in it ?

ssrlive commented 1 year ago

image

inflation commented 1 year ago
image

Can't access the server. It would be great to have an option to use the official index URL format, which is also working on all mirrors by default.

BarbossHack commented 1 year ago

API is not and will not be same with crates.io, due to some optimizations.

What are these optimisations ? Just for the Json unnecessary fields ? https://github.com/serayuzgur/crates/issues/197#issuecomment-1637195184

serayuzgur commented 1 year ago

API is not and will not be same with crates.io, due to some optimizations.

What are these optimisations ? Just for the Json unnecessary fields ? #197 (comment)

Caching , slicing, requesting multiple crates at once (in progress)

serayuzgur commented 1 year ago

image

@ssrlive The browser is functioning properly, indicating that there might be an issue with Vsc's connection. Do you have any specific settings related to it, such as a proxy or other configurations?

serayuzgur commented 1 year ago

Can't access the server. It would be great to have an option to use the official index URL format, which is also working on all mirrors by default.

See https://github.com/serayuzgur/crates/issues/197#issuecomment-1636997383

BarbossHack commented 1 year ago

Caching , slicing, requesting multiple crates at once (in progress)

Looks promising, thanks :+1:

inflation commented 1 year ago

@serayuzgur Well, then it's unusable for me now. See my previous comment, I can reach whatever network the server is sitting but not itself.

May I suggest to try another cloud provider?

ssrlive commented 1 year ago

yes. I'm in china. so I have to modify hosts file to avoid dns pollution.

and here is the crates plugin settings image

... Do you have any specific settings related to it, such as a proxy or other configurations?

serayuzgur commented 1 year ago

@inflation, it is possible. The server is hosted on DigitalOcean SF3. Are there any specific issues associated with this data center?

@ssrlive maybe you have to configure your vsc like your browser, can you check ? https://code.visualstudio.com/docs/setup/network

ssrlive commented 1 year ago

Perfect. I hope you write it to you readme file.

image

serayuzgur commented 1 year ago

@ssrlive, please don't hesitate to create a pull request (PR). Feel free to explain it in your own words within the PR.

azusachino commented 1 year ago

I just switch back to 0.5.11, and it still works perfect fine. image

golanguage commented 1 year ago

I have this issue and have not any proxys. So back to 0.5.11 also.

buf1024 commented 1 year ago

yes. I'm in china. so I have to modify hosts file to avoid dns pollution.

and here is the crates plugin settings image

... Do you have any specific settings related to it, such as a proxy or other configurations?

这样的解决办法并不好,因为在中国使用的境内的镜像加速,而设置全局代理,这加速镜像等于白干了。

ssrlive commented 1 year ago

My final solution in Windows. Please use sstap with a proxy server. image

inflation commented 1 year ago

After upgrading to v0.6.2 and using the sparse index, this issue still presents. Versions with metadata still wrongly marked as pre-releases.

BarbossHack commented 1 year ago

Hi @inflation I don't have my laptop right now, so could you enable crates.listPreReleases in vscode settings, and see what happens ?

inflation commented 1 year ago

Hi @inflation I don't have my laptop right now, so could you enable crates.listPreReleases in vscode settings, and see what happens ?

It lists all versions with metadata, both "real pre-release" like 0.8.1-alpha+libjxl-0.8.1 and stable ones like 0.8.2+libjxl-0.8.2. My guess is that it detects "-" as an identifier.

BarbossHack commented 1 year ago

My guess is that it detects "-" as an identifier.

Indeed, it must be something like this 👍 I will have time to look at this in a few days (if not already fixed in the meantime)

BarbossHack commented 1 year ago

https://github.com/serayuzgur/crates/blob/49e1d65545fd448ad2b5aff423a7e5c4c1388cda/src/core/fetcher.ts#L51

golanguage commented 7 months ago

For China user, this setting is working. "crates.indexServerURL": "https://rsproxy.cn/index/"

And https://rsproxy.cn/ shows how to use this mirror instead of officil crate index server for rustup and cargo.

golanguage commented 7 months ago

yes. I'm in china. so I have to modify hosts file to avoid dns pollution. and here is the crates plugin settings image

... Do you have any specific settings related to it, such as a proxy or other configurations?

这样的解决办法并不好,因为在中国使用的境内的镜像加速,而设置全局代理,这加速镜像等于白干了。 "crates.indexServerURL": "https://rsproxy.cn/index/"