diff --git a/.github/bors.toml b/.github/bors.toml deleted file mode 100644 index ca42be0..0000000 --- a/.github/bors.toml +++ /dev/null @@ -1,4 +0,0 @@ -block_labels = ["needs-decision"] -delete_merged_branches = true -required_approvals = 1 -status = ["continuous-integration/travis-ci/push"] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ce29799 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,150 @@ +on: + push: + branches: [ main ] + pull_request: + +name: Build + +jobs: + # Build the workspace for a target architecture + build: + runs-on: ubuntu-24.04 + strategy: + matrix: + rust: [stable, 1.59] + target: + - armebv7r-none-eabi + - armebv7r-none-eabihf + - armv7r-none-eabi + - armv7r-none-eabihf + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install rust + run: | + rustup install ${{ matrix.rust }} + rustup default ${{ matrix.rust }} + rustup target add ${{ matrix.target }} + - name: Build + run: | + cargo build --target ${{ matrix.target }} + cargo build --target ${{ matrix.target }} --no-default-features + cargo build --target ${{ matrix.target }} --all-features + + # Build the workspace for the target architecture but using nightly to compile libcore + build-tier3: + runs-on: ubuntu-24.04 + strategy: + matrix: + target: + - armebv7r-none-eabi + - armebv7r-none-eabihf + - armv7r-none-eabi + - armv7r-none-eabihf + - armv8r-none-eabihf + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install rust + run: | + rustup install nightly + rustup default nightly + rustup component add rust-src --toolchain nightly + - name: Build + run: | + cargo build --target ${{ matrix.target }} -Zbuild-std=core + cargo build --target ${{ matrix.target }} -Zbuild-std=core --no-default-features + cargo build --target ${{ matrix.target }} -Zbuild-std=core --all-features + + # Gather all the above build jobs together for the purposes of getting an overall pass-fail + build-all: + runs-on: ubuntu-24.04 + needs: [build, build-tier3] + steps: + - run: /bin/true + + # Build the docs for the workspace + docs: + runs-on: ubuntu-24.04 + strategy: + matrix: + rust: [stable, 1.59] + target: + - armebv7r-none-eabi + - armebv7r-none-eabihf + - armv7r-none-eabi + - armv7r-none-eabihf + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install rust + run: | + rustup install ${{ matrix.rust }} + rustup default ${{ matrix.rust }} + rustup target add ${{ matrix.target }} + - name: Build docs + run: | + cargo doc --target ${{ matrix.target }} + cargo doc --target ${{ matrix.target }} --no-default-features + cargo doc --target ${{ matrix.target }} --all-features + + # Format the workspace + fmt: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install rust + run: | + rustup install stable + rustup default stable + - name: Format + run: | + cargo fmt --check + + # Run clippy on the workpace + clippy: + runs-on: ubuntu-24.04 + strategy: + matrix: + rust: [stable, 1.59] + target: + - armebv7r-none-eabi + - armebv7r-none-eabihf + - armv7r-none-eabi + - armv7r-none-eabihf + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install rust + run: | + rustup install ${{ matrix.rust }} + rustup default ${{ matrix.rust }} + rustup target add ${{ matrix.target }} + rustup component add clippy + - name: Clippy + run: | + cargo clippy --target ${{ matrix.target }} + cargo clippy --target ${{ matrix.target }} --no-default-features + cargo clippy --target ${{ matrix.target }} --all-features + + # Run the unit tests + unit-test: + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install rust + run: | + rustup install stable + rustup default stable + - name: Run cargo test + run: | + cargo test --workspace --exclude panic-dcc + + # Gather all the above xxx-all jobs together for the purposes of getting an overall pass-fail + all: + runs-on: ubuntu-24.04 + needs: [build-all, docs, fmt, unit-test] # not gating on clippy + steps: + - run: /bin/true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 70e229e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,78 +0,0 @@ -language: rust - -env: - global: - - RUSTFLAGS="-D warnings" - -matrix: - include: - # MSRV - - env: TARGET=x86_64-unknown-linux-gnu - rust: 1.31.0 - if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) - - # MSRV - - env: TARGET=armv7r-none-eabi - rust: 1.31.0 - if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) - - # MSRV - - env: TARGET=armv7r-none-eabihf - rust: 1.31.0 - if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) - - # MSRV - - env: TARGET=armebv7r-none-eabi - rust: 1.31.0 - if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) - - # MSRV - - env: TARGET=armebv7r-none-eabihf - rust: 1.31.0 - if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) - - - env: TARGET=x86_64-unknown-linux-gnu - rust: nightly - if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) - - - env: TARGET=armv7r-none-eabi - rust: nightly - if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) - - - env: TARGET=armv7r-none-eabihf - rust: nightly - if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) - - - env: TARGET=armebv7r-none-eabi - rust: nightly - if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) - - - env: TARGET=armebv7r-none-eabihf - rust: nightly - if: (branch = staging OR branch = trying) OR (type = pull_request AND branch = master) - -before_install: set -e - -install: - - bash ci/install.sh - - export PATH="$PATH:$PWD/gcc/bin" - -script: - - bash ci/script.sh - -after_script: set +e - -cache: cargo - -before_cache: - - chmod -R a+r $HOME/.cargo; - -branches: - only: - - master - - staging - - trying - -notifications: - email: - on_success: never diff --git a/Cargo.toml b/Cargo.toml index d14eb37..4593d98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,20 +1,6 @@ -[package] -authors = [ - "The Cortex-R Team ", - "Jorge Aparicio ", -] -categories = ["embedded", "hardware-support", "no-std"] -description = "Debug Communication Channel (DCC) API" -edition = "2018" -keywords = ["ARM", "DCC"] -license = "MIT OR Apache-2.0" -name = "arm-dcc" -repository = "https://github.com/rust-embedded/arm-dcc" -rust-version = "1.59" -version = "0.1.0" - -[features] -nop = [] - [workspace] -members = ["panic"] \ No newline at end of file +members = [ + "panic-dcc", + "arm-dcc", +] +resolver = "2" diff --git a/LICENSE-MIT b/LICENSE-MIT index e2ac093..f993179 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,4 +1,5 @@ Copyright (c) 2018-2019 Jorge Aparicio +Copyright (c) Rust Embedded Devices Working Group developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated diff --git a/README.md b/README.md index 0a6b035..e6001c8 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ This project is developed and maintained by the [Cortex-R team][team]. -# Minimum Supported Rust Version (MSRV) +## Minimum Supported Rust Version (MSRV) -This crate is guaranteed to compile on stable Rust 1.31.0 and up. It *might* +This crate is guaranteed to compile on stable Rust 1.59 and up. It *might* compile with older versions but that may change in any new patch release. ## License diff --git a/arm-dcc/Cargo.toml b/arm-dcc/Cargo.toml new file mode 100644 index 0000000..4e78e51 --- /dev/null +++ b/arm-dcc/Cargo.toml @@ -0,0 +1,17 @@ +[package] +authors = [ + "The Cortex-R Team ", + "Jorge Aparicio ", +] +categories = ["embedded", "hardware-support", "no-std"] +description = "Debug Communication Channel (DCC) API" +edition = "2018" +keywords = ["ARM", "DCC"] +license = "MIT OR Apache-2.0" +name = "arm-dcc" +repository = "https://github.com/rust-embedded/arm-dcc" +rust-version = "1.59" +version = "0.1.0" + +[features] +nop = [] diff --git a/src/lib.rs b/arm-dcc/src/lib.rs similarity index 99% rename from src/lib.rs rename to arm-dcc/src/lib.rs index 95ecaad..99ad1df 100644 --- a/src/lib.rs +++ b/arm-dcc/src/lib.rs @@ -150,6 +150,7 @@ pub fn write_str(string: &str) { write_all(string.as_bytes()) } +#[cfg(target_arch = "arm")] core::arch::global_asm!( r#" // Routine for putting data in the DCC register diff --git a/bin/armebv7r-none-eabi.a b/bin/armebv7r-none-eabi.a deleted file mode 100644 index a4a12fa..0000000 Binary files a/bin/armebv7r-none-eabi.a and /dev/null differ diff --git a/bin/armebv7r-none-eabihf.a b/bin/armebv7r-none-eabihf.a deleted file mode 100644 index f07c658..0000000 Binary files a/bin/armebv7r-none-eabihf.a and /dev/null differ diff --git a/bin/armv7r-none-eabi.a b/bin/armv7r-none-eabi.a deleted file mode 100644 index 99b2cad..0000000 Binary files a/bin/armv7r-none-eabi.a and /dev/null differ diff --git a/bin/armv7r-none-eabihf.a b/bin/armv7r-none-eabihf.a deleted file mode 100644 index 020c0b8..0000000 Binary files a/bin/armv7r-none-eabihf.a and /dev/null differ diff --git a/panic/Cargo.toml b/panic-dcc/Cargo.toml similarity index 90% rename from panic/Cargo.toml rename to panic-dcc/Cargo.toml index f65c420..183e820 100644 --- a/panic/Cargo.toml +++ b/panic-dcc/Cargo.toml @@ -14,4 +14,4 @@ rust-version = "1.59" version = "0.1.0" [dependencies] -arm-dcc = { path = "..", version = "0.1.0" } +arm-dcc = { path = "../arm-dcc", version = "0.1.0" } diff --git a/panic/LICENSE-APACHE b/panic-dcc/LICENSE-APACHE similarity index 100% rename from panic/LICENSE-APACHE rename to panic-dcc/LICENSE-APACHE diff --git a/panic/LICENSE-MIT b/panic-dcc/LICENSE-MIT similarity index 100% rename from panic/LICENSE-MIT rename to panic-dcc/LICENSE-MIT diff --git a/panic/README.md b/panic-dcc/README.md similarity index 100% rename from panic/README.md rename to panic-dcc/README.md diff --git a/panic/src/lib.rs b/panic-dcc/src/lib.rs similarity index 100% rename from panic/src/lib.rs rename to panic-dcc/src/lib.rs