Commit graph

13800 commits

Author SHA1 Message Date
Eric Huss 7e4764a56b Add more information to wait-for-publish 2023-03-15 08:15:00 -07:00
Eric Huss 7b19a6e8ef Add some more publish timeout tests 2023-03-15 08:15:00 -07:00
Eric Huss 5bea4abb72 Add ability to silence Source updates.
This adds the ability to silence Source status messages and progress bars.
This is intended to be used with the publish "wait for available"
system, which causes sources to repeatedly update which ends up spamming
the terminal.
2023-03-15 08:15:00 -07:00
Eric Huss 261249a5e4 Add documentation for progress bars. 2023-03-15 08:15:00 -07:00
bors ff1e4ebaf0 Auto merge of #11850 - epage:file, r=weihanglo
docs(contrib): Create a file overview in the nightly docs

This is a follow up to #11809.

On top of what was in the old contrib, I added links out for `.cargo/config.toml`.  I'm assuming there are more files that would be worth indexing here but we can add those over time.

My focus was on linking to the high-detail documentation.  In some cases, this meant increasing visibility to make rustdoc happy.  In the registry case, `sources::registry` is a great document to link to so I instead dropped links that rustdoc couldn't handle as they were to details covered in the bigger document or can easily be derived from it.

The rest of the file docs will need to be handled in a different way as they are details for people implementing file system interactions.
2023-03-15 13:46:20 +00:00
bors 4a3c588b1f Auto merge of #11848 - weihanglo:rmrf, r=epage
ci: make clean-test-output a script for reuse
2023-03-14 14:05:36 +00:00
Weihang Lo 6712c513b5
ci: remove redundant CARGO_REGISTRIES_CRATES_IO_PROTOCOL 2023-03-14 11:21:30 +00:00
Weihang Lo c70fac0bc5
ci: make clean-test-output a script for reuse 2023-03-14 10:59:59 +00:00
bors 9282cf74a3 Auto merge of #11839 - djc:downgrading-status, r=weihanglo
Accurately show status when downgrading dependencies

### What does this PR try to resolve?

A few times now I've ran into issues where Cargo ends up downgrading a dependency in order to satisfy a pinned dependency somewhere in the dependency graph. Unfortunately this is not clear in the output of `cargo update`, which just shows all the changed dependencies as `Updating`.

References:

