Skip to content

Commit 118d0f8

Browse files
committed
Dockerfile: bump Rust toolchain to 1.78
This reduces the fw binary size by 4176 bytes as compared to the v9.18.0 release. Also bump LLVM 18 - it is unrelated but I did it anyway as the Rust release notes also mentioned that they moved to LLVM 18. The workflow.rs change is due to this deprecation warning: ``` warning: creating a shared reference to mutable static is discouraged --> bitbox02-rust-c/src/workflow.rs:103:11 | 103 | match &CONFIRM_STATE { | ^^^^^^^^^^^^^^ shared reference to mutable static | = note: for more information, see issue #114447 <rust-lang/rust#114447> = note: this will be a hard error in the 2024 edition = note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior = note: `#[warn(static_mut_refs)]` on by default help: use `addr_of!` instead to create a raw pointer | 103 | match addr_of!(CONFIRM_STATE) { ```
1 parent 13c527d commit 118d0f8

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

.ci/run-container-ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
set -e
2626
set -x
2727

28-
CONTAINER=shiftcrypto/firmware_v2:37
28+
CONTAINER=shiftcrypto/firmware_v2:38
2929

3030
if [ "$1" == "pull" ] ; then
3131
docker pull "$CONTAINER"

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ ENV DEBIAN_FRONTEND noninteractive
2020
RUN apt-get update && apt-get upgrade -y && apt-get install -y wget nano rsync curl gnupg2 jq unzip bzip2
2121

2222
# for clang-*-15, see https://apt.llvm.org/
23-
RUN echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" >> /etc/apt/sources.list && \
24-
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" >> /etc/apt/sources.list && \
23+
RUN echo "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" >> /etc/apt/sources.list && \
24+
echo "deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main" >> /etc/apt/sources.list && \
2525
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
2626

2727
# Install gcc8-arm-none-eabi
@@ -37,7 +37,7 @@ RUN mkdir ~/Downloads &&\
3737
# Tools for building
3838
RUN apt-get update && apt-get install -y \
3939
build-essential \
40-
llvm-15 \
40+
llvm-18 \
4141
gcc-10 \
4242
binutils \
4343
valgrind \
@@ -68,8 +68,8 @@ RUN update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-10 100
6868
RUN apt-get update && apt-get install -y \
6969
python3 \
7070
python3-pip \
71-
clang-format-15 \
72-
clang-tidy-15
71+
clang-format-18 \
72+
clang-tidy-18
7373

7474
RUN python3 -m pip install --upgrade pip
7575

src/rust/bitbox02-rust-c/src/workflow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ pub unsafe extern "C" fn rust_workflow_unlock_poll(result_out: &mut bool) -> boo
100100
/// Returns true if there was a result.
101101
#[no_mangle]
102102
pub unsafe extern "C" fn rust_workflow_confirm_poll(result_out: &mut bool) -> bool {
103-
match &CONFIRM_STATE {
104-
TaskState::ResultAvailable(result) => {
103+
match CONFIRM_STATE {
104+
TaskState::ResultAvailable(ref result) => {
105105
CONFIRM_TITLE = None;
106106
CONFIRM_BODY = None;
107107
CONFIRM_PARAMS = None;

src/rust/bitbox02-rust/src/hww/api/ethereum/sign_typed_msg.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,10 @@ async fn hash_struct(
423423
child_formatted_path.push("".into());
424424
for (index, member) in typ.members.iter().enumerate() {
425425
*child_path.last_mut().unwrap() = index as u32;
426-
*child_formatted_path.last_mut().unwrap() = member.name.clone();
426+
child_formatted_path
427+
.last_mut()
428+
.unwrap()
429+
.clone_from(&member.name);
427430
let member_type = member.r#type.as_ref().ok_or(Error::InvalidInput)?;
428431
encode_member(
429432
&mut hasher,

src/rust/rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.76.0
1+
1.78.0

0 commit comments

Comments
 (0)