From fef9277908cbf21d08864bf4e01bddf458c89832 Mon Sep 17 00:00:00 2001 From: wcampbell Date: Mon, 11 Nov 2024 22:30:31 -0500 Subject: [PATCH 1/3] Add CI for backhand windows * backhand only builds windows and doesn't test it (no backhand-cli support, which is required). --- .github/workflows/main.yml | 41 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bbcbe174..11a96306 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,6 +10,47 @@ on: name: ci jobs: + # build on backhand only supported target + cross-build: + runs-on: ${{ matrix.job.os }} + env: + BUILD_CMD: cargo + strategy: + fail-fast: false + matrix: + job: + - { target: x86_64-pc-windows-gnu, os: ubuntu-latest, use-cross: true } + toolchain: + - stable + # msrv of backhand-cli + - 1.77.0 + features: + - --no-default-features --features xz + - --no-default-features --features gzip + - --no-default-features --features gzip,xz + - --no-default-features --features xz-static + - --no-default-features --features gzip-zune-inflate + # default features + - + + steps: + - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + - name: Populate cache + uses: ./.github/workflows/cache + + - name: Overwrite build command env variable + if: matrix.job.use-cross + shell: bash + run: | + echo "BUILD_CMD=cross" >> $GITHUB_ENV + RUSTFLAGS="-C target-feature=-crt-static" cargo install cross --git https://github.com/cross-rs/cross + + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.toolchain }} + # build lib with cross + - run: $BUILD_CMD build ${{ matrix.features }} --target ${{ matrix.job.target }} --release --locked --workspace --lib + # build/test all supported targets for library and bins (skipping slow and squashfs-tools tests) cross-test: runs-on: ${{ matrix.job.os }} From 31176048b2fe0f1013df3bff4b908045c1fd4128 Mon Sep 17 00:00:00 2001 From: wcampbell Date: Mon, 11 Nov 2024 22:31:07 -0500 Subject: [PATCH 2/3] Add target support to README --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index c43fcc47..b3360bef 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,20 @@ Add the following to your `Cargo.toml` file: [dependencies] backhand = "0.18.0" ``` + +#### Target Support +Although additional targets may be supported, only the following have been fully tested or confirmed to build successfully. + +| Target | `build` | `test` | +|----------------------------------------|--------:|:------:| +| `x86_64-unknown-linux-musl` | ✓ | ✓ | +| `aarch64-unknown-linux-musl` | ✓ | ✓ | +| `arm-unknown-linux-musleabi` | ✓ | ✓ | +| `armv7-unknown-linux-musleabi` | ✓ | ✓ | +| `aarch64-unknown-linux-musl` | ✓ | ✓ | +| `x86_64-apple-darwin` | ✓ | ✓ | +| `x86_64-pc-windows-gnu` | ✓ | | + ### Reading/Writing/Modifying Firmware ```rust,no_run use std::fs::File; @@ -68,6 +82,18 @@ To install, run `cargo install backhand-cli --locked`, or download from the See ``--help`` for more information. +#### Target Support +Although additional targets may be supported, only the following have been tested and included in our GitHub releases. + +| Target | `test` | `release` | +|----------------------------------------|----------:|:---------:| +| `x86_64-unknown-linux-musl` | ✓ | ✓ | +| `aarch64-unknown-linux-musl` | ✓ | ✓ | +| `arm-unknown-linux-musleabi` | ✓ | ✓ | +| `armv7-unknown-linux-musleabi` | ✓ | ✓ | +| `aarch64-unknown-linux-musl` | ✓ | ✓ | +| `x86_64-apple-darwin` | ✓ | ✓ | + ### unsquashfs-backhand ```no_test tool to uncompress, extract and list squashfs filesystems From 11145b6b3494bb980a74029d6c7e6dde22a36e2c Mon Sep 17 00:00:00 2001 From: wcampbell Date: Mon, 11 Nov 2024 23:15:27 -0500 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23b05920..5705fa5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,11 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Remove duplicated data when addding new files to a `FilesystemWriter`. This also applies this behavior to the `add` and `replace` binaries. This is controllable with `FilesystemWriter::set_no_duplicate_files`. ([#603](https://github.com/wcampbell0x2a/backhand/pull/603)), ([#594](https://github.com/wcampbell0x2a/backhand/pull/594)) - Increase speed of internal `HashMap`s, by switching to `xxhash` and just using the `inode` as the key in other places. - Changed `SuperBlock::Flags` to be public. - - Add non-standard CompressionOptions support ([#584](https://github.com/wcampbell0x2a/backhand/pull/584)) - Add `CompressionAction::compression_options` to override the default compression options emitted during writing. - Add `FilesystemWriter::set_emit_compression_options` - Support sparse file extraction ([#624](https://github.com/wcampbell0x2a/backhand/pull/624)) +- Add `x86_64-pc-windows-gnu` support ([@Wolfyxon](https://github.com/Wolfyxon)) ([#634](https://github.com/wcampbell0x2a/backhand/pull/634)) ### `backhand-cli` - Add `--no-compression-options` to `add` and `replace` to remove compression options from image after modification.