diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..e8d412756 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,58 @@ +language: rust + +matrix: + include: + - env: TARGET=x86_64-unknown-linux-gnu + rust: nightly + + - env: TARGET=thumbv6m-none-eabi + rust: nightly + addons: + apt: + packages: + - gcc-arm-none-eabi + + - env: TARGET=thumbv7m-none-eabi + rust: nightly + addons: + apt: + packages: + - gcc-arm-none-eabi + + - env: TARGET=thumbv7em-none-eabi + rust: nightly + addons: + apt: + packages: + - gcc-arm-none-eabi + + - env: TARGET=thumbv7em-none-eabihf + rust: nightly + addons: + apt: + packages: + - gcc-arm-none-eabi + +before_install: set -e + +install: + - bash ci/install.sh + +script: + - bash ci/script.sh + +after_script: set +e + +cache: cache + +before_cache: + - chmod -R a+r $HOME/.cargo; + +branches: + only: + - staging + - trying + +notifications: + email: + on_success: never diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d7bae4ab..5cce0d6f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,8 +7,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [v0.2.0] - 2018-05-11 + +### Changed + +- [breaking-change] made inline assembly (`asm!`) opt-in via the `"inline-asm"` feature. This is a + breaking change because this crate now requires `arm-none-eabi-gcc` to be installed to build + without the `"inline-asm"` feature, which is the default. + ## v0.1.0 - 2018-04-09 Initial release -[Unreleased]: https://github.com/japaric/panic-semihosting/compare/v0.1.0...HEAD +[Unreleased]: https://github.com/japaric/panic-semihosting/compare/v0.2.0...HEAD +[v0.2.0]: https://github.com/japaric/panic-semihosting/compare/v0.1.0...v0.2.0 diff --git a/Cargo.toml b/Cargo.toml index ea088de1a..4a4fcd6d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,8 +6,11 @@ keywords = ["panic-impl", "panic", "semihosting"] license = "MIT OR Apache-2.0" name = "panic-semihosting" repository = "https://github.com/japaric/panic-semihosting" -version = "0.1.0" +version = "0.2.0" [dependencies] -cortex-m-semihosting = "0.2.0" -cortex-m = "0.4.3" +cortex-m = "0.5.0" +cortex-m-semihosting= "0.3.0" + +[features] +inline-asm = ["cortex-m-semihosting/inline-asm", "cortex-m/inline-asm"] \ No newline at end of file diff --git a/bors.toml b/bors.toml new file mode 100644 index 000000000..5ccee21e0 --- /dev/null +++ b/bors.toml @@ -0,0 +1,3 @@ +status = [ + "continuous-integration/travis-ci/push", +] \ No newline at end of file diff --git a/ci/install.sh b/ci/install.sh new file mode 100644 index 000000000..3c4192119 --- /dev/null +++ b/ci/install.sh @@ -0,0 +1,9 @@ +set -euxo pipefail + +main() { + if [ $TARGET != x86_64-unknown-linux-gnu ]; then + rustup target add $TARGET + fi +} + +main diff --git a/ci/script.sh b/ci/script.sh new file mode 100644 index 000000000..eb1a31397 --- /dev/null +++ b/ci/script.sh @@ -0,0 +1,11 @@ +set -euxo pipefail + +main() { + cargo check --target $TARGET + + if [ $TRAVIS_RUST_VERSION = nightly ]; then + cargo check --target $TARGET --features inline-asm + fi +} + +main diff --git a/src/lib.rs b/src/lib.rs index 437b654aa..013580725 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,6 +6,11 @@ //! //! [`cortex-m-semihosting`]: https://crates.io/crates/cortex-m-semihosting //! +//! # Requirements +//! +//! To build this crate on the stable or beta channels `arm-none-eabi-gcc` needs to be installed and +//! available in `$PATH`. +//! //! # Usage //! //! ``` ignore @@ -32,6 +37,19 @@ //! (..) //! panicked at 'FOO', src/main.rs:6:5 //! ``` +//! +//! # Optional features +//! +//! ## `inline-asm` +//! +//! When this feature is enabled semihosting is implemented using inline assembly (`asm!`) and +//! compiling this crate requires nightly. +//! +//! When this feature is disabled semihosting is implemented using FFI calls into an external +//! assembly file and compiling this crate works on stable and beta. +//! +//! Apart from the toolchain requirement, enabling `inline-asm` removes the requirement of having +//! `arm-none-eabi-gcc` installed on the host. #![deny(missing_docs)] #![deny(warnings)]