diff --git a/.github/bors.toml b/.github/bors.toml deleted file mode 100644 index 161cde1..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.62.0)", -] diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bca3ba5..9335302 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,43 +1,36 @@ name: CI on: + workflow_dispatch: #Enables manual run of this workflow push: branches: [master, staging, trying] pull_request: 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 +43,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 +51,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 +89,7 @@ jobs: RUST_VERSION: ${{ matrix.rust }} deploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest needs: [build] @@ -94,7 +99,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 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" 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" 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" diff --git a/ci/script.sh b/ci/script.sh index 7d3d959..ad4c13e 100644 --- a/ci/script.sh +++ b/ci/script.sh @@ -42,6 +42,7 @@ main() { diff app.o.nm \ <(cargo nm -- $(pwd)/target/thumbv7m-none-eabi/debug/deps/app-*.o | grep '[0-9]* [^N] ') + edition_check popd @@ -86,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 @@ -96,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 ]; then + if [ $RUST_VERSION = FIXME ]; then pushd exceptions # check that the disassembly matches @@ -231,7 +234,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 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" diff --git a/src/logging.md b/src/logging.md index 1832960..563dcb3 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/config.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