Skip to content

Commit

Permalink
Merge pull request tock#4275 from tock/hail-stable-rustc-version
Browse files Browse the repository at this point in the history
Hail: Specify minimum stable rustc version, makefile auto updates if needed
  • Loading branch information
lschuermann authored Jan 3, 2025
2 parents 47319ba + 4d8770f commit 19d59db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions boards/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,20 @@ ifneq ($(shell $(RUSTUP) target list | grep "$(TARGET) (installed)"),$(TARGET) (
$(shell sleep 5)
$(shell $(RUSTUP) target add $(TARGET))
endif

# If the board the user is compiling is using the stable toolchain, verify that
# the user's stable rustc toolchain is new enough to compile the board. If the
# toolchain is too old, wait 5 seconds and then install for the user.
ifneq ($(shell $(RUSTUP) show active-toolchain | grep "stable"),)
# If the error from running --version shows a version mismatch we know the
# installed toolchain is too old.
ifneq ($(shell $(CARGO) rustc -- --version 2>&1 | grep "is not supported by the following packages"),)
$(warning Your stable rustc is older than the MSRV of this board)
$(warning make will update your stable rustc in 5s)
$(shell sleep 5)
DUMMY := $(shell $(RUSTUP) update)
endif
endif
endif # $(NO_RUSTUP)

# If the user is using the standard toolchain provided as part of the llvm-tools
Expand Down
1 change: 1 addition & 0 deletions boards/hail/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ version.workspace = true
authors.workspace = true
build = "../build.rs"
edition.workspace = true
rust-version = "1.83"

[dependencies]
components = { path = "../components" }
Expand Down

0 comments on commit 19d59db

Please sign in to comment.