-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fail to compile dependencies which in turn have renamed dependencies #14148
Comments
Link to urlo thread here |
Can you check the index entries of your registry to verify that they are correct? I'm uncertain of the best way for you to do that, but if the registry supports the sparse protocol, it would be something like fetching Some registries have had issues with generating the index correctly for renamed deps. There is a section below https://doc.rust-lang.org/cargo/reference/registry-index.html#json-schema which explains some of the subtle concerns registry implementers should consider. |
I assume this is incorrect? https://my-gitea-domain/api/packages/SomeOwner/cargo/re/na/rename_deps : {"name":"rename_deps","vers":"0.1.2","deps":[{"name":"embedded-hal","req":"^0.2.7","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null}],"cksum":"5a4e09f3752e42de84106f0f3b3e219eb553c78ade6ba0f4473fd5b744d18572","features":{},"yanked":false} same thing formatted: {
"name": "rename_deps",
"vers": "0.1.2",
"deps": [
{
"name": "embedded-hal", // <-- Should have been my new name?
"req": "^0.2.7",
"features": [],
"optional": false,
"default_features": true,
"target": null,
"kind": "normal",
"registry": "https://github.com/rust-lang/crates.io-index",
"package": null // <-- Should be "embedded-hal"?
}
],
"cksum": "5a4e09f3752e42de84106f0f3b3e219eb553c78ade6ba0f4473fd5b744d18572",
"features": {},
"yanked": false
} |
Not sure how things work, but ~/.cargo/registry/src/my-very-secret-gitea-registry/rename_deps-0.1.2/Cargo.toml contains the correct things right? [package]
edition = "2021"
name = "rename_deps"
version = "0.1.2"
publish = ["gitea"]
[dependencies.embedded-hal-0-2]
version = "0.2.7"
package = "embedded-hal" |
Yea, it looks like the registry doesn't support renamed dependencies. You might want to follow up with them.
Yea, the manifest looks correct. However, cargo uses the data from the index for doing resolution. |
Oh, ok.
Ok, I will give it a try. Sorry for the noise and thanks for the help! :) Feel free to close if you believe this issue is on the registry's side of things |
I have had another gitea and/or cargo related issue. Not sure where the issue lies here either. Not sure if this is in any way related so please let me know if you prefer I open a new issue. I have another package in the same registry(with no renamed deps). I have successfully published Published a new version
|
You'll need to verify that the registry's index got updated (using the similar approach above of fetching the index entry manually using something like curl). The message here:
indicates that the index was not updated. The reason |
I'm going to close since these seem like gitea issues. I recommend following up with them. |
Here are the last working version and the first problematic version, side by side from https://my-gitea-domain/api/packages/SomeOwner/cargo/fu/nc/function-generator [older versions here]
{"name":"function-generator","vers":"0.1.5-alpha.1","deps":[{"name":"atomic","req":"^0.5.3","features":[],"optional":false,"default_features":false,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"const_soft_float","req":"^0.1.4","features":["no_std"],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"defmt","req":"^0.3","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"embedded-hal","req":"^0.2.7","features":["unproven"],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"embedded-svc","req":"^0.24.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"fixed","req":"^1.22.1","features":["num-traits","serde"],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"json","req":"^0.12.4","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"log","req":"^0.4.17","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"micromath","req":"^2.0.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"nb","req":"^1.0.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"num-traits","req":"^0.2.15","features":[],"optional":false,"default_features":false,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"pid","req":"^4.0.1-alpha.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":null,"package":null},{"name":"serde","req":"^1.0","features":["derive"],"optional":true,"default_features":false,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"serde_json","req":"^1.0.83","features":[],"optional":true,"default_features":false,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"stm32g0xx-hal","req":"^0.2.1-alpha.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal","registry":null,"package":null},{"name":"stm32g4xx-hal","req":"^0.0.3-alpha.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal","registry":null,"package":null},{"name":"anyhow","req":"^1","features":[],"optional":false,"default_features":true,"target":null,"kind":"build","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"embuild","req":"^0.31.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"build","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"npm_rs","req":"^0.2.1","features":[],"optional":true,"default_features":true,"target":null,"kind":"build","registry":"https://github.com/rust-lang/crates.io-index","package":null}],"cksum":"0faa7a51521db3da51849be01e847273b05daad989518cf20e6f6f0840a722c2","features":{"default":[],"std":[],"stm32g030":["stm32g0xx-hal/stm32g030"],"stm32g474":["stm32g4xx-hal/stm32g474"]},"yanked":false}
{"name":"function-generator","vers":"0.2.0-alpha.0","deps":[{"name":"atomic","req":"^0.5.3","features":[],"optional":false,"default_features":false,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"const_soft_float","req":"^0.1.4","features":["no_std"],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"defmt","req":"^0.3","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"embedded-hal","req":"^0.2.7","features":["unproven"],"optional":true,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"embedded-svc","req":"^0.24.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"fixed","req":"^1.22.1","features":["num-traits","serde"],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"json","req":"^0.12.4","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"log","req":"^0.4.17","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"micromath","req":"^2.0.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"nb","req":"^1.0.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"num-traits","req":"^0.2.15","features":[],"optional":false,"default_features":false,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"pid","req":"^4.0.1-alpha.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal","registry":null,"package":null},{"name":"serde","req":"^1.0","features":["derive"],"optional":true,"default_features":false,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"serde_json","req":"^1.0.83","features":[],"optional":true,"default_features":false,"target":null,"kind":"normal","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"stm32g0xx-hal","req":"^0.2.1-alpha.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal","registry":null,"package":null},{"name":"stm32g4xx-hal","req":"^0.0.3-alpha.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"normal","registry":null,"package":null},{"name":"anyhow","req":"^1","features":[],"optional":false,"default_features":true,"target":null,"kind":"build","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"embuild","req":"^0.31.0","features":[],"optional":true,"default_features":true,"target":null,"kind":"build","registry":"https://github.com/rust-lang/crates.io-index","package":null},{"name":"npm_rs","req":"^0.2.1","features":[],"optional":true,"default_features":true,"target":null,"kind":"build","registry":"https://github.com/rust-lang/crates.io-index","package":null}],"cksum":"1deba9ce69b5f1e018ab8ef08566312e11c2365d36a2f5e1f98060c1abb41003","features":{"default":[],"e-hal-v02":["embedded-hal-0-2"],"std":[],"stm32g030":["stm32g0xx-hal/stm32g030"],"stm32g474":["stm32g4xx-hal/stm32g474"]},"yanked":false}
[newer non-working versions here] Any ideas as to why |
How would I test this/find information about how to test this beyond the above? |
After publishing, cargo tries for 1 minute to verify that the package shows up in the index. The So, the method to test it would be to One way this can happen is if the index is served by a webserver that does caching. If the registry does not invalidate the cache, then you will get stale entries for as long as the cache entry stays live. There is information for registry implementers about caching and cache invalidation at https://doc.rust-lang.org/nightly/cargo/reference/registry-index.html#caching. |
So that should be what I did in my comment above? However as far as I can tell, that does show the new versions that |
The result from the search api at: http://my-gitea-domain/api/packages/SomeOwner/cargo/api/v1/crates?q=function-generator {"crates":[{"name":"function-generator","max_version":"0.2.0-alpha.2","description":""}],"meta":{"total":1}} which matches the version of my latest attempted push which is also present in the full list from which I in my comment above only showed two lines(the index page actually showed all) |
Is there anything else that could explain why I have also deleted
|
Problem
I have two cargo projects, lets call them "the_bin" and "rename_deps".
"rename_deps" has a renamed dependency:
This is then what gets published to my private registry
Compiling this works fine. I have then published this to my own private cargo registry(gitea). The publish check thing passes with no errors.
I then create a new binary project "the_bin", add "rename_deps" as dependency. And now cargo build fails to compile "rename_deps" when running
cargo build
on "the_bin". Same thing but withrename_deps { path = "some-path" }
orgit =
and it compiles fine again.Steps
Possible Solution(s)
Since what I receive from my registry seems correct this is likely not due to me using a private registry I think?
Notes
This is what gets published to my private registry (ignoring the comments)
Version
The text was updated successfully, but these errors were encountered: