diff --git a/cpu/riscv_common/Kconfig b/cpu/riscv_common/Kconfig index 707cf33278..ff8958aced 100644 --- a/cpu/riscv_common/Kconfig +++ b/cpu/riscv_common/Kconfig @@ -12,7 +12,7 @@ config CPU_ARCH_RISCV select HAS_NEWLIB select HAS_PERIPH_CORETIMER select HAS_PICOLIBC if '$(RIOT_CI_BUILD)' != '1' - #select HAS_RUST_TARGET + select HAS_RUST_TARGET select HAS_SSP select MODULE_MALLOC_THREAD_SAFE if TEST_KCONFIG diff --git a/cpu/riscv_common/Makefile.features b/cpu/riscv_common/Makefile.features index 39d2d1c083..23a8d9441f 100644 --- a/cpu/riscv_common/Makefile.features +++ b/cpu/riscv_common/Makefile.features @@ -8,7 +8,7 @@ FEATURES_PROVIDED += cpp FEATURES_PROVIDED += libstdcpp FEATURES_PROVIDED += newlib FEATURES_PROVIDED += periph_coretimer -#FEATURES_PROVIDED += rust_target +FEATURES_PROVIDED += rust_target FEATURES_PROVIDED += ssp # RISC-V toolchain on CI does not work properly with picolibc yet diff --git a/makefiles/cargo-targets.inc.mk b/makefiles/cargo-targets.inc.mk index f9343e1ddf..e6b9809ed6 100644 --- a/makefiles/cargo-targets.inc.mk +++ b/makefiles/cargo-targets.inc.mk @@ -11,7 +11,9 @@ CARGO_COMPILE_COMMANDS_FLAGS = --clang $(CARGO_COMPILE_COMMANDS): $(BUILDDEPS) $(Q)DIRS="$(DIRS)" APPLICATION_BLOBS="$(BLOBS)" \ "$(MAKE)" -C $(APPDIR) -f $(RIOTMAKE)/application.inc.mk compile-commands + @# replacement addresses https://github.com/rust-lang/rust-bindgen/issues/1555 $(Q)$(RIOTTOOLS)/compile_commands/compile_commands.py $(CARGO_COMPILE_COMMANDS_FLAGS) $(BINDIR) \ + | sed 's/"riscv-none-embed"/"riscv32"/g' \ | $(LAZYSPONGE) $@ diff --git a/makefiles/docker.inc.mk b/makefiles/docker.inc.mk index cfa6cc7c4e..f94f328790 100644 --- a/makefiles/docker.inc.mk +++ b/makefiles/docker.inc.mk @@ -241,6 +241,11 @@ DOCKER_APPDIR = $(DOCKER_RIOTPROJECT)/$(BUILDRELPATH) # Directory mapping in docker and directories environment variable configuration DOCKER_VOLUMES_AND_ENV += $(call docker_volume,$(ETC_LOCALTIME),/etc/localtime,ro) DOCKER_VOLUMES_AND_ENV += $(call docker_volume,$(RIOTBASE),$(DOCKER_RIOTBASE)) +# Selective components of Cargo to ensure crates are not re-downloaded (and +# subsequently rebuilt) on every run. Not using all of ~/.cargo as ~/.cargo/bin +# would be run by Cargo and that'd be very weird. +DOCKER_VOLUMES_AND_ENV += $(call docker_volume,$(HOME)/.cargo/registry,$(DOCKER_BUILD_ROOT)/.cargo/registry) +DOCKER_VOLUMES_AND_ENV += $(call docker_volume,$(HOME)/.cargo/git,$(DOCKER_BUILD_ROOT)/.cargo/git) DOCKER_VOLUMES_AND_ENV += -e 'RIOTBASE=$(DOCKER_RIOTBASE)' DOCKER_VOLUMES_AND_ENV += -e 'CCACHE_BASEDIR=$(DOCKER_RIOTBASE)'