44 Commits

Author SHA1 Message Date
Ed Page
5965c15179 fix(toml): Disallow ignored default-features when inheriting 2024-05-01 12:04:07 -05:00
Ed Page
2e686d46f3 test(toml): Show default features inheritance on 2024 Edition 2024-05-01 12:04:07 -05:00
Ed Page
06a57142f1 fix(toml): Warn, rather than fail publish, if targets are excluded
This could offer performance gains when parsing a published
manifest since the targets don't need to be discovered.
To see this, we'd first need to stop discovering potential targets even when it isn't
needed.
2024-04-29 12:25:56 -05:00
Ed Page
1e6047763d fix(toml): Warn, rather than fail publish, if build.rs is excluded
This could offer a minor performance gain when reading this manifest
since the target doesn't need to be discovered.
2024-04-29 12:25:19 -05:00
Ed Page
39f1a210b8 perf(toml): Avoid looking up readme on published packages
Not much of a performance gain;
this is mostly done to be consistent with the target work.
2024-04-29 12:25:19 -05:00
Ed Page
bdd4bda518 fix(toml)!: Remove support for inheriting badges
We allowed `[badges]` to inherit from `[workspace.package.badges]`

This was a bug:
- This was not specified in the RFC
- We did not document this
- Even if someone were to try to guess to use this, it is inconsistent
  with how inheritance works because this should inherit from
  `workspace.badges` instead of `workspace.package.badges`

While keeping in mind that `[badges]` is effectively deprecated.

In that context, I think its safe to break support for this without a
transition period.

Fixes #13643
2024-04-22 14:22:01 -05:00
Ed Page
cf23e4b538 fix(toml)!: Disallow source-less dependencies
This is part of #13629

This turns deps like
```toml
foo = { optional = true }
```
from `version="*"` deps with a warning into errors.
This breaking change was deemed acceptable because this behavior has
been considered a bug from the beginning.
We have gotten little to no feedback about people wanting this behavior.

This improves our forwards-compatibility story as we can add new
dependency sources and they won't be considered a wildcard registry
dependency on older cargo.
2024-04-18 12:55:27 -05:00
Ed Page
1876326b6b feat(resolve): Tell the user the style of resovle done
This is to help with #9930

Example changes:
```diff
-[LOCKING] 4 packages
+[LOCKING] 4 packages to latest version
-[LOCKING] 2 packages
+[LOCKING] 2 packages to latest Rust 1.60.0 compatible versions
-[LOCKING] 2 packages
+[LOCKING] 2 packages to earliest versions
```

Benefits
- The package count is of "added" packages and this makes that more
  logically clear
- This gives users transparency into what is happening, especially with
  - what rust-version is use
  - the transition to this feature in the new edition
  - whether the planned config was applied or not (as I don't want it to
    require an MSRV bump)
- Will make it easier in tests to show what changed
- Provides more motiviation to show this message in `cargo update` and
  `cargo install` (that will be explored in a follow up PR)

This does come at the cost of more verbose output but hopefully not too
verbose.  This is why I left off other factors, like avoid-dev-deps.
2024-04-13 20:39:59 -05:00
Ed Page
cad9673785 refactor(package): Move preamble to Manifest 2024-03-28 13:29:24 -05:00
Ed Page
4ab2797f36 feat(lock): Print lockfile changes on all commands 2024-03-12 13:39:56 -05:00
Ed Page
14646e6af6 test: Make edition explicit on packages 2024-02-22 11:37:03 -06:00
Ed Page
e7e8d8748a fix(compiler): Clarify we're showing a profile name 2024-02-08 14:01:39 -06:00
Ed Page
69eb49194b fix: Switch more notes/warnings to lowercase
See https://doc.crates.io/contrib/implementation/console.html#style

By fixing existing cases, we make it more likely people will copy a case
they should.

I left out multi-sentance cases because I was unsure how to handle those

r? @weighanglo
2024-02-06 19:52:12 -06:00
Scott Schafer
0d62ae2fc3
feat: Add rustc style errors for manifest parsing 2023-12-15 13:30:10 -07:00
Ed Page
96fa278540 test(manifest): Verify we warn on unused workspace.package fields
Inspired by #13258
2024-01-08 09:21:31 -06:00
Ed Page
53dcd2f454 fix(manifest): Provide more context on sematic errors 2023-08-24 16:27:53 -05:00
Ed Page
5cac7aa8c6 fix(toml): Remove redundant error messages 2023-08-24 16:19:48 -05:00
cassaundra
5554889f88
Include rust-version in publish request
crates.io reads rust-version from the tarball directly, but we can include it in
the publish request for the sake of consistency for third-party registries.
2023-04-26 11:59:29 -07:00
hi-rustin
af0cd9fc5a Improve error message for empty dep
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-04-20 09:32:24 +08:00
Eric Huss
3c295cf5ec Update tests for publish text changes 2023-03-15 08:50:11 -07:00
Scott Schafer
a32af2fff1 fix(toml): Provide a way to show unused manifest keys for workspace inheritance 2023-03-01 13:43:57 -06:00
Eric Huss
1c4651e5f3 Fix tests with nondeterministic ordering 2023-02-24 17:28:28 -08:00
hi-rustin
5751e17c9b Change the download output order 2023-02-23 09:11:52 +08:00
hi-rustin
0b06a456f2 Make blocking tests non blocking 2023-02-23 09:11:52 +08:00
Scott Schafer
df909b938c chore: update inheritable_workspace_fields tests to use check 2023-02-20 12:21:27 -06:00
Ed Page
6007f05a85 chore: Update to toml v0.6, toml_edit v0.18
`toml` replaces `toml_edit::easy`, using `toml_edit` as its parser.
2023-01-19 15:26:28 -06:00
Scott Schafer
712b327f32 refactor(toml): Move TomlWorkspaceDependency out of TomlDependency 2023-01-25 10:50:55 -06:00
Scott Schafer
49d722cfe6 fix(toml): Add default-features to TomlWorkspaceDependency 2023-01-10 11:53:45 -06:00
Arlo Siemsen
7cd613773d Fix several tests that are waiting 60 seconds for publishing to time out 2022-11-17 15:54:24 -06:00
Arlo Siemsen
dd5134c7a5 Implement RFC 3289: source replacement ambiguity 2022-10-07 22:30:59 -05:00
Scott Schafer
ab18bd40d5 refactor(testsuite): Replace [project] with [package] 2022-09-26 09:51:16 -06:00
Wim Looman
492358a19f
Only override published resolver when the workspace is different 2022-08-10 09:26:50 +02:00
Wim Looman
d953c3b2d7
Override to resolver=1 in published package 2022-07-29 16:03:05 +02:00
Scott Schafer
2c810afda9 Stabilize workspace inheritance 2022-07-23 09:36:49 -05:00
Scott Schafer
c239e407e7 add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
Scott Schafer
a18b97f8f3 Prefer dependency.workspace = true to dependency = { workspace = true } when only specifying { workspace = true } 2022-04-20 10:45:18 -05:00
Scott Schafer
ea79548c1b Prefer field.workspace = true to field = { workspace = true } 2022-04-20 10:44:53 -05:00
Scott Schafer
114f1e53f7 Part 7 of RFC2906 - Add support for inheriting exclude and include 2022-04-13 18:32:53 -05:00
Scott Schafer
494eb293ff Part 6 of RFC2906 - Switch the inheritance source from workspace to workspace.package 2022-04-13 15:22:38 -05:00
Scott Schafer
327976f36a Part 5 of RFC2906 - Add support for inheriting rust-version 2022-04-13 12:03:40 -05:00
Scott Schafer
3bbb781ae7 Part 4 of RFC2906 - Add support for inheriting readme 2022-04-08 15:18:48 -05:00
Scott Schafer
3d07652c38 Part 3 of RFC2906 - Add support for inheriting license-path, and depednency.path 2022-04-07 16:34:34 -05:00
scott
0cd55465a4 Part 2 of RFC2906 - allow inheriting from parent workspaces 2022-04-04 15:32:46 -05:00
scott
e6992d4310 -- renamed deduplicate_workspace to inheritable_workspace_fields
-- removed `[]` from error messages in favor of back-ticks
2022-03-23 16:47:06 -05:00