Skip to content

Commit 4be243f

Browse files
kilian-huKilian Hu
andauthored
fix: warn about no pinning strategy for unused features (#4065)
Co-authored-by: Kilian Hu <[email protected]>
1 parent fbd8ab6 commit 4be243f

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

crates/pixi_manifest/src/toml/manifest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ impl TomlManifest {
390390

391391
warnings.push(Warning::from(
392392
GenericError::new(format!(
393-
"The feature '{}' is defined but not used in any environment",
393+
"The feature '{}' is defined but not used in any environment. Dependencies of unused features are not resolved or checked, and use wildcard (*) version specifiers by default, disregarding any set `pinning-strategy`",
394394
feature_name
395395
))
396396
.with_opt_span(span)

crates/pixi_manifest/src/toml/snapshots/pixi_manifest__toml__feature__test__mismatching_excluded_target_selector.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ expression: "expect_parse_warnings(r#\"\n [workspace]\n name = \"t
1616
╰────
1717
help: Add one of 'osx-64', 'osx-arm64' to the supported platforms, using `pixi project platform add osx-64`
1818

19-
The feature 'foo' is defined but not used in any environment
19+
The feature 'foo' is defined but not used in any environment. Dependencies of unused features are not resolved or checked, and use wildcard (*) version specifiers by default, disregarding any
20+
set `pinning-strategy`
2021
╭─[pixi.toml:7:18]
2122
6
2223
7 │ [feature.foo]

crates/pixi_manifest/src/toml/snapshots/pixi_manifest__toml__feature__test__mismatching_target_selector.snap

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ expression: "expect_parse_warnings(r#\"\n [workspace]\n name = \"t
1616
╰────
1717
help: Add osx-64 to the supported platforms, using `pixi project platform add osx-64`
1818

19-
The feature 'foo' is defined but not used in any environment
19+
The feature 'foo' is defined but not used in any environment. Dependencies of unused features are not resolved or checked, and use wildcard (*) version specifiers by default, disregarding any
20+
set `pinning-strategy`
2021
╭─[pixi.toml:7:18]
2122
6
2223
7 │ [feature.foo.target.osx-64.dependencies]

crates/pixi_manifest/src/toml/snapshots/pixi_manifest__toml__manifest__test__unused_features.snap

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
source: crates/pixi_manifest/src/toml/manifest.rs
33
expression: "expect_parse_warnings(r#\"\n [workspace]\n name = \"foo\"\n channels = []\n platforms = ['osx-64']\n\n [feature.foobar.dependencies]\n\n [feature.generic.target.osx.dependencies]\n \"#,)"
44
---
5-
The feature 'foobar' is defined but not used in any environment
5+
The feature 'foobar' is defined but not used in any environment. Dependencies of unused features are not resolved or checked, and use wildcard (*) version specifiers by default, disregarding any
6+
set `pinning-strategy`
67
╭─[pixi.toml:7:18]
78
6
89
7 │ [feature.foobar.dependencies]
@@ -11,7 +12,8 @@ expression: "expect_parse_warnings(r#\"\n [workspace]\n name = \"f
1112
╰────
1213
help: Remove the feature from the manifest or add it to an environment
1314

14-
The feature 'generic' is defined but not used in any environment
15+
The feature 'generic' is defined but not used in any environment. Dependencies of unused features are not resolved or checked, and use wildcard (*) version specifiers by default, disregarding
16+
any set `pinning-strategy`
1517
╭─[pixi.toml:9:18]
1618
8
1719
9 │ [feature.generic.target.osx.dependencies]

0 commit comments

Comments
 (0)