From 99b05104ee91c7088539183b917cdc66c2c3a0b3 Mon Sep 17 00:00:00 2001 From: chrysn Date: Tue, 27 Sep 2022 09:28:40 +0200 Subject: [PATCH 1/3] CI: Test Rust both with hello-world and gcoap example Build failures after https://github.com/RIOT-OS/riotdocker/pull/189 show that the test coverage is insufficient to catch C2Rust breakage; this mitigates it by building an example that pulls in much more code. --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9ba19fe..d5bedf36 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -141,6 +141,7 @@ jobs: # action does only minimal fetching. (cd RIOT && git fetch origin master && git checkout FETCH_HEAD) make -CRIOT/examples/rust-hello-world BUILDTEST_MAKE_REDIRECT='' buildtest + make -CRIOT/examples/rust-gcoap BUILDTEST_MAKE_REDIRECT='' buildtest (cd RIOT && git switch -) env: BUILD_IN_DOCKER: 1 From a6dcf98cc4b07f17299696dc5dba2eeae5c9868b Mon Sep 17 00:00:00 2001 From: chrysn Date: Tue, 27 Sep 2022 09:33:20 +0200 Subject: [PATCH 2/3] Update C2Rust --- riotbuild/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riotbuild/Dockerfile b/riotbuild/Dockerfile index d932de8d..aac8289f 100644 --- a/riotbuild/Dockerfile +++ b/riotbuild/Dockerfile @@ -344,7 +344,7 @@ RUN \ RUN \ echo 'Installing C2Rust' >&2 && \ - CARGO_HOME=/opt/rustup/.cargo cargo install --no-track --locked c2rust --git https://github.com/immunant/c2rust --rev ed56c794230bbf5a0e417941e4778316d31ab114 && \ + CARGO_HOME=/opt/rustup/.cargo cargo install --no-track --locked c2rust --git https://github.com/immunant/c2rust --rev 7d88216756204553a44e2b1a39f840922229d5d6 && \ echo 'Cleaning up root-owned crates.io cache' >&2 && \ rm -rf /opt/rustup/.cargo/{git,registry,.package-cache} From 676997657ecf1e93b74d1f267b99b136f5b27dbe Mon Sep 17 00:00:00 2001 From: chrysn Date: Tue, 27 Sep 2022 14:12:52 +0200 Subject: [PATCH 3/3] C2Rust: Use fixes needed with Jammy's LLVM This uses a branch of the LLVM PR which fixes C2Rust's issue . Both have been preexisting for a while, but became critical when switching over to the current LLVM version. --- riotbuild/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riotbuild/Dockerfile b/riotbuild/Dockerfile index aac8289f..bc42ef68 100644 --- a/riotbuild/Dockerfile +++ b/riotbuild/Dockerfile @@ -344,7 +344,7 @@ RUN \ RUN \ echo 'Installing C2Rust' >&2 && \ - CARGO_HOME=/opt/rustup/.cargo cargo install --no-track --locked c2rust --git https://github.com/immunant/c2rust --rev 7d88216756204553a44e2b1a39f840922229d5d6 && \ + CARGO_HOME=/opt/rustup/.cargo cargo install --no-track --locked c2rust --git https://github.com/chrysn-pull-requests/c2rust --branch riscv-vector-types && \ echo 'Cleaning up root-owned crates.io cache' >&2 && \ rm -rf /opt/rustup/.cargo/{git,registry,.package-cache}