From a1ef436bfa4f22cc3fdc63e80fe8fd1232c2fc2b Mon Sep 17 00:00:00 2001 From: Lokathor Date: Sat, 25 Jul 2020 15:43:31 -0600 Subject: [PATCH] test new CI --- .github/workflows/rust.yml | 34 ++++++------ .travis.yml | 59 -------------------- Cargo.toml | 12 ++--- appveyor.yml | 45 ---------------- bors.toml | 1 - changelog.md | 8 ++- scripts/generic-cross/.cargo/config | 16 ------ scripts/linux-android/.cargo/config | 21 -------- scripts/travis.sh | 77 --------------------------- scripts/windows-android/.cargo/config | 21 -------- src/allocation.rs | 2 + 11 files changed, 28 insertions(+), 268 deletions(-) delete mode 100644 .travis.yml delete mode 100644 appveyor.yml delete mode 100644 bors.toml delete mode 100644 scripts/generic-cross/.cargo/config delete mode 100644 scripts/linux-android/.cargo/config delete mode 100755 scripts/travis.sh delete mode 100644 scripts/windows-android/.cargo/config diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a1bf28f..e4a35c9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,27 +11,23 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - rust: [1.34.0, stable, beta, nightly] + rust: + # 1.34 doesn't support the alloc feature! (1.36 or later) + - { toolchain: 1.34, extra_args: "" } + # Stable and later support all of our features. + - { toolchain: stable, extra_args: "" } + - { toolchain: stable, extra_args: "--all-features" } + - { toolchain: beta, extra_args: "" } + - { toolchain: beta, extra_args: "--all-features" } + - { toolchain: nightly, extra_args: "" } + - { toolchain: nightly, extra_args: "--all-features" } steps: - uses: hecrj/setup-rust-action@v1 with: - rust-version: ${{ matrix.rust }} + rust-version: ${{ matrix.rust.toolchain }} - uses: actions/checkout@v1 - - name: Build - run: cargo build - - name: Test - run: cargo test - build_test_with_features: - runs-on: ubuntu-latest - strategy: - matrix: - rust: [1.34.0, stable, nightly] - steps: - - uses: hecrj/setup-rust-action@v1 + - uses: actions-rs/cargo@v1 with: - rust-version: ${{ matrix.rust }} - - uses: actions/checkout@v1 - - name: Build - run: cargo build --all-features - - name: Test - run: cargo test --all-features + toolchain: ${{ matrix.rust.toolchain }} + command: test + args: ${{ matrix.rust.extra_args }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7703d58..0000000 --- a/.travis.yml +++ /dev/null @@ -1,59 +0,0 @@ -language: rust -sudo: false -git: - quiet: true - -rust: - - 1.34.0 - - stable - - beta - - nightly - -os: - - osx - - linux - # Technically works, but super slow, so we use AppVeyor - #- windows - -matrix: - fast_finish: true - allow_failures: - - rust: nightly - include: - # If we wanted to flag on --release mode we'd add a line like this - #- { os: linux, rust: 1.38.0, env: FLAGS=--release } - - - { os: linux, rust: 1.34.0, env: TARGET=wasm32-unknown-unknown } - #- { os: linux, rust: 1.34.0, env: TARGET=wasm32-wasi } - - - { os: linux, rust: 1.34.0, env: TARGET=aarch64-linux-android } - - { os: linux, rust: 1.34.0, env: TARGET=armv7-linux-androideabi } - - { os: linux, rust: 1.34.0, env: TARGET=i686-linux-android } - - { os: linux, rust: 1.34.0, env: TARGET=x86_64-linux-android } - - - { os: linux, rust: 1.34.0, env: TARGET=arm-unknown-linux-gnueabihf } - - { os: linux, rust: 1.34.0, env: TARGET=armv7-unknown-linux-gnueabihf } - - { os: linux, rust: 1.34.0, env: TARGET=thumbv7neon-unknown-linux-gnueabihf } - - - { os: osx, rust: 1.34.0, env: TARGET=aarch64-apple-ios } - - { os: osx, rust: 1.34.0, env: TARGET=armv7-apple-ios } - - { os: osx, rust: 1.34.0, env: TARGET=armv7s-apple-ios } - - { os: osx, rust: 1.34.0, env: TARGET=i386-apple-ios } - - { os: osx, rust: 1.34.0, env: TARGET=x86_64-apple-ios } - - - { os: linux, rust: nightly, env: RUN_MIRI=1 } - -script: - - pushd scripts - - ./travis.sh - - popd - -# Configured so we cache cargo-web for WASM unit testing, otherwise it takes -# forever (13+ minutes) to compile. See also -# https://levans.fr/rust_travis_cache.html -cache: - directories: - - $TRAVIS_HOME/.cargo/ - - $TRAVIS_HOME/.rustup/ -before_cache: - - rm -rf "$TRAVIS_HOME/.cargo/registry/src" diff --git a/Cargo.toml b/Cargo.toml index db9aba3..adacb0c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "bytemuck" description = "A crate for mucking around with piles of bytes." -version = "1.3.0" +version = "1.3.1-alpha.0" authors = ["Lokathor "] repository = "https://github.com/Lokathor/bytemuck" readme = "README.md" @@ -9,16 +9,12 @@ keywords = ["transmute", "bytes", "casting"] categories = ["encoding", "no-std"] edition = "2018" license = "Zlib OR Apache-2.0 OR MIT" -exclude = ["/scripts/*", "/.travis.yml", "/appveyor.yml", "/bors.toml", "/pedantic.bat"] - -[package.metadata.docs.rs] -all-features = true +exclude = ["/pedantic.bat"] [features] # Note: Yeah these names are non-standard, we'll fix it in v2 some day maybe extern_crate_alloc = [] extern_crate_std = ["extern_crate_alloc"] -[badges] -appveyor = { repository = "Lokathor/bytemuck" } -travis-ci = { repository = "Lokathor/bytemuck" } +[package.metadata.docs.rs] +all-features = true diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index d6c4f5e..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,45 +0,0 @@ - -os: Visual Studio 2015 - -branches: - only: - - staging - - trying - - master - - dev - -matrix: - fast_finish: true - -environment: - matrix: - # Stable - - channel: 1.34.0 - target: i686-pc-windows-msvc - - channel: 1.34.0 - target: i686-pc-windows-gnu - - channel: 1.34.0 - target: x86_64-pc-windows-msvc - - channel: 1.34.0 - target: x86_64-pc-windows-gnu - # Beta and Nightly are checked by TravisCI since builds there run in - # parallel. - -install: - - appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe - - rustup-init -y --default-toolchain %channel% --default-host %target% - - set PATH=%PATH%;%USERPROFILE%\.cargo\bin - - rustup component add rustfmt - - rustup component add clippy - - rustc -vV - - cargo -vV - -# On advice of retep we skip the "build" script phase -build: false - -test_script: - - cargo fmt -- --check - - cargo clippy - - cargo test --no-default-features - - cargo test - #- cargo test --all-features diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 359f894..0000000 --- a/bors.toml +++ /dev/null @@ -1 +0,0 @@ -status = ["continuous-integration/travis-ci/push"] diff --git a/changelog.md b/changelog.md index 8a81177..0fe666e 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ # `bytemuck` changelog -## 1.3.0 +## 1.3.1 * The entire crate is now available under the `Apache-2.0 OR MIT` license as well as the previous `Zlib` license @@ -19,6 +19,12 @@ isn't aligned has been corrected from being `AlignmentMismatch` (intended for allocation casting only) to `TargetAlignmentGreaterAndInputNotAligned`. +## 1.3.0 + +* Had a bug because the CI was messed up! It wasn't soundness related, because + it prevented the crate from building entirely if the `extern_crate_alloc` + feature was used. Still, this is yanked, sorry. + ## 1.2.0 * [thomcc](https://github.com/thomcc) added many things: diff --git a/scripts/generic-cross/.cargo/config b/scripts/generic-cross/.cargo/config deleted file mode 100644 index 8c82fbb..0000000 --- a/scripts/generic-cross/.cargo/config +++ /dev/null @@ -1,16 +0,0 @@ -# Don't generate CPU mismatch warnings when cross-compiling - -[target.arm-unknown-linux-gnueabihf] -ar = "arm-linux-gnueabihf-ar" -linker = "arm-linux-gnueabihf-gcc" -rustflags = ["-C","target-cpu=generic"] - -[target.armv7-unknown-linux-gnueabihf] -ar = "arm-linux-gnueabihf-ar" -linker = "arm-linux-gnueabihf-gcc" -rustflags = ["-C","target-cpu=generic"] - -[target.thumbv7neon-unknown-linux-gnueabihf] -ar = "arm-linux-gnueabihf-ar" -linker = "arm-linux-gnueabihf-gcc" -rustflags = ["-C","target-cpu=generic"] diff --git a/scripts/linux-android/.cargo/config b/scripts/linux-android/.cargo/config deleted file mode 100644 index befe0d9..0000000 --- a/scripts/linux-android/.cargo/config +++ /dev/null @@ -1,21 +0,0 @@ -# Android ar/linker/flags config for when building on linux. - -[target.aarch64-linux-android] -ar = "aarch64-linux-android-ar" -linker = "aarch64-linux-android21-clang" -rustflags = ["-C","target-cpu=generic"] - -[target.armv7-linux-androideabi] -ar = "armv7a-linux-androideabi-ar" -linker = "armv7a-linux-androideabi21-clang" -rustflags = ["-C","target-cpu=generic"] - -[target.i686-linux-android] -ar = "i686-linux-android-ar" -linker = "i686-linux-android21-clang" -rustflags = ["-C","target-cpu=generic"] - -[target.x86_64-linux-android] -ar = "x86_64-linux-android-ar" -linker = "x86_64-linux-android21-clang" -rustflags = ["-C","target-cpu=generic"] diff --git a/scripts/travis.sh b/scripts/travis.sh deleted file mode 100755 index 31201ce..0000000 --- a/scripts/travis.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash - -set -e - -if [[ "$RUN_MIRI" != "" ]]; then - - cargo clean - - # Install and run the latest version of nightly where miri built successfully. - # Taken from: https://github.com/rust-lang/miri#running-miri-on-ci - - MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri) - echo "Installing latest nightly with Miri: $MIRI_NIGHTLY" - rustup set profile minimal - rustup default "$MIRI_NIGHTLY" - - rustup component add miri - cargo miri setup - - cargo miri test --verbose - cargo miri test --verbose --no-default-features - cargo miri test --verbose --all-features - -else - - rustup component add clippy - cargo clippy - - if [[ "$TARGET" != "" ]]; then rustup target install $TARGET; fi - - if [[ "$TARGET" == "wasm32-"* && "$TARGET" != "wasm32-wasi" ]]; then - cargo-web --version || cargo install cargo-web - cargo web test --no-default-features $FLAGS --target=$TARGET - cargo web test $FLAGS --target=$TARGET - #cargo web test --all-features $FLAGS --target=$TARGET - - elif [[ "$TARGET" == *"-linux-android"* ]]; then - export PATH=/usr/local/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH - pushd linux-android - cargo build --no-default-features --target=$TARGET $FLAGS - cargo build --target=$TARGET $FLAGS - #cargo build --all-features --target=$TARGET $FLAGS - # Don't test, can't run android emulators successfully on travis currently - popd - - elif [[ "$TARGET" == *"-apple-ios" || "$TARGET" == "wasm32-wasi" ]]; then - cargo build --no-default-features --target=$TARGET $FLAGS - cargo build --target=$TARGET $FLAGS - #cargo build --all-features --target=$TARGET $FLAGS - # Don't test - # iOS simulator setup/teardown is complicated - # cargo-web doesn't support wasm32-wasi yet, nor can wasm-pack test specify a target - - elif [[ "$TARGET" == *"-unknown-linux-gnueabihf" ]]; then - #sudo apt-get update - #sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf - pushd generic-cross - cargo build --no-default-features --target=$TARGET $FLAGS - cargo build --target=$TARGET $FLAGS - #cargo build --all-features --target=$TARGET $FLAGS - # Don't test - popd - - elif [[ "$TARGET" != "" ]]; then - pushd generic-cross - cargo test --no-default-features --target=$TARGET $FLAGS - cargo test --target=$TARGET $FLAGS - #cargo test --all-features --target=$TARGET $FLAGS - popd - - else - # Push nothing, target host CPU architecture - cargo test --no-default-features $FLAGS - cargo test $FLAGS - fi - -fi diff --git a/scripts/windows-android/.cargo/config b/scripts/windows-android/.cargo/config deleted file mode 100644 index 0839f7e..0000000 --- a/scripts/windows-android/.cargo/config +++ /dev/null @@ -1,21 +0,0 @@ -# Android ar/linker/flags config for when building on windows. - -[target.aarch64-linux-android] -ar = "aarch64-linux-android-ar.cmd" -linker = "aarch64-linux-android21-clang.cmd" -rustflags = ["-C","target-cpu=generic"] - -[target.armv7-linux-androideabi] -ar = "armv7a-linux-androideabi-ar.cmd" -linker = "armv7a-linux-androideabi21-clang.cmd" -rustflags = ["-C","target-cpu=generic"] - -[target.i686-linux-android] -ar = "i686-linux-android-ar.cmd" -linker = "i686-linux-android21-clang.cmd" -rustflags = ["-C","target-cpu=generic"] - -[target.x86_64-linux-android] -ar = "x86_64-linux-android-ar.cmd" -linker = "x86_64-linux-android21-clang.cmd" -rustflags = ["-C","target-cpu=generic"] diff --git a/src/allocation.rs b/src/allocation.rs index 6b116e5..1e33796 100644 --- a/src/allocation.rs +++ b/src/allocation.rs @@ -1,3 +1,5 @@ +#![cfg(feature = "extern_crate_alloc")] + //! Stuff to boost things in the `alloc` crate. //! //! * You must enable the `extern_crate_alloc` feature of `bytemuck` or you will