killercup / killercup/cargo-edit

`cargo upgrade` fails with private registry and with features w/ dependencies

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

Description

Hi there,

I work in an offline environment where I only have access to a private crates repository. My `~/.cargo/config.toml` looks like this:
```toml
[source.crates-io]
replace-with = "my-private-mirror"

[source.my-private-mirror]
registry = "sparse+https//my-rust-registry/sparse/rust-index"
```
And my local `Cargo.toml` has dependencies with features like `clap = { version = "4.5", features = ["derive"] }`. But when I try to use `cargo upgrade`, it fails with
```
Checking my_crate's dependencies
Error: trailing characters at line 1 column 498
```
When I remove features, and just use plain version, it succeeds. Is there some config I need to do in order to get this work nicely?

Contributor guide

Open the contributing guide

Research direction

Reproduce `cargo upgrade` using the shown `~/.cargo/config.toml` private registry and the `Cargo.toml` dependency with the `derive` feature. Start by tracing how the command reads registry metadata and dependencies with features enabled; done means the upgrade works in this offline setup without the trailing-characters error.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.