18701 Commits

Author SHA1 Message Date
bors
12caaff7c2 Auto merge of #14659 - tweag:publish-workspace-cli-args, r=<try>
Support package selection options like `--exclude` in `cargo publish`

Fixes #14652.

Is there a way to make the help text depend on whether nightly/unstable features are enabled? I couldn't find one...
2024-10-09 11:12:30 +00:00
Joe Neeman
3e1a989611 Support package-selection arguments in cargo publish 2024-10-09 14:36:27 +07:00
Joe Neeman
45565f8aec Add failing test 2024-10-09 14:35:15 +07:00
bors
15fbd2f607 Auto merge of #14137 - Xaeroxe:checksum-freshness, r=weihanglo
initial version of checksum based freshness

Implementation for https://github.com/rust-lang/cargo/issues/14136 and resolves https://github.com/rust-lang/cargo/issues/6529

This PR implements the use of checksums in cargo fingerprints as an alternative to using mtimes. This is most useful on systems with poor mtime implementations.

This has a dependency on https://github.com/rust-lang/rust/pull/126930. It's expected this will increase the time it takes to declare a build to be fresh. Still this loss in performance may be preferable to the issues the ecosystem has had with the use of mtimes for determining freshness.
2024-10-08 21:08:11 +00:00
Jacob Kiesel
cf893c1695
test(freshness_checksum): verify cargo depinfo is properly encoded 2024-10-08 16:30:54 -04:00
Jacob Kiesel
c0e550ee5b
test(freshness_checksum): different fingeprint methods are compatible
This ensures that users can switch between different fingerprint
freshness methods and still correctly rebuild stuff.
2024-10-08 16:29:46 -04:00
Jacob Kiesel
0d08e19661
test(freshness_checksum): verify unstable flag is gated correctly 2024-10-08 16:29:45 -04:00
Weihang Lo
66998ea24a
test(freshness_checksum): verify checksum works
Two new tests:

* checksum_actually_uses_checksum: chekcsum works when mtime forwards
* same_size_different_content: checksum does check content
2024-10-08 16:29:45 -04:00
Weihang Lo
b48fe7354f
test(freshness_checksum): remove unnecessary sleep
We don't rely on mtime anymore for checksum-based fingerprint
2024-10-08 16:29:45 -04:00
Weihang Lo
74cc1deb51
test(freshness_checksum): enable -Zfreshness-checksum
These tests are modified or renamed to reflect the switch to
checksum fingerprint:

* bust_patched_dep
* modifying_and_moving
* rebuild_on_mid_build_file_modification
* rebuild_sub_package_then_while_package
* skip_mtime_check_in_selected_cargo_home_subdirs
* use_mtime_cache_in_cargo_home
2024-10-08 16:29:45 -04:00
Weihang Lo
e5a44e24a1
test(freshness_checksum): requires nightly rustc 2024-10-08 16:29:45 -04:00
Weihang Lo
eea5fe9b00
test(freshness_checksum): remove unnecessary tests
* cargo_env_changes
* fingerprint_cleaner_does_not_rebuild
* modify_only_some_files
* rebuild_if_build_artifacts_move_forward_in_time
* simulated_docker_deps_stay_cached
* update_dependency_mtime_does_not_rebuild
2024-10-08 16:29:45 -04:00
Weihang Lo
9b17115534
test(freshness_checksum): update test module description 2024-10-08 16:29:45 -04:00
Weihang Lo
ad7d33d893
test: copy freshness tests in preparation of checksum tests 2024-10-08 16:29:44 -04:00
Jacob Kiesel
b9420f87cf
Add appropriate documentation 2024-10-08 16:29:44 -04:00
Jacob Kiesel
0d2e8a5619
add bsd 2 clause to allow list for blake3 dep arrayref 2024-10-08 16:29:44 -04:00
Jacob Kiesel
f4ca739073
implement checksum freshness fingerprints for cargo 2024-10-08 16:29:44 -04:00
bors
ac39e69a0f Auto merge of #14656 - shannmu:_cargo_publish_registry_completer, r=epage
feat: Add custom completer for completing registry name

### What does this PR try to resolve?
Tracking issue https://github.com/rust-lang/cargo/issues/14520

Add custom completer for completing `cargo publish --registry <TAB>` and `cargo add --registry <TAB>`.
2024-10-08 16:42:13 +00:00
bors
42a774bb8a Auto merge of #14657 - ehuss:deprecate-build-plan, r=epage
Document build-plan as being deprecated

This adds a note to the build-plan documentation that it is deprecated. I do not think it will make any progress as it is. In the future, we should remove the feature (#7902), possibly with a code-warning ahead of time.
2024-10-08 16:07:10 +00:00
Eric Huss
bc2eba1333 Document build-plan as being deprecated 2024-10-08 08:57:17 -07:00
shannmu
245cba27db feat: Add custom completer for completing registry name 2024-10-08 23:50:00 +08:00
bors
9026f9565c Auto merge of #14653 - epage:complete, r=ehuss
fix(complete): Don't complete files for any value

### What does this PR try to resolve?
We now need to opt-in to path completions for values, which can be as simple as setting the value parser to be for `PathBuf`s.

We'll now show a lot less irrelevant completions.

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

### Additional information
2024-10-08 15:35:41 +00:00
bors
aea3404eae Auto merge of #14614 - x-hgg-x:more-sat-resolver-tests, r=Eh2406
Add more SAT resolver tests

### What does this PR try to resolve?

This is a follow-up of #14583.

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

* Commit 1 splits tests into smaller modules.
* Commit 2 adds more helper trait methods.
* Commit 3 refactors computation of the SAT clauses, by introducing intermediate boolean variables for each dependency and each dependency feature declared in a package.
The old behavior was incorrect: package features specified in an optional dependency were activated if the package was activated, even if the dependency wasn't activated.
* Commit 4 add tests from https://github.com/Eh2406/pubgrub-crates-benchmark/tree/main/out/index_ron.

r? Eh2406
2024-10-08 14:25:42 +00:00
bors
fbcd9bb571 Auto merge of #14464 - linyihai:issue-14194, r=weihanglo
fix: avoid inserting duplicate `dylib_path_envvar` when calling `cargo run` recursively

### What does this PR try to resolve?

If the current program started by `cargo run` recursively call into `cargo run`, the second `cargo run` will insert  `search_path`  into `dylib_path_envvar` again.

Fixes #14194

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

The first commit adds the test to reflect the issue. The first call to `cargo run` stores the dylib search path env var to a file. Subsequent calls verify that env var remains the same.

The second commit fixes the behavior by checking if env vars in `search_path` are a prefix of the slice of env vars in `dylib_path_envvar`.
2024-10-08 12:51:33 +00:00
Lin Yihai
54dbc2bf66 fix: Avoid inserting search_path again. 2024-10-08 16:20:21 +08:00
Lin Yihai
e888c1306f test: Add test for issue-14194 2024-10-08 16:16:25 +08:00
x-hgg-x
dedf251c27 test: add tests from pubgrub 2024-10-08 08:06:15 +02:00
x-hgg-x
870f6d31d7 test: refactor sat resolver clauses computation
Add new intermediate boolean variables for each dependency and each dependency feature declared in a package.
This is used to simplify computation of the sat clauses.

Add support for multiple dependencies with the same name, if their kind or target is different.

A non-weak dependency feature for an optional dependency now activates a feature of the same name in the sat resolver.
2024-10-08 08:04:43 +02:00
x-hgg-x
04e4270758 test: add more resolver helper methods 2024-10-08 08:04:43 +02:00
x-hgg-x
cc4c3e784a test: separate resolver tests into multiple files 2024-10-08 08:04:43 +02:00
Ed Page
244578e9e2 fix(complete): Don't complete files for any value
We now need to opt-in to path completions for values, which can be as
simple as setting the value parser to be for `PathBuf`s.

We'll now show a lot less irrelevant completions.
2024-10-07 21:01:03 -05:00
bors
2e309bd754 Auto merge of #14489 - rust-lang:dependabot/cargo/gix-path-0.10.10, r=weihanglo
chore(deps): bump gix-path from 0.10.9 to 0.10.11

Bumps [gix-path](https://github.com/Byron/gitoxide) from 0.10.9 to 0.10.10.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/Byron/gitoxide/releases">gix-path's releases</a>.</em></p>
<blockquote>
<h2>gix-path v0.10.10</h2>
<p>A maintenance release without user-facing changes.</p>
<h3>Commit Statistics</h3>
<ul>
<li>6 commits contributed to the release over the course of 12 calendar days.</li>
<li>35 days passed between releases.</li>
<li>0 commits were understood as <a href="https://www.conventionalcommits.org">conventional</a>.</li>
<li>0 issues like '(#ID)' were seen in commit messages</li>
</ul>
<h3>Commit Details</h3>
<!-- raw HTML omitted -->
<!-- raw HTML omitted -->
<ul>
<li><strong>Uncategorized</strong>
<ul>
<li>Prepare changelogs prior to release (0f25841)</li>
<li>Merge pull request <a href="https://redirect.github.com/Byron/gitoxide/issues/1523">#1523</a> from martinvonz/push-xmsuurxprnnw (83c9de0)</li>
<li>Remove <code>--system</code> from <code>git config</code> call as it fails on MacOS (6b1c243)</li>
<li>Run <code>git config -l</code> in temp dir when looking up system config (20ef4e9)</li>
<li>Merge branch 'push-ysnqkzlzwuwq' (e2c747d)</li>
<li>Don't show console on Windows (087594c)</li>
</ul>
</li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="d19af16e1d"><code>d19af16</code></a> Release gix-date v0.9.0, gix-actor v0.31.6, gix-validate v0.9.0, gix-object v...</li>
<li><a href="0f2584178a"><code>0f25841</code></a> prepare changelogs prior to release</li>
<li><a href="9ed2b24e5d"><code>9ed2b24</code></a> Merge branch 'improvements'</li>
<li><a href="6990afd269"><code>6990afd</code></a> fix: similarity detection</li>
<li><a href="f8c5d9ce87"><code>f8c5d9c</code></a> fix similarity detection</li>
<li><a href="25a3f1b0b0"><code>25a3f1b</code></a> Merge pull request <a href="https://redirect.github.com/Byron/gitoxide/issues/1531">#1531</a> from EliahKagan/progress-typos</li>
<li><a href="ba72ee0f06"><code>ba72ee0</code></a> fix!: better peeling performance for reference traversal.</li>
<li><a href="9f9feb6545"><code>9f9feb6</code></a> add progress report for July</li>
<li><a href="b31d6b79fd"><code>b31d6b7</code></a> Fix typos in config support info</li>
<li><a href="242fedc973"><code>242fedc</code></a> Merge branch 'improvements'</li>
<li>Additional commits viewable in <a href="https://github.com/Byron/gitoxide/compare/gix-path-v0.10.9...gix-path-v0.10.10">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=gix-path&package-manager=cargo&previous-version=0.10.9&new-version=0.10.10)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

You can trigger a rebase of this PR by commenting ``@dependabot` rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- ``@dependabot` rebase` will rebase this PR
- ``@dependabot` recreate` will recreate this PR, overwriting any edits that have been made to it
- ``@dependabot` merge` will merge this PR after your CI passes on it
- ``@dependabot` squash and merge` will squash and merge this PR after your CI passes on it
- ``@dependabot` cancel merge` will cancel a previously requested merge and block automerging
- ``@dependabot` reopen` will reopen this PR if it is closed
- ``@dependabot` close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- ``@dependabot` show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency
- ``@dependabot` ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- ``@dependabot` ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/rust-lang/cargo/network/alerts).

</details>

> **Note**
> Automatic rebases have been disabled on this pull request as it has been open for over 30 days.
2024-10-08 00:07:37 +00:00
dependabot[bot]
7a58e6fbd0
chore(deps): bump gix-path from 0.10.9 to 0.10.11
Bumps [gix-path](https://github.com/Byron/gitoxide) from 0.10.9 to 0.10.11.
- [Release notes](https://github.com/Byron/gitoxide/releases)
- [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Byron/gitoxide/compare/gix-path-v0.10.9...gix-path-v0.10.11)

---
updated-dependencies:
- dependency-name: gix-path
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-07 19:24:32 -04:00
bors
ab361f24a3 Auto merge of #14647 - elchukc:refactor_pkg_activated_features, r=weihanglo
improve error reporting when feature not found in `activated_features`

Pulls the error message refactor out of #14593 (originally #13207) to improve error reporting when we fail to get the list of activated features enabled for the given package. It now fully lists the activated_features hashmap keys too.

From the [original author](https://github.com/rust-lang/cargo/pull/13207#issue-2056019109):

> I moved `activated_features_int` into `activated_features` and `activated_features_unverified` as I was concerned of the performance cost of generating the full error when its not a fatal error and may occur many times.

Old vs new error message:
```diff
- activated_features for invalid package: features did not find PackageId { name: "bindep", version: "0.0.0", source: "[ROOT]/foo/bindep" } NormalOrDev
+ did not find features for (PackageId { name: "bindep", version: "0.0.0", source: "[ROOT]/foo/bindep" }, NormalOrDev) within activated_features:
+ [
+     (
+         PackageId {
+             name: "bindep",
+             version: "0.0.0",
+             source: "[ROOT]/foo/bindep",
+         },
+         ArtifactDep(
+             CompileTarget {
+                 name: "[ALT_TARGET]",
+             },
+         ),
+     ),
+     (
+         PackageId {
+             name: "foo",
+             version: "0.0.0",
+             source: "[ROOT]/foo",
+         },
+         NormalOrDev,
+     ),
+ ]
```
r? weihanglo
2024-10-05 21:29:43 +00:00
Lucas Kent
1623c414ad improve error reporting when feature not found in activated_features 2024-10-05 17:10:54 -04:00
bors
ad074abe3a Auto merge of #14576 - epage:tests, r=weihanglo
test: Remove the last of our custom json assertions

### What does this PR try to resolve?

This is part of #14039 and consolidates us down to only one way of doing json assertions, using snapbox.

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

### Additional information
2024-10-04 18:18:15 +00:00
bors
e1179b5507 Auto merge of #14636 - epage:msrv-policy, r=weihanglo
docs(ref): Expand on MSRV

### What does this PR try to resolve?

The need for this has been growing and becomes especially important with the upcoming MSRV aware resolver
We will be making having an MSRV easier so we need to meet those maintainers where they are and help them.

In particular, this covers
- What setting an MSRV does
- What "support" in MSRV means, according to the definition we developed during the review of [RFC 3537](https://rust-lang.github.io/rfcs/3537-msrv-resolver.html)
- Background and guidance on setting an MSRV policy

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

### Additional information

This intentionally leaves out anything related to the MSRV-aware resolver as that will be handled as the feature is stabilized.
2024-10-04 17:04:01 +00:00
Ed Page
c3f19a8ec1 refactor(test): Migrate validate_upload to snapbox for json comparisons 2024-10-03 21:15:10 -05:00
Ed Page
01a47f3c4d fix(test): Remove unused, deprecated with_json 2024-10-03 21:15:10 -05:00
Ed Page
c18765a152 test: Migrate remaining build with_json tests to snapbox 2024-10-03 21:15:10 -05:00
Ed Page
f92e54faf9 test: Migrate remaining metadata with_json tests to snapbox 2024-10-03 21:15:10 -05:00
Ed Page
01e138fc0e chore: Update snapbox 2024-10-03 21:09:18 -05:00
Ed Page
b48e5f1e5f docs(ref): Step users through MSRV policies 2024-10-03 16:14:11 -05:00
Ed Page
9ae75338c1 docs(ref): Set Rust version support expectations 2024-10-03 16:14:11 -05:00
Ed Page
17ecc17ea9 docs(ref): Expand on uses of Rust version 2024-10-03 16:14:11 -05:00
Ed Page
e38e966d0d docs(ref): Change from rust-version from compilation to support 2024-10-03 16:14:10 -05:00
Ed Page
1652c3bdb2 docs(ref): Split rust-version into its own chapter 2024-10-03 16:11:52 -05:00
bors
0473ee8b87 Auto merge of #14620 - epage:guideless, r=weihanglo
docs: Minor re-grouping of pages

### What does this PR try to resolve?

In figuring out where MSRV documentation should live, I found the location of some items confusing
- Publishing is written in more of a guide-form, rather than reference
- Caching is written in more of a reference form, rather than a guide, and is more advanced
- Dependency references were scattered, making it harder to find

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

### Additional information
2024-10-03 20:01:11 +00:00
bors
a06986cda6 Auto merge of #14638 - epage:msrv-feat, r=ehuss
docs(ref): Highleft whats left for msrv-policy

### What does this PR try to resolve?

While there is a tracking issue for these,
I didn't want to have everything under `msrv-policy` to be stabilized,
making it look like it should be moved to the Stable section of the
page, when there are independently stabilizable pieces missing.

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

### Additional information

This is prep for stabilizing MSRV-aware resover
2024-10-03 16:45:54 +00:00
Ed Page
cb2bcc938b docs(ref): Highleft whats left for msrv-policy
While there is a tracking issue for these,
I didn't want to have everything under `msrv-policy` to be stabilized,
making it look like it should be moved to the Stable section of the
page, when there are independently stabilizable pieces missing.
2024-10-03 10:17:46 -05:00