这是indexloc提供的服务,不要输入任何密码
Skip to content

cannot publish with sparse registries #146

@j-baker

Description

@j-baker

When I try to publish with sparse registries, I get:

error: crates index error: Protocol Ext("sparse+https") of url "sparse+https://$MY_REGISTRY" is denied per configuration

If I github code search for this, I find this error has come from gitoxide, https://github.com/search?q=%22is+denied+per+configuration%22&type=code, which is the library Cargo uses to talk to git repositories.

This makes me believe that cargo-workspace-publish is trying to publish using a non-sparse URL.

Looking at https://github.com/pksunkara/cargo-workspaces/blob/master/cargo-workspaces/src/publish.rs#L112, it looks like registry+ is prepended to every url, meaning that with my sparse registry, the url being passed to the is_published check happening in the publish is registry+sparse+https://$MY_REGISTRY which is invalid and so passed through as a git check.

I think that blanket prepending registry+ is an incorrect algorithm. My suspicion is that this check should be skipped as for larger registries it would tend to take an unnecessarily large amount of time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions