Skip to content
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

doc: Hide cargo-fetch description in offline man page #13364

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

linyihai
Copy link
Contributor

What does this PR try to resolve?

Fixes #13232

How should we test and review this PR?

Suggest review commit by commit.

Additional information

r? @weihanglo

@rustbot rustbot added A-cli Area: Command-line interface, option parsing, etc. A-cli-help Area: built-in command-line help A-documenting-cargo-itself Area: Cargo's documentation Command-fetch S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 29, 2024
@@ -2,6 +2,7 @@
{{~*set command="fetch"}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For each command there should be a command variable available, so guess we can check if it is fetch and exclude the self-referential part.

Some place not set command, like cargo-vendor.md, cargo-verify-project.md.

@@ -9,6 +9,7 @@ pub fn cli() -> Command {
.arg_silent_suggestion()
.arg_target_triple("Fetch dependencies for the target triple")
.arg_manifest_path()
.arg(flag("offline", "Run without accessing the network").hide(true))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be used to test if all packages are fetched. Unsure if its worth showing for that reason or not.

If we hide it, should we also have the command say its deprecated when used?

Copy link
Contributor Author

@linyihai linyihai Jan 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm solving the wrong problem, although my first impression is that this option is really not used.

network and the network is not available. With this flag, Cargo will
attempt to proceed without the network if possible.

Beware that this may result in different dependency resolution than
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beware that this may result in different dependency resolution than
Comment online mode

Haven't tested it. If this statement is true, we may want to keep this, as it makes a huge difference between with and without --offline.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the cargo-fetch(1)
command to download dependencies before going offline.

I may have taken too big a step, and the original problem may have just been to remove this

@linyihai linyihai force-pushed the fetch-remove-offline branch from b745dbb to 2e0c1ac Compare January 30, 2024 07:10
@linyihai linyihai changed the title doc: Hide offline flag for cargo-fetch doc: Hide cargo-fetch description in offline man page Jan 30, 2024
@linyihai linyihai force-pushed the fetch-remove-offline branch from 2e0c1ac to 333e8da Compare January 30, 2024 07:16
@@ -18,8 +18,10 @@ proceed without the network if possible.
Beware that this may result in different dependency resolution than online
mode. Cargo will restrict itself to crates that are downloaded locally, even
if there might be a newer version as indicated in the local copy of the index.
{{#if (ne no-fetch-in-offline true)}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this work?

Suggested change
{{#if (ne no-fetch-in-offline true)}}
{{#if (ne command "fetch")}}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it works. I should have tried this before, but it didn't work.

@linyihai linyihai force-pushed the fetch-remove-offline branch from 333e8da to c028c72 Compare January 31, 2024 01:18
@weihanglo
Copy link
Member

Thanks!

@bors r+

@bors
Copy link
Contributor

bors commented Jan 31, 2024

📌 Commit c028c72 has been approved by weihanglo

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 31, 2024
@bors
Copy link
Contributor

bors commented Jan 31, 2024

⌛ Testing commit c028c72 with merge e1ebce1...

@bors
Copy link
Contributor

bors commented Jan 31, 2024

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing e1ebce1 to master...

1 similar comment
@bors
Copy link
Contributor

bors commented Jan 31, 2024

☀️ Test successful - checks-actions
Approved by: weihanglo
Pushing e1ebce1 to master...

@bors bors merged commit e1ebce1 into rust-lang:master Jan 31, 2024
20 checks passed
@bors
Copy link
Contributor

bors commented Jan 31, 2024

👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request.

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 5, 2024
Update cargo

24 commits in 7bb7b539558dc88bea44cee4168b6269bf8177b0..cdf84b69d0416c57ac9dc3459af80dfb4883d27a
2024-01-20 00:15:32 +0000 to 2024-02-02 19:39:16 +0000
- Apply `-Zpanic-abort-tests` to doctests too (rust-lang/cargo#13388)
- Don't print rustdoc command lines on failure by default (rust-lang/cargo#13387)
- Ensure `nonzero_exit_code` test isn't affected by developers `RUST_BACKTRACE` setting (rust-lang/cargo#13385)
- Add `docsrs` cfg as a well known `--check-cfg` (rust-lang/cargo#13383)
- fix(new): Print a note, rather than a comment, for more information (rust-lang/cargo#13371)
- Change tests to support changes to suggestion (rust-lang/cargo#13382)
- chore(ci): enable m1 runner (rust-lang/cargo#13377)
- fix(toml): Improve map/sequence error message (rust-lang/cargo#13376)
- fix(diagnostic): Don't panic on empty spans (rust-lang/cargo#13375)
- doc: Hide `cargo-fetch` description in offline man page (rust-lang/cargo#13364)
- feat: stabilize lockfile v4 (rust-lang/cargo#12852)
- fix(new): Print a 'Creating', rather than 'Created' status (rust-lang/cargo#13367)
- fix: use spec id instead of name to match package (rust-lang/cargo#13335)
- refactor(shell): Use new fancy anstyle API (rust-lang/cargo#13368)
- feat(cargo-update): `--precise` to allow yanked versions (rust-lang/cargo#13333)
- refactor: remove unnecessary Option in `Freshness::Dirty` (rust-lang/cargo#13361)
- doc: Replace version with `latest` for jobserver link (rust-lang/cargo#13366)
- test: data layout fix for `x86_64-unknown-none-gnu` (rust-lang/cargo#13362)
- docs(ref): Try to improve reg auth docs (rust-lang/cargo#13351)
- fix typo of rustbuild, instead of rustuild (rust-lang/cargo#13357)
- fix(config): Deprecate non-extension files (rust-lang/cargo#13349)
- fix(cli): Improve errors related to cargo script (rust-lang/cargo#13346)
- fix list option description starting with uppercase (rust-lang/cargo#13344)
- Fix typo in test (rust-lang/cargo#13342)
@rustbot rustbot added this to the 1.78.0 milestone Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-cli Area: Command-line interface, option parsing, etc. A-cli-help Area: built-in command-line help A-documenting-cargo-itself Area: Cargo's documentation Command-fetch S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargo fetch --offline documentation directs user to use cargo fetch --offline
5 participants