cargo-edit icon indicating copy to clipboard operation
cargo-edit copied to clipboard

Custom registry with port - The directory name is invalid

Open MarkRx opened this issue 3 years ago • 0 comments

If using a custom registry that has a port specified the cargo-upgrade upgrade command will fail due to attempting to create a directory with a ':' in the name. It looks like cargo strips out the port when creating directories in the registry. The cargo-edit command should do the same.

$ cargo-upgrade upgrade Error: failed to make directory 'C:\Users\mrichar2\.cargo\registry/index\myregistry.com:8081-0224531983076253': The directory name is invalid. ; class=Os (2)

Caused by: failed to make directory 'C:\Users\mrichar2\.cargo\registry/index\myregistry.com:8081-0224531983076253': The directory name is invalid. ; class=Os (2)

~/.cargo/config.toml:

[registry]
default = "artifactory"

[registries.artifactory]
index = "http://myregistry.com:8081/artifactory/git/crates-remote.git"

[source.artifactory]
registry = "http://myregistry.com:8081/artifactory/git/crates-remote.git"

[source.crates-io]
replace-with = "artifactory"

The index directory appears to be named "myregistry.com-0224531983076253" instead of "myregistry.com:8081-0224531983076253"

MarkRx avatar Jul 29 '22 13:07 MarkRx