-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Source Replacement not working #107
Comments
Tested this locally, but if you would be so kind as to check if the newest |
It works on Linux and Windows MSVC. On macOS (both stable and nightly), it still picks the default config. Cargo versions are all |
Hmm, can you apply the following patch and post the output? diff --git a/src/main.rs b/src/main.rs
index d3cba3d17..3a1f74908 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -69,10 +69,12 @@ fn actual_main() -> Result<(), i32> {
}
let registry_url = cargo_update::ops::get_index_url(&crates_file);
+ println!("registry_url {}", registry_url);
let registry = cargo_update::ops::get_index_path(&opts.cargo_dir.1, Some(®istry_url)).map_err(|e| {
println!("Couldn't get package repository: {}.", e);
2
})?;
+ println!("registry {:?}", registry);
let mut registry_repo = Repository::open(®istry).map_err(|_| {
println!("Failed to open registry repository at {}.", registry.display());
2
diff --git a/src/ops/mod.rs b/src/ops/mod.rs
index 359ee6271..865556633 100644
--- a/src/ops/mod.rs
+++ b/src/ops/mod.rs
@@ -796,8 +796,11 @@ pub fn get_index_url(crates_file: &Path) -> Cow<'static, str> {
}
fn get_index_url_impl(crates_file: &Path) -> Option<String> {
+ println!("crates_file {:?}", crates_file);
let config = fs::read_to_string(crates_file.with_file_name("config")).ok()?;
+ println!("config {}", config);
let config = toml::from_str::<toml::Value>(&config).ok()?;
+ println!("config {:#?}", config);
let sources = config.get("source")?;
|
I fixed a typo in Thanks for your help. |
Released in |
According to The Cargo Book, Cargo supports the ability to replace one source with another.
Below is my
~/.cargo/config
:When executing
cargo install
, Cargo downloads from custom source.When executing
cargo install-update
, Cargo downloads from the default source.The text was updated successfully, but these errors were encountered: