1079 Commits

Author SHA1 Message Date
bors
28274d0a51 Auto merge of #14724 - epage:resolver, r=weihanglo
test(install): Verify 2024 edition / resolver=3 doesn't affect resolution

### What does this PR try to resolve?

I was worried there might be bugs related to this.  With this out of the way, I think we'll be ready to stabilize `resolver = "3"`.

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

### Additional information
2024-10-25 13:41:40 +00:00
bors
cf9152007e Auto merge of #14683 - dacianpascu06:355adcad7, r=epage
Added unstable-schema generation for Cargo.toml

### What does this PR try to resolve?

Added unstable-schema feature that generates JsonSchema for Cargo.toml

See #12883
finished first step of [plan](https://github.com/rust-lang/cargo/issues/12883#issuecomment-2407648385)

### Information
In cargo-util-schemas,  run cargo test --feature unstable-schema  . If there have been any changes to manifest.schema.json, rerun with env variable SNAPSHOTS=overwrite  and it will update them.

### How should we test and review this PR?
In cargo-util-schemas run cargo test --features unstable-schema and it will generate manifest.schema.json
2024-10-24 21:26:44 +00:00
dacian
21ce69ef37 feat: unstable-json-schema generation for Cargo.toml 2024-10-25 00:05:11 +03:00
Ed Page
646e29abb5 feat(test): Allow setting edition on published packages 2024-10-23 15:14:08 -05:00
Ed Page
255f622299 feat(test): Allow setting resolver on published packages 2024-10-23 14:53:46 -05:00
bors
42f41439b2 Auto merge of #14707 - x-hgg-x:sat-fixes, r=Eh2406
test: add fixes in the sat resolver

### What does this PR try to resolve?

This is a follow-up of https://github.com/rust-lang/cargo/pull/14614.

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

Commit 1 removes duplicate variables in the sat resolver.
Commit 2 removes useless clones in the sat resolver.

r? Eh2406
2024-10-22 18:17:36 +00:00
Weihang Lo
c9102e54bb
refactor(rustfix): only compute snippets when needed 2024-10-20 20:42:22 -04:00
Weihang Lo
f483dc0b95
refactor(rustfix): simplify debug print for Span 2024-10-20 20:42:22 -04:00
Weihang Lo
6ac20fd1be
refactor(rustfix): remove unnecessary indentations 2024-10-20 20:42:22 -04:00
Weihang Lo
446e3f05ba
chore(rustfix): bump to 0.8.8 2024-10-20 20:42:22 -04:00
x-hgg-x
c85d8329d0 test: Avoid needlessly cloning in the sat resolver 2024-10-19 21:57:45 +02:00
x-hgg-x
af9b2d75a5 test: Avoid creating duplicate variables in the sat resolver 2024-10-19 21:57:30 +02:00
renovate[bot]
341d619f66
chore(deps): update msrv 2024-10-19 01:35:59 -04:00
Ed Page
5b84fc99c5 feat(test): Snapshot .crate validation 2024-10-17 06:26:47 +08:00
Ed Page
5c25f7a9b8 refactor(test): Simplify handling of tar file prefixes 2024-10-17 06:26:47 +08:00
Ed Page
6d048153b3 refactor(test): Pull out new POST parsing 2024-10-17 06:26:47 +08:00
Ed Page
e52b041a4d chore(test): Bump to 0.6 2024-10-17 06:26:47 +08:00
bors
a4600184b8 Auto merge of #14668 - dacianpascu06:bump, r=epage
chore(deps): update rust crate pulldown-cmark to 0.12.0

### What does this PR try to resolve?

Closes #14667

### How should we test and review this PR?
Cargo build-man stopped giving errors after updating pulldown-cmark
### Additional information
2024-10-10 20:27:06 +00:00
dacian
54bbe02489 chore(deps): update rust crate pulldown-cmark to 0.12.0 2024-10-10 22:38:01 +03:00
x-hgg-x
3d4d48b0ff fix: use rustc-hash in the resolver 2024-10-10 20:06:31 +02:00
x-hgg-x
2579ec3d08 test: add a test showing a slow case in the resolver 2024-10-10 20:06:30 +02: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
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
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
5c87c14f9a docs: Declare support level for each crate in our Charter / docs
This is to bring us into conformance with the [Rust crate ownership
policy](https://forge.rust-lang.org/policies/crate-ownership.html).

Items of note
- `cargo-credential-1password` is declared as Experimental as it is
  intended for the community but I was unsure if we wanted to commit to
  full support for it.  In my mind, the ideal thing to do would be to
  expatriate this to 1password.
- `home` is declared as Internal despite its wide use within the
  ecosystem.
- `cargo-credential` is declared as Intentional as its an API intended
  for the wider ecosystem and I didn't see a reason to declare it
  experimental.
- `cargo-platform`, `cargo-util-schemas`, and `crates-io` are declared
  as Intentional as they are both used internally and intended for
  others to use for logic that integrates with cargo/registries.
  I wondered about these being Experimental or Internal instead.
2024-09-26 12:43:09 -05:00
Ed Page
d199f2e97c chore: Bump versions 2024-09-26 12:43:09 -05:00
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
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
x-hgg-x
6f1315be84 test: add support for features in the sat resolver 2024-09-27 22:09:32 +02:00
x-hgg-x
aece1f4623 test: refactor resolver test functions 2024-09-26 15:43:26 +02:00
Ed Page
5e35e271bc feat(toml): Add autolib
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.

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 packags 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.

Fixes #14476
2024-09-24 11:24:24 -05:00
Ed Page
da18686f29 chore(schemas): Bump version 2024-09-24 11:24:24 -05:00
Ed Page
7ab9320664 fix(test): Remove with_stdout/with_stderr 2024-09-23 20:44:41 -05:00
Ed Page
61b8903e59 chore(test): Bump for breaking changes 2024-09-23 20:44:40 -05:00
Ed Page
1f5f7021e5 fix(test):; Allow '0 files' to not be redacted 2024-09-23 20:44:14 -05:00
Ed Page
1b94fb2326 chore: Bump MSRV to 1.81
This is prep for using `#[expect]`.

Its not clear why RenovateBot didn't do this.
2024-09-23 19:45:57 -05:00
Ed Page
f4c7ed1990 fix(pkgid): Allow open namespaces in PackageIdSpec's 2024-08-28 10:35:16 -05:00
Ed Page
c81e82dffb refactor(pkgid): Pull out spec parsing 2024-08-28 10:19:13 -05:00
Ed Page
00604fa152 test(pkgid): Show existing pkgid behavior 2024-08-28 10:03:37 -05:00
Ed Page
8dd37c1d22 refactor(schema): Pull out test helpers for reuse 2024-08-28 10:03:37 -05:00
Kornel
f3c7525a61
Tests rely on absence of RUST_BACKTRACE 2024-08-21 23:12:05 +01:00
Daniel Paoliello
8e2a37cc17 [mdman] Normalize newlines when rendering options 2024-08-19 15:02:04 -07:00
Daniel Paoliello
a250d275ef [mdman] Add a test for a code block split across multiple lines in an options template 2024-08-19 15:01:32 -07:00
Joe Birr-Pixton
b9fe71853e Correct diagnostic for TomlDebugInfo
This is missing the friendly aliases introduced in 3dbb474c.
2024-08-16 16:48:03 +01:00
Daniel Paoliello
502c74e0a5 Implement base paths (RFC 3529) 1/n: path dep and patch support 2024-08-13 15:00:45 -07:00