20338 Commits

Author SHA1 Message Date
Weihang Lo
58ff5efe61
test(build-std): relax the thread name assertion
rust-lang/rust#115746 changed to print thread ID,
so we update accordingly.
2025-08-08 17:34:48 -04:00
Ed Page
045a7977b2
chore(deps): update msrv (1 version) to v1.89 (#15815)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [MSRV:1](https://redirect.github.com/rust-lang/rust) | minor | `1.88`
-> `1.89` |

---

### Release Notes

<details>
<summary>rust-lang/rust (MSRV:1)</summary>

###
[`v1.89`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1890-2025-08-07)

[Compare
Source](https://redirect.github.com/rust-lang/rust/compare/1.88.0...1.89.0)

\==========================

<a id="1.89.0-Language"></a>

## Language

- [Stabilize explicitly inferred const arguments
(`feature(generic_arg_infer)`)](https://redirect.github.com/rust-lang/rust/pull/141610)
- [Add a warn-by-default `mismatched_lifetime_syntaxes`
lint.](https://redirect.github.com/rust-lang/rust/pull/138677)
This lint detects when the same lifetime is referred to by different
syntax categories between function arguments and return values, which
can be confusing to read, especially in unsafe code.
This lint supersedes the warn-by-default `elided_named_lifetimes` lint.
- [Expand `unpredictable_function_pointer_comparisons` to also lint on
function pointer comparisons in external
macros](https://redirect.github.com/rust-lang/rust/pull/134536)
- [Make the `dangerous_implicit_autorefs` lint
deny-by-default](https://redirect.github.com/rust-lang/rust/pull/141661)
- [Stabilize the avx512 target
features](https://redirect.github.com/rust-lang/rust/pull/138940)
- [Stabilize `kl` and `widekl` target features for
x86](https://redirect.github.com/rust-lang/rust/pull/140766)
- [Stabilize `sha512`, `sm3` and `sm4` target features for
x86](https://redirect.github.com/rust-lang/rust/pull/140767)
- [Stabilize LoongArch target features `f`, `d`, `frecipe`, `lasx`,
`lbt`, `lsx`, and
`lvz`](https://redirect.github.com/rust-lang/rust/pull/135015)
- [Remove `i128` and `u128` from
`improper_ctypes_definitions`](https://redirect.github.com/rust-lang/rust/pull/137306)
- [Stabilize `repr128` (`#[repr(u128)]`,
`#[repr(i128)]`)](https://redirect.github.com/rust-lang/rust/pull/138285)
- [Allow `#![doc(test(attr(..)))]`
everywhere](https://redirect.github.com/rust-lang/rust/pull/140560)
- [Extend temporary lifetime extension to also go through tuple struct
and tuple variant
constructors](https://redirect.github.com/rust-lang/rust/pull/140593)
- [`extern "C"` functions on the `wasm32-unknown-unknown` target now
have a standards compliant
ABI](https://blog.rust-lang.org/2025/04/04/c-abi-changes-for-wasm32-unknown-unknown/)

<a id="1.89.0-Compiler"></a>

## Compiler

- [Default to non-leaf frame pointers on
aarch64-linux](https://redirect.github.com/rust-lang/rust/pull/140832)
- [Enable non-leaf frame pointers for Arm64EC
Windows](https://redirect.github.com/rust-lang/rust/pull/140862)
- [Set Apple frame pointers by
architecture](https://redirect.github.com/rust-lang/rust/pull/141797)

<a id="1.89.0-Platform-Support"></a>

## Platform Support

- [Add new Tier-3 targets `loongarch32-unknown-none` and
`loongarch32-unknown-none-softfloat`](https://redirect.github.com/rust-lang/rust/pull/142053)
- [`x86_64-apple-darwin` is in the process of being demoted to Tier 2
with host tools](https://redirect.github.com/rust-lang/rfcs/pull/3841)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

[platform-support-doc]:
https://doc.rust-lang.org/rustc/platform-support.html

<a id="1.89.0-Libraries"></a>

## Libraries

- [Specify the base path for
`file!`](https://redirect.github.com/rust-lang/rust/pull/134442)
- [Allow storing `format_args!()` in a
variable](https://redirect.github.com/rust-lang/rust/pull/140748)
- [Add `#[must_use]` to `[T;
N]::map`](https://redirect.github.com/rust-lang/rust/pull/140957)
- [Implement `DerefMut` for
`Lazy{Cell,Lock}`](https://redirect.github.com/rust-lang/rust/pull/129334)
- [Implement `Default` for
`array::IntoIter`](https://redirect.github.com/rust-lang/rust/pull/141574)
- [Implement `Clone` for
`slice::ChunkBy`](https://redirect.github.com/rust-lang/rust/pull/138016)
- [Implement `io::Seek` for
`io::Take`](https://redirect.github.com/rust-lang/rust/pull/138023)

<a id="1.89.0-Stabilized-APIs"></a>

## Stabilized APIs

-
[`NonZero<char>`](https://doc.rust-lang.org/stable/std/num/struct.NonZero.html)
- Many intrinsics for x86, not enumerated here
- [AVX512
intrinsics](https://redirect.github.com/rust-lang/rust/issues/111137)
- [`SHA512`, `SM3` and `SM4`
intrinsics](https://redirect.github.com/rust-lang/rust/issues/126624)
-
[`File::lock`](https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.lock)
-
[`File::lock_shared`](https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.lock_shared)
-
[`File::try_lock`](https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.try_lock)
-
[`File::try_lock_shared`](https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.try_lock_shared)
-
[`File::unlock`](https://doc.rust-lang.org/stable/std/fs/struct.File.html#method.unlock)
-
[`NonNull::from_ref`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.from_ref)
-
[`NonNull::from_mut`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.from_mut)
-
[`NonNull::without_provenance`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.without_provenance)
-
[`NonNull::with_exposed_provenance`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.with_exposed_provenance)
-
[`NonNull::expose_provenance`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.expose_provenance)
-
[`OsString::leak`](https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.leak)
-
[`PathBuf::leak`](https://doc.rust-lang.org/stable/std/path/struct.PathBuf.html#method.leak)
-
[`Result::flatten`](https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.flatten)
-
[`std::os::linux::net::TcpStreamExt::quickack`](https://doc.rust-lang.org/stable/std/os/linux/net/trait.TcpStreamExt.html#tymethod.quickack)
-
[`std::os::linux::net::TcpStreamExt::set_quickack`](https://doc.rust-lang.org/stable/std/os/linux/net/trait.TcpStreamExt.html#tymethod.set_quickack)

These previously stable APIs are now stable in const contexts:

- [`<[T;
N]>::as_mut_slice`](https://doc.rust-lang.org/stable/std/primitive.array.html#method.as_mut_slice)
-
[`<[u8]>::eq_ignore_ascii_case`](https://doc.rust-lang.org/stable/std/primitive.slice.html#impl-%5Bu8%5D/method.eq_ignore_ascii_case)
-
[`str::eq_ignore_ascii_case`](https://doc.rust-lang.org/stable/std/primitive.str.html#impl-str/method.eq_ignore_ascii_case)

<a id="1.89.0-Cargo"></a>

## Cargo

- [`cargo fix` and `cargo clippy --fix` now default to the same Cargo
target selection as other build
commands.](https://redirect.github.com/rust-lang/cargo/pull/15192/)
Previously it would apply to all targets (like binaries, examples,
tests, etc.). The `--edition` flag still applies to all targets.
- [Stabilize
doctest-xcompile.](https://redirect.github.com/rust-lang/cargo/pull/15462/)
Doctests are now tested when cross-compiling. Just like other tests, it
will use the [`runner`
setting](https://doc.rust-lang.org/cargo/reference/config.html#targettriplerunner)
to run the tests. If you need to disable tests for a target, you can use
the [ignore doctest
attribute](https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html#ignoring-targets)
to specify the targets to ignore.

<a id="1.89.0-Rustdoc"></a>

## Rustdoc

- [On mobile, make the sidebar full width and
linewrap](https://redirect.github.com/rust-lang/rust/pull/139831). This
makes long section and item names much easier to deal with on mobile.

<a id="1.89.0-Compatibility-Notes"></a>

## Compatibility Notes

- [Make `missing_fragment_specifier` an unconditional
error](https://redirect.github.com/rust-lang/rust/pull/128425)
- [Enabling the `neon` target feature on
`aarch64-unknown-none-softfloat` causes a
warning](https://redirect.github.com/rust-lang/rust/pull/135160) because
mixing code with and without that target feature is not properly
supported by LLVM
- [Sized Hierarchy: Part
I](https://redirect.github.com/rust-lang/rust/pull/137944)
- Introduces a small breaking change affecting `?Sized` bounds on impls
on recursive types which contain associated type projections. It is not
expected to affect any existing published crates. Can be fixed by
refactoring the involved types or opting into the `sized_hierarchy`
unstable feature. See the [FCP
report](https://redirect.github.com/rust-lang/rust/pull/137944#issuecomment-2912207485)
for a code example.
- The warn-by-default `elided_named_lifetimes` lint is [superseded by
the warn-by-default `mismatched_lifetime_syntaxes`
lint.](https://redirect.github.com/rust-lang/rust/pull/138677)
- [Error on recursive opaque types earlier in the type
checker](https://redirect.github.com/rust-lang/rust/pull/139419)
- [Type inference side effects from requiring element types of array
repeat expressions are `Copy` are now only available at the end of type
checking](https://redirect.github.com/rust-lang/rust/pull/139635)
- [The deprecated accidentally-stable
`std::intrinsics::{copy,copy_nonoverlapping,write_bytes}` are now proper
intrinsics](https://redirect.github.com/rust-lang/rust/pull/139916).
There are no debug assertions guarding against UB, and they cannot be
coerced to function pointers.
- [Remove long-deprecated
`std::intrinsics::drop_in_place`](https://redirect.github.com/rust-lang/rust/pull/140151)
- [Make well-formedness predicates no longer
coinductive](https://redirect.github.com/rust-lang/rust/pull/140208)
- [Remove hack when checking impl method
compatibility](https://redirect.github.com/rust-lang/rust/pull/140557)
- [Remove unnecessary type inference due to built-in trait object
impls](https://redirect.github.com/rust-lang/rust/pull/141352)
- [Lint against "stdcall", "fastcall", and "cdecl" on non-x86-32
targets](https://redirect.github.com/rust-lang/rust/pull/141435)
- [Future incompatibility warnings relating to the never type (`!`) are
now reported in
dependencies](https://redirect.github.com/rust-lang/rust/pull/141937)
- [Ensure `std::ptr::copy_*` intrinsics also perform the static
self-init
checks](https://redirect.github.com/rust-lang/rust/pull/142575)
- [`extern "C"` functions on the `wasm32-unknown-unknown` target now
have a standards compliant
ABI](https://blog.rust-lang.org/2025/04/04/c-abi-changes-for-wasm32-unknown-unknown/)

<a id="1.89.0-Internal-Changes"></a>

## Internal Changes

These changes do not affect any public interfaces of Rust, but they
represent
significant improvements to the performance or internals of rustc and
related
tools.

- [Correctly un-remap compiler sources paths with the `rustc-dev`
component](https://redirect.github.com/rust-lang/rust/pull/142377)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Every minute ( * * * * * ) (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/rust-lang/cargo).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS41MS4xIiwidXBkYXRlZEluVmVyIjoiNDEuNTEuMSIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
2025-08-07 19:08:07 +00:00
Ed Page
bea3af40f1
Update semver tests for 1.89 (#15816)
This updates the tests where messages have changed in 1.89.
2025-08-07 17:05:22 +00:00
Eric Huss
5f972d1cbf Update semver tests for 1.89
This updates the tests where messages have changed in 1.89.
2025-08-07 09:16:35 -07:00
Ed Page
178a07231e chore: Bump versions 2025-08-07 10:15:50 -05:00
renovate[bot]
f0379a2a8c chore(deps): update msrv (1 version) to v1.89 2025-08-07 13:00:25 +00:00
Ed Page
e87ec1a12a
Accessing each build script's OUT_DIR and in the correct order (#15776)
Hi Everyone!

This PR is aimed to have some improvements over #15704

### What does this PR try to resolve?

Now, multiple build scripts are built correctly. But there are some
underlying issues, that this PR is targeting.

- Preserving the order of the build scripts: Earlier the build scripts
were sorted by default, but now, the order will be preserved.

### How to test and review this PR?

There is a feature gate `multiple-build-scripts` that can be passed via
`cargo-features` in `Cargo.toml`. So, you have to add
```toml
cargo-features = ["multiple-build-scripts"]
```
Preferably on the top of the `Cargo.toml` and use nightly toolchain to
use the feature
2025-08-06 19:58:35 +00:00
Naman Garg
aca513a24b
Preserve order of build scripts 2025-08-07 00:56:14 +05:30
Weihang Lo
d507fbef4d
chore: bump to 0.92.0; update changelog (#15807)
[rendered](https://github.com/weihanglo/cargo/blob/version-bump/src/doc/src/CHANGELOG.md)

or preview through `mdbook serve src/doc`
2025-08-05 20:46:31 +00:00
Weihang Lo
d39c3ac029
docs: -Zpackage-workspace has been stabilized (#15808)
We forgot to remove this in
<https://github.com/rust-lang/cargo/pull/15636>.
2025-08-05 20:34:46 +00:00
Weihang Lo
9d2ce7ae1c
docs: update changelog for 1.90.0 2025-08-05 16:03:43 -04:00
Weihang Lo
4528704113
chore: bump to 0.92.0 2025-08-05 16:03:43 -04:00
Weihang Lo
ca4cb03c83
docs: -Zpackage-workspace has been stabilized 2025-08-05 15:59:21 -04:00
Ed Page
dadac2347b
chore(deps): update rust crate cargo_metadata to 0.21.0 (#15795)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [cargo_metadata](https://redirect.github.com/oli-obk/cargo_metadata) |
workspace.dependencies | minor | `0.20.0` -> `0.21.0` |

---

### Release Notes

<details>
<summary>oli-obk/cargo_metadata (cargo_metadata)</summary>

###
[`v0.21.0`](https://redirect.github.com/oli-obk/cargo_metadata/compare/0.20.0...0.21.0)

[Compare
Source](https://redirect.github.com/oli-obk/cargo_metadata/compare/0.20.0...0.21.0)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on the first day of the
month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/rust-lang/cargo).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS40Ni4zIiwidXBkYXRlZEluVmVyIjoiNDEuNDYuMyIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
2025-08-05 18:34:17 +00:00
Naman Garg
8be51ef2d6
Add test for multiple build scripts in different order 2025-08-05 23:33:54 +05:30
Weihang Lo
c01efc8f4b
docs(build-rs): Fix broken intra-doc links (#15810)
### What does this PR try to resolve?

Unblock CI

### How to test and review this PR?

### Notes

These were caught with the latest nightly

This was pulled from #15800
2025-08-05 17:43:55 +00:00
Ojus Chugh
c0c256ba17 docs(build-rs): Fix broken intra-doc links
These were caught with the latest nightly

This was pulled from #15800
2025-08-05 12:03:46 -05:00
renovate[bot]
ebaa23c4c6
chore(deps): update rust crate cargo_metadata to 0.21.0 2025-08-01 02:44:19 +00:00
Ed Page
840b83a10f
chore: fix some minor issues in comments (#15787)
### What does this PR try to resolve?

 fix some minor issues in comments

### How to test and review this PR?

No need.
0.91.0
2025-07-30 13:59:19 +00:00
houpo-bob
cbef1d150a chore: fix some minor issues in comments
Signed-off-by: houpo-bob <houpocun@outlook.com>
2025-07-30 15:53:03 +08:00
Ed Page
37eeab7c16
feat(schema): Expose IndexPackage, the description of a package within a Registry Index (#15770)
### What does this PR try to resolve?

ref https://github.com/rust-lang/cargo/issues/14834

In this pull request, I moved `IndexPackage` to `cargo-util-schemas` to
enable third-party applications and `cargo-dev-registry` to utilize this
common struct.

For instance, crates.io has its own `IndexPackage` located at
005667f041/crates/crates_io_index/data.rs (L5).

By moving it to `cargo-util-schemas`, we allow different applications to
use this struct more easily.

### How to test and review this PR?

It shouldn't break any tests; it's just a refactoring.
2025-07-28 19:35:47 +00:00
Scott Schafer
c629f5b5cb
chore: update toml/toml_edit to latest (#15779)
fixes https://github.com/rust-lang/cargo/issues/15778
although this is unlikely to bump into.
2025-07-28 15:41:18 +00:00
Weihang Lo
50127603a7
chore: update toml/toml_edit to latest
fixes https://github.com/rust-lang/cargo/issues/15778
although this is unlikely to bump into.
2025-07-28 10:55:47 -04:00
0xPoe
8811325b5a feat: add JSON schema support for IndexPackage and RegistryDependency structs
Signed-off-by: 0xPoe <techregister@pm.me>
2025-07-27 15:02:34 +02:00
0xPoe
a7fcef21fe refactor: move IndexPackage and RegistryDependency to cargo-util-schemas for better modularity
Signed-off-by: 0xPoe <techregister@pm.me>
2025-07-27 15:02:27 +02:00
Weihang Lo
9b296973b4
Allow using Cargo-as-a-library with gix's reqwest backend (#15653)
### What does this PR try to resolve?

Unconditionally enabling "blocking-http-transport-curl" made the `cargo`
library incompatible with crates that prefer reqwest. An example being
the `rustsec` crate with git support:

-
https://github.com/rustsec/rustsec/blob/rustsec/v0.30.2/rustsec/Cargo.toml#L45-L47
-
https://github.com/rustsec/rustsec/blob/rustsec/v0.30.2/rustsec/Cargo.toml#L34
-
https://github.com/EmbarkStudios/tame-index/blob/0.21.0/Cargo.toml#L14-L17

Having `cargo` and `rustsec` in the same dependency graph makes
`gix-transport` fail to compile.

```toml
[dependencies]
cargo = "0.88.0"
rustsec = "0.30.2"
```

```console
error[E0428]: the name `Impl` is defined multiple times
   --> $CARGO_HOME/registry/src/index.crates.io-1949cf8c6b5b557f/gix-transport-0.45.0/src/client/blocking_io/http/mod.rs:220:1
    |
217 | pub type Impl = curl::Curl;
    | --------------------------- previous definition of the type `Impl` here
...
220 | pub type Impl = reqwest::Remote;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Impl` redefined here
    |
    = note: `Impl` must be defined only once in the type namespace of this module

error: Cannot set both 'http-client-reqwest' and 'http-client-curl' features as they are mutually exclusive
  --> $CARGO_HOME/registry/src/index.crates.io-1949cf8c6b5b557f/gix-transport-0.45.0/src/client/blocking_io/http/mod.rs:26:1
   |
26 | compile_error!("Cannot set both 'http-client-reqwest' and 'http-client-curl' features as they are mutually exclusive");
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

After this PR, dependency graphs that prefer reqwest can switch to
Cargo's http-transport-reqwest feature.

```toml
[dependencies]
cargo = { default-features = false, features = ["http-transport-reqwest"] }
rustsec = "0.30.2"
```

Cargo will continue to have a direct dependency on `curl`, but HTTP
operations performed through gix will use `reqwest`. This means both
curl's HTTP implementation and reqwest's HTTP implementation will be
linked. This is still much better than the only existing solution, which
is that you must pick versions of `cargo` and other dependency
(`rustsec`) which depend on semver-incompatible versions of gix, causing
2 entire versions of gix to be linked, in order to sidestep the mutually
exclusive features being enabled on the same version of gix. Gix version
numbers advance rapidly enough that this is often possible, but
sometimes (like right now) you would be unable to use the most recent
published release of `cargo`.

### How to test and review this PR?

- `cargo check --lib`
- `cargo check --lib --no-default-features --features
http-transport-reqwest`

Also tested by backporting this commit onto
<https://github.com/rust-lang/cargo/pull/15391>'s base commit (i.e. when
gix 0.70 was used) to ensure a conflict with rustsec's gix dependency,
and successfully building the following project.

```toml
[package]
name = "repro"
version = "0.0.0"
edition = "2024"
publish = false

[dependencies]
cargo = { path = "../cargo", default-features = false, features = ["http-transport-reqwest"] }
rustsec = "0.30.2"
```
2025-07-25 17:10:08 +00:00
Weihang Lo
1d5d0ba023
Make timings graphs scalable to user's window (#15766)
### What does this PR try to resolve?

This PR changes the way the charts produced by `cargo build --timings`
scale. It changes the scale slider so that its min/max values adapt to
the duration of the build, to allow zooming in/out even for very short
build durations. It also automatically initializes the scale value based
on the client's window width.

The number of pixels per second per scale value has been changed from 1
to 8, to avoid having too many scale values for the given duration of
supported chart widths, which I have determined in this PR to be `[200,
4096]` pixels.

https://github.com/user-attachments/assets/3e6e9f14-eabe-425a-a568-9fcb5c835145

### How to test and review this PR?

Run `cargo build --timings` e.g. on
https://github.com/BurntSushi/ripgrep. Then open the resulting page in a
browser, and try to enlarge/ensmall the window (possibly using mobile
emulation), and see how the charts react to window size.

Fixes: https://github.com/rust-lang/cargo/issues/15666
2025-07-25 15:00:39 +00:00
David Tolnay
1441ea4f4a
Perform cargo-semver-checks separately for cargo crate 2025-07-25 07:49:17 -07:00
Jakub Beránek
d4f414db08
Initialize scale value based on viewport width 2025-07-25 08:49:28 +02:00
Eric Huss
8b0f05e51d
refactor: rename arg mode to intent (#15774)
This was me overlooked when doing rust-lang/cargo#15601
2025-07-24 22:37:20 +00:00
Weihang Lo
e5a43c0e7a
refactor: rename arg mode to intent
This was me overlooked when doing rust-lang/cargo#15601
2025-07-24 16:22:14 -04:00
David Tolnay
39ad260013
Allow using Cargo-as-a-library with gix's reqwest backend 2025-07-23 14:25:34 -07:00
Weihang Lo
dfcf4c2cbd
fix: no-proc-macro is overridden by subsequent edges (#15764)
### What does this PR try to resolve?
To close #15763.

### How to test and review this PR?
See steps in #15763.
2025-07-23 16:56:18 +00:00
ChenRuiwei
2654f29ddb fix: no-proc-macro is overridden by subsequent edges 2025-07-24 00:06:54 +08:00
ChenRuiwei
4fdd6ecbab test: add test for no-proc-macro order issue 2025-07-24 00:06:54 +08:00
Weihang Lo
9b5231f892
Use gix for cargo package (#15534)
This should also help fixing these spurious "cannot package because some
excluded file is untracked" issues.

### Tasks

* [x] step-by-step conversion of `vcs.rs`
* [x] use proper feature toggle
* [x] ~~cleanup~~ final check by myself
* [ ] ~~move split & rename into its own commit. Probably squash all
changes except for the gix upgrade.~~
     - I like to have the major stages of this PR conserved.
* [x] upgrade to a gix release including
https://github.com/GitoxideLabs/gitoxide/pull/2016
     - This was done in `master` already.
* [x] fix tests by fixing `gix` - `submodules()` call isn't bare-repo
safe.
* [x] fix failure on Windows
- `gix status` seems to go through a symlink, arriving at the wrong
conclusion, on Windows.
* [x] fix performance regression on `aws-sdk-rust`.

### Notes for the Reviewer

* This implementation is both faster and more correct, thus affects
#15416 and #14955.

Related to https://github.com/GitoxideLabs/gitoxide/issues/106.
2025-07-23 03:13:49 +00:00
Sebastian Thiel
dfe3737634
Optimize performance of cargo package.
This is achieved by allowing `gix status` to only run in the
package root, while running it another time just on the few files
that are interesting outside of the package root.

This saves a lot of time compared to the previous implementation,
which ran the status on the entire repository.
2025-07-23 04:36:45 +02:00
Sebastian Thiel
d3b85cd96a
Provide a package implementation with gix-status.
This should also help fixing these spurious "cannot package because
some excluded file is untracked" issues.

Remove the respective `git2` implementation at the same time
as there seems to be no need for it.
2025-07-23 04:36:07 +02:00
Sebastian Thiel
ac04a82c7f
Upgrade gix to the latest version.
This will fix an issue with submodules that couldn't be queried
in an unborn repository.
2025-07-23 04:32:28 +02:00
Weihang Lo
d2ee2df594
cargo-credential-libsecret: give FFI correctly-sized object (#15767)
### What does this PR try to resolve?

The type is
```c
typedef struct {
	const gchar *name;
	SecretSchemaFlags flags;
	SecretSchemaAttribute attributes[32];

	/* <private> */
	gint reserved;
	gpointer reserved1;
	gpointer reserved2;
	gpointer reserved3;
	gpointer reserved4;
	gpointer reserved5;
	gpointer reserved6;
	gpointer reserved7;
} SecretSchema;
```
so the current object we give it is 8 pointers too short

It's incredibly lucky that libsecret, at this time, only uses
`reserved`, and not in any of the functions we call

Also, some obvious cleanups while I was there and comparing with [my
implementation](https://github.com/nabijaczleweli/cargo-update/blob/v17.0.0/src/ops/mod.rs#L1443)
from [cargo-update
17.0.0](https://github.com/nabijaczleweli/cargo-update/releases/v17.0.0).

### How to test and review this PR?

Observe
https://sources.debian.org/src/libsecret/0.20.5-3/libsecret/secret-schema.h/#L43
I suppose?
2025-07-22 23:40:40 +00:00
наб
ed85b79f8b
cargo-credential-libsecret: c""-style literals 2025-07-23 01:05:56 +02:00
наб
688d59002e
rustfmt mess 2025-07-22 23:03:05 +02:00
наб
67749b1a30
cargo-credential-libsecret: don't allocate "url" C string
We already don't do this and use this precise idiom elsewhere
2025-07-22 23:03:04 +02:00
наб
1abdb1d2aa
cargo-credential-libsecret: give FFI correctly-sized object
The type is
	typedef struct {
		const gchar *name;
		SecretSchemaFlags flags;
		SecretSchemaAttribute attributes[32];

		/* <private> */
		gint reserved;
		gpointer reserved1;
		gpointer reserved2;
		gpointer reserved3;
		gpointer reserved4;
		gpointer reserved5;
		gpointer reserved6;
		gpointer reserved7;
	} SecretSchema;
so the current object we give it is 8 pointers too short

It's incredibly lucky that libsecret, at this time,
only uses reserved, and not in any of the functions we call
2025-07-22 23:02:56 +02:00
наб
219a4da303
cargo-credential-libsecret: pull out error, attr_url, schema too 2025-07-22 22:44:08 +02:00
Weihang Lo
5b295b77ee
Remove unnecessary target-c-int-width from target specs (#15759)
### What does this PR try to resolve?

This is not necessary, as 32 is the default, and actually of the wrong
type now since it's a number now.
When planning to make these type mismatches error in
https://github.com/rust-lang/rust/pull/144218, cargo would fail here, so
I just removed it.

This custom target test very much shows how Cargo should be a subtree,
in this case it was fine because there's a compatible fix that I can
push now, otherwise it would have been very annoying.

### How to test and review this PR?

If the test suite passes, it works
2025-07-20 13:44:51 +00:00
Noratrieb
a6e1f11d4e Remove unnecessary target-c-int-width from target specs
This is not necessary, as 32 is the default, and actually of the wrong
type now since it's a number now.
When planning to make these type mismatches error, cargo would fail
here, so I just removed it.

This custom target test very much shows how Cargo should be a subtree,
in this case it was fine because there's a compatible fix that I can
push now, otherwise it would have been very annoying.
2025-07-20 15:04:25 +02:00
Ed Page
f5b3a6ba89
Expose artifact dependency getters in cargo-as-a-library (#15753)
### What does this PR try to resolve?

Information about artifact dependencies is already available through
`cargo metadata`, and therefore also through serializing and re-parsing
`dependency.serialized()` using `serde_json::to_value` +
`serde_json::from_value`. This PR makes the same information available
directly through the library API of `cargo::core::Dependency`.

I ran into these private methods while working on
https://github.com/rust-lang/cargo/issues/15751.

### How to test and review this PR?

`cargo check`
2025-07-18 18:23:10 +00:00
David Tolnay
04bafa3624
Expose artifact dependency getters in cargo-as-a-library 2025-07-18 10:06:57 -07:00
Ed Page
6833aa715d
Add [hints] table in Cargo.toml, and a hints.mostly-unused hint (#15673)
The `[hints]` table in a `Cargo.toml` manifest provides optional
information that Cargo can use for building the package, and will use
even when using the package as a dependency. All hints can be safely
ignored, and Cargo only warns about unknown hints, but does not error.
This allows packages to use hints without depending on new Cargo.

Add a `mostly-unused` hint, which allows a package to hint that most
users of the package will not use most of its items. This is useful for
improving the build performance of crates with large dependencies.

Crates can override this hint using `hint-mostly-unused = false` in
their profile for a dependency.

---

In the future, this same mechanism could be used for other hints, such
as
`min-opt-level`.

### How to test and review this PR?

This PR is built atop https://github.com/rust-lang/cargo/pull/15643 .
I'd
suggest reviewing that PR separately, then just reviewing the new
commits in
this PR.

The new "hints" testsuite module demonstrates the expected behavior of
hints.

Like https://github.com/rust-lang/cargo/pull/15643 , the nightly-only
tests
will only pass once https://github.com/rust-lang/rust/pull/135656 has
been
merged into Rust.
2025-07-13 02:25:52 +00:00