1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-16 10:03:50 +01:00

Merge pull request #17761 from chrysn-pull-requests/riot-updates

{examples,tests}/rust: Rust updates (-sys/-wrappers version, stable)
This commit is contained in:
chrysn 2022-03-08 23:32:56 +01:00 committed by GitHub
commit d3e1a1ac9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 49 additions and 23 deletions

View File

@ -84,10 +84,20 @@ Toolchain {#toolchain}
To install the necessary Rust components, it is easiest use [**rustup**, installed as described on its website]. To install the necessary Rust components, it is easiest use [**rustup**, installed as described on its website].
Using Rust on RIOT requires a nightly version of Rust, Using most of Rust on RIOT requires a nightly version of Rust,
because some transpiled expressions for RIOT make use of unstable features, because some transpiled expressions for RIOT make use of unstable features,
and because the RIOT wrappers use some unstable idioms. and because the RIOT wrappers use some unstable idioms.
@note
Building on stable is supported for some examples and platforms starting with Rust 1.59
(e.g., the rust-hello-world on any ARM Cortex, but not yet on native).
Try it out by adding `CARGO_CHANNEL=stable` to the project's Makefile;
where it doesn't work, rustc will complain that "`#![feature]` may not be used on the stable release channel".
@note
A stable version of Rust is not currently provided with the Docker images;
consequently, builds on stable are not tested as regularly as builds on nightly.
Make sure you have both the nightly **toolchain** Make sure you have both the nightly **toolchain**
and the core library for the CPU (**target**) of your choice available: and the core library for the CPU (**target**) of your choice available:

View File

@ -534,7 +534,7 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]] [[package]]
name = "riot-coap-handler-demos" name = "riot-coap-handler-demos"
version = "0.1.0" version = "0.1.0"
source = "git+https://gitlab.com/etonomy/riot-module-examples/#3a4487b3bf678e454aa8b3d6c8003600707d6583" source = "git+https://gitlab.com/etonomy/riot-module-examples/#2fc38cbc4a14529cad9162f4dc3ed0f56c01448c"
dependencies = [ dependencies = [
"coap-handler", "coap-handler",
"coap-handler-implementations", "coap-handler-implementations",
@ -552,9 +552,9 @@ dependencies = [
[[package]] [[package]]
name = "riot-sys" name = "riot-sys"
version = "0.7.2" version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0945e5819b4bf59e0af38998faab1846dc8e9f530b968ace030a66029acdfc69" checksum = "b2041eeef3e226f836d27cace1e6131f88a53b53df0ae62eb1cae060d9eb2a6e"
dependencies = [ dependencies = [
"bindgen", "bindgen",
"c2rust-asm-casts", "c2rust-asm-casts",
@ -568,9 +568,9 @@ dependencies = [
[[package]] [[package]]
name = "riot-wrappers" name = "riot-wrappers"
version = "0.7.17" version = "0.7.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b62946759a8042f516e6b395cc1183da6435e84fcd7a1cd4d9138c8e6a8820ec" checksum = "1fc2844134d2599d7a010382c659aa0713d9ddc845a3791bf48e2801e9f4c59f"
dependencies = [ dependencies = [
"bare-metal 1.0.0", "bare-metal 1.0.0",
"coap-handler", "coap-handler",
@ -758,9 +758,9 @@ dependencies = [
[[package]] [[package]]
name = "termcolor" name = "termcolor"
version = "1.1.2" version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
dependencies = [ dependencies = [
"winapi-util", "winapi-util",
] ]

View File

@ -9,7 +9,7 @@ resolver = "2"
crate-type = ["staticlib"] crate-type = ["staticlib"]
[dependencies] [dependencies]
riot-wrappers = { version = "^0.7", features = [ "with_coap_message", "with_coap_handler" ] } riot-wrappers = { version = "^0.7.18", features = [ "set_panic_handler", "panic_handler_format", "with_coap_message", "with_coap_handler" ] }
coap-message-demos = { git = "https://gitlab.com/chrysn/coap-message-demos/", default-features = false } coap-message-demos = { git = "https://gitlab.com/chrysn/coap-message-demos/", default-features = false }
coap-handler-implementations = "0.3" coap-handler-implementations = "0.3"

View File

@ -30,6 +30,11 @@ DEVELHELP ?= 1
# Change this to 0 show compiler invocation lines by default: # Change this to 0 show compiler invocation lines by default:
QUIET ?= 1 QUIET ?= 1
# Add 3k extra stack: The Rust examples take more of it than gcoap expects,
# presumably because the example use the standard library's sting formatting
# instead of one of the more optimized formatters.
CFLAGS += -DGCOAP_STACK_SIZE='(THREAD_STACKSIZE_DEFAULT+DEBUG_EXTRA_STACKSIZE+sizeof(coap_pkt_t)+1024)'
# The name of crate (as per Cargo.toml package name, but with '-' replaced with '_') # The name of crate (as per Cargo.toml package name, but with '-' replaced with '_')
APPLICATION_RUST_MODULE = rust_gcoap APPLICATION_RUST_MODULE = rust_gcoap
BASELIBS += $(APPLICATION_RUST_MODULE).module BASELIBS += $(APPLICATION_RUST_MODULE).module

View File

@ -1,11 +1,19 @@
BOARD_INSUFFICIENT_MEMORY := \ BOARD_INSUFFICIENT_MEMORY := \
airfy-beacon \
blackpill \ blackpill \
bluepill \ bluepill \
bluepill-stm32f030c8 \ bluepill-stm32f030c8 \
calliope-mini \
im880b \
i-nucleo-lrwan1 \ i-nucleo-lrwan1 \
microbit \
nrf51dongle \
nrf6310 \
nucleo-f030r8 \ nucleo-f030r8 \
nucleo-f031k6 \ nucleo-f031k6 \
nucleo-f042k6 \ nucleo-f042k6 \
nucleo-f070rb \
nucleo-f072rb \
nucleo-f302r8 \ nucleo-f302r8 \
nucleo-f303k8 \ nucleo-f303k8 \
nucleo-f334r8 \ nucleo-f334r8 \
@ -22,4 +30,5 @@ BOARD_INSUFFICIENT_MEMORY := \
stm32g0316-disco \ stm32g0316-disco \
stm32l0538-disco \ stm32l0538-disco \
stm32mp157c-dk2 \ stm32mp157c-dk2 \
yunjia-nrf51822 \
# #

View File

@ -456,9 +456,9 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]] [[package]]
name = "riot-sys" name = "riot-sys"
version = "0.7.2" version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0945e5819b4bf59e0af38998faab1846dc8e9f530b968ace030a66029acdfc69" checksum = "b2041eeef3e226f836d27cace1e6131f88a53b53df0ae62eb1cae060d9eb2a6e"
dependencies = [ dependencies = [
"bindgen", "bindgen",
"c2rust-asm-casts", "c2rust-asm-casts",
@ -472,9 +472,9 @@ dependencies = [
[[package]] [[package]]
name = "riot-wrappers" name = "riot-wrappers"
version = "0.7.17" version = "0.7.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b62946759a8042f516e6b395cc1183da6435e84fcd7a1cd4d9138c8e6a8820ec" checksum = "1fc2844134d2599d7a010382c659aa0713d9ddc845a3791bf48e2801e9f4c59f"
dependencies = [ dependencies = [
"bare-metal 1.0.0", "bare-metal 1.0.0",
"cstr_core", "cstr_core",
@ -637,9 +637,9 @@ dependencies = [
[[package]] [[package]]
name = "termcolor" name = "termcolor"
version = "1.1.2" version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
dependencies = [ dependencies = [
"winapi-util", "winapi-util",
] ]

View File

@ -9,4 +9,5 @@ resolver = "2"
crate-type = ["staticlib"] crate-type = ["staticlib"]
[dependencies] [dependencies]
riot-wrappers = "0.7" # `default-features = false` can be removed with 0.8, and enables building on stable during the 0.7 series
riot-wrappers = { version = "0.7", features = [ "set_panic_handler" ], default-features = false }

View File

@ -456,9 +456,9 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
[[package]] [[package]]
name = "riot-sys" name = "riot-sys"
version = "0.7.2" version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0945e5819b4bf59e0af38998faab1846dc8e9f530b968ace030a66029acdfc69" checksum = "b2041eeef3e226f836d27cace1e6131f88a53b53df0ae62eb1cae060d9eb2a6e"
dependencies = [ dependencies = [
"bindgen", "bindgen",
"c2rust-asm-casts", "c2rust-asm-casts",
@ -472,9 +472,9 @@ dependencies = [
[[package]] [[package]]
name = "riot-wrappers" name = "riot-wrappers"
version = "0.7.17" version = "0.7.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b62946759a8042f516e6b395cc1183da6435e84fcd7a1cd4d9138c8e6a8820ec" checksum = "1fc2844134d2599d7a010382c659aa0713d9ddc845a3791bf48e2801e9f4c59f"
dependencies = [ dependencies = [
"bare-metal 1.0.0", "bare-metal 1.0.0",
"cstr_core", "cstr_core",
@ -637,9 +637,9 @@ dependencies = [
[[package]] [[package]]
name = "termcolor" name = "termcolor"
version = "1.1.2" version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755"
dependencies = [ dependencies = [
"winapi-util", "winapi-util",
] ]

View File

@ -9,4 +9,5 @@ resolver = "2"
crate-type = ["staticlib"] crate-type = ["staticlib"]
[dependencies] [dependencies]
riot-wrappers = "0.7" # `default-features = false` can be removed with 0.8, and enables building on stable during the 0.7 series
riot-wrappers = { version = "0.7", features = [ "set_panic_handler" ], default-features = false }