120 Commits

Author SHA1 Message Date
Ed Page
539a48452a perf: Update toml 2025-07-08 11:55:41 -05:00
Eric Huss
1ce8023626 Rustfmt 2024 2025-07-05 19:50:36 -07:00
Eric Huss
a0d1859575 Apply keyword_idents_2024 2025-07-05 19:29:09 -07:00
Ed Page
d8975d2901 chore: Update incompatible versions 2025-07-01 13:51:18 -05:00
Ed Page
e5987ea9b6 chore: Bump versions 2025-06-26 16:38:16 -05:00
renovate[bot]
e6740738a8
chore(deps): update msrv (1 version) to v1.88 2025-06-26 19:55:27 +00:00
Naman Garg
a9d5cb8abe
Add MultipleScript (error on stable, error about not implemented on nightly) 2025-06-23 19:14:37 +05:30
Naman Garg
126b3a18c1
Refactor normalized_build to accept slice instead of string 2025-06-23 19:14:35 +05:30
Naman Garg
92b00aefc3
Fork StringOrBool into new TomlPackageBuild type and update manifest.schema.json 2025-06-23 19:14:33 +05:30
Naman Garg
93fd488f94
Rename readme variable to build 2025-06-23 19:14:30 +05:30
Eric Huss
0c59ee9009 Bump cargo-util-schemas version
https://github.com/rust-lang/cargo/pull/15643 introduced a semver
breaking change by adding a new pub field to `TomlProfile`.
2025-06-22 15:54:29 -07:00
Josh Triplett
36480ce012 Plumb rustc -Zhint-mostly-unused flag through as a profile option
The rustc `-Zhint-mostly-unused` flag tells rustc that most of a crate
will go unused. This is useful for speeding up compilation of large
dependencies from which you only use a few items. Plumb that option
through as a profile option, to allow specifying it for specific
dependencies:

```toml
[profile.dev.package.huge-mostly-unused-dependency]
hint-mostly-unused = true
```

To enable this feature, pass `-Zprofile-hint-mostly-unused`. However,
since this option is a hint, using it without passing
`-Zprofile-hint-mostly-unused` will only warn and ignore the profile
option. Versions of Cargo prior to the introduction of this feature will
give an "unused manifest key" warning, but will otherwise function
without erroring. This allows using the hint in a crate's `Cargo.toml`
without mandating the use of a newer Cargo to build it.

Add a test verifying that the profile option gets ignored with a warning
without passing `-Zprofile-hint-mostly-unused`, and another test
verifying that it gets handled when passing
`-Zprofile-hint-mostly-unused`.
2025-06-20 15:16:03 -07:00
Josh Triplett
262d4dd5f2 Use Not::not rather than a custom is_false function
The `is_false` function already exists in the standard library, as
`Not::not`; use that in `skip_serializing_if` rather than defining an
`is_false` function.
2025-06-08 19:15:27 -07:00
Ed Page
92cb7b9a60 chore: Upgrade schemars
0.9.0 may look like a downgrade but the maintainer has decided to go
  back to `0.x` versions rather than continuing to use pre-release
versions
2025-05-27 12:34:14 -05:00
Ed Page
31433a3094 chore: Bump package versions 2025-05-20 16:08:34 -05:00
renovate[bot]
8b5fd61ec8
chore(deps): update msrv (1 version) to v1.87 2025-05-15 23:35:57 +00:00
Scott Schafer
df915190e3
chore: Bump cargo-util-schemas to 0.8.2 2025-04-04 22:54:51 -06:00
Scott Schafer
8855150d30
chore: Bump cargo-util-schemas to 0.8.1 2025-04-04 22:45:21 -06:00
Scott Schafer
66991b5a33
chore: Bump cargo-util-schemas to 0.8.0 2025-04-04 22:44:24 -06:00
Eric Huss
be781458a9 Bump versions due to MSRV update 2025-04-03 07:11:48 -07:00
renovate[bot]
fc88578277
chore(deps): update msrv (1 version) to v1.86 2025-04-03 12:07:38 +00: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
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
d5b5074024 refactor(schema): Make TomlPackage defaultable 2025-02-10 14:29:15 -06:00
Ed Page
6ec8da96f4 fix(schema): Mark package.name as optional 2025-02-10 14:29:15 -06:00
renovate[bot]
7ee43a58ec
chore(deps): update msrv (1 version) to v1.84 2025-01-09 19:15:56 +00:00
Ed Page
6fe36c20ad fix(schemas): Make lints.workspace not required 2025-01-08 11:26:39 -06:00
Ed Page
e6114c3395 fix(schema): Include lints sub-tables in packages
This was done by upgrading schemars.  Hard to tell what else was changed
because of the noise from the other changes in the layout.

Fixes #15030
2025-01-08 11:26:39 -06:00
Weihang Lo
4a1e2ea539
fix(schemas): Fix 'metadata' JSON Schema (#15033)
Instead of allowing any type in metadata, we were specifying fields like
`"string": "<any string>"`.

Found this when looking into #15030

<!--
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.
-->
2025-01-08 19:05:19 +00:00
Jacob Finkelman
06811d8594 manual impl of hash 2025-01-08 17:35:54 +00:00
Jacob Finkelman
d8b7c072c5 shortening the comment 2025-01-08 17:35:42 +00:00
Ed Page
e48257d3c8 fix(schemas): Fix 'metadata' JSON Schema
Found this when looking into #15030
2025-01-08 11:26:27 -06:00
Ed Page
e8f3e5e0f2 chore(schema): Bump version 2025-01-08 11:26:27 -06:00
Ed Page
729776b589 fix(schema): Correct and update the JSON Schema
Fixes #14999
2025-01-01 10:14:31 -06:00
Ed Page
4e5af28150 refactor(schema): Group TomlManifest fields to clarify requires_package
I found a bug in the manifest parser and figured this would help make it
more obvious.

Since I was already changing the order, I figure I'm make things a
little more logical (user-facing first, implementtion details later)
2024-12-13 10:31:53 -06:00
Ed Page
6da546c9e1 chore: Bump versions 2024-11-29 10:43:19 -06:00
renovate[bot]
1ec49b8947
chore(deps): update msrv 2024-11-29 03:54:45 +00:00
Ed Page
878caf7447 docs: Surround identifiers in backticks
This was mostly done by clippy via `clippy::doc_markdown`.
I then reviewed it to fix words that shouldn't have it or where `--fix`
put the backtick in the wrong location.
2024-11-15 09:33:23 -06:00
Ed Page
13255d0fc1 fix(schemas): Support deserializing str's as well as Strings
Not needed for `toml` but could be useful for other formats.
2024-11-08 10:21:50 -06:00
dacian
21ce69ef37 feat: unstable-json-schema generation for Cargo.toml 2024-10-25 00:05:11 +03:00
renovate[bot]
341d619f66
chore(deps): update msrv 2024-10-19 01:35:59 -04: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
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
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