Skip to content

Commit a5c9ac2

Browse files
committed
rust: Make dependencies visible
The Cargo.lock of rust_riotmodules_standalone should explicitly list all versions of software that would ever be pulled in by enabling RIOT modules backed by a Rust crate. That way, the Cargo.lock file will not spontaneously change because the software is being built with a different set of modules enabled. This did not happen before, because while the optional dependencies could all be selected on the command line, they were not visible as possible features to `cargo update`, and were thus not encoded in the Cargo.lock file.
1 parent a0ee4de commit a5c9ac2

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

sys/rust_riotmodules/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,8 @@ publish = false
1212

1313
riot-module-lsm303agr = { path = "../../drivers/lsm303agr", optional = true }
1414
riot-module-shell-democommands = { path = "../../sys/shell/democommands", optional = true }
15+
16+
[features]
17+
# This feature is just there so that rust_riotmodules_standalone can use its
18+
# _all; see documentation there.
19+
_all = [ "riot-module-lsm303agr", "riot-module-shell-democommands"]

sys/rust_riotmodules_standalone/Cargo.lock

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

sys/rust_riotmodules_standalone/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ codegen-units = 1
1919
riot-wrappers = { version = "0.8", features = [ "set_panic_handler" ] }
2020

2121
rust_riotmodules = { path = "../rust_riotmodules" }
22+
23+
[features]
24+
# By having this explicit feature (comapred to what is enabled by the build
25+
# system as `--features rust_riotmodules/foo`), all possible dependencies are
26+
# visible to `cargo update` and in `Cargo.lock. This should not be enabled for
27+
# compilation, as the modules behind it likely have their own RIOT modules they
28+
# need enabled.
29+
_all = [ "rust_riotmodules/_all" ]

0 commit comments

Comments
 (0)