Skip to content

Commit

Permalink
rust: Make dependencies visible
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
chrysn committed Mar 20, 2024
1 parent a2250f4 commit 1c2c65b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sys/rust_riotmodules/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ publish = false

riot-module-lsm303agr = { path = "../../drivers/lsm303agr", optional = true }
riot-module-shell-democommands = { path = "../../sys/shell/democommands", optional = true }

[features]
# This feature is just there so that rust_riotmodules_standalone can use its
# _all; see documentation there.
_all = [ "riot-module-lsm303agr", "riot-module-shell-democommands"]
30 changes: 30 additions & 0 deletions sys/rust_riotmodules_standalone/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions sys/rust_riotmodules_standalone/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,11 @@ codegen-units = 1
riot-wrappers = { version = "0.8", features = [ "set_panic_handler" ] }

rust_riotmodules = { path = "../rust_riotmodules" }

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

0 comments on commit 1c2c65b

Please sign in to comment.