18638 Commits

Author SHA1 Message Date
xzfc
0c74d2449d chore(deps): update tar to 0.4.42
The new version of tar enables the creation of sparse tar archives by
default.  The ability to read such sparse entries was added in tar
0.4.6, which has been in use starting from Cargo 0.13 and Rust 1.12.
Additionally, `docker cp` doesn't support sparse tar entries in the GNU
format.  For compatibility with older versions of Rust and Cargo, as
well as with `docker cp`, this commit disables sparse archive creation
in the corresponding cases where the `tar::Builder` is used.  See
#14594.
2024-10-02 03:27:27 +00:00
bors
fd5f1a05c1 Auto merge of #14630 - epage:implicit-removal, r=weihanglo
fix: Remove implicit feature removal

### What does this PR try to resolve?

Due to problems we ran into with #14016, we're removing implicit features from the 2024 edition to give ourselves more time to design it as we should.

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

### Additional information

I could have added a new flag for this or made an EditionNext but I decided to remove it in the hopes to avoid any path dependency in solving this the next time.
2024-10-01 20:06:46 +00:00
bors
8fdd7f4b78 Auto merge of #14631 - weihanglo:config-cli, r=epage
docs(config): make `--config <PATH>` more prominent
2024-10-01 19:33:51 +00:00
Weihang Lo
b4253e5057
fix(help): mention --config <PATH> in help text 2024-10-01 14:54:52 -04:00
bors
135ea1c653 Auto merge of #14624 - rust-lang:renovate/unicode-width-0.x, r=epage
chore(deps): update rust crate unicode-width to 0.2.0

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [unicode-width](https://redirect.github.com/unicode-rs/unicode-width) | workspace.dependencies | minor | `0.1.13` -> `0.2.0` |

---

### Release Notes

<details>
<summary>unicode-rs/unicode-width (unicode-width)</summary>

### [`v0.1.14`](https://redirect.github.com/unicode-rs/unicode-width/compare/v0.1.13...v0.1.14)

[Compare Source](https://redirect.github.com/unicode-rs/unicode-width/compare/v0.1.13...v0.1.14)

</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:eyJjcmVhdGVkSW5WZXIiOiIzOC45Ny4wIiwidXBkYXRlZEluVmVyIjoiMzguOTcuMCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6W119-->
2024-10-01 18:51:23 +00:00
Weihang Lo
6269ab4dd9
docs(config): make --config <PATH> more prominent 2024-10-01 14:31:10 -04:00
Ed Page
7be5a2146b fix: Remove implicit feature removal
Due to problems we ran into with #14016, we're removing implicit
features from the 2024 edition to give ourselves more time to design it
as we should.

I could have added a new flag for this or made an EditionNext but I
decided to remove it in the hopes to avoid any path dependency in
solving this the next time.
2024-10-01 11:48:31 -05:00
bors
bd31b4a805 Auto merge of #14628 - weihanglo:cargo-deny, r=epage
chore(deps): update embarkstudios/cargo-deny-action action to v2

### What does this PR try to resolve?

See

* https://github.com/rust-lang/cargo/pull/14625
* https://github.com/EmbarkStudios/cargo-deny-action/releases

for the full list of changes.

Notably changes that would affect this repository:

* `[advisories.unmaintained]` and  `[advisories.notice]` have become deny-by-default and these fields are all removed. Exceptions can only be added to specific advisory via [`ignore`](https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html#the-ignore-field-optional)

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

CI passes.
2024-10-01 13:50:09 +00:00
Weihang Lo
96ef4e4e7d
chore(deps): update embarkstudios/cargo-deny-action action to v2 2024-10-01 09:13:19 -04:00
renovate[bot]
a6a2b66e0f chore(deps): update rust crate unicode-width to 0.2.0 2024-10-01 03:12:10 +00:00
bors
2fd7321ee4 Auto merge of #14619 - epage:msrv-docs, r=weihanglo
docs(ref): Clean up language for `package.rust-version`

### What does this PR try to resolve?

Some small tweaks I noticed as I was working on putting in more MSRV policy guidance.

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

### Additional information
2024-09-30 21:25:54 +00:00
bors
dc041a0599 Auto merge of #14312 - weihanglo:doc, r=epage
docs: clarify `target.'cfg(...)'`  doesnt respect cfg from build script
2024-09-30 20:53:38 +00:00
Weihang Lo
828c7ef16f
docs: clarify target.'cfg(...)' doesnt respect cfg from build script
This was a mistake, see https://github.com/rust-lang/cargo/issues/14306
2024-09-30 16:40:47 -04:00
Ed Page
d74f02e642 docs(ref): Group all functional comments 2024-09-30 15:25:42 -05:00
Ed Page
f51524c0b7 docs(ref): Fix mistake on how many fields a rust-version must include 2024-09-30 15:25:09 -05:00
Ed Page
fe70046edd docs(ref): Remove reference to interplay of rust-version/edition
Ideally, we have rust-version checks on more fields and we shouldn't have to specify
every variant of this.

By removing this, it gives us more breathing room to expand the text
more generally.
2024-09-30 15:24:15 -05:00
Ed Page
f42831b356 docs(ref): Remove duplicate MSRV comment about MSRV
Previousl, we've added a -note to each item in a consistent style.
2024-09-30 15:23:15 -05:00
bors
fe50f67b60 Auto merge of #14618 - weihanglo:relax-more, r=epage
test: relax compiler panic assertions

### What does this PR try to resolve?

Minimize the panic output assertion per request from <https://github.com/rust-lang/cargo/pull/14602#issuecomment-2378205191>.

Instead of snapshotting the entire panic message,
here we only check the precense of our custom messaage.

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

Test suite passes.
2024-09-30 19:27:18 +00:00
Weihang Lo
dfa8f26ddc
test(test): unnecessay env_remove("RUST_BACKTRACE")
This is done for all tests in f3c7525a61d61b347ed9e2e278dd84cc8c943531
2024-09-30 14:23:47 -04:00
Weihang Lo
e965b41fa0
test(test): relax compiler panic assertions 2024-09-30 14:23:47 -04:00
Weihang Lo
c3a74f5c36
test(rustflags): relax compiler panic assertions 2024-09-30 14:23:47 -04:00
Weihang Lo
e2946ab9fb
test(install): relax compiler panic assertions 2024-09-30 14:23:47 -04:00
Weihang Lo
d6ebb14227
test(features2): relax compiler panic assertions 2024-09-30 14:23:47 -04:00
Weihang Lo
7cb5be34c0
test(bench): relax compiler panic assertions 2024-09-30 14:23:47 -04:00
Weihang Lo
3f1b82893a
test(artifact_dep): relax compiler panic assertions 2024-09-30 13:26:49 -04:00
Weihang Lo
8534276f0d
test(build-std): relax compiler panic assertions 2024-09-30 13:25:34 -04:00
Weihang Lo
b1f574a10d
test(jobserver): relax compiler panic assertions 2024-09-30 13:25:33 -04:00
Weihang Lo
e4e970d309
test(freshness): relax compiler panic assertions 2024-09-30 13:25:33 -04:00
bors
5e2878f786 Auto merge of #14608 - weihanglo:deserialize, r=epage
refactor(compiler): zero-copy deserialization when possible
2024-09-29 02:05:25 +00:00
bors
2d368ed844 Auto merge of #14583 - x-hgg-x:features-sat-resolver, r=Eh2406
test: add support for features in the sat resolver

### What does this PR try to resolve?

This PR implements the first step of https://github.com/rust-lang/cargo/pull/11938#issuecomment-1868426431.

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

The first commit does some refactorings, and the second commit updates the SAT resolver.

List of boolean variables in the SAT resolver:
* One variable representing the activation of each registry package.
* One variable representing the activation of each feature of a given registry package.
* In the `sat_resolve()` method, we create an additional representing the activation of the root package.

List of clauses in the SAT resolver:
* If a package feature is activated, then the package should be activated.
* No two packages with the same links set.
* No two semver compatible versions of the same package.
* For each package:
    - For each feature:
        - If the package feature is activated and it depends of another feature of the same package, then it is also activated.
        - If the package feature is activated and it depends of a dependency, then at least one of the compatible dependency package should be activated.
        - If the package feature is activated and it depends of a feature of a dependency, then the feature of a compatible dependency package should be activated only if the compatible dependency package is activated. If this is not a weak dependency feature, then at least one of the compatible dependency package should be activated.
    - For each dependency, if the package is activated and if the dependency is non-optional or has been activated, then at least one of the compatible dependency package and its required features should be activated.
* The root package has the same dependency clauses but has no features.

List of assumptions in the SAT resolver:
* The root package is activated.
* Old root packages from previous calls to `sat_resolve()` are deactivated. This is necessary since the proptest call `sat_resolve()` several times with a different root package using the same SAT resolver, and clauses relative to the root package are not removable.
2024-09-27 21:29:29 +00:00
Weihang Lo
d6b740f6f3
refactor: use Cow on artifact notification
`artifact` field is an (absolute) path to emitted artifact like
/home/projects/foo/target/debug/deps/libbar-73d672db2af2c9a8.rmeta

It is worth not copying them.
2024-09-27 17:18:47 -04:00
Weihang Lo
cdba1c7bee
refactor: use RawValue::from_string for potential perf win 2024-09-27 17:07:38 -04:00
Weihang Lo
9a6a9451ba
refactor: zero-copy deserialization when possible
Found this during PR review.

We could leverage `#[serde(borrow)]` for zero-copy deserialization for
messages from the compiler.

We can't use `&str` fields because they may contain escape sequences
in the future, which fails the deserialization.
See https://github.com/serde-rs/json/issues/742
2024-09-27 17:06:44 -04:00
x-hgg-x
6f1315be84 test: add support for features in the sat resolver 2024-09-27 22:09:32 +02:00
bors
80d82ca22a Auto merge of #14607 - ChrisDenton:cc, r=epage
Update cc to 1.1.22

This version of `cc` contains [a fix](https://github.com/rust-lang/cc-rs/releases/tag/cc-v1.1.22) to prevent spurious rebuilds. Hopefully this should help avoid the CI issues rustc has been having.
2024-09-27 17:56:01 +00:00
Chris Denton
a5503c1480
Update cc to1.1.22 2024-09-27 17:31:46 +00:00
bors
1fad770250 Auto merge of #14556 - Ifropc:lockfile-path-install, r=weihanglo
feat: lockfile path implies --locked on cargo install

Follow-up of https://github.com/rust-lang/cargo/issues/14421
Resolving one of the items
> cargo install should make --lockfile-path imply --locked

Simply mirrored behavior as if `--locked` was provided (on creating the workspace)
2024-09-27 16:57:50 +00:00
bors
b396f2c3aa Auto merge of #14591 - epage:autolib, r=weihanglo
feat(toml): Add `autolib`

### What does this PR try to resolve?

PR #5335 added `autobins`, etc for #5330.  Nowhere in there is
discussion of `autolib`.

Cargo script disables support for additional build-targets by disabling
discovery.
Except we don't have a way to disable discovery of `autolib`, leading to #14476.
By adding `autolib`, we can continue in that direction.

This also allows us to bypass inferring of libs on published packages,
like all other build-targets which were handled in #13849.

Fixes #14476

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

### Additional information

As this seems fairly low controversy, this insta-stabilizes the field.
In prior versions of Cargo, users will get an "unused manifest key"
warning.
For packages where this is set by `cargo publish`, the warning will be suppressed and things will work as normal.
For `cargo vendor`, the same except there will be some churn in the
vendored source as this field will now be set.
For local development, it should be rare to set `autolib` so the lack of
error by discovering a file when this is set shouldn't be a problem.
2024-09-27 12:25:16 +00:00
bors
a3b35a0ccc Auto merge of #14598 - yichi170:correct-error-count, r=weihanglo
fix: correct error count for `cargo check --message-format json`

Hi! This is my first time contributing to Cargo. If there is anything that I need to do, please let me know!
(I'm not sure whether the commit message is aligned with the Cargo's convention. If it doesn't, I'm willing to modify it!)

This PR resolves the issue with incorrect error count and ensures warnings are correctly displayed when using `cargo check --message-format json`.

Fixes #14472
2024-09-27 11:47:04 +00:00
yichi170
71c830ccef fix: correct error count for cargo check --message-format json 2024-09-26 23:07:51 -05:00
bors
43e3fa9025 Auto merge of #14602 - weihanglo:rust-122565, r=epage
test: relax panic output assertion

### What does this PR try to resolve?

rust-lang/rust#122565 adds a new line to thread panic output. To make the current test suites works on stable, beta, and nightly, this relaxes the assertion around that by globbing everything.

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

Switch to rust-lang/rust#122565 and build a stage0 std, then use it to run these Cargo tests.

Linking to stage0 toolchain should work: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#creating-a-rustup-toolchain
2024-09-26 21:15:26 +00:00
Weihang Lo
498ae399bf
test: relax panic output assertion
rust-lang/rust#122565 adds a new line to thread panic output.
To make the current test suites works on stable, beta, and nightly,
this relaxes the assertion around that by globbing everything.
2024-09-26 16:00:54 -04:00
x-hgg-x
aece1f4623 test: refactor resolver test functions 2024-09-26 15:43:26 +02:00
bors
9d66d13e44 Auto merge of #14588 - ahaoboy:dark-mode, r=weihanglo
feat(timings): support dark color scheme in HTML output

### What does this PR try to resolve?

Use CSS variables to control colors in different modes

Fixes #14586

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

Switch to dark mode to preview cargo-timing.html file

### Additional information

I am not an expert in CSS. The color table is generated by gpt. Maybe there are other better color schemes.

<img width="1671" alt="Snipaste_2024-09-24_19-36-14" src="https://github.com/user-attachments/assets/5a4556f6-8c5b-4c81-af1d-9d2cdb304201">
<img width="1644" alt="Snipaste_2024-09-24_19-36-50" src="https://github.com/user-attachments/assets/0ae0457c-8fcc-463a-bbb9-ec9e549021b6">
2024-09-26 13:32:55 +00:00
bors
7cbdcf0b21 Auto merge of #14404 - Ifropc:cargo_manifest_path, r=weihanglo
feat: add CARGO_MANIFEST_PATH env variable

Adds `CARGO_MANIFEST_PATH` variable as part of https://github.com/rust-lang/cargo/issues/12207
Context: `CARGO_MANIFEST_DIR` is not very useful, because there is no `Cargo.toml` file when running a cargo script. In cases when multiple scripts are stored in the same folder, we can't tell which script exactly is being run using `CARGO_MANIFEST_DIR`
2024-09-26 13:01:01 +00:00
ahaoboy
3401cb8fe2 timings: add dark mode 2024-09-26 14:21:39 +08:00
ahaoboy
fd63023cf5 timings: use css variables 2024-09-26 14:21:32 +08:00
Ifropc
d4ac929563 test: add tests for CARGO_MANIFEST_PATH in build.rs
- Uses same checks as for already existing CARGO_MANIFEST_DIR
2024-09-26 01:43:16 -04:00
Ifropc
bf37cf7f32 feat: --lockfile-path add install support 2024-09-26 01:19:40 -04:00
bors
4b81a83267 Auto merge of #14579 - linyihai:issue-14560, r=epage
fix(config): Don't double-warn about `$CARGO_HOME/config`

### What does this PR try to resolve?

The core requirements for this bug are
- You have a `$CARGO_HOME/.config`
- Your project is inside of `$HOME`

We have a check to make sure we don't double-walk `$CARGO/config` but
that check is *after* we warn about there being no `.toml` extension.

To fix this, we just need to move that check outside of the file lookup.
This required changing the `seen` check from checking whether walked the
config file to checking if we've walked the config dir.  As we only have
one file per directory, this should work.

Fixes #14560

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

test commit added the test, fix commit fixed the issue.

### Additional information
2024-09-26 01:45:10 +00:00