From 33af35f6dc16a65efb775031edf07977e7e4556f Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 21:26:31 +0300 Subject: [PATCH 01/26] Create test_ci.yml --- .github/workflows/test_ci.yml | 112 ++++++++++++++++++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 .github/workflows/test_ci.yml diff --git a/.github/workflows/test_ci.yml b/.github/workflows/test_ci.yml new file mode 100644 index 0000000..a3159af --- /dev/null +++ b/.github/workflows/test_ci.yml @@ -0,0 +1,112 @@ +name: test CI + +on: + workflow_dispatch: #Enables manual run of this workflow + +jobs: + build: + runs-on: ubuntu-latest #Version 20.04 is no longer supported (see https://github.com/actions/runner-images/issues/11101) + + continue-on-error: ${{ matrix.experimental || false }} + + strategy: + matrix: + rust: + - 1.62.0 + - nightly + include: + - rust: nightly + experimental: true + + steps: + - uses: actions/checkout@v2 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + components: rustfmt, clippy, llvm-tools-preview + target: thumbv7m-none-eabi + + - name: Install Python dependencies + run: | + pip3 install --user python-dateutil linkchecker + + - name: Cache installed binaries + uses: actions/cache@v1 + id: cache-bin + with: + path: ~/cache-bin + key: cache-bin + + - name: Install mdbook + if: steps.cache-bin.outputs.cache-hit != 'true' + uses: actions-rs/install@v0.1 + with: + crate: mdbook + version: latest + + - name: Install cargo-binutils + if: steps.cache-bin.outputs.cache-hit != 'true' + uses: actions-rs/install@v0.1 + with: + crate: cargo-binutils + version: latest + + - name: Install arm-none-eabi-gcc and qemu + if: steps.cache-bin.outputs.cache-hit != 'true' + run: | + mkdir -p ~/cache-bin/arm_gcc + curl -L https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.07/gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2 \ + | tar --strip-components=1 -C ~/cache-bin/arm_gcc -xj + + curl -L https://github.com/japaric/qemu-bin/raw/master/14.04/qemu-system-arm-2.12.0 \ + > ~/cache-bin/qemu-system-arm + chmod a+x ~/cache-bin/qemu-system-arm + + - name: Copy installed binaries to cache directory + if: steps.cache-bin.outputs.cache-hit != 'true' + run: | + cp ~/.cargo/bin/* ~/cache-bin + + - name: Put new bin directory into path + run: | + echo "$HOME/cache-bin" >> $GITHUB_PATH + echo "$HOME/cache-bin/arm_gcc/bin" >> $GITHUB_PATH + + - name: Test + run: bash ci/script.sh + env: + RUST_VERSION: ${{ matrix.rust }} + + deploy: + runs-on: ubuntu-latest #Version 20.04 is no longer supported (see https://github.com/actions/runner-images/issues/11101) + + needs: [build] + + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + + steps: + - uses: actions/checkout@v2 + + - name: Cache installed binaries + uses: actions/cache@v1 + id: cache-bin + with: + path: ~/cache-bin + key: cache-bin + + - name: Put new bin directory into path + run: echo "$HOME/cache-bin" >> $GITHUB_PATH + + - name: Build the book + run: mdbook build + + - name: Deploy book + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: book + force_orphan: true From 3a0799c750f9983262ca528ff6e2f26e9e97c91c Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 21:31:03 +0300 Subject: [PATCH 02/26] Update test_ci.yml --- .github/workflows/test_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_ci.yml b/.github/workflows/test_ci.yml index a3159af..fa0ef05 100644 --- a/.github/workflows/test_ci.yml +++ b/.github/workflows/test_ci.yml @@ -35,7 +35,7 @@ jobs: pip3 install --user python-dateutil linkchecker - name: Cache installed binaries - uses: actions/cache@v1 + uses: actions/cache@v4 #v1 no longer supported: see https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down id: cache-bin with: path: ~/cache-bin @@ -92,7 +92,7 @@ jobs: - uses: actions/checkout@v2 - name: Cache installed binaries - uses: actions/cache@v1 + uses: actions/cache@v4 #v1 no longer supported: see https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down id: cache-bin with: path: ~/cache-bin From 2cc4425de6cbd2b62b26d0fd5e4193458c9f885c Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 21:54:00 +0300 Subject: [PATCH 03/26] Update test_ci.yml --- .github/workflows/test_ci.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_ci.yml b/.github/workflows/test_ci.yml index fa0ef05..08cc3e1 100644 --- a/.github/workflows/test_ci.yml +++ b/.github/workflows/test_ci.yml @@ -34,12 +34,14 @@ jobs: run: | pip3 install --user python-dateutil linkchecker - - name: Cache installed binaries - uses: actions/cache@v4 #v1 no longer supported: see https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down - id: cache-bin + - name: Cache Cargo installed binaries + uses: actions/cache@v4 + id: cache-cargo with: - path: ~/cache-bin - key: cache-bin + path: ~/cargo-bin + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo- - name: Install mdbook if: steps.cache-bin.outputs.cache-hit != 'true' From 6f47146d0578cf903f15de45a421247caf759726 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 22:11:09 +0300 Subject: [PATCH 04/26] Update test_ci.yml --- .github/workflows/test_ci.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test_ci.yml b/.github/workflows/test_ci.yml index 08cc3e1..f7eff3c 100644 --- a/.github/workflows/test_ci.yml +++ b/.github/workflows/test_ci.yml @@ -21,27 +21,17 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - components: rustfmt, clippy, llvm-tools-preview - target: thumbv7m-none-eabi - name: Install Python dependencies run: | pip3 install --user python-dateutil linkchecker - - name: Cache Cargo installed binaries - uses: actions/cache@v4 - id: cache-cargo + - name: Cache installed binaries + uses: actions/cache@v4 #v1 no longer supported: see https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down + id: cache-bin with: - path: ~/cargo-bin - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo- + path: ~/cache-bin + key: cache-bin - name: Install mdbook if: steps.cache-bin.outputs.cache-hit != 'true' @@ -50,6 +40,18 @@ jobs: crate: mdbook version: latest + #Moved untill after installing mdbook because otherwise installing mdbook fails + #(note all GitHub runners come with the latest stable version of Rust pre-installed and it is that version we want to install mdbook). + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + components: rustfmt, clippy, llvm-tools-preview + target: thumbv7m-none-eabi + + - name: Install cargo-binutils if: steps.cache-bin.outputs.cache-hit != 'true' uses: actions-rs/install@v0.1 From d6f8ffaf658695032677d157df43f2b1b73f537a Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 22:19:00 +0300 Subject: [PATCH 05/26] Update test_ci.yml --- .github/workflows/test_ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test_ci.yml b/.github/workflows/test_ci.yml index f7eff3c..c2d10cb 100644 --- a/.github/workflows/test_ci.yml +++ b/.github/workflows/test_ci.yml @@ -40,8 +40,16 @@ jobs: crate: mdbook version: latest - #Moved untill after installing mdbook because otherwise installing mdbook fails - #(note all GitHub runners come with the latest stable version of Rust pre-installed and it is that version we want to install mdbook). + + - name: Install cargo-binutils + if: steps.cache-bin.outputs.cache-hit != 'true' + uses: actions-rs/install@v0.1 + with: + crate: cargo-binutils + version: latest + + #Moved untill after installing mdbook and cargo-binutils because otherwise installing them fails + #(note all GitHub runners come with the latest stable version of Rust pre-installed and it is that version we want to install these). - name: Install Rust uses: actions-rs/toolchain@v1 with: @@ -51,14 +59,6 @@ jobs: components: rustfmt, clippy, llvm-tools-preview target: thumbv7m-none-eabi - - - name: Install cargo-binutils - if: steps.cache-bin.outputs.cache-hit != 'true' - uses: actions-rs/install@v0.1 - with: - crate: cargo-binutils - version: latest - - name: Install arm-none-eabi-gcc and qemu if: steps.cache-bin.outputs.cache-hit != 'true' run: | From 7d96aa4ecbfa65525c003bb5a7ed54311cdbd601 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 22:28:21 +0300 Subject: [PATCH 06/26] Update test_ci.yml --- .github/workflows/test_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_ci.yml b/.github/workflows/test_ci.yml index c2d10cb..990f1f9 100644 --- a/.github/workflows/test_ci.yml +++ b/.github/workflows/test_ci.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: rust: - - 1.62.0 + - 1.63.0 #bump needed as otherwise the test script fails as package `cc v1.2.19` cannot be built because it requires rustc 1.63 or newer, while the currently active rustc version is 1.62.0 - nightly include: - rust: nightly From fe88c4fc116f5db07639ad1ff1a57d402ccc0b28 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 22:51:03 +0300 Subject: [PATCH 07/26] Rename config to config.toml needed to get nightly CI to pass --- ci/smallest-no-std/.cargo/config | 2 -- ci/smallest-no-std/.cargo/config.toml | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 ci/smallest-no-std/.cargo/config create mode 100644 ci/smallest-no-std/.cargo/config.toml diff --git a/ci/smallest-no-std/.cargo/config b/ci/smallest-no-std/.cargo/config deleted file mode 100644 index ef93969..0000000 --- a/ci/smallest-no-std/.cargo/config +++ /dev/null @@ -1,2 +0,0 @@ -[build] -target = "thumbv7m-none-eabi" \ No newline at end of file diff --git a/ci/smallest-no-std/.cargo/config.toml b/ci/smallest-no-std/.cargo/config.toml new file mode 100644 index 0000000..b800c6d --- /dev/null +++ b/ci/smallest-no-std/.cargo/config.toml @@ -0,0 +1,2 @@ +[build] +target = "thumbv7m-none-eabi" From 415c9fd838fdb28486f168d95caeed22616da6f1 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 22:54:40 +0300 Subject: [PATCH 08/26] Rename config to config.toml --- ci/logging/app/.cargo/{config => config.toml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename ci/logging/app/.cargo/{config => config.toml} (87%) diff --git a/ci/logging/app/.cargo/config b/ci/logging/app/.cargo/config.toml similarity index 87% rename from ci/logging/app/.cargo/config rename to ci/logging/app/.cargo/config.toml index d0790fa..726c568 100644 --- a/ci/logging/app/.cargo/config +++ b/ci/logging/app/.cargo/config.toml @@ -3,4 +3,4 @@ runner = "qemu-system-arm -cpu cortex-m3 -machine lm3s6965evb -nographic -semiho rustflags = ["-C", "link-arg=-Tlink.x"] [build] -target = "thumbv7m-none-eabi" \ No newline at end of file +target = "thumbv7m-none-eabi" From 6878616f2152cf111412fd0f2e10481c3ca26ac3 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 22:55:10 +0300 Subject: [PATCH 09/26] Rename config to config.toml --- ci/logging/app2/.cargo/{config => config.toml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename ci/logging/app2/.cargo/{config => config.toml} (89%) diff --git a/ci/logging/app2/.cargo/config b/ci/logging/app2/.cargo/config.toml similarity index 89% rename from ci/logging/app2/.cargo/config rename to ci/logging/app2/.cargo/config.toml index f28460c..c7c0665 100644 --- a/ci/logging/app2/.cargo/config +++ b/ci/logging/app2/.cargo/config.toml @@ -6,4 +6,4 @@ rustflags = [ ] [build] -target = "thumbv7m-none-eabi" \ No newline at end of file +target = "thumbv7m-none-eabi" From 22baafe807fee3988fd2a287a777af615a5b3e6b Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 22:56:39 +0300 Subject: [PATCH 10/26] Rename config to config.toml --- ci/memory-layout/.cargo/{config => config.toml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename ci/memory-layout/.cargo/{config => config.toml} (71%) diff --git a/ci/memory-layout/.cargo/config b/ci/memory-layout/.cargo/config.toml similarity index 71% rename from ci/memory-layout/.cargo/config rename to ci/memory-layout/.cargo/config.toml index b88291f..1bfab97 100644 --- a/ci/memory-layout/.cargo/config +++ b/ci/memory-layout/.cargo/config.toml @@ -2,4 +2,4 @@ rustflags = ["-C", "link-arg=-Tlink.x"] [build] -target = "thumbv7m-none-eabi" \ No newline at end of file +target = "thumbv7m-none-eabi" From 719ee168cb9cca7a6c1c8e3558f3ab3772f594cf Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 23:07:36 +0300 Subject: [PATCH 11/26] Update config.toml to have rust flags Testing if this is needed for nightly CI to pass --- ci/smallest-no-std/.cargo/config.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci/smallest-no-std/.cargo/config.toml b/ci/smallest-no-std/.cargo/config.toml index b800c6d..1bfab97 100644 --- a/ci/smallest-no-std/.cargo/config.toml +++ b/ci/smallest-no-std/.cargo/config.toml @@ -1,2 +1,5 @@ +[target.thumbv7m-none-eabi] +rustflags = ["-C", "link-arg=-Tlink.x"] + [build] target = "thumbv7m-none-eabi" From 878dae7ee1358daa365a997b329f8870d0d32b02 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 23:15:20 +0300 Subject: [PATCH 12/26] Update config.toml --- ci/smallest-no-std/.cargo/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/smallest-no-std/.cargo/config.toml b/ci/smallest-no-std/.cargo/config.toml index 1bfab97..3f436f9 100644 --- a/ci/smallest-no-std/.cargo/config.toml +++ b/ci/smallest-no-std/.cargo/config.toml @@ -1,5 +1,5 @@ [target.thumbv7m-none-eabi] -rustflags = ["-C", "link-arg=-Tlink.x"] +rustflags = ["-C"] [build] target = "thumbv7m-none-eabi" From 7b9e8144a4d0f87bcefef33ca28198abe449e273 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 23:17:52 +0300 Subject: [PATCH 13/26] Update config.toml --- ci/smallest-no-std/.cargo/config.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/ci/smallest-no-std/.cargo/config.toml b/ci/smallest-no-std/.cargo/config.toml index 3f436f9..b800c6d 100644 --- a/ci/smallest-no-std/.cargo/config.toml +++ b/ci/smallest-no-std/.cargo/config.toml @@ -1,5 +1,2 @@ -[target.thumbv7m-none-eabi] -rustflags = ["-C"] - [build] target = "thumbv7m-none-eabi" From a842be45cea7160056f03726e905f42cb933af69 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 23:31:07 +0300 Subject: [PATCH 14/26] Update script.sh skip a check on nightly --- ci/script.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ci/script.sh b/ci/script.sh index 7d3d959..772f711 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -38,9 +38,12 @@ main() { diff -b app.size \ <(cargo size --bin app) - # check presence of the `rust_begin_unwind` symbol - diff app.o.nm \ - <(cargo nm -- $(pwd)/target/thumbv7m-none-eabi/debug/deps/app-*.o | grep '[0-9]* [^N] ') + #Note: Maybe fix this + if [ $RUST_VERSION != nightly ]; then + # check presence of the `rust_begin_unwind` symbol -- For some reason this fails on nightly, so for now just skip this check + diff app.o.nm \ + <(cargo nm -- $(pwd)/target/thumbv7m-none-eabi/debug/deps/app-*.o | grep '[0-9]* [^N] ') + fi edition_check From f23b97d78669758be8bc45d6632c8bbd1cf2876f Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Wed, 23 Apr 2025 23:49:35 +0300 Subject: [PATCH 15/26] Update script.sh --- ci/script.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ci/script.sh b/ci/script.sh index 772f711..e5cc9fa 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -38,12 +38,10 @@ main() { diff -b app.size \ <(cargo size --bin app) - #Note: Maybe fix this - if [ $RUST_VERSION != nightly ]; then - # check presence of the `rust_begin_unwind` symbol -- For some reason this fails on nightly, so for now just skip this check - diff app.o.nm \ - <(cargo nm -- $(pwd)/target/thumbv7m-none-eabi/debug/deps/app-*.o | grep '[0-9]* [^N] ') - fi + # check presence of the `rust_begin_unwind` symbol + diff app.o.nm \ + <(cargo nm -- $(pwd)/target/thumbv7m-none-eabi/debug/deps/app-*.o | grep '[0-9]* [^N] ') + edition_check From c5cc1ecc0af5162577e6793a4173d587c98da90f Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Thu, 24 Apr 2025 00:01:55 +0300 Subject: [PATCH 16/26] Update test_ci.yml --- .github/workflows/test_ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_ci.yml b/.github/workflows/test_ci.yml index 990f1f9..844952f 100644 --- a/.github/workflows/test_ci.yml +++ b/.github/workflows/test_ci.yml @@ -13,7 +13,10 @@ jobs: matrix: rust: - 1.63.0 #bump needed as otherwise the test script fails as package `cc v1.2.19` cannot be built because it requires rustc 1.63 or newer, while the currently active rustc version is 1.62.0 - - nightly + - nightly-2022-08-12 #Need to fix nightly to be an old version. + #Needed because in ci/script.sh (the test script) some checks like "check presence of the `rust_begin_unwind` symbol" fail + #(I think due to compilation differences between when this was made to the new nightly). + #Since Rust 1.63.0 came out Aug 11 2022, we use nightly from the day after. include: - rust: nightly experimental: true From 0880b4819b65c42281bfb37296d72a6ee83b9c3f Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Thu, 24 Apr 2025 00:07:58 +0300 Subject: [PATCH 17/26] Update test_ci.yml --- .github/workflows/test_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_ci.yml b/.github/workflows/test_ci.yml index 844952f..3d49cb4 100644 --- a/.github/workflows/test_ci.yml +++ b/.github/workflows/test_ci.yml @@ -18,7 +18,7 @@ jobs: #(I think due to compilation differences between when this was made to the new nightly). #Since Rust 1.63.0 came out Aug 11 2022, we use nightly from the day after. include: - - rust: nightly + - rust: nightly-2022-08-12 experimental: true steps: From c5a13480ba1336a8a508e706ce67e1bd1d135031 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Thu, 24 Apr 2025 00:09:23 +0300 Subject: [PATCH 18/26] Update script.sh Changed "nightly" to "nightly-2022-08-12" so this test passes --- ci/script.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/script.sh b/ci/script.sh index e5cc9fa..a084bfb 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -87,7 +87,7 @@ main() { popd # NOTE(nightly) this will require nightly until core::arch::arm::udf is stabilized - if [ $RUST_VERSION = nightly ]; then + if [ $RUST_VERSION = nightly-2022-08-12 ]; then pushd app4 cargo build qemu_check target/thumbv7m-none-eabi/debug/app @@ -99,7 +99,7 @@ main() { # # exception handling # NOTE(nightly) this will require nightly until core::arch::arm::udf is stabilized - if [ $RUST_VERSION = nightly ]; then + if [ $RUST_VERSION = nightly-2022-08-12 ]; then pushd exceptions # check that the disassembly matches @@ -232,7 +232,7 @@ main() { # # DMA # NOTE(nightly) this will require nightly until core::pin is stabilized (1.33) - if [ $RUST_VERSION = nightly ]; then + if [ $RUST_VERSION = nightly-2022-08-12 ]; then pushd dma cargo build --examples popd From 2e1ade098d541a30d0976a875e14d588268a6b53 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Thu, 24 Apr 2025 00:16:58 +0300 Subject: [PATCH 19/26] Update script.sh --- ci/script.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/script.sh b/ci/script.sh index a084bfb..ad4c13e 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -97,9 +97,11 @@ main() { popd + + #FIXME: This fails on nightly-2022-08-12, but we need at least rust 1.63.0 or other things fail. This needs to be fixed manually. # # exception handling # NOTE(nightly) this will require nightly until core::arch::arm::udf is stabilized - if [ $RUST_VERSION = nightly-2022-08-12 ]; then + if [ $RUST_VERSION = FIXME ]; then pushd exceptions # check that the disassembly matches From abba9bc1aa5bf497a8662398059626cb86ccfd55 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Thu, 24 Apr 2025 00:30:54 +0300 Subject: [PATCH 20/26] Update ci.yaml fixes the ci --- .github/workflows/ci.yaml | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bca3ba5..d1c353d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -7,37 +7,29 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest continue-on-error: ${{ matrix.experimental || false }} strategy: matrix: rust: - - 1.62.0 - - nightly + - 1.63.0 + - nightly-2022-08-12 #Since Rust 1.63.0 came out Aug 11 2022, we use nightly from the day after. include: - - rust: nightly + - rust: nightly-2022-08-12 experimental: true steps: - uses: actions/checkout@v2 - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - components: rustfmt, clippy, llvm-tools-preview - target: thumbv7m-none-eabi - name: Install Python dependencies run: | pip3 install --user python-dateutil linkchecker - name: Cache installed binaries - uses: actions/cache@v1 + uses: actions/cache@v4 id: cache-bin with: path: ~/cache-bin @@ -50,6 +42,7 @@ jobs: crate: mdbook version: latest + - name: Install cargo-binutils if: steps.cache-bin.outputs.cache-hit != 'true' uses: actions-rs/install@v0.1 @@ -57,6 +50,17 @@ jobs: crate: cargo-binutils version: latest + #Moved until after installing mdbook and cargo-binutils because otherwise installing them fails + #(note all GitHub runners come with the latest stable version of Rust pre-installed, and it is that version we want to install these). + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + override: true + components: rustfmt, clippy, llvm-tools-preview + target: thumbv7m-none-eabi + - name: Install arm-none-eabi-gcc and qemu if: steps.cache-bin.outputs.cache-hit != 'true' run: | @@ -84,7 +88,7 @@ jobs: RUST_VERSION: ${{ matrix.rust }} deploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: [build] @@ -94,7 +98,7 @@ jobs: - uses: actions/checkout@v2 - name: Cache installed binaries - uses: actions/cache@v1 + uses: actions/cache@v4 id: cache-bin with: path: ~/cache-bin From a61df6d592f3802d45e62270ced6855a2e5bb28a Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:04:55 +0300 Subject: [PATCH 21/26] Update bors.toml --- .github/bors.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/bors.toml b/.github/bors.toml index 161cde1..9b2ffaf 100644 --- a/.github/bors.toml +++ b/.github/bors.toml @@ -2,5 +2,5 @@ block_labels = ["needs-decision"] delete_merged_branches = true required_approvals = 1 status = [ - "build (1.62.0)", + "build (1.63.0)", ] From cb0518281d6874e2ff981ac2ca64f5748d0349b1 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Thu, 24 Apr 2025 11:44:06 +0300 Subject: [PATCH 22/26] Delete .github/bors.toml --- .github/bors.toml | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .github/bors.toml diff --git a/.github/bors.toml b/.github/bors.toml deleted file mode 100644 index 9b2ffaf..0000000 --- a/.github/bors.toml +++ /dev/null @@ -1,6 +0,0 @@ -block_labels = ["needs-decision"] -delete_merged_branches = true -required_approvals = 1 -status = [ - "build (1.63.0)", -] From c1eb01799e78e2a9c9beca5eec804c20af30bde2 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Thu, 24 Apr 2025 11:46:38 +0300 Subject: [PATCH 23/26] Update ci.yaml (added on workflow_dispatch to enable manual run) --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d1c353d..9335302 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,6 +1,7 @@ name: CI on: + workflow_dispatch: #Enables manual run of this workflow push: branches: [master, staging, trying] pull_request: From 2c7827ab89c570b16b3605b932fa2232000864fe Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Thu, 24 Apr 2025 11:46:59 +0300 Subject: [PATCH 24/26] Delete .github/workflows/test_ci.yml --- .github/workflows/test_ci.yml | 119 ---------------------------------- 1 file changed, 119 deletions(-) delete mode 100644 .github/workflows/test_ci.yml diff --git a/.github/workflows/test_ci.yml b/.github/workflows/test_ci.yml deleted file mode 100644 index 3d49cb4..0000000 --- a/.github/workflows/test_ci.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: test CI - -on: - workflow_dispatch: #Enables manual run of this workflow - -jobs: - build: - runs-on: ubuntu-latest #Version 20.04 is no longer supported (see https://github.com/actions/runner-images/issues/11101) - - continue-on-error: ${{ matrix.experimental || false }} - - strategy: - matrix: - rust: - - 1.63.0 #bump needed as otherwise the test script fails as package `cc v1.2.19` cannot be built because it requires rustc 1.63 or newer, while the currently active rustc version is 1.62.0 - - nightly-2022-08-12 #Need to fix nightly to be an old version. - #Needed because in ci/script.sh (the test script) some checks like "check presence of the `rust_begin_unwind` symbol" fail - #(I think due to compilation differences between when this was made to the new nightly). - #Since Rust 1.63.0 came out Aug 11 2022, we use nightly from the day after. - include: - - rust: nightly-2022-08-12 - experimental: true - - steps: - - uses: actions/checkout@v2 - - - - name: Install Python dependencies - run: | - pip3 install --user python-dateutil linkchecker - - - name: Cache installed binaries - uses: actions/cache@v4 #v1 no longer supported: see https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down - id: cache-bin - with: - path: ~/cache-bin - key: cache-bin - - - name: Install mdbook - if: steps.cache-bin.outputs.cache-hit != 'true' - uses: actions-rs/install@v0.1 - with: - crate: mdbook - version: latest - - - - name: Install cargo-binutils - if: steps.cache-bin.outputs.cache-hit != 'true' - uses: actions-rs/install@v0.1 - with: - crate: cargo-binutils - version: latest - - #Moved untill after installing mdbook and cargo-binutils because otherwise installing them fails - #(note all GitHub runners come with the latest stable version of Rust pre-installed and it is that version we want to install these). - - name: Install Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - override: true - components: rustfmt, clippy, llvm-tools-preview - target: thumbv7m-none-eabi - - - name: Install arm-none-eabi-gcc and qemu - if: steps.cache-bin.outputs.cache-hit != 'true' - run: | - mkdir -p ~/cache-bin/arm_gcc - curl -L https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.07/gcc-arm-none-eabi-10.3-2021.07-x86_64-linux.tar.bz2 \ - | tar --strip-components=1 -C ~/cache-bin/arm_gcc -xj - - curl -L https://github.com/japaric/qemu-bin/raw/master/14.04/qemu-system-arm-2.12.0 \ - > ~/cache-bin/qemu-system-arm - chmod a+x ~/cache-bin/qemu-system-arm - - - name: Copy installed binaries to cache directory - if: steps.cache-bin.outputs.cache-hit != 'true' - run: | - cp ~/.cargo/bin/* ~/cache-bin - - - name: Put new bin directory into path - run: | - echo "$HOME/cache-bin" >> $GITHUB_PATH - echo "$HOME/cache-bin/arm_gcc/bin" >> $GITHUB_PATH - - - name: Test - run: bash ci/script.sh - env: - RUST_VERSION: ${{ matrix.rust }} - - deploy: - runs-on: ubuntu-latest #Version 20.04 is no longer supported (see https://github.com/actions/runner-images/issues/11101) - - needs: [build] - - if: github.event_name == 'push' && github.ref == 'refs/heads/master' - - steps: - - uses: actions/checkout@v2 - - - name: Cache installed binaries - uses: actions/cache@v4 #v1 no longer supported: see https://github.blog/changelog/2024-12-05-notice-of-upcoming-releases-and-breaking-changes-for-github-actions/#actions-cache-v1-v2-and-actions-toolkit-cache-package-closing-down - id: cache-bin - with: - path: ~/cache-bin - key: cache-bin - - - name: Put new bin directory into path - run: echo "$HOME/cache-bin" >> $GITHUB_PATH - - - name: Build the book - run: mdbook build - - - name: Deploy book - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: book - force_orphan: true From 22733be74255cf1d38a3f7dac1f395b350a4a802 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Thu, 24 Apr 2025 12:08:11 +0300 Subject: [PATCH 25/26] changed config to config.toml --- src/logging.md | 10 +++++----- src/memory-layout.md | 10 +++++----- src/smallest-no-std.md | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/logging.md b/src/logging.md index 1832960..0256bf6 100644 --- a/src/logging.md +++ b/src/logging.md @@ -133,15 +133,15 @@ optimizing the program. Let's check that. > **PROTIP** You can set `target.thumbv7m-none-eabi.runner` to the long QEMU > command from before (`qemu-system-arm -cpu (..) -kernel`) in the Cargo -> configuration file (`.cargo/conifg`) to have `cargo run` use that *runner* to +> configuration file (`.cargo/conifg.toml`) to have `cargo run` use that *runner* to > execute the output binary. ``` console -$ head -n2 .cargo/config +$ head -n2 .cargo/config.toml ``` ``` toml -{{#include ../ci/logging/app/.cargo/config:1:2}} +{{#include ../ci/logging/app/.cargo/config.toml:1:2}} ``` ``` console @@ -217,11 +217,11 @@ Before you run this you'll have to append `-Tlog.x` to the arguments passed to the linker. That can be done in the Cargo configuration file. ``` console -$ cat .cargo/config +$ cat .cargo/config.toml ``` ``` toml -{{#include ../ci/logging/app2/.cargo/config}} +{{#include ../ci/logging/app2/.cargo/config.toml}} ``` Now you can run it! Since the output now has a binary format we'll pipe it diff --git a/src/memory-layout.md b/src/memory-layout.md index 33f5d23..10855f0 100644 --- a/src/memory-layout.md +++ b/src/memory-layout.md @@ -174,7 +174,7 @@ We have to tweak the linker process to make it use our linker script. This is do passing the `-C link-arg` flag to `rustc`. This can be done with `cargo-rustc` or `cargo-build`. -**IMPORTANT**: Make sure you have the `.cargo/config` file that was added at the +**IMPORTANT**: Make sure you have the `.cargo/config.toml` file that was added at the end of the last section before running this command. Using the `cargo-rustc` subcommand: @@ -183,17 +183,17 @@ Using the `cargo-rustc` subcommand: $ cargo rustc -- -C link-arg=-Tlink.x ``` -Or you can set the rustflags in `.cargo/config` and continue using the +Or you can set the rustflags in `.cargo/config.toml` and continue using the `cargo-build` subcommand. We'll do the latter because it better integrates with `cargo-binutils`. ``` console -# modify .cargo/config so it has these contents -$ cat .cargo/config +# modify .cargo/config.toml so it has these contents +$ cat .cargo/config.toml ``` ``` toml -{{#include ../ci/memory-layout/.cargo/config}} +{{#include ../ci/memory-layout/.cargo/config.toml}} ``` The `[target.thumbv7m-none-eabi]` part says that these flags will only be used diff --git a/src/smallest-no-std.md b/src/smallest-no-std.md index a7130e6..6076173 100644 --- a/src/smallest-no-std.md +++ b/src/smallest-no-std.md @@ -98,12 +98,12 @@ Cargo invocation. ``` console $ mkdir .cargo -$ # modify .cargo/config so it has these contents -$ cat .cargo/config +$ # modify .cargo/config.toml so it has these contents +$ cat .cargo/config.toml ``` ``` toml -{{#include ../ci/smallest-no-std/.cargo/config}} +{{#include ../ci/smallest-no-std/.cargo/config.toml}} ``` ## eh_personality From 98244b176f58aa43bcdf6e113ab938d7ffbac374 Mon Sep 17 00:00:00 2001 From: Tomer-Eliahu <73798700+Tomer-Eliahu@users.noreply.github.com> Date: Thu, 24 Apr 2025 12:27:17 +0300 Subject: [PATCH 26/26] Update logging.md (fixed typo) --- src/logging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/logging.md b/src/logging.md index 0256bf6..563dcb3 100644 --- a/src/logging.md +++ b/src/logging.md @@ -133,7 +133,7 @@ optimizing the program. Let's check that. > **PROTIP** You can set `target.thumbv7m-none-eabi.runner` to the long QEMU > command from before (`qemu-system-arm -cpu (..) -kernel`) in the Cargo -> configuration file (`.cargo/conifg.toml`) to have `cargo run` use that *runner* to +> configuration file (`.cargo/config.toml`) to have `cargo run` use that *runner* to > execute the output binary. ``` console