From 642dbf1324f187cc11cd495c0fddb4d3f7d70c2a Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Tue, 20 Oct 2020 06:20:26 -0700 Subject: [PATCH 1/3] CI: test on 64-bit Windows (GNU) Splits the GitHub Actions configs into `linux`, `windows`, and `cross` jobs, each configured to test certain targets. Tests Windows in the 64-bit environment only, as it seems it's not possible to test MINGW32 builds on 64-bit Windows: https://github.com/rust-lang/rust/issues/33535#issuecomment-218527623 > The compiler only assumes that it can run executables for its own > platform, which in this case is x86_64-pc-windows-gnu. That means that > the compiler is running a 64-bit mingw gcc trying to generate a 32-bit > executable. The mingw gcc builds, however, do not support this. --- .github/workflows/md5.yml | 46 +++++++++++++------ .github/workflows/sha1.yml | 79 ++++++++++++++++++++++----------- .github/workflows/sha2.yml | 75 ++++++++++++++++++++----------- .github/workflows/workspace.yml | 2 +- Cargo.lock | 1 + README.md | 10 ++++- 6 files changed, 143 insertions(+), 70 deletions(-) diff --git a/.github/workflows/md5.yml b/.github/workflows/md5.yml index 991c6bf..4d4cfe0 100644 --- a/.github/workflows/md5.yml +++ b/.github/workflows/md5.yml @@ -8,36 +8,37 @@ on: push: branches: master +defaults: + run: + working-directory: md5 + env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Dwarnings" jobs: - test: + # Linux tests + linux: strategy: matrix: include: # 32-bit Linux/x86 - target: i686-unknown-linux-gnu - platform: ubuntu-latest - toolchain: 1.41.0 # MSRV + toolchain: 1.43.0 # MSRV deps: sudo apt install gcc-multilib - target: i686-unknown-linux-gnu - platform: ubuntu-latest toolchain: stable deps: sudo apt install gcc-multilib # 64-bit Linux/x86_64 - target: x86_64-unknown-linux-gnu - platform: ubuntu-latest - toolchain: 1.41.0 # MSRV + toolchain: 1.43.0 # MSRV deps: true - target: x86_64-unknown-linux-gnu - platform: ubuntu-latest toolchain: stable deps: true - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - run: ${{ matrix.deps }} @@ -47,10 +48,27 @@ jobs: toolchain: ${{ matrix.toolchain }} target: ${{ matrix.target }} override: true - # NOTE: using `marcopolo/cargo` fork to support the `working-directory` attribute - # See: https://github.com/actions-rs/cargo/pull/59 - - uses: marcopolo/cargo@master + - run: cargo test --target ${{ matrix.target }} --release + + # Windows tests + windows: + strategy: + matrix: + include: + # 64-bit Windows (GNU) + - target: x86_64-pc-windows-gnu + toolchain: 1.43.0 # MSRV + - target: x86_64-pc-windows-gnu + toolchain: stable + + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - uses: msys2/setup-msys2@v2 + - uses: actions-rs/toolchain@v1 with: - command: test - working-directory: md5 - args: --target ${{ matrix.target }} --release + profile: minimal + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.target }} + override: true + - run: cargo test --target ${{ matrix.target }} --release diff --git a/.github/workflows/sha1.yml b/.github/workflows/sha1.yml index 6639223..a07ce63 100644 --- a/.github/workflows/sha1.yml +++ b/.github/workflows/sha1.yml @@ -8,52 +8,83 @@ on: push: branches: master +defaults: + run: + working-directory: sha1 + env: CARGO_INCREMENTAL: 0 RUSTFLAGS: "-Dwarnings" jobs: - test: + # Linux tests + linux: strategy: matrix: include: # 32-bit Linux/x86 - target: i686-unknown-linux-gnu - platform: ubuntu-latest - rust: 1.41.0 # MSRV - use_cross: false + rust: 1.43.0 # MSRV deps: sudo apt install gcc-multilib - target: i686-unknown-linux-gnu - platform: ubuntu-latest rust: stable - use_cross: false deps: sudo apt install gcc-multilib # 64-bit Linux/x86_64 - target: x86_64-unknown-linux-gnu - platform: ubuntu-latest - rust: 1.41.0 # MSRV - use_cross: false + rust: 1.43.0 # MSRV deps: true - target: x86_64-unknown-linux-gnu - platform: ubuntu-latest rust: stable - use_cross: false deps: true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: ${{ matrix.deps }} + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - run: cargo test --target ${{ matrix.target }} --release + + # Windows tests + windows: + strategy: + matrix: + include: + # 64-bit Windows (GNU) + - target: x86_64-pc-windows-gnu + toolchain: 1.43.0 # MSRV + - target: x86_64-pc-windows-gnu + toolchain: stable + + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - uses: msys2/setup-msys2@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.target }} + override: true + - run: cargo test --target ${{ matrix.target }} --release + + # Cross-compiled tests + cross: + strategy: + matrix: + include: # ARM64 - target: aarch64-unknown-linux-gnu - platform: ubuntu-latest - rust: 1.41.0 # MSRV - use_cross: true - deps: true + rust: 1.43.0 # MSRV - target: aarch64-unknown-linux-gnu - platform: ubuntu-latest rust: stable - use_cross: true - deps: true - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - run: ${{ matrix.deps }} @@ -63,11 +94,5 @@ jobs: toolchain: ${{ matrix.rust }} target: ${{ matrix.target }} override: true - # NOTE: using `marcopolo/cargo` fork to support the `working-directory` attribute - # See: https://github.com/actions-rs/cargo/pull/59 - - uses: marcopolo/cargo@master - with: - command: test - working-directory: sha1 - use-cross: ${{ matrix.use_cross }} - args: --target ${{ matrix.target }} --release + - run: cargo install cross + - run: cross test --target ${{ matrix.target }} --release diff --git a/.github/workflows/sha2.yml b/.github/workflows/sha2.yml index c46d1e1..5cd6c3d 100644 --- a/.github/workflows/sha2.yml +++ b/.github/workflows/sha2.yml @@ -17,47 +17,74 @@ env: RUSTFLAGS: "-Dwarnings" jobs: - test: + # Linux tests + linux: strategy: matrix: include: # 32-bit Linux/x86 - target: i686-unknown-linux-gnu - platform: ubuntu-latest - rust: 1.41.0 # MSRV - use_cross: false + rust: 1.43.0 # MSRV deps: sudo apt install gcc-multilib - target: i686-unknown-linux-gnu - platform: ubuntu-latest rust: stable - use_cross: false deps: sudo apt install gcc-multilib # 64-bit Linux/x86_64 - target: x86_64-unknown-linux-gnu - platform: ubuntu-latest - rust: 1.41.0 # MSRV - use_cross: false + rust: 1.43.0 # MSRV deps: true - target: x86_64-unknown-linux-gnu - platform: ubuntu-latest rust: stable - use_cross: false deps: true + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: ${{ matrix.deps }} + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.rust }} + target: ${{ matrix.target }} + override: true + - run: cargo test --target ${{ matrix.target }} --release + + # Windows tests + windows: + strategy: + matrix: + include: + # 64-bit Windows (GNU) + - target: x86_64-pc-windows-gnu + toolchain: 1.43.0 # MSRV + - target: x86_64-pc-windows-gnu + toolchain: stable + + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - uses: msys2/setup-msys2@v2 + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + target: ${{ matrix.target }} + override: true + - run: cargo test --target ${{ matrix.target }} --release + + # Cross-compiled tests + cross: + strategy: + matrix: + include: # ARM64 - target: aarch64-unknown-linux-gnu - platform: ubuntu-latest - rust: 1.41.0 # MSRV - use_cross: true - deps: true + rust: 1.43.0 # MSRV - target: aarch64-unknown-linux-gnu - platform: ubuntu-latest rust: stable - use_cross: true - deps: true - runs-on: ${{ matrix.platform }} + runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - run: ${{ matrix.deps }} @@ -67,11 +94,5 @@ jobs: toolchain: ${{ matrix.rust }} target: ${{ matrix.target }} override: true - # NOTE: using `marcopolo/cargo` fork to support the `working-directory` attribute - # See: https://github.com/actions-rs/cargo/pull/59 - - uses: marcopolo/cargo@master - with: - command: test - working-directory: sha1 - use-cross: ${{ matrix.use_cross }} - args: --target ${{ matrix.target }} --release + - run: cargo install cross + - run: cross test --target ${{ matrix.target }} --release diff --git a/.github/workflows/workspace.yml b/.github/workflows/workspace.yml index 644a385..7851774 100644 --- a/.github/workflows/workspace.yml +++ b/.github/workflows/workspace.yml @@ -17,7 +17,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: 1.41.0 # MSRV + toolchain: 1.43.0 # MSRV components: clippy override: true - run: cargo clippy --all -- -D warnings diff --git a/Cargo.lock b/Cargo.lock index 6092935..c858659 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +# [[package]] name = "cc" version = "1.0.61" diff --git a/README.md b/README.md index e82da7b..62c1daf 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# RustCrypto: ASM hashes [![Project Chat][chat-image]][chat-link] +# RustCrypto: ASM hashes ![Rust Version][rustc-image] [![Project Chat][chat-image]][chat-link] Assembly implementations of hash functions core functionality based on code from [Project Nayuki](https://www.nayuki.io/). @@ -9,6 +9,13 @@ functionality please refer to the crates from enabled `asm` feature `md5`, `sha-1`, `sha2` and `whirlpool` crates will use code from this repository. +### Minimum Supported Rust Version + +All crates in this repository support **Rust 1.43** or higher. + +In the future when the minimum supported Rust version is changed, +it will be accompanied by a minor version bump. + ## License All crates licensed under the [MIT license](http://opensource.org/licenses/MIT). @@ -21,5 +28,6 @@ dual licensed as above, without any additional terms or conditions. [//]: # (badges) +[rustc-image]: https://img.shields.io/badge/rustc-1.43+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes From 4165c81e7aa61ac57c20f5058a2f06577ef2e408 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Tue, 20 Oct 2020 09:25:55 -0700 Subject: [PATCH 2/3] tweaks --- .github/workflows/md5.yml | 4 ++-- .github/workflows/sha1.yml | 7 ++----- .github/workflows/sha2.yml | 7 ++----- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/md5.yml b/.github/workflows/md5.yml index 4d4cfe0..3a6321e 100644 --- a/.github/workflows/md5.yml +++ b/.github/workflows/md5.yml @@ -41,13 +41,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - run: ${{ matrix.deps }} - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.toolchain }} target: ${{ matrix.target }} override: true + - run: ${{ matrix.deps }} - run: cargo test --target ${{ matrix.target }} --release # Windows tests @@ -64,11 +64,11 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v1 - - uses: msys2/setup-msys2@v2 - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.toolchain }} target: ${{ matrix.target }} override: true + - uses: msys2/setup-msys2@v2 - run: cargo test --target ${{ matrix.target }} --release diff --git a/.github/workflows/sha1.yml b/.github/workflows/sha1.yml index a07ce63..1b94798 100644 --- a/.github/workflows/sha1.yml +++ b/.github/workflows/sha1.yml @@ -33,21 +33,19 @@ jobs: # 64-bit Linux/x86_64 - target: x86_64-unknown-linux-gnu rust: 1.43.0 # MSRV - deps: true - target: x86_64-unknown-linux-gnu rust: stable - deps: true runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - run: ${{ matrix.deps }} - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.rust }} target: ${{ matrix.target }} override: true + - run: ${{ matrix.deps }} - run: cargo test --target ${{ matrix.target }} --release # Windows tests @@ -64,13 +62,13 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v1 - - uses: msys2/setup-msys2@v2 - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.toolchain }} target: ${{ matrix.target }} override: true + - uses: msys2/setup-msys2@v2 - run: cargo test --target ${{ matrix.target }} --release # Cross-compiled tests @@ -87,7 +85,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - run: ${{ matrix.deps }} - uses: actions-rs/toolchain@v1 with: profile: minimal diff --git a/.github/workflows/sha2.yml b/.github/workflows/sha2.yml index 5cd6c3d..6fc8c58 100644 --- a/.github/workflows/sha2.yml +++ b/.github/workflows/sha2.yml @@ -33,21 +33,19 @@ jobs: # 64-bit Linux/x86_64 - target: x86_64-unknown-linux-gnu rust: 1.43.0 # MSRV - deps: true - target: x86_64-unknown-linux-gnu rust: stable - deps: true runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - run: ${{ matrix.deps }} - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.rust }} target: ${{ matrix.target }} override: true + - run: ${{ matrix.deps }} - run: cargo test --target ${{ matrix.target }} --release # Windows tests @@ -64,13 +62,13 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v1 - - uses: msys2/setup-msys2@v2 - uses: actions-rs/toolchain@v1 with: profile: minimal toolchain: ${{ matrix.toolchain }} target: ${{ matrix.target }} override: true + - uses: msys2/setup-msys2@v2 - run: cargo test --target ${{ matrix.target }} --release # Cross-compiled tests @@ -87,7 +85,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1 - - run: ${{ matrix.deps }} - uses: actions-rs/toolchain@v1 with: profile: minimal From 47d0fd792bad0a181c8eaf2693d04c542658cbdc Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Tue, 20 Oct 2020 09:30:31 -0700 Subject: [PATCH 3/3] README.md: platform docs --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 62c1daf..12972a8 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,17 @@ functionality please refer to the crates from enabled `asm` feature `md5`, `sha-1`, `sha2` and `whirlpool` crates will use code from this repository. -### Minimum Supported Rust Version +## Supported Platforms + +All crates are tested on the following platforms: + +- Linux (32-bit and 64-bit x86) +- Windows (64-bit x86, GNU only) +- ARM64 (except `md5`, which is x86 only) + +Windows MSVC builds are known to be broken. See [#17]. + +## Minimum Supported Rust Version All crates in this repository support **Rust 1.43** or higher. @@ -31,3 +41,7 @@ dual licensed as above, without any additional terms or conditions. [rustc-image]: https://img.shields.io/badge/rustc-1.43+-blue.svg [chat-image]: https://img.shields.io/badge/zulip-join_chat-blue.svg [chat-link]: https://rustcrypto.zulipchat.com/#narrow/stream/260041-hashes + +[//]: # (general links) + +[#17]: https://github.com/RustCrypto/asm-hashes/issues/17