* #5702
* [Finding a pinned dependency edge](https://users.rust-lang.org/t/finding-a-pinned-dependency-edge/81157)
* https://github.com/tokio-rs/axum/issues/1814

### How should we test and review this PR?

This is a small change that tries to make dependency downgrades stand out more in the output of `cargo update`. I have not added any new tests since the existing tests seem to cover this functionality.

Some tests still fail, these refer to Git dependencies. I'm honestly not sure how to handle these, so I'd like to get some feedback on this before I fix those tests up. Git commits form a DAG, so one option is to see if the new commit is an ancestor of the old one (mark as "updating"), if the old commit is an ancestor of the new one (mark as "downgrading"), or neither (could be from parallel branches) we could compare based on timestamp in that case.

### To do

* Fix up tests for Git dependency updates
2023-03-14 01:01:48 +00:00
Ed Page 9836deb629 docs(contrib): Create a file overview in the nightly docs
This is a follow up to #11809.

On top of what was in the old contrib, I added links out for
`.cargo/config.toml`.  I'm assuming there are more files that would be
worth indexing here but we can add those over time.

My focus was on linking to the high-detail documentation.  In some
cases, this meant increasing visibility to make rustdoc happy.  In the
registry case, `sources::registry` is a great document to link to so I
instead dropped links that rustdoc couldn't handle as they were to
details covered in the bigger document or can easily be derived from it.

The rest of the file docs will need to be handled in a different way as
they are details for people implementing file system interactions.
2023-03-13 19:50:46 -05:00
bors 71ea049a4f Auto merge of #11842 - epage:design, r=ehuss
docs(contrib): Move Design Principles earlier in the book

This is the framing by which all contributions should happen, so this should come first before getting into what is needed to know to implement a change and test it.

This is also prep for adding a new Implementations Practices section to pull out various tips spread through the Architecture section.  See #11841
2023-03-13 21:39:28 +00:00
bors 92751f9c89 Auto merge of #11841 - epage:contrib, r=weihanglo
docs(contrib): Point compilation docs to doc comments

This is a follow up to #11809, merging the description of compilation with what is in the source code, leaving a breadcrumb for people who were used to going to the old page (for now).  The new entry point for finding this is the doc comment in `lib.rs`

Like with #11809, this also meant increasing the visibility of a mod.  This mod is mostly re-exported already, so this doesn't seem too bad.  I pointed directly to the `job _queue` mod rather than `JobQueue` because the mod had more of an architecture discussion.  For `drain_the_queue`, I also pointed at the mod because it talks about it and this avoided making `DrainState` and `drain_the_queue` `pub(crate)`.

This still leaves
- Files
  - Part of this indexes the architecture based on files generated and should be in `lib.rs`
  - Part of this is filesystem best practices and should be moved out of the architecture overview into some kind of Implementation Practices
- Package and Resolution
- Console Output.  This also likely belongs in an Implementation section
- Likely stuff in the testing section
2023-03-13 20:38:52 +00:00
Ed Page 67ca847232 docs(contrib): Move Design Principles earlier in the book
This is the framing by which all contributions should happen, so this
should come first before getting into what is needed to know to
implement a change and test it.

This is also prep for adding a new Implementations Practices section to
pull out various tips spread through the Architecture section.  See #11841
2023-03-13 13:58:07 -05:00
Ed Page e14823174a docs(contrib): Point compilation docs to doc comments
I also verified that `src/cargo/lib.rs` points people to this location
for learning about compilation.
2023-03-13 13:21:44 -05:00
Dirkjan Ochtman 20a5d2b82f Accurately show status when downgrading dependencies 2023-03-13 13:29:30 +01:00
bors 9855f92494 Auto merge of #11835 - domsleee:git-install-bin-flag-hint, r=weihanglo
`cargo install --git` multiple packages with binaries found hint

### What does this PR try to resolve?
The issues discussed in: https://github.com/rust-lang/cargo/issues/4830

namely this one:
> 4. a multiple packages with binaries found error should give users a hint about how to specify a single crate

I think improving the error message to provide a suggestion is a simple change that would help a lot of people when this happens, sorry if I'm out of line for just opening a PR here :)

### Before
cargo 1.68.0 (115f34552 2023-02-26)
![image](https://user-images.githubusercontent.com/14891742/224546157-d9b48bfd-f896-4fd1-9f0a-e04a3ad60ae2.png)

### After
![image](https://user-images.githubusercontent.com/14891742/224546182-d4b451ae-1b28-41b6-9d74-db860532512b.png)

### Additional information

I added in a related test documenting existing behaviours
* multiple_examples_error: "multiple packages with examples found" (i.e. not "binaries")

I added these tests which aren't necessarily related to this PR, but could be considered if the behaviour were to change
* `multiple_binaries_deep_select_uses_package_name`: it uses the name, not the path. Is this a problem for crates with the same name?
* `multiple_binaries_in_selected_package_installs_all`: so `--bins` is implied when a package is specified?
* `multiple_binaries_in_selected_package_with_bin_option_installs_only_one`: demonstrates a use case where `--bin` and `[crate]` are both used
2023-03-13 10:34:17 +00:00
Dom Slee 3363931f7f redundant escapes 2023-03-13 18:57:26 +11:00
Dom Slee ea27499a2e review comments 2023-03-13 17:54:45 +11:00
Dom Slee dc449bce6d cargo clippy + fmt 2023-03-12 23:52:45 +11:00
Dom Slee a668956dd7 improve error message and add related tests 2023-03-12 23:52:06 +11:00
bors d4249c923e Auto merge of #11830 - Byron:disable-auth-tests, r=weihanglo
Disable flaky auth tests when `gitoxide` runs them

The proper fix is in https://github.com/Byron/gitoxide/releases/tag/gix-v0.41.0
which unfortunately can't be used as it also comes with the latest `tempfile` v3.4
which causes other issues when compiling on some platforms.

Thus we first disable the flaky tests, and re-enable them with the `gix` upgrade
which should be possible once `tempfile` doesn't hinder `cargo` on some platforms
anymore.

Related to https://github.com/rust-lang/cargo/issues/11821

This PR is supposed to be followed up by #11831 which re-enables the flaky tests and fixes them properly by upgrading `gix` which contains the fix.
2023-03-11 23:25:45 +00:00
bors 7b2fabf785 Auto merge of #11825 - ehuss:cross-test-docs, r=weihanglo
Add some documentation on writing cross-compilation tests

This adds an overview of what you need to know to write tests that do cross-compilation.
2023-03-11 20:08:15 +00:00
bors 595cb112be Auto merge of #11829 - Muscraft:spaese-ci, r=weihanglo
chore: Use sparse protocol on stable CI

[Rust `1.68.0`](https://blog.rust-lang.org/2023/03/09/Rust-1.68.0.html) was released yesterday and it stabilized [Cargo's sparse protocol](https://blog.rust-lang.org/2023/03/09/Rust-1.68.0.html#cargos-sparse-protocol).

The protocol has been used in [CI on nightly](3c35bf10ad/.github/workflows/main.yml (L100-L102)) for some time. This PR enables the protocol for stable CI runs.
2023-03-11 17:28:46 +00:00
Sebastian Thiel c890c64080
Disable flaky tests for now (#11821)
The proper fix is in https://github.com/Byron/gitoxide/releases/tag/gix-v0.41.0
which unfortunately can't be used as it also comes with the latest `tempfile` v3.4
which causes other issues when compiling on some platforms.

Thus we first disable the flaky tests, and re-enable them with the `gix` upgrade
which should be possible once `tempfile` doesn't hinder `cargo` on some platforms
anymore.

Related to https://github.com/rust-lang/cargo/issues/11821
2023-03-10 19:45:22 +01:00
Scott Schafer b6205c95fd chore: Use sparse protocol on stable CI 2023-03-10 11:13:31 -06:00
bors 3c35bf10ad Auto merge of #11826 - weihanglo:cargo-add-target, r=epage
Notice for potential unexpected shell expansions in help text of `cargo-add`
2023-03-10 15:09:04 +00:00
Weihang Lo 4ec1885eda
doc: notice for shell expansions for cargo add/remove 2023-03-10 10:19:25 +00:00
Weihang Lo fc18f76694
Remove sneaked-in </dl> 2023-03-10 09:58:29 +00:00
Eric Huss 9e6d0c0500 Add some documentation on writing cross-compilation tests 2023-03-09 19:32:50 -08:00
bors d58902e22e Auto merge of #11822 - ehuss:gitoxide-tracking, r=weihanglo
Add tracking issue to gitoxide unstable docs
2023-03-09 21:19:54 +00:00
Eric Huss fcb5c07a4f Add tracking issue to gitoxide unstable docs 2023-03-09 12:24:37 -08:00
bors 0dec9a3d59 Auto merge of #11820 - weihanglo:bump-crates-io, r=ehuss
Bump crates-io to 0.36.0

This was an overlook of https://github.com/rust-lang/cargo/pull/11600

Since we already got #11806 to backport, I guess it is not harmful to <https://github.com/rust-lang/cargo/labels/beta-nominated> this as well.  Maybe it do need a backport as `src/cargo/ops/registry.rs` use a new public API from that PR.

BTW, please help check if it is really a breaking change.
2023-03-09 20:19:04 +00:00
bors 754b79c037 Auto merge of #11815 - weihanglo:version-bump, r=epage
Bump to 0.71.0; update changelog

[Rendered](https://github.com/weihanglo/cargo/blob/version-bump/CHANGELOG.md)

## Proposal: two new sections

Before, we usually just highlight user-facing changes. However, there are more and more documentation updates and internal infrastructure PRs today. To make contributors feel a part of a release, I propose to have two new section “Documentation improvements” and “Internal improvements”.

To provide some data points, both [Rust Analyzer](https://rust-analyzer.github.io/thisweek/2023/03/06/changelog-171.html#internal-improvements) and [Intellij Rust](https://intellij-rust.github.io/2023/02/27/changelog-189.html#internal-improvements) get an “Internal improvements” section.
2023-03-09 18:49:55 +00:00
bors e1605eb7bf Auto merge of #11809 - epage:contrib, r=weihanglo
docs(contrib): Move overview to lib

### What does this PR try to resolve?

Goals
- Move docs closer to their use to make them more likely to be updated
- More exhaustively rely on intra-doc links to keep the links valid through refactorings

To do this, I am exploring moving contributing documentation to their relevant libraries and linking out to them instead.

### How should we test and review this PR?

Look at the PR a commit at a time
```console
cargo doc --open
cargo doc --allow-private-items --open
```

### Additional information

In moving the content over, I felt a lot of our current intro documentation was a bit verbose, so I tried to shrink it down so that adding more content would not make it overwhelming

Unfortunately, the intra-doc links seem to follow the same visibility
rule as using the API items, meaning that for `lib.rs` to link to a
`mod`, it has to have visibility of the `mod`, requiring some mods to be
made `pub(crate)` that previously weren't.  I've gone ahead and done
this for now as the goal of this effort is for us to catch broken docs
through refactorings by using intra-doc links.

For now, the contrib docs page that was moved just links to the nightly
docs.  Over time, all of this will just be collapsed into the
architecture page which will link out to the nightly docs.
2023-03-09 17:49:16 +00:00
Weihang Lo 8296cfe547
Bump crates-io to 0.36.0
This was an overlook of https://github.com/rust-lang/cargo/pull/11600
2023-03-09 17:10:32 +00:00
bors 7e6687f280 Auto merge of #11817 - weihanglo:semvercheck-fix, r=epage
Fix semver check for 1.68

See https://github.com/rust-lang/cargo/actions/runs/4375746793/jobs/7656883351

Run `cd src/doc/semver-check && cargo +stable run` to test.
2023-03-09 16:05:58 +00:00
Weihang Lo a6c9a21d42
Fix semver check for 1.68 2023-03-09 15:25:06 +00:00
Weihang Lo 60df49d6e4
Make section headers a bit shorter
* Documentation improvements -> Documentation
* Internal improvements -> Internal
2023-03-09 15:14:48 +00:00
Weihang Lo 821db0971c
move nightly only up above doc/internal improvements 2023-03-09 15:10:49 +00:00
Weihang Lo 140ed0f12b
Add doc/internal sections for 1.70 changelog 2023-03-09 15:10:48 +00:00
Weihang Lo 2d36e8c9eb
Add doc/internal sections for 1.69 changelog 2023-03-09 15:10:48 +00:00
Weihang Lo ac5a799154
Update changelog for 1.70 2023-03-09 13:40:10 +00:00
Weihang Lo d13403abba
Update changelog for 1.69 2023-03-09 13:40:10 +00:00
Weihang Lo 4dccac6a4a
Bump to 0.71.0 2023-03-08 21:46:33 +00:00
bors 7d3033d2e5 Auto merge of #11812 - weihanglo:revert-11738, r=epage
Revert "#11738" - Use test name for dir when running tests
2023-03-08 17:05:08 +00:00
Weihang Lo f3778f9193
Revert "#11738" - Use test name for dir when running tests
This reverts commit 64b0e793ce, reversing
changes made to 958078633e.
2023-03-08 15:17:48 +00:00
bors c59c623465 Auto merge of #11810 - weihanglo:1.68-changelog, r=ehuss
Update CHANGELOG for 1.68 backports

- See https://github.com/rust-lang/cargo/pull/11760
2023-03-08 13:01:48 +00:00
Weihang Lo b0d4210854
Update CHANGELOG for 1.68 backports 2023-03-08 11:28:10 +00:00
bors c1334b059c Auto merge of #11645 - chansuke:issue-11597, r=weihanglo
Add `CARGO_PKG_README`

Fixes #11597

This environment variable shows the path to the README file of your package. From #11597:

> Cargo may rewrite the package’s `Cargo.toml` and move the README file around, relative to the manifest. I would like to `include_str!()` this README in my `lib.rs`, but am unable to do so right now, because if I specify `include_str!("../../README")` it works for development, but I can’t package my crate. Conversely if I specify `include_str!("../README")` it works when packaged, but not during development.
2023-03-07 19:21:50 +00:00
bors f72f8a87c8 Auto merge of #11807 - ahollmann:master, r=weihanglo
path dependency: fix cargo-util version

The update of the version in workspace `Cargo.toml` file slipped through my last PR.

This change has no real effect, as the version is ignored for path dependencies.

Since all other path dependencies have the correct version specified  we should either do it for all or remove the versions for path dependencies.
2023-03-07 13:20:37 +00:00