Skip to content

Commit f9e9889

Browse files
authored
Prep release (#719)
Resolves: #706 Resolves: #718
1 parent 2182b47 commit f9e9889

File tree

9 files changed

+74
-39
lines changed

9 files changed

+74
-39
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
<!-- next-header -->
1010
## [Unreleased] - ReleaseDate
11+
### Fixed
12+
- [PR#703](https://github.com/EmbarkStudios/cargo-deny/pull/703) resolved [#696](https://github.com/EmbarkStudios/cargo-deny/issues/696) by no longer emitting errors when failing to deserialize deprecated fields, and removed some lingering documentation that wasn't removed in [PR#611](https://github.com/EmbarkStudios/cargo-deny/pull/611).
13+
- [PR#719](https://github.com/EmbarkStudios/cargo-deny/pull/719) updated to `krates` -> 0.17.5, fixing an issue where `cargo-deny` could [panic](https://github.com/EmbarkStudios/krates/issues/97) due to [incorrectly resolving](https://github.com/EmbarkStudios/krates/issues/84) features for different versions of the same crate referenced by a single crate.
14+
- [PR#719](https://github.com/EmbarkStudios/cargo-deny/pull/719) resolved [#706](https://github.com/EmbarkStudios/cargo-deny/issues/706) by removing a warning issued when users use ignored scheme modifiers for source urls.
15+
- [PR#719](https://github.com/EmbarkStudios/cargo-deny/pull/719) resolved [#718](https://github.com/EmbarkStudios/cargo-deny/issues/718) by updating the book with missing arguments.
16+
17+
### Added
18+
- [PR#715](https://github.com/EmbarkStudios/cargo-deny/pull/715) resolved [#714](https://github.com/EmbarkStudios/cargo-deny/issues/714) by adding support for Edition 2024. Thanks [@kpcyrd](https://github.com/kpcyrd)!
19+
- [PR#710](https://github.com/EmbarkStudios/cargo-deny/pull/710) resolved [#708](https://github.com/EmbarkStudios/cargo-deny/issues/708) by allowing for unpublished workspace crates to be excluded from the dependency graph that checks are run against, either via the `--exclude-unpublished` CLI argument or the `graph.exclude-unpublished` config field. Thanks [@Tastaturtaste](https://github.com/Tastaturtaste)!
20+
21+
### Changed
22+
- [PR#711](https://github.com/EmbarkStudios/cargo-deny/pull/711) updated `goblin` -> 0.9.2
23+
- [PR#713](https://github.com/EmbarkStudios/cargo-deny/pull/713) updated various crates, notably `rustsec` -> 0.30.
24+
1125
## [0.16.1] - 2024-08-05
1226
### Fixed
1327
- [PR#691](https://github.com/EmbarkStudios/cargo-deny/pull/691) fixed an issue where workspace dependencies that used the current dir '.' path component would incorrectly trigger the `unused-workspace-dependency` lint.

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/src/checks/cfg.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ If set, and `--features` is not specified on the cmd line, these features will b
7272

7373
If set to `true`, all `dev-dependencies`, even one for workspace crates, are not included in the crate graph used for any of the checks. This option can also be enabled on cmd line with `--exclude-dev` either [before](../cli/common.md#--exclude-dev) or [after](../cli/check.md#--exclude-dev) the `check` subcommand.
7474

75+
### The `exclude-unpublished` field (optional)
76+
77+
If set to `true`, workspace crates marked as `publish = false` will not be used as roots in the dependency graph, meaning they, and any dependencies they have that aren't directly or indirectly referenced by workspace crates that _are_ published, will be excluded from the dependency graph that checks are executed against.
78+
7579
## The `output` field (optional)
7680

7781
### The `feature-depth` field (optional)

docs/src/cli/common.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,31 @@ Possible values:
7272

7373
One or more platforms to filter crates with. If a dependency is target specific, it will be ignored if it does not match at least 1 of the specified targets. This overrides the top-level [`targets = []`](../checks/cfg.md) configuration value.
7474

75-
### `--offline`
75+
### `--exclude-unpublished`
7676

77-
Disables network I/O.
77+
If set, exclude unpublished workspace members from graph roots.
78+
79+
Workspace members are considered unpublished if they they are explicitly marked with `publish = false`. Note that the excluded workspace members are still used for the initial dependency resolution by cargo, which might affect the exact version of used dependencies.
80+
81+
### `--allow-git-index`
82+
83+
If set, the crates.io git index is initialized for use in fetching crate information, otherwise it is enabled only if using a cargo < 1.70.0 without the sparse protocol enabled
84+
85+
### [`--locked`](https://doc.rust-lang.org/cargo/commands/cargo-fetch.html#option-cargo-fetch---locked)
86+
87+
Asserts that the exact same dependencies and versions are used as when the existing Cargo.lock file was originally generated. Cargo will exit with an error when either of the following scenarios arises:
88+
89+
* The lock file is missing.
90+
* Cargo attempted to change the lock file due to a different dependency resolution.
91+
92+
### [`--offline`](https://doc.rust-lang.org/cargo/commands/cargo-fetch.html#option-cargo-fetch---offline)
93+
94+
Prevents Cargo and `cargo-deny` from accessing the network for any reason. Without this flag, Cargo will stop with an error if it needs to access the network and the network is not available. With this flag, Cargo will attempt to proceed without the network if possible.
95+
96+
Beware that this may result in different dependency resolution than online mode. Cargo will restrict itself to crates that are downloaded locally, even if there might be a newer version as indicated in the local copy of the index. See the cargo-fetch(1) command to download dependencies before going offline.
97+
98+
`cargo-deny` will also not fetch advisory databases with this option, meaning that any new or updated advisories since the last time the database(s) were fetched won't be known and thus won't be checked against the dependency graph.
99+
100+
### [`--frozen`](https://doc.rust-lang.org/cargo/commands/cargo-fetch.html#option-cargo-fetch---frozen)
101+
102+
Equivalent to specifying both `--locked` and `--offline`.

docs/src/cli/list.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ Similarly to [cargo-license](https://github.com/onur/cargo-license), `list` prin
44

55
## Options
66

7+
### `-c, --config <CONFIG>`
8+
9+
Path to the config to use
10+
11+
Defaults to `<cwd>/deny.toml` if not specified
12+
713
### `-f, --format`
814

915
The format of the output
@@ -12,13 +18,7 @@ The format of the output
1218
* `json`
1319
* `tsv`
1420

15-
### `--color`
16-
17-
Output coloring, only applies to the `human` format.
18-
19-
* `auto` (default) - Only colors if stdout is a TTY
20-
* `always` - Always emits colors
21-
* `never` - Never emits colors
21+
### [`--color`](../cli/common.md#--color)
2222

2323
Colors:
2424

src/cargo-deny/main.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,30 +79,31 @@ pub(crate) struct GraphContext {
7979
/// Space or comma separated list of features to activate
8080
#[arg(long, value_delimiter = ',')]
8181
pub(crate) features: Vec<String>,
82-
/// Require Cargo.lock and cache are up to date
82+
/// Equivalent to specifying both `--locked` and `--offline`
8383
#[arg(long)]
8484
pub(crate) frozen: bool,
85-
/// Require Cargo.lock is up to date
86-
#[arg(long)]
87-
pub(crate) locked: bool,
8885
/// Run without accessing the network.
8986
///
9087
/// If used with the `check` subcommand, this disables advisory database
9188
/// fetching
9289
#[arg(long)]
9390
pub(crate) offline: bool,
91+
/// Assert that `Cargo.lock` will remain unchanged
92+
#[arg(long)]
93+
pub(crate) locked: bool,
9494
/// If set, the crates.io git index is initialized for use in fetching crate information, otherwise it is enabled
9595
/// only if using a cargo < 1.70.0 without the sparse protocol enabled
9696
#[arg(long)]
9797
pub(crate) allow_git_index: bool,
98-
#[arg(long)]
9998
/// If set, excludes all dev-dependencies, not just ones for non-workspace crates
100-
pub(crate) exclude_dev: bool,
10199
#[arg(long)]
100+
pub(crate) exclude_dev: bool,
102101
/// If set, exclude unpublished workspace members from graph roots.
103-
/// Workspace members are considered unpublished if they they are explicitly marked with `publish = false` as such.
102+
///
103+
/// Workspace members are considered unpublished if they they are explicitly marked with `publish = false`.
104104
/// Note that the excluded workspace members are still used for the initial dependency resolution by cargo,
105105
/// which might affect the exact version of used dependencies.
106+
#[arg(long)]
106107
pub(crate) exclude_unpublished: bool,
107108
}
108109

src/sources/cfg.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,6 @@ impl cfg::UnvalidatedConfig for Config {
157157

158158
if let Some(start_scheme) = astr.find("://") {
159159
if let Some(i) = astr[..start_scheme].find('+') {
160-
ctx.push(
161-
Diagnostic::warning()
162-
.with_message("scheme modifiers are unnecessary")
163-
.with_labels(vec![Label::primary(
164-
ctx.cfg_id,
165-
aurl.span.start..aurl.span.start + start_scheme,
166-
)]),
167-
);
168-
169160
skip = i + 1;
170161
}
171162
}
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
---
22
source: src/sources/cfg.rs
33
expression: diags
4+
snapshot_kind: text
45
---
5-
warning: scheme modifiers are unnecessary
6-
┌─ tests/cfg/sources.toml:7:6
7-
8-
7"sparse+https://fake.sparse.com",
9-
│ ━━━━━━━━━━━━
6+

tests/snapshots/cargo_deny__test__cargo_deny.snap

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
source: src/cargo-deny/main.rs
33
expression: help_text
4+
snapshot_kind: text
45
---
56
Cargo plugin to help you manage large dependency graphs
67

@@ -73,24 +74,26 @@ Options:
7374
Space or comma separated list of features to activate
7475

7576
--frozen
76-
Require Cargo.lock and cache are up to date
77-
78-
--locked
79-
Require Cargo.lock is up to date
77+
Equivalent to specifying both `--locked` and `--offline`
8078

8179
--offline
8280
Run without accessing the network.
8381

8482
If used with the `check` subcommand, this disables advisory database fetching
8583

84+
--locked
85+
Assert that `Cargo.lock` will remain unchanged
86+
8687
--allow-git-index
8788
If set, the crates.io git index is initialized for use in fetching crate information, otherwise it is enabled only if using a cargo < 1.70.0 without the sparse protocol enabled
8889

8990
--exclude-dev
9091
If set, excludes all dev-dependencies, not just ones for non-workspace crates
9192

9293
--exclude-unpublished
93-
If set, exclude unpublished workspace members from graph roots. Workspace members are considered unpublished if they they are explicitly marked with `publish = false` as such. Note that the excluded workspace members are still used for the initial dependency resolution by cargo, which might affect the exact version of used dependencies
94+
If set, exclude unpublished workspace members from graph roots.
95+
96+
Workspace members are considered unpublished if they they are explicitly marked with `publish = false`. Note that the excluded workspace members are still used for the initial dependency resolution by cargo, which might affect the exact version of used dependencies.
9497

9598
-h, --help
9699
Print help (see a summary with '-h')

0 commit comments

Comments
 (0)