19581 Commits

Author SHA1 Message Date
Ed Page
f035814fe2 chore(ci): Visually group output in Github 2025-02-21 09:13:36 -06:00
Ed Page
88f858a5b5 refactor(bump): Visual group related operations 2025-02-21 09:11:33 -06:00
Ed Page
1566e4c346
chore(deps): update msrv (1 version) to v1.85 (#15211)
This PR contains the following updates:

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

---

### Release Notes

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

###
[`v1.85`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1850-2025-02-20)

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

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

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

## Language

- [The 2024 Edition is now
stable.](https://redirect.github.com/rust-lang/rust/pull/133349)
See [the edition
guide](https://doc.rust-lang.org/nightly/edition-guide/rust-2024/index.html)
for more details.
- [Stabilize async
closures](https://redirect.github.com/rust-lang/rust/pull/132706)
See [RFC
3668](https://rust-lang.github.io/rfcs/3668-async-closures.html) for
more details.
- [Stabilize
`#[diagnostic::do_not_recommend]`](https://redirect.github.com/rust-lang/rust/pull/132056)
- [Add `unpredictable_function_pointer_comparisons` lint to warn against
function pointer
comparisons](https://redirect.github.com/rust-lang/rust/pull/118833)
- [Lint on combining `#[no_mangle]` and `#[export_name]`
attributes.](https://redirect.github.com/rust-lang/rust/pull/131558)

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

## Compiler

- [The unstable flag `-Zpolymorphize` has been
removed](https://redirect.github.com/rust-lang/rust/pull/133883), see
[https://github.com/rust-lang/compiler-team/issues/810](https://redirect.github.com/rust-lang/compiler-team/issues/810)
for some background.

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

## Platform Support

- [Promote `powerpc64le-unknown-linux-musl` to tier 2 with host
tools](https://redirect.github.com/rust-lang/rust/pull/133801)

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

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

## Libraries

- [Panics in the standard library now have a leading `library/` in their
path](https://redirect.github.com/rust-lang/rust/pull/132390)
- [`std::env::home_dir()` on Windows now ignores the non-standard
`$HOME` environment
variable](https://redirect.github.com/rust-lang/rust/pull/132515)

    It will be un-deprecated in a subsequent release.
- [Add `AsyncFn*` to the prelude in all
editions.](https://redirect.github.com/rust-lang/rust/pull/132611)

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

## Stabilized APIs

-
[`BuildHasherDefault::new`](https://doc.rust-lang.org/stable/std/hash/struct.BuildHasherDefault.html#method.new)
-
[`ptr::fn_addr_eq`](https://doc.rust-lang.org/std/ptr/fn.fn_addr_eq.html)
-
[`io::ErrorKind::QuotaExceeded`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.QuotaExceeded)
-
[`io::ErrorKind::CrossesDevices`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.CrossesDevices)
-
[`{float}::midpoint`](https://doc.rust-lang.org/core/primitive.f32.html#method.midpoint)
- [Unsigned
`{integer}::midpoint`](https://doc.rust-lang.org/std/primitive.u64.html#method.midpoint)
-
[`NonZeroU*::midpoint`](https://doc.rust-lang.org/std/num/type.NonZeroU32.html#method.midpoint)
- [impl `std::iter::Extend` for tuples with arity 1 through
12](https://doc.rust-lang.org/stable/std/iter/trait.Extend.html#impl-Extend%3C\(A,\)%3E-for-\(EA,\))
- [`FromIterator<(A, ...)>` for tuples with arity 1 through
12](https://doc.rust-lang.org/stable/std/iter/trait.FromIterator.html#impl-FromIterator%3C\(EA,\)%3E-for-\(A,\))
-
[`std::task::Waker::noop`](https://doc.rust-lang.org/stable/std/task/struct.Waker.html#method.noop)

These APIs are now stable in const contexts:

-
[`mem::size_of_val`](https://doc.rust-lang.org/stable/std/mem/fn.size_of_val.html)
-
[`mem::align_of_val`](https://doc.rust-lang.org/stable/std/mem/fn.align_of_val.html)
-
[`Layout::for_value`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.for_value)
-
[`Layout::align_to`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.align_to)
-
[`Layout::pad_to_align`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.pad_to_align)
-
[`Layout::extend`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.extend)
-
[`Layout::array`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.array)
-
[`std::mem::swap`](https://doc.rust-lang.org/stable/std/mem/fn.swap.html)
-
[`std::ptr::swap`](https://doc.rust-lang.org/stable/std/ptr/fn.swap.html)
-
[`NonNull::new`](https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.new)
-
[`HashMap::with_hasher`](https://doc.rust-lang.org/stable/std/collections/struct.HashMap.html#method.with_hasher)
-
[`HashSet::with_hasher`](https://doc.rust-lang.org/stable/std/collections/struct.HashSet.html#method.with_hasher)
-
[`BuildHasherDefault::new`](https://doc.rust-lang.org/stable/std/hash/struct.BuildHasherDefault.html#method.new)
-
[`<float>::recip`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.recip)
-
[`<float>::to_degrees`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.to_degrees)
-
[`<float>::to_radians`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.to_radians)
-
[`<float>::max`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.max)
-
[`<float>::min`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.min)
-
[`<float>::clamp`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.clamp)
-
[`<float>::abs`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.abs)
-
[`<float>::signum`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.signum)
-
[`<float>::copysign`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.copysign)
-
[`MaybeUninit::write`](https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.write)

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

## Cargo

- [Add future-incompatibility warning against keywords in cfgs and add
raw-idents](https://redirect.github.com/rust-lang/cargo/pull/14671/)
- [Stabilize higher precedence trailing
flags](https://redirect.github.com/rust-lang/cargo/pull/14900/)
- [Pass `CARGO_CFG_FEATURE` to build
scripts](https://redirect.github.com/rust-lang/cargo/pull/14902/)

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

## Rustdoc

- [Doc comment on impl blocks shows the first line, even when the impl
block is
collapsed](https://redirect.github.com/rust-lang/rust/pull/132155)

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

## Compatibility Notes

- [`rustc` no longer treats the `test` cfg as a well known
check-cfg](https://redirect.github.com/rust-lang/rust/pull/131729),
instead it is up to the build systems and users of
`--check-cfg`\[^check-cfg] to set it as a well known cfg using
`--check-cfg=cfg(test)`.

This is done to enable build systems like Cargo to set it conditionally,
as not all source files are suitable for unit tests.
[Cargo (for now) unconditionally sets the `test` cfg as a well known
cfg](https://redirect.github.com/rust-lang/cargo/pull/14963).
\[^check-cfg]: https://doc.rust-lang.org/nightly/rustc/check-cfg.html
- [Disable potentially incorrect type inference if there are trivial and
non-trivial
where-clauses](https://redirect.github.com/rust-lang/rust/pull/132325)
- `std::env::home_dir()` has been deprecated for years, because it can
give surprising results in some Windows configurations if the `HOME`
environment variable is set (which is not the normal configuration on
Windows). We had previously avoided changing its behavior, out of
concern for compatibility with code depending on this non-standard
configuration. Given how long this function has been deprecated, we're
now fixing its behavior as a bugfix. A subsequent release will remove
the deprecation for this function.
- [Make `core::ffi::c_char` signedness more closely match that of the
platform-default
`char`](https://redirect.github.com/rust-lang/rust/pull/132975)

This changed `c_char` from an `i8` to `u8` or vice versa on many Tier 2
and 3
targets (mostly Arm and RISC-V embedded targets). The new definition may
result in compilation failures but fixes compatibility issues with C.

    The `libc` crate matches this change as of its 0.2.169 release.
- [When compiling a nested `macro_rules` macro from an external crate,
the content of the inner `macro_rules` is now built with the edition of
the external crate, not the local
crate.](https://redirect.github.com/rust-lang/rust/pull/133274)
- [Increase `sparcv9-sun-solaris` and `x86_64-pc-solaris` Solaris
baseline to
11.4.](https://redirect.github.com/rust-lang/rust/pull/133293)
- [Show `abi_unsupported_vector_types` lint in future breakage
reports](https://redirect.github.com/rust-lang/rust/pull/133374)
- [Error if multiple super-trait instantiations of `dyn Trait` need
associated types to be specified but only one is
provided](https://redirect.github.com/rust-lang/rust/pull/133392)
- [Change `powerpc64-ibm-aix` default `codemodel` to
large](https://redirect.github.com/rust-lang/rust/pull/133811)

<a id="1.85.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.

- [Build `x86_64-unknown-linux-gnu` with LTO for C/C++ code (e.g.,
`jemalloc`)](https://redirect.github.com/rust-lang/rust/pull/134690)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "* * * * *" (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:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNzYuMiIsInVwZGF0ZWRJblZlciI6IjM5LjE3Ni4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->
2025-02-20 22:38:57 +00:00
Ed Page
9946566ce4 chore(ci): Update cargo-semver-checks 2025-02-20 16:08:12 -06:00
Ed Page
7e0da417c0 test(gc): Update tests for latest stable 2025-02-20 15:47:19 -06:00
Ed Page
b4dee5dcf9 chore: Bump versions 2025-02-20 15:47:07 -06:00
renovate[bot]
c30d4f9293
chore(deps): update msrv (1 version) to v1.85 2025-02-20 19:37:56 +00:00
Ed Page
5946db3c14
fix: build warning in windows_reserved_names_are_allowed (#15206)
A recent change removed use of the `is_ci` function, but didn't remove
the `use` statement.
2025-02-19 17:32:21 +00:00
Arlo Siemsen
44de80f89c fix: build warning in windows_reserved_names_are_allowed 2025-02-19 10:59:50 -06:00
Ed Page
684bca2012
Typo: "togother" -> "together" (#15204)
In test name, `nonexistence_package_togother_with_workspace`.
2025-02-19 14:31:55 +00:00
Ed Page
e4bd878cec
chore: bump to 0.88.0; update changelog (#15202)
[rendered](https://github.com/weihanglo/cargo/blob/version-bump/src/doc/src/CHANGELOG.md)

or preview through `mdbook serve src/doc`
2025-02-19 14:16:20 +00:00
Samuel Moelius
8e1931f3a4
Typo: "togother" -> "together"
In test name, `nonexistence_package_togother_with_workspace`.
2025-02-19 06:33:21 -05:00
Weihang Lo
9244ff6586
docs: update changelog for 1.87.0 2025-02-19 00:03:37 -05:00
Weihang Lo
5cfe7fbed8
docs: update changelog for 1.86.0 2025-02-19 00:02:17 -05:00
Weihang Lo
1ec88b3b03
chore: bump to 0.88.0 2025-02-19 00:02:15 -05:00
Weihang Lo
511e3ab945
Typo: "explicitally" -> "explicitly" (#15201)
Pretty self-explanatory, I think.
2025-02-19 00:50:49 +00:00
Samuel Moelius
65521c3ba0
Typo: "explicitally" -> "explicitly" 2025-02-18 19:06:15 -05:00
Weihang Lo
2d61f602a0
fix(add): Focus on error, rather than large feature lists (#15200)
### What does this PR try to resolve?

Inspired by #11100 and previous work to collapse feature lists down.

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

### Additional information
2025-02-18 21:52:32 +00:00
Ed Page
524d123332 fix(add): Focus on error, rather than large feature lists
Inspired by #11100 and previous work to collapse feature lists down.
2025-02-18 12:44:13 -06:00
Ed Page
4a0b8948dd refactor(add): Pull out feature count for reuse 2025-02-18 12:42:52 -06:00
Ed Page
1f34b007e8 test(add): Show behavior with unrecognized feature with large list 2025-02-18 12:42:43 -06:00
Weihang Lo
73a925a0f8
docs: Improve comments (#15197)
This salvages the few comments of
#[15196](https://github.com/rust-lang/cargo/pull/15196)
2025-02-18 01:16:47 +00:00
Orion Gonzalez
280bc1f68b docs: Improve comments 2025-02-17 22:19:32 +01:00
Weihang Lo
3b784a42e3
fix(embedded): Handle more parsing corner cases (#15187)
### What does this PR try to resolve?

This is part of #12207. I found these while implementing frontmatter
support within rustc.

I'll likely do another pass when I finish rustc support to
- Unify tests between cargo and rustc
- Improve error messages

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

### Additional information
2025-02-16 05:05:53 +00:00
Eric Huss
0a4aff2e78
docs: docs for -Zfeature-unification (#15189)
### What does this PR try to resolve?

Follow-up of <https://github.com/rust-lang/cargo/pull/15157>.
Add missing docs for <https://github.com/rust-lang/cargo/issues/14774>.

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

```
mdbook serve src/doc
```
2025-02-15 15:02:31 +00:00
Eric Huss
ad740fd221
Fix man page with malformed {{#options}} block (#15191)
<!--
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?

The man page template for `cargo publish` includes a malformed
`{{#options}}` block containing a freestanding paragraph outside the
scope of the `{{#option}}` it relates to. This results in bad formatting
in the generated man pages.

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

Review the diffs of the generated man pages.
2025-02-15 13:56:08 +00:00
Max Heller
5e55f526ca
Fix man page with paragraph outside of option block 2025-02-15 08:10:14 -05:00
Weihang Lo
3f49ca8132
docs: docs for -Zfeature-unification 2025-02-14 23:41:21 -05:00
Weihang Lo
ce948f4616
util: provide a better error message for invalid SSH URLs (#15185)
### What does this PR try to resolve?

It's very common for users to attempt to use the pseudo-URLs that GitHub
or other providers provide in the form
`git@github.com:rust-lang/rust.git` as a source in Cargo.toml, which are
the default format accepted by OpenSSH. Unfortunately, these are not
actually URLs, and unsurprisingly, the `url` crate doesn't accept them.

However, our error message is unhelpful and looks like this:

invalid url `git@github.com:rust-lang/rust.git`: relative URL without a
base

This is technically true, but we can do better. The user actually wants
to write a real SSH URL, so if the non-URL starts with `git@`, let's
rewrite it into a real URL for them to help them and include that in the
error message.

`git@` is the prefix used by all major forges, as well as the default
configuration for do-it-yourself implementations like Gitolite. While
other options are possible, they are much less common, and this is an
extremely easy and cheap heuristic that does not necessitate complicated
parsing, but which we can change in the future should that be necessary.

This also avoids the problem where users try to turn the pseudo-URL into
a real URL by just prepending `ssh://`, which causes an error message
about the invalid port number due to the colon which they have not
changed. Since they can just copy and paste the proposed answer, they'll
be less likely to attempt this invalid approach.

Fixes #13549

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

1. `cargo init pkg1`
2. `cd pkg1`
3. Edit `Cargo.toml` to add the dependency line `bytes = { git =
"git@github.com:tokio-rs/bytes.git", tag = "v1.10.0" }`.
4. Run `cargo build`
5. Notice that the error suggests a URL to try.
6. Replace the Git URL with the suggested URL.
7. Run `cargo build`.
8. Notice that the package compiles cleanly.

### Additional information

N/A
2025-02-14 20:32:07 +00:00
brian m. carlson
7cd88900d3
util: provide a better error message for invalid SSH URLs
It's very common for users to attempt to use the pseudo-URLs that GitHub
or other providers provide in the form
`git@github.com:rust-lang/rust.git` as a source in Cargo.toml, which are
the default format accepted by OpenSSH. Unfortunately, these are not
actually URLs, and unsurprisingly, the `url` crate doesn't accept them.

However, our error message is unhelpful and looks like this:

    invalid url `git@github.com:rust-lang/rust.git`: relative URL without a base

This is technically true, but we can do better.  The user actually wants
to write a real SSH URL, so if the non-URL starts with `git@`, let's
rewrite it into a real URL for them to help them and include that in the
error message.

`git@` is the prefix used by all major forges, as well as the default
configuration for do-it-yourself implementations like Gitolite.  While
other options are possible, they are much less common, and this is an
extremely easy and cheap heuristic that does not necessitate complicated
parsing, but which we can change in the future should that be necessary.

This also avoids the problem where users try to turn the pseudo-URL into
a real URL by just prepending `ssh://`, which causes an error message
about the invalid port number due to the colon which they have not
changed.  Since they can just copy and paste the proposed answer,
they'll be less likely to attempt this invalid approach.
2025-02-14 19:43:16 +00:00
Ed Page
fd2000b106 fix(embedded): Allow non-starting dashes in frontmatter 2025-02-14 10:23:10 -06:00
Ed Page
b14a5f4ae9 fix(embedded): Don't parse indented frontmatter 2025-02-14 10:10:35 -06:00
Ed Page
a00d0bade5 refactor(embedded): Name the steps when trimming 2025-02-14 10:09:35 -06:00
Ed Page
544013e786 refactor(embedded): Clarify the parser 2025-02-14 10:06:57 -06:00
Ed Page
e148c3d3e1 refactor(embedded): Extract shebang splitting
This is intended to make the code more closely match rustc
2025-02-14 10:04:57 -06:00
Weihang Lo
26f5f3f50e
Fix the description of the "root" field of the cargo metadata's output (#15182)
<!--
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 #15181.
2025-02-13 22:55:25 +00:00
Ed Page
fbd2993c3d test(embedded): Add more frontmatter cases 2025-02-13 15:55:48 -06:00
Fluid
eb5c9a8fa5 update the right file & cargo build-man 2025-02-13 23:51:41 +02:00
Fluid
485a1b198a cargo build-man 2025-02-13 23:48:02 +02:00
Fluid
f6262a4eef fix 2025-02-13 23:43:17 +02:00
Weihang Lo
c52d4da4e6
refactor: Consolidate creation of SourceId from manifest path (#15172)
### What does this PR try to resolve?

This preps more features for cargo-script support and makes it clearer
where we don't yet support it.

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

### Additional information
2025-02-12 00:41:17 +00:00
Weihang Lo
81d8406781
docs(embedded): Note the shebang deviation (#15173)
### What does this PR try to resolve?

rustc considers the following valid and without a shebang:
```rust

// Hello

[allow(dead_code)]

fn main() {
    println!("Hello, world!");
}
```
and
```rustc
[allow(dead_code)]

fn main() {
    println!("Hello, world!");
}
```

In both cases, we consider it to have a shebang. This commit documents
that intention.

We could add our own heuristics
(e.g. `#!` with only whitespace is not a shebang)
but we should either be a subset or intentionally different than rustc
(e.g. require a non `[`-prefixes interpreter)
rather than do both.

Fixes #15170

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

This will be reflected in the tracking issue which will handle the final
decision for the team on this matter.

### Additional information
2025-02-11 22:05:19 +00:00
Ed Page
48224c19c6 docs(embedded): Note the shebang deviation
rustc considers the following valid and without a shebang:
```rust

// Hello

[allow(dead_code)]

fn main() {
    println!("Hello, world!");
}
```
and
```rustc
[allow(dead_code)]

fn main() {
    println!("Hello, world!");
}
```

In both cases, we consider it to have a shebang.  This commit documents
that intention.

We could add our own heuristics
(e.g. `#!` with only whitespace is not a shebang)
but we should either be a subset or intentionally different than rustc
(e.g. require a non `[`-prefixes interpreter)
rather than do both.

This will be reflected in the tracking issue which will handle the final
decision for the team on this matter.

Fixes #15170
2025-02-11 15:30:47 -06:00
Ed Page
080f7474aa refactor: Consolidate to SourceId::from_manifest_path 2025-02-11 14:05:57 -06:00
Ed Page
5a351405dc refactor: Centralize SourceId creation for manifests 2025-02-11 14:00:10 -06:00
Eric Huss
b64750d83d
refactor(embedded): Integrate cargo-script logic into main parser (#15168)
### What does this PR try to resolve?

This is a part of #12207

Now that the experiment is over and we can be intrusive, this merges all
of the permanent cargo-script manifest logic into the regular manifest
loading code path with the goal of reducing the number of places people
need to be aware to check to know how things work so we're less likely
to overlook them (e.g. `package.name`s being optional). This should also
make error reporting better as we will eventually only use the real
manifest users specify, instead of one with a lot of edits by us.

This comes at the cost of some uglier code needed to check some of these
cases.

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

### Additional information
2025-02-11 14:54:56 +00:00
Weihang Lo
321f14e03e
feat: implement workspace feature unification (#15157)
### What does this PR try to resolve?

Adds workspace feature unification for #14774

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

In a workspace that has dependencies with different activated features
depending on the packages being built, add the
`resolver.feature-unification = "workspace"` option to
`.cargo/config.toml`. Build the entire workspace with `--workspace` and
then build individual packages, ensuring no dependencies are being
recompiled.

### Additional information

Originally, the RFC and tracking issue mention some more complex changes
required in cargo's dependency/feature resolution phases in order to
support workspace feature unification. However, it seems like it also
works by just modifying the list of `PackageIdSpec`s passed to the
workspace resolver to include all workspace members, and then using the
original list of specs when generating the build units. I'm wondering if
I missed something because this change feels a bit *too* simple...

I tested it on a fairly large workspace containing about 100 packages
and didn't see any recompilations when building with different sets of
packages. I also added an integration test that verifies the correct
features are enabled. If there are any other test cases I should
include, please let me know and I'll try to add it.
2025-02-11 13:30:10 +00:00
Andrew Liu
a471adbd2c feat: implement workspace feature unification 2025-02-11 15:10:39 +09:00
Andrew Liu
91e83d70ed test: verify feature unification behavior in workspaces 2025-02-11 12:15:12 +09:00
Ed Page
e3fa31e335
Fix race condition in panic_abort_tests (#15169)
This fixes a race condition in the `panic_abort_tests` test which can
randomly fail. Prior to https://github.com/rust-lang/cargo/pull/14226
the test would check the lines individually (which was also kinda broken
for the same reason, but wouldn't actually fail).
2025-02-10 21:47:09 +00:00