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

cargo registry - Renamed dependencies does not get renamed #31500

Open
usbalbin opened this issue Jun 26, 2024 · 4 comments
Open

cargo registry - Renamed dependencies does not get renamed #31500

usbalbin opened this issue Jun 26, 2024 · 4 comments

Comments

@usbalbin
Copy link

Description

When publishing a crate with a renamed dependency

# Cargo.toml

[package]
name = "rename_deps"
version = "0.1.2"
edition = "2021"
publish = ["gitea"]

[dependencies]
embedded-hal-0-2 = { package = "embedded-hal", version = "0.2.7" } # <-- embedded-hal renamed to embedded-hal-0-2

The registry does not reflect the fact that the dependency is renamed 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
}

I posted the same issue in rust-lang/cargo#14148 leading me here. I have not tried this on demo.gitea.com

Gitea Version

1.22.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

Whatever is in the docker image

Operating System

Debian 12

How are you running Gitea?

  • docker image: gitea/gitea:1.22.0-rootless

Database

MySQL/MariaDB

@techknowlogick
Copy link
Member

Thanks @usbalbin, has this been working previously, or has it always been like this? (If you haven’t tried this before and don’t know that’s ok)

@usbalbin
Copy link
Author

usbalbin commented Jul 9, 2024

I first tried the same thing with 1.21.something (can probably look up the patch version if needed) but it did not work either

@KN4CK3R
Copy link
Member

KN4CK3R commented Jul 9, 2024

@techknowlogick That's not implemented. I didn't know that was possible. I will send a PR when I got time for it.

@usbalbin
Copy link
Author

I have found another issue. Not sure if it is gitea or cargo. In case it is related https://forum.gitea.com/t/published-cargo-crate-version-not-available/9365

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

No branches or pull requests

3 participants