You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Respect --frozen everywhere --offline or --locked is accepted (#15263)
### What does this PR try to resolve?
Fixes#15239
This also makes `--frozen` be respected in more situations, including
* `cargo add`
* `cargo install`
* Git fetches
* HTTP registry access
### How should we test and review this PR?
To prevent this from happening again, I removed `offline()` and
`locked()` accessors. To maintain the quality of error messages, I added
`offline_flag()` and `locked_flag()` that will pick up `--frozen`, if
present.
### Additional information
[ERROR] no matching package named `not_cached_dep` found
185
185
location searched: crates.io index
186
186
required by package `bar v0.1.0 ([ROOT]/bar)`
187
-
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without the offline flag.
187
+
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without `--offline`.
188
188
189
189
"#]])
190
190
.run();
@@ -195,7 +195,7 @@ As a reminder, you're using offline mode (--offline) which can sometimes cause s
195
195
[ERROR] no matching package named `not_cached_dep` found
196
196
location searched: crates.io index
197
197
required by package `bar v0.1.0 ([ROOT]/bar)`
198
-
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without the offline flag.
198
+
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without `--offline`.
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without the offline flag.
391
+
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without `--offline`.
392
392
393
-
"]])
393
+
"#]])
394
394
.run();
395
395
}
396
396
@@ -607,7 +607,7 @@ candidate versions found which didn't match: 1.0.0
607
607
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
608
608
required by package `foo v0.1.0 ([ROOT]/foo)`
609
609
perhaps a crate was updated and forgotten to be re-vendored?
610
-
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without the offline flag.
610
+
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without `--offline`.
611
611
612
612
"#]]
613
613
)
@@ -754,7 +754,7 @@ fn main(){
754
754
[ERROR] no matching package named `present_dep` found
755
755
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
756
756
required by package `foo v0.1.0 ([ROOT]/foo)`
757
-
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without the offline flag.
757
+
As a reminder, you're using offline mode (--offline) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without `--offline`.
[ERROR] failed to get `foo` as a dependency of package `bar v0.5.0 ([ROOT]/foo)`
2436
-
2437
-
Caused by:
2438
-
failed to query replaced source registry `crates-io`
2439
-
2440
-
Caused by:
2441
-
attempting to make an HTTP request, but --frozen was specified
2434
+
[ERROR] no matching package named `foo` found
2435
+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
2436
+
required by package `bar v0.5.0 ([ROOT]/foo)`
2437
+
As a reminder, you're using offline mode (--frozen) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without `--frozen`.
[ERROR] failed to get `foo` as a dependency of package `bar v0.5.0 ([ROOT]/foo)`
2471
-
2472
-
Caused by:
2473
-
failed to load source for dependency `foo`
2474
-
2475
-
Caused by:
2476
-
Unable to update registry `crates-io`
2477
-
2478
-
Caused by:
2479
-
failed to update replaced source registry `crates-io`
2480
-
2481
-
Caused by:
2482
-
attempting to make an HTTP request, but --frozen was specified
2466
+
[ERROR] no matching package named `foo` found
2467
+
location searched: `dummy-registry` index (which is replacing registry `crates-io`)
2468
+
required by package `bar v0.5.0 ([ROOT]/foo)`
2469
+
As a reminder, you're using offline mode (--frozen) which can sometimes cause surprising resolution failures, if this error is too confusing you may wish to retry without `--frozen`.
0 commit comments