panamax-rs / panamax

Mirror rustup and crates.io repositories, for offline Rust and cargo usage.
Apache License 2.0
427 stars 45 forks source link

Unable to `cargo search` against panamax mirror #129

Open alexjbuck opened 3 months ago

alexjbuck commented 3 months ago

When trying to use the cargo search command, I get this error:

$ cargo search <crate>
error: crates-io is replaced with non-remote-registry source registry `panamax`;
include `--registry crates-io` to use crates.io

I have set both environment variables:

RUSTUP_DIST_SERVER=http://127.0.0.1:8080"
RUSTUP_UPDATE_ROOT=http://127.0.0.1:8080/rustup"

This is my .cargo/config.toml:

[source.panamax]
registry = "http://127.0.0.1:8080/git/crates.io-index"
[source.panamax-sparse]
registry = "sparse+http://127.0.0.1:8080/index/"

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

And I edited mirror.toml to have the base_url be http://127.0.0.1:8080/crates.

Despite that, cargo search <crate> doesn't seem like it will search against the local panamax instance.

I couldn't find anything in the Readme or elsewhere that indicated whether or not cargo search should work with Panamax, but it seems like it would be a useful feature to have if its not yet supported.

k3d3 commented 3 months ago

Hey,

Unfortunately cargo search does not work with the mirror.

Implementing it, while useful, would be a pretty big endeavour that I unfortunately don't have the bandwidth to take on right now.

I'd happily accept a PR for it though.

alexjbuck commented 3 months ago

Okay! I can't say I'll look into it soon, but good to know that it doesn't. At a minimum I might push a docs PR that states that cargo search doesn't work with this mirror.

Thanks for the super quick response!