killercup / killercup/cargo-edit

Custom registry with port - The directory name is invalid

Open
#758 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
3.5k
Forks
166
PR merge metrics
No merged PRs in 30d

Description

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"

Contributor guide

Open the contributing guide

Research direction

Start by reproducing `cargo-upgrade upgrade` with the provided custom registry configuration on Windows, then trace how the registry index URL becomes a directory name. Compare the generated path with Cargo's `myregistry.com-0224531983076253` naming. Done means the command handles registry URLs containing ports without creating an invalid directory name.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.