20009 Commits

Author SHA1 Message Date
renovate[bot]
fc88578277
chore(deps): update msrv (1 version) to v1.86 2025-04-03 12:07:38 +00:00
Weihang Lo
92f8cc9503
docs(changelog): polish changelog items
They are supposed to be sorted and have proper prefixes.
2025-04-02 22:51:45 -07:00
Weihang Lo
f1e447077d
chore: add aarch64 linux runner (#15077)
### What does this PR try to resolve?

Linux arm64 hosted runners is in public preview.
Enable and see if is is something we can have now.

https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/

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

aarch64-unknown-linux-gnu is a tier-1 target platform.
It is better to have this in Cargo's CI.

Cross-compilation tests are disabled temporarily on this platform.

### Additional information

https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Free.20Linux.20ARM64.20runners.20on.20GHA.20now.20in.20beta
2025-04-02 15:52:23 +00:00
Weihang Lo
253eee4bfb
Added build_directory field to cargo metadata output (#15377)
<!--
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.
-->

### What does this PR try to resolve?

This PR continues on the build-dir work laid in #14125. (see
[this](https://github.com/rust-lang/cargo/issues/14125#issuecomment-2751658701)
comment)

We add a new `build_directory` field to the `cargo metadata` output when
the `-Z build-dir` feature flag is enabled.

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

I added a test for metadata output when build-dir is set. There are
already many existing tests that verify that build-dir is not included
if `-Z build-dir` is not passed.

### Additional information

NOTE: I use `build_directory` instead of `build-dir` to match the
existing `target_directory` field in the metadata output

r? @epage
2025-04-02 13:25:35 +00:00
Ross Sullivan
54e5369584
feat(build-dir): Added build-directory to cargo metadata output 2025-04-02 21:38:35 +09:00
Ross Sullivan
155aaae22e
test(build-dir): Added build_directory field to cargo metadata output 2025-04-02 21:36:05 +09:00
Weihang Lo
2080ac30df
chore(ci): add aarch64 linux runner
Linux arm64 hosted runners is in public preview.
Enable and see if is is something we can have now.

setting `target.linker` is required for cross-compilation
on ARM64, so disable cross compilation tests for it.

https://github.blog/changelog/2025-01-16-linux-arm64-hosted-runners-now-available-for-free-in-public-repositories-public-preview/
2025-04-01 22:07:36 -07:00
Ed Page
2a5f670ec0
chore(deps): update rust crate rusqlite to 0.34.0 (#15373)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [rusqlite](https://redirect.github.com/rusqlite/rusqlite) |
workspace.dependencies | minor | `0.33.0` -> `0.34.0` |

---

### Release Notes

<details>
<summary>rusqlite/rusqlite (rusqlite)</summary>

###
[`v0.34.0`](https://redirect.github.com/rusqlite/rusqlite/releases/tag/v0.34.0):
0.34.0

[Compare
Source](https://redirect.github.com/rusqlite/rusqlite/compare/v0.33.0...v0.34.0)

#### What's Changed

- Find the system library with minimum version 3.14.0
[#&#8203;1628](https://redirect.github.com/rusqlite/rusqlite/issues/1628)
- Update error type for `ValueRef` methods
[#&#8203;1629](https://redirect.github.com/rusqlite/rusqlite/issues/1629)
- Use decrement_strong_count directly for Array
[#&#8203;1633](https://redirect.github.com/rusqlite/rusqlite/issues/1633)
- Dedup free_boxed_value
[#&#8203;1635](https://redirect.github.com/rusqlite/rusqlite/issues/1635)
- Bump jiff version
[#&#8203;1645](https://redirect.github.com/rusqlite/rusqlite/issues/1645)
- Deserialize impls
[#&#8203;1646](https://redirect.github.com/rusqlite/rusqlite/issues/1646)
- Introduce BindIndex trait
[#&#8203;1649](https://redirect.github.com/rusqlite/rusqlite/issues/1649)
- Use BindIndex in bind_parameters_named
[#&#8203;1651](https://redirect.github.com/rusqlite/rusqlite/issues/1651)
- Improve flexibility of named params
[#&#8203;1652](https://redirect.github.com/rusqlite/rusqlite/issues/1652)
- Use std::ffi instead of std::os::raw
[#&#8203;1653](https://redirect.github.com/rusqlite/rusqlite/issues/1653)
- Bump bundled SQLite version to 3.49.1
[#&#8203;1654](https://redirect.github.com/rusqlite/rusqlite/issues/1654)
- update LICENSE
[#&#8203;1655](https://redirect.github.com/rusqlite/rusqlite/issues/1655)

**Full Changelog**:
https://github.com/rusqlite/rusqlite/compare/v0.33.0...v0.34.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:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMDcuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIwNy4xIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->
2025-04-01 14:27:07 +00:00
Ed Page
58efeda3bd
Prevent undeclared public network access (#15368)
Stop a few tests which aren't marked with `public_network_test` from
trying to access crates.io.
2025-04-01 14:24:54 +00:00
Sebastian Poeplau
aa1b353d64 Prevent undeclared public network access
Stop a few tests which aren't marked with `public_network_test` from
trying to access crates.io. While doing so, also make sure that other
`cargo_add` and `cargo_info` tests initialize the registry.
2025-04-01 11:41:30 +02:00
Weihang Lo
c5f58e97c9
rename the author field to be authors in book.toml (#15362)
See the [mdbook
documentation](https://rust-lang.github.io/mdBook/format/configuration/general.html)
Apparently the `author` was field was [incorrect
documentation](https://github.com/rust-lang/mdBook/issues/2623)
2025-04-01 05:04:04 +00:00
renovate[bot]
3a0bd02bb3
chore(deps): update rust crate rusqlite to 0.34.0 2025-04-01 00:23:40 +00:00
Ed Page
58bab51ca4
move modules from kebab-case to snake_case (#14439)
<!-- homu-ignore:start -->
<!--
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.
-->
<!-- homu-ignore:end -->

### What does this PR try to resolve?

It is currently unclear reading the docs how files should be named. [RFC
430](https://rust-lang.github.io/rfcs/0430-finalizing-naming-conventions.html)
is clear on crates and module names, `kebab-case` is never mentioned and
while there are historical considerations, we should guide new
development towards `snake_case`. We should align the documented
defaults to that RFC.

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

Review the docs and determine if we view value in the change.
2025-03-31 23:49:28 +00:00
Dominick Schroer
f8984e1169 docs(project-layout): add note on recommended target naming 2025-03-31 17:18:25 -06:00
Ed Page
949858cda0
chore: bump to 0.89.0; update changelog (#15372)
[rendered](https://github.com/weihanglo/cargo/blob/version-bump/src/doc/src/CHANGELOG.md)

or preview through `mdbook serve src/doc`
2025-03-31 22:50:54 +00:00
Weihang Lo
f2618f11de
docs: update changelog for 1.88.0 2025-03-31 15:05:17 -07:00
Weihang Lo
0df147419b
docs: update changelog for 1.87.0 2025-03-31 15:05:08 -07:00
Weihang Lo
bf43378697
chore: bump to 0.89.0 2025-03-31 10:52:24 -07:00
Ed Page
94bc054fcf
docs(unstable): update -Zrustdoc-depinfo tracking issue link (#15371)
Tracking issue: <https://github.com/rust-lang/cargo/issues/15370>
2025-03-31 17:48:38 +00:00
Weihang Lo
28f2cc5893
fix(tree): Make output more deterministic (#15369)
### What does this PR try to resolve?
When you have a dependency show up in multiple dependency tables, the
order they are processed was not deterministic. Its hard to predict the
exact effects this was having (e.g. for writing tests for this) but
changing this made #15366 not reproduce anymore for me.

I'm going to consier this as fixing #15366 mostly because how difficult
it is to debug with the non-determinism.
If someone can find a case where this fails, at least it should now
always fail and it should be easier to determine why.

Fixes #15366

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

### Additional information
2025-03-31 17:24:30 +00:00
Weihang Lo
a792237e89
docs(unstable): update -Zrustdoc-depinfo tracking issue link 2025-03-31 10:18:32 -07:00
Ed Page
138a20b1b1 fix(tree): Make output more deterministic
When you have a dependency show up in multiple dependency tables,
the order they are processed was not deterministic.
Its hard to predict the exact effects this was having (e.g. for writing
tests for this) but changing this made #15366 not reproduce anymore for me.

I'm going to consier this as fixing #15366 mostly because how difficult
it is to debug with the non-determinism.
If someone can find a case where this fails, at least it should now
always fail and it should be easier to determine why.

Fixes #15366
2025-03-31 11:30:54 -05:00
Eric Huss
659e27413c Stabilize automatic garbage collection. 2025-03-31 09:28:44 -07:00
Ed Page
7220445a9d
feat: rustdoc depinfo rebuild detection via -Zrustdoc-depinfo (#15359)
### What does this PR try to resolve?

This leverages the unstable `--emit=depinfo` option from rustdoc,
so that rustdoc invocation rebuild can be better tracked
without traversing the entire directory.

Some design decisions made in the current implementation:

* Rustdoc's depinfo doesn't and shouldn't emit to `target/doc`,
  as the directory is considered part of the final artifact directory.
  In regard to that, we specify the dep-info output path to
  the fingerprint directory of rustdoc invocation.
  It looks like this
  `target/debug/.fingerprint/serde-12d29d32b3b8b38f/doc-lib-serde.d`.
* We also start supporting `-Zchecksum-freshness` as a side effect.
  Could make it a separate PR if desired.
* `-Zbinary-dep-depinfo` is not enabled along with this,
  since doc generations don't really require any binary dependencies.

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

The tests added has covered these cases:

* target src outside package root, e.g., `lib.path = "../lib.rs"`
* `#[doc = include_str!("../outside/pkgroot")]`
* `#[path = "../outside/pkgroot"]`
* `env!`

### Additional information

Fixes #12266
Closes #15205
2025-03-31 14:12:26 +00:00
Weihang Lo
585f66a01d
Rename the gc config table (#15367)
This renames the gc config table to `[cache]` to help avoid some
confusion, and to set up a namespace for possible expansion in the
future for different kind of cache controls.

Low-level settings are stuffed into the `[cache.global-clean]` table,
but we do not expect to stabilize these at this time. Only the top-level
`cache.auto-clean-frequency` setting is expected to be stabilized.

Closes https://github.com/rust-lang/cargo/issues/14292
2025-03-30 16:29:47 +00:00
Eric Huss
efb3419d47 Rename the gc config table
This renames the gc config table to `[cache]` to help avoid some
confusion, and to set up a namespace for possible expansion in the
future for different kind of cache controls.

Low-level settings are stuffed into the `[cache.global-clean]` table,
but we do not expect to stabilize these at this time. Only the top-level
`cache.auto-clean-frequency` setting is expected to be stabilized.

Closes https://github.com/rust-lang/cargo/issues/14292
2025-03-30 04:45:07 -07:00
Weihang Lo
a18e60462e
feat(fingerprint): integrate rustdoc dep-info files
This leverages the unstable `--emit=depinfo` option from rustdoc,
so that rustdoc invocation rebuild can be better tracked
without traversing the entire directory.

Some design decisions:

* Rustdoc's depinfo doesn't and shouldn't emit to `target/doc`,
  as the directory is considered part of the final artifact directory.
  In regard to that, we specify the dep-info output path to
  the fingerprint directory of rustdoc invocation.
  It looks like this
  `target/debug/.fingerprint/serde-12d29d32b3b8b38f/doc-lib-serde.d`.
* We also start supporting `-Zchecksum-freshness` as a side effect.
  Could make it a separate PR if desired.
* `-Zbinary-dep-depinfo` is not enabled along with this,
  since doc generations don't really require any binary dependencies.
2025-03-28 22:07:30 -07:00
Gábor Szabó
840d63b574
rename the author field to be authors in book.toml 2025-03-28 17:26:28 +03:00
Weihang Lo
1f6d4be081
test(doc): show scenarios cargo doc not rebuild 2025-03-27 22:45:49 -07:00
Weihang Lo
80525dc48a
Revert "Temporarily ignore cargo_test_doctest_xcompile_ignores" (#15357)
This reverts https://github.com/rust-lang/cargo/pull/15348 now that
https://github.com/rust-lang/rust/pull/138877 is on nightly.
2025-03-28 02:00:17 +00:00
Eric Huss
bbce504bf3
Revert "Temporarily ignore cargo_test_doctest_xcompile_ignores" 2025-03-27 18:28:09 -07:00
Weihang Lo
3530a26e5a
docs(unstable): explain -Z rustdoc-depinfo 2025-03-27 12:22:27 -04:00
Weihang Lo
95dafab660
feat(unstable): add -Zrustdoc-depinfo flag 2025-03-27 11:55:55 -04:00
Weihang Lo
84a38b9376
Don't canonicalize executable path in cargo_exe (#15355)
### What does this PR try to resolve?

Follow up to #9991. The issue explains why but in short canonicalising
executable paths causes issues for symlinks. It seems this was missed in
#9991.

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

Note that the comment I deleted is wrong since #9991.

Running existing test should ensure this doesn't break anything.
2025-03-27 00:40:31 +00:00
Chris Denton
d82b596962
Don't canonicalize in cargo_exe 2025-03-26 23:47:08 +00:00
Ed Page
a6c604d1b8
fix(package): update tracking issue for --message-format (#15354)
Went ahead and created a new tracking issue
<https://github.com/rust-lang/cargo/issues/15353>.
2025-03-26 18:11:00 +00:00
Weihang Lo
a24066a79c
fix(package): update tracking issue for --message-format 2025-03-26 13:37:01 -04:00
Weihang Lo
280efd3dce
docs(contrib): Expand the description of team meetings (#15349)
### What does this PR try to resolve?

The goal is to make Cargo team meetings more inviting. This PR includes
both the information for more people to attend while framing the purpose
of the meeting to set appropriate expectations.

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

### Additional information
2025-03-26 16:53:06 +00:00
Ed Page
856f1bae5d
feat(package): add unstable --message-format flag (#15311)
### What does this PR try to resolve?

#11666

This adds an unstable `--message-format` flag to `cargo package` to help
`--list` output in newline-delimited JSON format.

See
<https://github.com/weihanglo/cargo/blob/package-list-fmt/src/doc/man/cargo-package.md#package-options>
for more on what is provided.

Open questions
- `--list json` or `--message-format json`, see
https://github.com/rust-lang/cargo/pull/15311#discussion_r1995637878
- a single json blob vs N? What is N? See
https://github.com/rust-lang/cargo/pull/15311#discussion_r1995641250
- Is the current format `plain` or `human`, see
https://github.com/rust-lang/cargo/pull/15311#discussion_r2012443601
- snake_case or kebab-case, see
https://github.com/rust-lang/cargo/pull/15311#discussion_r1995641593

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

* This currently outputs absolute paths.
  If we don't want to show absolute paths in the JSON output,
  could switch to relative path to either package root or cwd
  (I prefer the latter though).
* The actual schema, format option names, and field names is open to
discuss and change. See also
<https://github.com/rust-lang/cargo/issues/12377> for reference.
2025-03-26 16:32:05 +00:00
Ed Page
521bd7650c
feat(complete): Added completion for --profile (#15308)
### What does this PR try to resolve?

This attempts to complete the autocompleter for `cargo build --profile
<TAB>`, it loads the built in profiles and the custom profile present in
`Cargo.toml` and `.cargo/config.toml` if present when pressing TAB key,
in the completion value it also adds an description inspired by
[this](https://github.com/rust-lang/cargo/blob/master/src/cargo/core/compiler/job_queue/mod.rs#L805-L813)

![Screenshot from 2025-03-14
02-17-40](https://github.com/user-attachments/assets/6fc784a0-e3e7-4deb-9252-847d720894c1)

Related to #14520
2025-03-26 13:48:54 +00:00
utnim2
feb0e50b68 feat(complete): Added completion for --profile
- Added completion for `--profile` in `cargo build`
 - Loads the built in profile and custom profiles present in `Cargo.toml` and `.cargo/config.toml`
2025-03-26 12:31:44 +05:30
Weihang Lo
6344cad39a
Uplift windows Cygwin DLL import libraries (#15193)
- needed to link std correctly

Related: https://github.com/rust-lang/rust/pull/134999
2025-03-26 04:13:53 +00:00
Ookiineko
28d8d7702d add import library (.dll.a) file type for Cygwin
- needed to link std correctly

Signed-off-by: Ookiineko <chiisaineko@protonmail.com>
2025-03-26 11:05:18 +08:00
Weihang Lo
e354769b1f
feat(package): JSON message format for --list 2025-03-25 23:02:37 -04:00
Weihang Lo
d493e38e15
refactor(package): attach path info to GeneratedFile
This is needed for `cargo package --list` JSON message
to access the orignal file path information
for the generated file kind
2025-03-25 23:02:37 -04:00
Weihang Lo
4e8014f4be
feat(schemas): add PackageList message schema
This is is for `cargo package --list` in JSON format
2025-03-25 23:02:37 -04:00
Weihang Lo
02226aee64
docs(unstable): --message-format flag in cargo-package 2025-03-25 23:02:37 -04:00
Weihang Lo
9f9ff628ef
docs(package): man page for cargo package --message-format 2025-03-25 23:02:37 -04:00
Weihang Lo
781c7ed515
feat(package): add unstable --message-format flag
The behavior is not implemented yet
2025-03-25 23:02:37 -04:00
Eric Huss
6a70640c91
do not pass cdylib link args to test (#15317)
<!--
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.
-->

fixes #12663
2025-03-25 18:57:24 +00:00