20231 Commits

Author SHA1 Message Date
Weihang Lo
5052f88917
Update dependencies (#15557)
Routine update of dependencies. It's been a long while since the last
full update.

Tempfile is updated since it is generating a deprecation due to a method
rename.

I presume the help output change is due to an update in clap.

Handlebars is not updated due to
https://github.com/sunng87/handlebars-rust/issues/711

Updating ahash v0.8.11 -> v0.8.12
Updating anyhow v1.0.96 -> v1.0.98
Updating base64ct v1.6.0 -> v1.7.3
Updating bitflags v2.8.0 -> v2.9.1
Updating blake3 v1.6.1 -> v1.8.2
Updating bstr v1.11.3 -> v1.12.0
Updating bytes v1.10.0 -> v1.10.1
Updating cargo_metadata v0.19.1 -> v0.19.2
Updating cc v1.2.16 -> v1.2.23
Updating clap v4.5.31 -> v4.5.38
Updating clap_builder v4.5.31 -> v4.5.38
Updating clap_complete v4.5.46 -> v4.5.50
Updating ct-codecs v1.1.3 -> v1.1.5
Updating darling v0.20.10 -> v0.20.11
Updating darling_core v0.20.10 -> v0.20.11
Updating darling_macro v0.20.10 -> v0.20.11
Updating der v0.7.9 -> v0.7.10
Updating deranged v0.3.11 -> v0.4.0
Updating dyn-clone v1.0.18 -> v1.0.19
Updating either v1.13.0 -> v1.15.0
Updating equivalent v1.0.1 -> v1.0.2
Updating erased-serde v0.4.5 -> v0.4.6
Updating errno v0.3.10 -> v0.3.12
Updating escargot v0.5.13 -> v0.5.14
  Adding faster-hex v0.10.0
Updating ff v0.13.0 -> v0.13.1
Updating foldhash v0.1.4 -> v0.1.5
Removing getrandom v0.2.15
Removing getrandom v0.3.1
  Adding getrandom v0.2.16
  Adding getrandom v0.3.3
Updating git2 v0.20.0 -> v0.20.2
Removing gix-features v0.41.0
  Adding gix-features v0.41.1
  Adding gix-features v0.42.1
  Adding gix-fs v0.15.0
  Adding gix-hash v0.18.0
Updating gix-hashtable v0.8.0 -> v0.8.1
Updating gix-lock v17.0.0 -> v17.1.0
Updating gix-path v0.10.15 -> v0.10.18
Updating gix-tempfile v17.0.0 -> v17.1.0
  Adding gix-utils v0.3.0
  Adding gix-validate v0.10.0
Updating globset v0.4.15 -> v0.4.16
Updating half v2.4.1 -> v2.6.0
  Adding hash32 v0.3.1
Updating hashbrown v0.15.2 -> v0.15.3
  Adding heapless v0.8.0
Updating hermit-abi v0.4.0 -> v0.5.1
Updating icu_collections v1.5.0 -> v2.0.0
  Adding icu_locale_core v2.0.0
Removing icu_locid v1.5.0
Removing icu_locid_transform v1.5.0
Removing icu_locid_transform_data v1.5.0
Updating icu_normalizer v1.5.0 -> v2.0.0
Updating icu_normalizer_data v1.5.0 -> v2.0.0
Updating icu_properties v1.5.1 -> v2.0.0
Updating icu_properties_data v1.5.0 -> v2.0.0
Updating icu_provider v1.5.0 -> v2.0.0
Removing icu_provider_macros v1.5.0
Updating idna_adapter v1.2.0 -> v1.2.1
Updating indexmap v2.7.1 -> v2.9.0
Updating is-terminal v0.4.15 -> v0.4.16
Updating itoa v1.0.14 -> v1.0.15
Updating jiff v0.2.3 -> v0.2.13
Updating jiff-static v0.2.3 -> v0.2.13
Updating jiff-tzdb v0.1.2 -> v0.1.4
Updating jiff-tzdb-platform v0.1.2 -> v0.1.3
Updating jobserver v0.1.32 -> v0.1.33
Updating libc v0.2.170 -> v0.2.172
Updating libgit2-sys v0.18.0+1.9.0 -> v0.18.1+1.9.0 Updating libloading
v0.8.6 -> v0.8.7
Updating libz-sys v1.1.21 -> v1.1.22
  Adding linux-raw-sys v0.9.4
Updating litemap v0.7.4 -> v0.8.0
Updating log v0.4.25 -> v0.4.27
Updating miniz_oxide v0.8.5 -> v0.8.8
Updating once_cell v1.20.3 -> v1.21.3
Updating oorandom v11.1.4 -> v11.1.5
Updating openssl-src v300.4.2+3.4.1 -> v300.5.0+3.5.0 Updating
openssl-sys v0.9.107 -> v0.9.108
Updating orion v0.17.8 -> v0.17.10
Updating os_info v3.10.0 -> v3.11.0
Updating pasetors v0.7.2 -> v0.7.4
Updating pest v2.7.15 -> v2.8.0
Updating pest_derive v2.7.15 -> v2.8.0
Updating pest_generator v2.7.15 -> v2.8.0
Updating pest_meta v2.7.15 -> v2.8.0
Updating pkg-config v0.3.31 -> v0.3.32
Updating portable-atomic v1.10.0 -> v1.11.0
  Adding potential_utf v0.1.2
Updating ppv-lite86 v0.2.20 -> v0.2.21
Updating proc-macro2 v1.0.93 -> v1.0.95
Updating prodash v29.0.1 -> v29.0.2
Updating quote v1.0.38 -> v1.0.40
  Adding r-efi v5.2.0
Updating rand v0.9.0 -> v0.9.1
Updating rand_core v0.9.0 -> v0.9.3
Updating redox_syscall v0.5.8 -> v0.5.12
Updating ref-cast v1.0.23 -> v1.0.24
Updating ref-cast-impl v1.0.23 -> v1.0.24
  Adding rustix v1.0.7
Updating rustversion v1.0.19 -> v1.0.20
Updating ryu v1.0.19 -> v1.0.20
Updating semver v1.0.25 -> v1.0.26
Updating serde v1.0.218 -> v1.0.219
Updating serde-untagged v0.1.6 -> v0.1.7
Updating serde_derive v1.0.218 -> v1.0.219
Updating serde_ignored v0.1.10 -> v0.1.12
Updating serde_json v1.0.139 -> v1.0.140
Updating sha2 v0.10.8 -> v0.10.9
Updating smallvec v1.13.2 -> v1.15.0
Updating socket2 v0.5.8 -> v0.5.9
Updating syn v2.0.98 -> v2.0.101
Updating synstructure v0.13.1 -> v0.13.2
Updating tempfile v3.17.1 -> v3.20.0
Updating terminal_size v0.4.1 -> v0.4.2
Updating thiserror v2.0.11 -> v2.0.12
Updating thiserror-impl v2.0.11 -> v2.0.12
Updating time v0.3.37 -> v0.3.41
Updating time-core v0.1.2 -> v0.1.4
Updating time-macros v0.2.19 -> v0.2.22
Updating tinystr v0.7.6 -> v0.8.1
Updating tinyvec v1.8.1 -> v1.9.0
Updating toml v0.8.20 -> v0.8.22
Updating toml_datetime v0.6.8 -> v0.6.9
Updating toml_edit v0.22.24 -> v0.22.26
  Adding toml_write v0.1.1
Updating typeid v1.0.2 -> v1.0.3
Updating typenum v1.17.0 -> v1.18.0
Updating unicode-ident v1.0.17 -> v1.0.18
Removing utf16_iter v1.0.5
Updating wasi v0.13.3+wasi-0.2.2 -> v0.14.2+wasi-0.2.4
  Adding windows-targets v0.53.0
  Adding windows_aarch64_gnullvm v0.53.0
  Adding windows_aarch64_msvc v0.53.0
  Adding windows_i686_gnu v0.53.0
  Adding windows_i686_gnullvm v0.53.0
  Adding windows_i686_msvc v0.53.0
  Adding windows_x86_64_gnu v0.53.0
  Adding windows_x86_64_gnullvm v0.53.0
  Adding windows_x86_64_msvc v0.53.0
Updating winnow v0.7.1 -> v0.7.10
Updating wit-bindgen-rt v0.33.0 -> v0.39.0
Removing write16 v1.0.0
Updating writeable v0.5.5 -> v0.6.1
Updating yoke v0.7.5 -> v0.8.0
Updating yoke-derive v0.7.5 -> v0.8.0
Removing zerocopy v0.7.35
Removing zerocopy v0.8.17
  Adding zerocopy v0.8.25
Removing zerocopy-derive v0.7.35
Removing zerocopy-derive v0.8.17
  Adding zerocopy-derive v0.8.25
Updating zerofrom v0.1.5 -> v0.1.6
Updating zerofrom-derive v0.1.5 -> v0.1.6
  Adding zerotrie v0.2.2
Updating zerovec v0.10.4 -> v0.11.2
Updating zerovec-derive v0.10.3 -> v0.11.1

<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide"
first:
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to
review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to
generate docs:

https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its
title.
* It's ok to use the CI resources to test your PR, but please don't
abuse them.

### What does this PR try to resolve?

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing
issue.

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

Demonstrate how you test this change and guide reviewers through your
PR.
With a smooth review process, a pull request usually gets reviewed
quicker.

If you don't know how to write and run your tests, please read the
guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->
2025-05-18 03:02:27 +00:00
Eric Huss
cbdb9f0620 Update dependencies
Routine update of dependencies.

Tempfile is updated since it is generating a deprecation due to a method
rename.

I presume the help output change is due to an update in clap.

Handlebars is not updated due to
https://github.com/sunng87/handlebars-rust/issues/711

Updating ahash v0.8.11 -> v0.8.12
Updating anyhow v1.0.96 -> v1.0.98
Updating base64ct v1.6.0 -> v1.7.3
Updating bitflags v2.8.0 -> v2.9.1
Updating blake3 v1.6.1 -> v1.8.2
Updating bstr v1.11.3 -> v1.12.0
Updating bytes v1.10.0 -> v1.10.1
Updating cargo_metadata v0.19.1 -> v0.19.2
Updating cc v1.2.16 -> v1.2.23
Updating clap v4.5.31 -> v4.5.38
Updating clap_builder v4.5.31 -> v4.5.38
Updating clap_complete v4.5.46 -> v4.5.50
Updating ct-codecs v1.1.3 -> v1.1.5
Updating darling v0.20.10 -> v0.20.11
Updating darling_core v0.20.10 -> v0.20.11
Updating darling_macro v0.20.10 -> v0.20.11
Updating der v0.7.9 -> v0.7.10
Updating deranged v0.3.11 -> v0.4.0
Updating dyn-clone v1.0.18 -> v1.0.19
Updating either v1.13.0 -> v1.15.0
Updating equivalent v1.0.1 -> v1.0.2
Updating erased-serde v0.4.5 -> v0.4.6
Updating errno v0.3.10 -> v0.3.12
Updating escargot v0.5.13 -> v0.5.14
  Adding faster-hex v0.10.0
Updating ff v0.13.0 -> v0.13.1
Updating foldhash v0.1.4 -> v0.1.5
Removing getrandom v0.2.15
Removing getrandom v0.3.1
  Adding getrandom v0.2.16
  Adding getrandom v0.3.3
Updating git2 v0.20.0 -> v0.20.2
Removing gix-features v0.41.0
  Adding gix-features v0.41.1
  Adding gix-features v0.42.1
  Adding gix-fs v0.15.0
  Adding gix-hash v0.18.0
Updating gix-hashtable v0.8.0 -> v0.8.1
Updating gix-lock v17.0.0 -> v17.1.0
Updating gix-path v0.10.15 -> v0.10.18
Updating gix-tempfile v17.0.0 -> v17.1.0
  Adding gix-utils v0.3.0
  Adding gix-validate v0.10.0
Updating globset v0.4.15 -> v0.4.16
Updating half v2.4.1 -> v2.6.0
  Adding hash32 v0.3.1
Updating hashbrown v0.15.2 -> v0.15.3
  Adding heapless v0.8.0
Updating hermit-abi v0.4.0 -> v0.5.1
Updating icu_collections v1.5.0 -> v2.0.0
  Adding icu_locale_core v2.0.0
Removing icu_locid v1.5.0
Removing icu_locid_transform v1.5.0
Removing icu_locid_transform_data v1.5.0
Updating icu_normalizer v1.5.0 -> v2.0.0
Updating icu_normalizer_data v1.5.0 -> v2.0.0
Updating icu_properties v1.5.1 -> v2.0.0
Updating icu_properties_data v1.5.0 -> v2.0.0
Updating icu_provider v1.5.0 -> v2.0.0
Removing icu_provider_macros v1.5.0
Updating idna_adapter v1.2.0 -> v1.2.1
Updating indexmap v2.7.1 -> v2.9.0
Updating is-terminal v0.4.15 -> v0.4.16
Updating itoa v1.0.14 -> v1.0.15
Updating jiff v0.2.3 -> v0.2.13
Updating jiff-static v0.2.3 -> v0.2.13
Updating jiff-tzdb v0.1.2 -> v0.1.4
Updating jiff-tzdb-platform v0.1.2 -> v0.1.3
Updating jobserver v0.1.32 -> v0.1.33
Updating libc v0.2.170 -> v0.2.172
Updating libgit2-sys v0.18.0+1.9.0 -> v0.18.1+1.9.0
Updating libloading v0.8.6 -> v0.8.7
Updating libz-sys v1.1.21 -> v1.1.22
  Adding linux-raw-sys v0.9.4
Updating litemap v0.7.4 -> v0.8.0
Updating log v0.4.25 -> v0.4.27
Updating miniz_oxide v0.8.5 -> v0.8.8
Updating once_cell v1.20.3 -> v1.21.3
Updating oorandom v11.1.4 -> v11.1.5
Updating openssl-src v300.4.2+3.4.1 -> v300.5.0+3.5.0
Updating openssl-sys v0.9.107 -> v0.9.108
Updating orion v0.17.8 -> v0.17.10
Updating os_info v3.10.0 -> v3.11.0
Updating pasetors v0.7.2 -> v0.7.4
Updating pest v2.7.15 -> v2.8.0
Updating pest_derive v2.7.15 -> v2.8.0
Updating pest_generator v2.7.15 -> v2.8.0
Updating pest_meta v2.7.15 -> v2.8.0
Updating pkg-config v0.3.31 -> v0.3.32
Updating portable-atomic v1.10.0 -> v1.11.0
  Adding potential_utf v0.1.2
Updating ppv-lite86 v0.2.20 -> v0.2.21
Updating proc-macro2 v1.0.93 -> v1.0.95
Updating prodash v29.0.1 -> v29.0.2
Updating quote v1.0.38 -> v1.0.40
  Adding r-efi v5.2.0
Updating rand v0.9.0 -> v0.9.1
Updating rand_core v0.9.0 -> v0.9.3
Updating redox_syscall v0.5.8 -> v0.5.12
Updating ref-cast v1.0.23 -> v1.0.24
Updating ref-cast-impl v1.0.23 -> v1.0.24
  Adding rustix v1.0.7
Updating rustversion v1.0.19 -> v1.0.20
Updating ryu v1.0.19 -> v1.0.20
Updating semver v1.0.25 -> v1.0.26
Updating serde v1.0.218 -> v1.0.219
Updating serde-untagged v0.1.6 -> v0.1.7
Updating serde_derive v1.0.218 -> v1.0.219
Updating serde_ignored v0.1.10 -> v0.1.12
Updating serde_json v1.0.139 -> v1.0.140
Updating sha2 v0.10.8 -> v0.10.9
Updating smallvec v1.13.2 -> v1.15.0
Updating socket2 v0.5.8 -> v0.5.9
Updating syn v2.0.98 -> v2.0.101
Updating synstructure v0.13.1 -> v0.13.2
Updating tempfile v3.17.1 -> v3.20.0
Updating terminal_size v0.4.1 -> v0.4.2
Updating thiserror v2.0.11 -> v2.0.12
Updating thiserror-impl v2.0.11 -> v2.0.12
Updating time v0.3.37 -> v0.3.41
Updating time-core v0.1.2 -> v0.1.4
Updating time-macros v0.2.19 -> v0.2.22
Updating tinystr v0.7.6 -> v0.8.1
Updating tinyvec v1.8.1 -> v1.9.0
Updating toml v0.8.20 -> v0.8.22
Updating toml_datetime v0.6.8 -> v0.6.9
Updating toml_edit v0.22.24 -> v0.22.26
  Adding toml_write v0.1.1
Updating typeid v1.0.2 -> v1.0.3
Updating typenum v1.17.0 -> v1.18.0
Updating unicode-ident v1.0.17 -> v1.0.18
Removing utf16_iter v1.0.5
Updating wasi v0.13.3+wasi-0.2.2 -> v0.14.2+wasi-0.2.4
  Adding windows-targets v0.53.0
  Adding windows_aarch64_gnullvm v0.53.0
  Adding windows_aarch64_msvc v0.53.0
  Adding windows_i686_gnu v0.53.0
  Adding windows_i686_gnullvm v0.53.0
  Adding windows_i686_msvc v0.53.0
  Adding windows_x86_64_gnu v0.53.0
  Adding windows_x86_64_gnullvm v0.53.0
  Adding windows_x86_64_msvc v0.53.0
Updating winnow v0.7.1 -> v0.7.10
Updating wit-bindgen-rt v0.33.0 -> v0.39.0
Removing write16 v1.0.0
Updating writeable v0.5.5 -> v0.6.1
Updating yoke v0.7.5 -> v0.8.0
Updating yoke-derive v0.7.5 -> v0.8.0
Removing zerocopy v0.7.35
Removing zerocopy v0.8.17
  Adding zerocopy v0.8.25
Removing zerocopy-derive v0.7.35
Removing zerocopy-derive v0.8.17
  Adding zerocopy-derive v0.8.25
Updating zerofrom v0.1.5 -> v0.1.6
Updating zerofrom-derive v0.1.5 -> v0.1.6
  Adding zerotrie v0.2.2
Updating zerovec v0.10.4 -> v0.11.2
Updating zerovec-derive v0.10.3 -> v0.11.1
2025-05-17 19:32:32 -07:00
renovate[bot]
8b5fd61ec8
chore(deps): update msrv (1 version) to v1.87 2025-05-15 23:35:57 +00:00
Eric Huss
47c911e9e6
Stabilize doctest-xcompile (#15462)
This stabilizes the doctest-xcompile feature by unconditionally enabling
it.

Closes https://github.com/rust-lang/cargo/issues/7040
Closes https://github.com/rust-lang/cargo/issues/12118

## What is being stabilized?

This changes it so that cargo will run doctests when using the
`--target` flag for a target that is not the host. Previously, cargo
would ignore doctests (and show a note if passing `--verbose`).

A wrapper for running the doctest can be specified with the
[`target.*.runner`](https://doc.rust-lang.org/cargo/reference/config.html#targettriplerunner)
configuration option (which is powered by the `--test-runtool` rustdoc
flag). This would typically be something like qemu to run under
emulation. It is my understanding that this should work just like
running other kinds of tests.

Additionally, the
[`target.*.linker`](https://doc.rust-lang.org/cargo/reference/config.html#targettriplelinker)
config option is honored for using a custom linker.

Already stabilized in rustdoc is the ability to [ignore tests
per-target](https://doc.rust-lang.org/nightly/rustdoc/write-documentation/documentation-tests.html#ignoring-targets).

## Motivation

The lack of doctest cross-compile support has always been simply due to
the lack of functionality in rustdoc to support this. Rustdoc gained the
ability to cross-compile doctests some time ago, but there were
additional flags like the test runner that were not stabilized until
just recently.

This is intended to ensure that projects have full test coverage even
when doing cross-compilation. It can be
[surprising](https://github.com/rust-lang/cargo/issues/12118) to some
that this was not happening, particularly since cargo is silent about
it.

## Risks

The cargo team had several conversations about how to roll out this
feature. Ultimately we decided to enable it unconditionally with the
understanding that most projects will probably want to have their
doctests covered, and that any breakage will be a local concern that can
be resolved by either fixing the test or ignoring the target.

Tests in rust-lang/rust run into this issue, [particularly on
android](https://github.com/rust-lang/rust/pull/119147#issuecomment-1863712897),
and those will need to be fixed before this reaches beta. This is
something I am looking into.

Some cross-compiling scenarios may need codegen flags that are not
supported. It's not clear how common this will be, or if ignoring will
be a solution, or how difficult it would be to update rustdoc and cargo
to support these. Additionally, the split between RUSTFLAGS and
RUSTDOCFLAGS can be cumbersome.

## Implementation history

- https://github.com/rust-lang/rust/pull/60387 -- Support added to
rustdoc to support the `--target` flag and runtool and
per-target-ignores.
- https://github.com/rust-lang/cargo/pull/6892 -- Initial support in
cargo.
- https://github.com/rust-lang/cargo/pull/7391 -- Added unstable
documentation.
- https://github.com/rust-lang/cargo/pull/8094 -- Fix target for doc
test cross compilation
- https://github.com/rust-lang/cargo/pull/8358 -- Fixed regression with
`--target=HOST` not working on stable.
- https://github.com/rust-lang/cargo/pull/10132 -- Added note about
doctests not running (under `--verbose`).
- https://github.com/rust-lang/rust/pull/112751 -- Fixed
`--test-run-directory` interaction with `--test-runtool`.
- https://github.com/rust-lang/rust/pull/137096 -- Stabilization (and
rename) of the rustdoc `--test-runtool` and `--test-runtool-arg` CLI
args, and drops `--enable-per-target-ignores` unconditionally enabling
it.

## Test coverage

Cargo tests:
-
[artifact_dep::cross_doctests_works_with_artifacts](56c08f84e2/tests/testsuite/artifact_dep.rs (L1248-L1326))
-- Checks that doctest has access to the artifact dependencies.
-
[build_script::duplicate_script_with_extra_env](56c08f84e2/tests/testsuite/build_script.rs (L5514-L5614))
-- Checks that build-script env and cfg values are correctly handled on
host versus target when cross running doctests.
-
[cross_compile::cross_tests](56c08f84e2/tests/testsuite/cross_compile.rs (L416-L502))
-- Basic test that cross-compiled tests work.
-
[cross_compile::doctest_xcompile_linker](56c08f84e2/tests/testsuite/cross_compile.rs (L1139-L1182))
-- Checks that the linker config argument works.
-
[custom_target::custom_target_minimal](56c08f84e2/tests/testsuite/custom_target.rs (L39-L71))
-- Checks that `.json` targets work with rustdoc cross tests.
-
[test::cargo_test_doctest_xcompile_ignores](56c08f84e2/tests/testsuite/test.rs (L4743-L4777))
-- Checks the `ignore-*` syntax works.
-
[test::cargo_test_doctest_xcompile_runner](2603268cda/tests/testsuite/test.rs (L4783-L4863))
-- Checks runner with cross doctests.
-
[test::cargo_test_doctest_xcompile_no_runner](2603268cda/tests/testsuite/test.rs (L4869-L4907))
-- Checks cross doctests without a runner.

Rustdoc tests:
-
[run-make/doctest-runtool](25cdf1f674/tests/run-make/doctests-runtool)
-- Tests behavior of `--test-run-directory` with relative paths of the
runner.
-
[rustdoc/doctest/doctest-runtool](25cdf1f674/tests/rustdoc/doctest/doctest-runtool.rs)
-- Tests for `--test-runtool` and `--test-runtool-arg`.

## Future concerns

There have been some discussions
(https://github.com/rust-lang/testing-devex-team/issues/5) about
changing how doctests are driven. My understanding is that stabilizing
this should not affect those plans, since if cargo becomes the driver,
it will simply need to build things with `--target` and use the
appropriate runner.

## Change notes

This PR changed tests a little:
- artifact_dep::no_cross_doctests_works_with_artifacts was changed now
that doctests actually work.
- cross_compile::cross_tests was changed to properly check doctests.
- cross_compile::no_cross_doctests dropped since it is no longer
relevant.
- standard_lib::doctest didn't need `-Zdoctest-xcompile` since
`-Zbuild-std` no longer uses a target.
- test::cargo_test_doctest_xcompile was removed since it is a duplicate
of cross_compile::cross_tests

I think this should probably wait until the next release cutoff, moving
this to 1.89 (will update the PR accordingly if that happens).
2025-05-14 17:53:17 +00:00
Eric Huss
4194703c99 Update stabilization to 1.89 2025-05-14 08:54:06 -07:00
Eric Huss
bead46769c Stabilize doctest-xcompile
This stabilizes the doctest-xcompile feature by unconditionally enabling
it.
2025-05-14 08:52:27 -07:00
Ed Page
a14791c355
feat: skip publish=false pkg when publishing entire workspace (#15525)
### What does this PR try to resolve?

Fixes #15006

This changes how cargo-publish works with the unstable
`-Zpackage-workspace` feature.

Before this, when publishing the entire workspace,
like `cargo publish --workspace`,
if there is a package with `package.pulibsh=false,
it'll fail the entire publish process.

After this, when `--workspace` is passed,
or when publishing the virtual workspace,
the intent is more like “publish all publishable in this workspace”,
so skip `publish=false` packages and proceed to publish others.

The new overall behavior looks like this:

* `cargo publish` (inside a `package.publish = false` package): error
* `cargo publish -p publishable -p unpublishable`: error
* `cargo publish --workspace`: skips `package.publish = false

See
https://github.com/rust-lang/cargo/issues/15006#issuecomment-2847660911

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

* `workspace_flag_with_unpublishable_packages` was added to ensure
`--workspace` work with non-virtual workspace.
* `unpublishable_package_as_versioned_dev_dep` was added to ensure
versioned dev-dependencies won't be skipped and still fail
cargo-publish, as they are required to be published.

There is a new scenario that nothing is going to publish.
I went with a warning instead of hard error because missing publish for
the entire worspace should be a fairly visible. However, this is open
for future to configure via Cargo lint system.
2025-05-14 05:54:19 +00:00
Weihang Lo
090dcfe9af
fix(publish): better message when nothing to publish
This doesn't need to be an hard error because missing
publish for the entire worspace should be a fairly visible.
However, this is open for future to configure via Cargo lint system.
2025-05-14 01:22:30 -04:00
Weihang Lo
4f7494c4ec
feat(publish): workspace publish skips publish=false
This changes how cargo-publish works with the unstable
`-Zpackage-workspace` feature.

Before this, when publishing the entire workspace,
like `cargo publish --workspace`,
if there is a package with `package.pulibsh=false,
it'll fail the entire publish process.

After this, when `--workspace` is passed,
or when publishing the virtual workspace,
the intent is more like “publish all publishable in this workspace”,
so skip `publish=false` packages and proceed to publish others.

The new overall behavior looks like this:

- `cargo publish` (inside a `package.publish = false` package): error
- `cargo publish -p publishable -p unpublishable`: error
- `cargo publish --workspace`: skips `package.publish = false

See https://github.com/rust-lang/cargo/issues/15006#issuecomment-2847660911
2025-05-14 01:22:29 -04:00
Weihang Lo
6f8136488e
refactor(publish): extract "no publishable found" error 2025-05-14 01:21:10 -04:00
Weihang Lo
2421496c92
test(publish): prepare tests for skipping unpublishable
For `-Zpackage-workspace`.
2025-05-14 01:08:22 -04:00
Ed Page
966229a4c9
chore: bump to 0.90.0; update changelog (#15520)
[rendered](https://github.com/weihanglo/cargo/blob/version-bump/src/doc/src/CHANGELOG.md)

or preview through `mdbook serve src/doc`

---

Note that the long note of `-Zgc` stabilization is from Josh's comment
here:
<https://github.com/rust-lang/cargo/pull/14287#issuecomment-2802552543>
2025-05-12 23:50:10 +00:00
Weihang Lo
da104f3981
docs: update changelog for 1.89.0 2025-05-12 17:27:10 -04:00
Weihang Lo
eb89766947
docs: update changelog for 1.88.0 2025-05-12 17:26:45 -04:00
Weihang Lo
3f03281918
docs: update changelog for 1.87.0 2025-05-12 17:24:13 -04:00
Weihang Lo
6459528bca
chore: bump to 0.90.0 2025-05-12 17:24:13 -04:00
Ed Page
3c5bb555ca
chore(triagebot): add [no-mentions] and [note] (#15517)
`[no-mentions]` is for preventing something like
<https://github.com/rust-lang/cargo/pull/15378#issuecomment-2855248173>.
Well, maybe not working for PR description, I don't know.

`[note]` is for somebody else wanting to help summarize but having no
permission to edit top-level comments.

See docs for more:

* https://forge.rust-lang.org/triagebot/note.html
* https://forge.rust-lang.org/triagebot/no-mentions.html
2025-05-10 18:43:16 +00:00
Weihang Lo
541a51c146
chore(triagebot): add [no-mentions] and [note] 2025-05-10 14:04:39 -04:00
Weihang Lo
13625cec0b
add glob pattern support for known_hosts (#15508)
### What does this PR try to resolve?

This PR implements glob pattern match for known_hosts file. Hosts
written with `*` and `?` now matches correctly.

### Tests

Tests are added accordingly.

### Miscs

This is my first time submitting PR, sorry if there's anything that's
off although I've read the contributor guide.
2025-05-10 16:29:00 +00:00
motorailgun
e68d951a12 add glob pattern support for known_hosts 2025-05-10 15:42:36 +00:00
Weihang Lo
056f5f4f3c
Revert "doc: Mention XDG_DATA_HOME" (#15512)
This reverts commit 15a7672dde9853a8b15b545a1e5da5bbee7244c9.

### What does this PR try to resolve?

There was a miscommunication about some outstanding concerns with #15480
and it got merged before we were ready.

Specifically
- How important is this for unstable docs?
- How universal is the use of `bash-completions` and what should we do
for people who don't have it?
- How likely is someone to catch that they don't have `XDG_DATA_HOME`
set and get tripped up over this documentation
- Should we be aligned with upstream clap?

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

### Additional information
2025-05-09 14:54:18 +00:00
Ed Page
05b18b42cc Revert "doc: Mention XDG_DATA_HOME"
This reverts commit 15a7672dde9853a8b15b545a1e5da5bbee7244c9.
2025-05-09 09:19:07 -05:00
Ed Page
c7a2aa3f8f
docs: update version notice for deprecation removal (#15511)
Thank you for always maintaining cargo.

### What does this PR try to resolve?
`std::env::home_dir` is still deprecated in
[v1.86.0](https://doc.rust-lang.org/1.86.0/src/std/env.rs.html#644-648).

However, it has been undeprecated in the current
[nightly](https://doc.rust-lang.org/nightly/src/std/env.rs.html#651).

Therefore, I propose updating the notice for avoiding confusion.
2025-05-09 14:10:33 +00:00
Weihang Lo
c566be4742
doc: Update instructions on using native-completions (#15480)
`~/.local/share/bash-completion/completions/cargo` is more sensible, and
[recommended by
rustup](e4f3ad6f89/src/cli/help.rs (L275)).

<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide"
first:
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to
review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to
generate docs:

https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its
title.
* It's ok to use the CI resources to test your PR, but please don't
abuse them.

### What does this PR try to resolve?

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing
issue.

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

Demonstrate how you test this change and guide reviewers through your
PR.
With a smooth review process, a pull request usually gets reviewed
quicker.

If you don't know how to write and run your tests, please read the
guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->
2025-05-09 13:15:26 +00:00
kyu08
ded3f36068 docs: update version notice for deprecation removal 2025-05-09 22:10:46 +09:00
PRO
15a7672dde
doc: Mention XDG_DATA_HOME
Ref: [bash-completion](89aa18b154/README.md (L153-L161))
2025-05-09 13:50:50 +08:00
Eric Huss
a154422cec
feat(network): use Retry-After header for HTTP 429 responses (#15463)
### What does this PR try to resolve?

Cargo registries that return HTTP 429 when the service is overloaded
expect the client to retry the request automatically after a delay.
Cargo currently does not retry for HTTP 429.

### What changed?
* Adds HTTP 429 (too many requests) as a spurious HTTP error to enable
retries.
* Parse the
[Retry-After](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Retry-After)
HTTP header to determine how long to wait before a retry.

In this implementation, the maximum delay is limited to Cargo's existing
limit of 10 seconds. We could consider increasing that limit for this
case, since the server is explicitly requesting the delay.
2025-05-07 21:22:52 +00:00
Arlo Siemsen
b72d6476ae feat(network): use Retry-After header for HTTP 429 responses 2025-05-07 15:44:35 -05:00
Ed Page
b1bb014cdb
CI: Require schema job to pass (#15504)
I'm not certain, but I do not believe it was intentional in
https://github.com/rust-lang/cargo/pull/15000 to allow the `schema` job
to fail. This adds it to the required passing list.
2025-05-07 20:15:03 +00:00
Eric Huss
1c3197babc
chore(config): migrate renovate config (#15501)
The Renovate config in this repository needs migrating. Typically this
is because one or more configuration options you are using have been
renamed.

You don't need to merge this PR right away, because Renovate will
continue to migrate these fields internally each time it runs. But later
some of these fields may be fully deprecated and the migrations removed.
So it's a good idea to merge this migration PR soon.

#### [PLEASE
NOTE](https://docs.renovatebot.com/configuration-options#configmigration):
JSON5 config file migrated! All comments & trailing commas were removed.

🔕 **Ignore**: Close this PR and you won't be reminded about config
migration again, but one day your current config may no longer be valid.

 Got questions? Does something look wrong to you? Please don't hesitate
to [request help
here](https://redirect.github.com/renovatebot/renovate/discussions).

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/rust-lang/cargo).
2025-05-07 19:40:32 +00:00
Eric Huss
c9261238cf
CI: Require schema job to pass
I'm not certain, but I do not believe it was intentional in https://github.com/rust-lang/cargo/pull/15000 to allow the `schema` job to fail. This adds it to the required passing list.
2025-05-07 12:39:52 -07:00
renovate[bot]
19704b9496 chore(config): migrate config .github/renovate.json5 2025-05-07 12:01:16 -07:00
Ed Page
cf7b053c0f
Make cargo script ignore workspaces (#15496)
### What does this PR try to resolve?

Cargo script considers itself part of the workspace if the script is
located in a sub-directory of a workspace (presumably since
https://github.com/rust-lang/cargo/pull/15168). This becomes an issue
when using a custom registry that is defined in the `.cargo/config.toml`
within the workspace. Cargo script does not take that file into account
and fails with ``registry index was not found in any configuration:
`test-reg` ``.

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

This PR adds a regression test and makes cargo script ignore the
surrounding workspace.
The test ~~will fail without the fix in the second commit and~~ can be
used to reproduce the issue.

### Additional information

The issue started occurring with `nightly-2025-02-16`.
Related to https://github.com/rust-lang/cargo/issues/12207.

<!--
Thanks for submitting a pull request 🎉! Here are some tips for you:

* If this is your first contribution, read "Cargo Contribution Guide"
first:
  https://doc.crates.io/contrib/
* Run `cargo fmt --all` to format your code changes.
* Small commits and pull requests are always preferable and easy to
review.
* If your idea is large and needs feedback from the community, read how:
  https://doc.crates.io/contrib/process/#working-on-large-features
* Cargo takes care of compatibility. Read our design principles:
  https://doc.crates.io/contrib/design.html
* When changing help text of cargo commands, follow the steps to
generate docs:

https://github.com/rust-lang/cargo/tree/master/src/doc#building-the-man-pages
* If your PR is not finished, set it as "draft" PR or add "WIP" in its
title.
* It's ok to use the CI resources to test your PR, but please don't
abuse them.

Explain the motivation behind this change.
A clear overview along with an in-depth explanation are helpful.

You can use `Fixes #<issue number>` to associate this PR to an existing
issue.

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

Demonstrate how you test this change and guide reviewers through your
PR.
With a smooth review process, a pull request usually gets reviewed
quicker.

If you don't know how to write and run your tests, please read the
guide:
https://doc.crates.io/contrib/tests

### Additional information

Other information you want to mention in this PR, such as prior arts,
future extensions, an unresolved problem, or a TODO list.
-->
2025-05-07 14:23:29 +00:00
arctic-alpaca
2b247ffd4e
make cargo script ignore surrounding workspace 2025-05-07 07:48:08 +02:00
arctic-alpaca
03a2a29aed
add test for cargo script workspace handling 2025-05-07 07:43:44 +02:00
Weihang Lo
74c051fd83
fix(rustc): Don't panic on unknown bins (#15497)
### What does this PR try to resolve?

Fixes #15493

### How should we test and review this PR?
This takes the most surgical, direct route to addressing the problem.
Alternatively, we could look into why `cargo rustc` and `cargo check`
are different.

### Additional information
2025-05-06 20:03:07 +00:00
Weihang Lo
33d7b0aa92
test: Remove unused nightly requirements (#15498)
### What does this PR try to resolve?

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

### Additional information
2025-05-06 18:26:39 +00:00
Ed Page
b81c676ebc test: Remove unused nightly requirements 2025-05-06 12:52:20 -05:00
Ed Page
f83e11acfe fix(rustc): Don't panic on unknown bins
This takes the most surgical, direct route to addressing the problem.
Alternatively, we could look into why `cargo rustc` and `cargo check`
are different.

Fixes #15493
2025-05-06 11:13:30 -05:00
Ed Page
981ea84bdc refactor(compile): Make unmatched_packages optional 2025-05-06 11:10:12 -05:00
Ed Page
02ec8d48e5 test(rustc): Show the bug 2025-05-06 11:05:10 -05:00
Eric Huss
7bdd872cec
Add support for -Zembed-metadata (#15378)
### What does this PR try to resolve?

This PR adds Cargo integration for the new unstable `-Zembed-metadata`
rustc flag, which was implemented in
https://github.com/rust-lang/rust/pull/137535 ([tracking
issue](https://github.com/rust-lang/rust/issues/139165)). The new
behavior has to be enabled explicitly using a new unstable CLI flag
`-Zno-embed-metadata`.

The `-Zembed-metadata=no` rustc flag can reduce disk usage of compiled
artifacts, and also the size of Rust dynamic library artifacts shipped
to users. However, it is not enough to just pass this flag through
`RUSTFLAGS`; it needs to be integrated within Cargo, because it
interacts with how the `--emit` flag is passed to rustc, and also how
`--extern` args are passed to the final linked artifact build by Cargo.
Furthermore, using the flag for all crates in a crate graph compiled by
Cargo would be suboptimal (this will all be described below).

When you pass `-Zembed-metadata=no` to rustc, it will not store Rust
metadata into the compiled artifact. This is important when compiling
libs/rlibs/dylibs, since it reduces their size on disk. However, this
also means that everytime we use this flag, we have to make sure that we
also:
- Include `metadata` in the `--emit` flag to generate a `.rmeta` file,
otherwise no metadata would be generated whatsoever, which would mean
that the artifact wouldn't be usable as a dependency.
- Pass also `--extern <dep>=<path>.rmeta` when compiling the final
linkable artifact. Before, Cargo would only pass `--extern
<dep>=<path>.[rlib|so|dll]`. Since with `-Zembed-metadata=no`, the
metadata is only in the `.rmeta` file and not in the rlib/dylib, this is
needed to help rustc find out where the metadata lies.
- Note: this essentially doubles the cmdline length when compiling the
final linked artifact. Not sure if that is a concern.

The two points above is what this PR implements, and why this rustc flag
needs Cargo integration.

The `-Zembed-metadata` flag is only passed to libs, rlibs and dylibs. It
does not seem to make sense for other crate types. The one situation
where it might make sense are proc macros, but according to @bjorn3 (who
initially came up with the idea for `-Zembed-metadata`, it isn't really
worth it).

Here is a table that summarizes the changes in passed flags and
generated files on disk for rlibs and dylibs:

| **Crate type** | **Flags** | **Generated files** | **Disk usage** |
|--|--|--|--|
| Rlib/Lib (before) | `--emit=dep-info,metadata,link` | `.rlib` (with
metadata), `.rmeta` (for pipelining) | - |
| Rlib/Lib (after) | `--emit=dep-info,metadata,link -Zembed-metadata=no`
| `.rlib` (without metadata), `.rmeta` (for metadata/pipelining) |
Reduced (metadata no longer duplicated) |
| Dylib (before) | `--emit=dep-info,link` | `[.so\|.dll]` (with
metadata) | - |
| Dylib (after) | `--emit=dep-info,metadata,link -Zembed-metadata=no` |
`[.so\|.dll]` (without metadata), `.rmeta` | Unchanged, but split
between two files |

Behavior for other target kinds/crate types should be unchanged.

From the table above, we can see two benefits of using
`-Zembed-metadata=no`:
- For rlibs/dylibs, we no longer store their metadata twice in the
target directory, thus reducing target directory size.
- For dylibs, we store esssentially the same amount of data on disk, but
the benefit is that the metadata is now in a separate .rmeta file. This
means that you can ship the dylib (`.so`/`.dll`) to users without also
shipping the metadata. This would slightly reduce e.g. the
[size](https://github.com/rust-lang/rust/pull/120855#issuecomment-1937018169)
of the shipped rustc toolchains (note that the size reduction here is
after the toolchain has been already heavily compressed).

Note that if this behavior ever becomes the default, it should be
possible to simplify the code quite a bit, and essentially merge the
`requires_upstream_objects` and `benefits_from_split_metadata`
functions.

I did a very simple initial benchmark to evaluate the space savings on
cargo itself and
[hyperqueue](https://github.com/It4innovations/hyperqueue) (a mid-size
crate from my work) using `cargo build` and `cargo build --release` with
and without `-Zembed-metadata=no`:

![image](https://github.com/user-attachments/assets/a26994a2-156f-4863-a823-1042ebe03bf0)

For debug/incremental builds, the effect is smaller, as the artifact
disk usage is dwarfed by incremental artifacts and debuginfo. But for
(non-incremental) release builds, the disk savings (and also performed
I/O operations) are significantly reduced.

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

I wrote two basic tests. The second one tests a situation where a crate
depends on a dylib dependency, which is quite rare, but the behavior of
this has actually changed in this PR (see comparison table above).
Testing this on various real-world projects (or even trying to enable it
by default across the whole Cargo suite?) might be beneficial.

## Unresolved questions

### Is this a breaking change?
With this new behavior, dylibs and rlibs will no longer contain
metadata. If they are compiled with Cargo, that shouldn't matter, but
other build systems might have to adapt.

### Should this become the default?
I think that in terms of disk size usage and performed I/O operations,
it is a pure win. It should either generate less disk data (for rlibs)
or the ~same amount of data for dylibs (the data will be a bit larger,
because the dylib will still contain a metadata stub header, but that's
like 50 bytes and doesn't scale with the size of the dylib, so it's
negligible).

So I think that eventually, we should just do this by default in Cargo,
unless some concerns are found. I suppose that before stabilizing we
should also benchmark the effect on compilation performance.
2025-05-06 15:53:21 +00:00
Ed Page
79dfdd3ef6
Fix tracking issue template link (#15494)
Found while trying to create a tracking issue for
https://github.com/rust-lang/cargo/pull/15378.
2025-05-06 11:45:30 +00:00
Jakub Beránek
329fa50e69
Add entry to unstable.md 2025-05-06 13:24:38 +02:00
Jakub Beránek
33cdfb7c7a
Fix tracking issue link 2025-05-06 13:14:59 +02:00
Ed Page
bfe41282be
Refactor artifact deps in FeatureResolver::deps (#15492)
This moves the closure used for computing artifact dependency
information out into a separate function. The large line lengths were
causing rustfmt to fail to format the entire parent closure. Also, the
rightwards drift was getting quite extreme.

This also simplifies the code a little by avoiding all the transpose
stuff and needing the separate match at the end.
2025-05-05 20:48:11 +00:00
Eric Huss
e637d7c5c7 Refactor artifact deps in FeatureResolver::deps
This moves the closure used for computing artifact dependency
information out into a separate function. The large line lengths were
causing rustfmt to fail to format the entire parent closure. Also,
the rightwards drift was getting quite extreme.

This also simplifies the code a little by avoiding all the transpose
stuff and needing the separate match at the end.
2025-05-05 13:17:45 -07:00
Jakub Beránek
8250a90878
Add -Zno-embed-metadata unstable flag 2025-05-05 12:07:34 +02:00
Weihang Lo
6cba807e2c
Improved error message for versions prefixed with v (#15484)
### What does this PR try to resolve?

- Added an error message when version in `CRATE[@<VER>]` or `--version
<VER>` starts with 'v' for `install`, `add`, `yank` and `update
--precise <VER>`
- Check if version is valid in `cargo yank`

Fixes #12331

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

Added tests for each subcommand
2025-05-04 13:44:15 +00:00
Pyrode
2ba61b9dfc update: Added error message for when v is prefixed with version 2025-05-03 22:35:44 +05:30