Skip to content

Commit ba81b09

Browse files
authored
fix(mn): use correct "_any-deps" feature name (#286)
Manganese uses a "private" feature flag called "_any-deps" to determine whether any bindep dependency feature flag is enabled. Unfortunately, some parts of the code mistakenly use the name "_any_deps" (with a second "_" instead of a "-") to refer to this feature, which is incorrect. This results in Manganese always emitting a warning that no deps were installed, even when this is not actually the case. Surprisingly, Rust doesn't warn you when you reference a feature flag that doesn't actually exist, which means we never caught this issue in development. This branch fixes that by using the correct name for the feature flag everywhere. Fixes #285
1 parent f96c103 commit ba81b09

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

.cargo/config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ crowtty = "run --bin crowtty --release --"
33
melpomene = "run --bin melpomene --release --"
44
melpo = "melpomene"
55
forth3 = "run --bin f3repl --release --"
6-
mn = "run --package manganese --bin manganese --release --features=install-deps --"
6+
mn = "run --package manganese --bin manganese --release --features install-deps --"
77

88
[build]
99
# Currently needed for `tokio-console` support.

tools/manganese/Cargo.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ install-deps = [
2424
"trunk",
2525
]
2626

27-
just = ["dep:just", "_any_deps"]
28-
cargo-nextest = ["dep:cargo-nextest", "_any_deps"]
29-
cargo-binutils = ["dep:cargo-binutils", "_any_deps"]
30-
cargo-espflash = ["dep:cargo-espflash", "_any_deps"]
27+
just = ["dep:just", "_any-deps"]
28+
trunk = ["dep:trunk", "_any-deps"]
29+
cargo-nextest = ["dep:cargo-nextest", "_any-deps"]
30+
cargo-binutils = ["dep:cargo-binutils", "_any-deps"]
31+
cargo-espflash = ["dep:cargo-espflash", "_any-deps"]
3132

3233
# dummy feature that indicates any dependency is being installed.
33-
_any_deps = []
34+
_any-deps = []
3435

3536
[dependencies]
3637
anyhow = "1"

tools/manganese/build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
fn main() -> anyhow::Result<()> {
2-
#[cfg(feature = "_any_deps")]
2+
#[cfg(feature = "_any-deps")]
33
install_deps()?;
44

55
Ok(())
66
}
77

8-
#[cfg(feature = "_any_deps")]
8+
#[cfg(feature = "_any-deps")]
99
fn install_deps() -> anyhow::Result<()> {
1010
use anyhow::{Context, Result};
1111
use std::{
@@ -40,15 +40,15 @@ fn install_deps() -> anyhow::Result<()> {
4040

4141
if link.exists() {
4242
fs::remove_file(link).with_context(|| {
43-
format!("failed to remove existing simlink at {}", link.display())
43+
format!("failed to remove existing symlink at {}", link.display())
4444
})?;
4545
}
4646

4747
symlink_file_os(original, link).with_context(|| {
4848
format!(
4949
"failed to create symlink:\nsrc: {}\ndst: {}",
5050
original.display(),
51-
link.display()
51+
link.display(),
5252
)
5353
})?;
5454

0 commit comments

Comments
 (0)