diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..6694656 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,9 @@ +[target.aarch64-unknown-linux-musl] +rustflags = ["-Clink-arg=-fuse-ld=lld"] + +[target.armv7-unknown-linux-musleabihf] +rustflags = ["-Clink-arg=-fuse-ld=lld"] + +[target.x86_64-unknown-linux-musl] +rustflags = ["-Clink-arg=-fuse-ld=lld"] + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f91771..d3c7fd5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,8 +51,8 @@ jobs: --userns host --user $(id -u):$(id -g) \ -v $HOME/.cargo/registry:/usr/local/cargo/registry \ -v ./:/project \ - ghcr.io/cargo-prebuilt/ink-cross:stable-${{ matrix.target }} \ - auditable build --verbose --workspace --locked --target ${{ matrix.target }} ${{ env.feature-set }} + ghcr.io/cargo-prebuilt/ink-cross:nightly-${{ matrix.target }} \ + auditable build --verbose --workspace --locked -Z build-std=std,panic_abort --target ${{ matrix.target }} ${{ env.feature-set }} - name: Run tests if: ${{ matrix.can-test }} run: | @@ -64,38 +64,6 @@ jobs: path: | target/${{ matrix.target }}/debug/${{ env.bin-name }} - cross: - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-unknown-freebsd - - target: x86_64-unknown-netbsd - - target: x86_64-unknown-illumos - - target: powerpc64-unknown-linux-gnu - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Update Rust and add target - run: | - rustup update - rustc --version - rustup target add ${{ matrix.target }} - - uses: cargo-prebuilt/cargo-prebuilt-action@v3 - with: - pkgs: cross - - uses: Swatinem/rust-cache@v2 - with: - key: ${{ matrix.target }} - - name: Build - run: cross build --verbose --workspace --locked --target ${{ matrix.target }} ${{ env.feature-set }} - - name: Artifact - uses: actions/upload-artifact@v4 - with: - name: target-${{ matrix.target }} - path: | - target/${{ matrix.target }}/debug/${{ env.bin-name }} - apple-darwin: strategy: fail-fast: false @@ -112,9 +80,10 @@ jobs: - uses: actions/checkout@v4 - name: Update Rust and add target run: | - rustup update - rustc --version - rustup target add ${{ matrix.target }} + rustup toolchain install nightly + rustc +nightly --version + rustup component add rust-src --toolchain nightly + rustup target add ${{ matrix.target }} --toolchain nightly - uses: cargo-prebuilt/cargo-prebuilt-action@v3 with: pkgs: cargo-auditable @@ -122,7 +91,7 @@ jobs: with: key: ${{ matrix.target }} - name: Build - run: cargo auditable build --verbose --workspace --locked --target ${{ matrix.target }} ${{ env.feature-set }} + run: cargo +nightly auditable build --verbose --workspace --locked -Z build-std=std,panic_abort --target ${{ matrix.target }} ${{ env.feature-set }} - name: Run tests if: ${{ matrix.can-test }} run: | @@ -148,9 +117,10 @@ jobs: - uses: actions/checkout@v4 - name: Update Rust and add target run: | - rustup update - rustc --version - rustup target add ${{ matrix.target }} + rustup toolchain install nightly + rustc +nightly --version + rustup component add rust-src --toolchain nightly + rustup target add ${{ matrix.target }} --toolchain nightly - uses: cargo-prebuilt/cargo-prebuilt-action@v3 with: pkgs: cargo-auditable @@ -158,7 +128,7 @@ jobs: with: key: ${{ matrix.target }} - name: Build - run: cargo auditable build --verbose --workspace --locked --target ${{ matrix.target }} ${{ env.feature-set }} + run: cargo +nightly auditable build --verbose --workspace --locked -Z build-std=std,panic_abort --target ${{ matrix.target }} ${{ env.feature-set }} - name: Artifact uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d2903e6..e0083a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,7 @@ jobs: publish-github-releases: runs-on: ubuntu-latest - needs: [ release, check-fmt, clippy, ink-cross, cross, apple-darwin, pc-windows-msvc ] + needs: [ release, check-fmt, clippy, ink-cross, apple-darwin, pc-windows-msvc ] steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 @@ -147,8 +147,8 @@ jobs: shell: bash run: | set -o pipefail - cargo clippy --all-targets --verbose --workspace --release --locked -- -D warnings 2>&1 | tee .step-data.txt - cargo clippy --all-targets --verbose --workspace --release --locked ${{ env.feature-set }} -- -D warnings 2>&1 | tee .step-data.txt + cargo clippy --all-targets --verbose --workspace --profile=zmall --locked -- -D warnings 2>&1 | tee .step-data.txt + cargo clippy --all-targets --verbose --workspace --profile=zmall --locked ${{ env.feature-set }} -- -D warnings 2>&1 | tee .step-data.txt - name: Put into summary (success) if: success() shell: bash @@ -191,12 +191,12 @@ jobs: shell: bash run: | set -o pipefail - cargo hack check --each-feature --no-dev-deps --verbose --workspace --release --locked 2>&1 | tee .step-data.txt + cargo hack check --each-feature --no-dev-deps --verbose --workspace --profile=zmall --locked 2>&1 | tee .step-data.txt - name: Hack Check (feature-powerset) shell: bash run: | set -o pipefail - cargo hack check --feature-powerset ${{ env.hack-group }} --no-dev-deps --verbose --workspace --release --locked 2>&1 | tee .step-data.txt + cargo hack check --feature-powerset ${{ env.hack-group }} --no-dev-deps --verbose --workspace --profile=zmall --locked 2>&1 | tee .step-data.txt - name: Put into summary (success) if: success() shell: bash @@ -241,7 +241,7 @@ jobs: shell: bash run: | set -o pipefail - cargo msrv verify -- cargo check --verbose --release --locked 2>&1 | tee .step-data.txt + cargo msrv verify -- cargo check --verbose --profile=zmall --locked 2>&1 | tee .step-data.txt - name: Put into summary (success) if: success() shell: bash @@ -359,8 +359,8 @@ jobs: --userns host --user $(id -u):$(id -g) \ -v $HOME/.cargo/registry:/usr/local/cargo/registry \ -v ./:/project \ - ghcr.io/cargo-prebuilt/ink-cross:stable-${{ matrix.target }} \ - auditable build --verbose --workspace --release --locked --target ${{ matrix.target }} ${{ env.feature-set }} + ghcr.io/cargo-prebuilt/ink-cross:nightly-${{ matrix.target }} \ + auditable build --verbose --workspace --profile=zmall --locked -Z build-std=std,panic_abort --target ${{ matrix.target }} ${{ env.feature-set }} - name: Run tests if: ${{ matrix.can-test }} run: | @@ -379,49 +379,6 @@ jobs: ${{ env.bin-name }}-${{ matrix.target }} ${{ matrix.target }}.sha256 - cross: - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-unknown-freebsd - can-test: false - - target: x86_64-unknown-netbsd - can-test: false - - target: x86_64-unknown-illumos - can-test: false - - target: powerpc64-unknown-linux-gnu - can-test: true - runs-on: ubuntu-latest - needs: [ check-fmt, clippy, cargo-hack, cargo-msrv, cargo-deny ] - steps: - - uses: actions/checkout@v4 - - name: Update Rust and add target - run: | - rustup update - rustc --version - rustup target add ${{ matrix.target }} - - uses: cargo-prebuilt/cargo-prebuilt-action@v3 - with: - pkgs: cross,coreutils - - uses: Swatinem/rust-cache@v2 - if: ${{ env.cache == 'true' }} - - name: Build - run: cross build --verbose --workspace --release --locked --target ${{ matrix.target }} ${{ env.feature-set }} - - name: Rename - run: cp ./target/${{ matrix.target }}/release/${{ env.bin-name }} ./${{ env.bin-name }}-${{ matrix.target }} - - name: Chmod - run: chmod +x ./${{ env.bin-name }}-${{ matrix.target }} - - name: Hash - run: echo "$(coreutils sha256sum ./${{ env.bin-name }}-${{ matrix.target }})" > ${{ matrix.target }}.sha256 - - name: Artifact - uses: actions/upload-artifact@v4 - with: - name: target-${{ matrix.target }} - path: | - ${{ env.bin-name }}-${{ matrix.target }} - ${{ matrix.target }}.sha256 - apple-darwin: strategy: fail-fast: false @@ -437,16 +394,17 @@ jobs: - uses: actions/checkout@v4 - name: Update Rust and add target run: | - rustup update - rustc --version - rustup target add ${{ matrix.target }} + rustup toolchain install nightly + rustc +nightly --version + rustup component add rust-src --toolchain nightly + rustup target add ${{ matrix.target }} --toolchain nightly - uses: cargo-prebuilt/cargo-prebuilt-action@v3 with: pkgs: cargo-auditable,coreutils - uses: Swatinem/rust-cache@v2 if: ${{ env.cache == 'true' }} - name: Build - run: cargo auditable build --verbose --workspace --release --locked --target ${{ matrix.target }} ${{ env.feature-set }} + run: cargo +nightly auditable build --verbose --workspace --profile=zmall --locked -Z build-std=std,panic_abort --target ${{ matrix.target }} ${{ env.feature-set }} - name: Run tests if: ${{ matrix.can-test }} run: | @@ -480,16 +438,17 @@ jobs: - uses: actions/checkout@v4 - name: Update Rust and add target run: | - rustup update - rustc --version - rustup target add ${{ matrix.target }} + rustup toolchain install nightly + rustc +nightly --version + rustup component add rust-src --toolchain nightly + rustup target add ${{ matrix.target }} --toolchain nightly - uses: cargo-prebuilt/cargo-prebuilt-action@v3 with: pkgs: cargo-auditable,coreutils - uses: Swatinem/rust-cache@v2 if: ${{ env.cache == 'true' }} - name: Build - run: cargo auditable build --verbose --workspace --release --locked --target ${{ matrix.target }} ${{ env.feature-set }} + run: cargo +nightly auditable build --verbose --workspace --profile=zmall --locked -Z build-std=std,panic_abort --target ${{ matrix.target }} ${{ env.feature-set }} - name: Rename run: cp ./target/${{ matrix.target }}/release/${{ env.bin-name }}.exe ./${{ env.bin-name }}-${{ matrix.target }}.exe - name: Hash diff --git a/Cargo.lock b/Cargo.lock index 7e346a9..8b71888 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -25,9 +25,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" [[package]] name = "autocfg" @@ -43,9 +43,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -58,15 +58,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.3" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "cc" -version = "1.0.88" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" [[package]] name = "cfg-if" @@ -87,9 +87,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ "android-tzdata", "iana-time-zone", @@ -135,9 +135,9 @@ dependencies = [ [[package]] name = "deflate64" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9576c1de19747eb6f5efb6a806c3e836512bbdb17bfedc984ccb0bcc953c8390" +checksum = "83ace6c86376be0b6cdcf3fb41882e81d94b31587573d1cfa9d01cd06bba210d" [[package]] name = "digest" @@ -259,9 +259,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -467,9 +467,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -514,9 +514,9 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "rc-zip" -version = "4.0.0" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17a2e4a592e2501742c853fbed65514ccdd11959d3d69ad6688bd1b695471c82" +checksum = "29dd39582d138524d58f6d50b440e9bcc707ebf13807b70ff77b12cf3341dd19" dependencies = [ "cfg-if", "chardetng", @@ -536,9 +536,9 @@ dependencies = [ [[package]] name = "rc-zip-sync" -version = "4.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40689e7a79f092e45fc3ee24a1ccc38242b626f9234564e561480b768f9e3fdf" +checksum = "47b119fa4c811a1b9112daaef1437db7ec4394fc15972487c1ce74fd94a6682d" dependencies = [ "oval", "rc-zip", @@ -556,11 +556,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -633,9 +633,9 @@ checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "syn" -version = "2.0.52" +version = "2.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" dependencies = [ "proc-macro2", "quote", @@ -655,18 +655,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", @@ -741,9 +741,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -751,9 +751,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -766,9 +766,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -776,9 +776,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -789,9 +789,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "windows-core" diff --git a/Cargo.toml b/Cargo.toml index 9a8f45d..7d2c976 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,11 +22,11 @@ include = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -anyhow = "1.0.80" +anyhow = "1.0.81" flate2 = "1.0.28" hex = "0.4.3" pico-args = { version = "0.5.0", features = ["eq-separator"] } -rc-zip-sync = { version = "4.0.0", default-features = false, features = ["deflate", "deflate64"] } +rc-zip-sync = { version = "4.1.0", default-features = false, features = ["deflate", "deflate64"] } sha2 = "0.10.8" sha3 = "0.10.8" tar = "0.4.40" @@ -37,11 +37,16 @@ lto = true codegen-units = 1 strip = true panic = "abort" +split-debuginfo = "off" [profile.small] inherits = "release" opt-level = "s" +[profile.zmall] +inherits = "release" +opt-level = "z" + [profile.quick-build] inherits = "release" opt-level = 0 diff --git a/justfile b/justfile index b289d17..ffe57c6 100644 --- a/justfile +++ b/justfile @@ -24,6 +24,11 @@ check-nightly: cargo +nightly clippy --all-targets --locked --workspace --release -- -D warnings cargo +nightly deny check +nbuild: + cargo +nightly build -Z build-std=std,panic_abort --target aarch64-apple-darwin --release + cargo +nightly build -Z build-std=std,panic_abort --target aarch64-apple-darwin --profile=small + cargo +nightly build -Z build-std=std,panic_abort --target aarch64-apple-darwin --profile=zmall + docker: docker run -it --rm --pull=always \ -e CARGO_TARGET_DIR=/ptarget \ diff --git a/rustfmt.toml b/rustfmt.toml index a5faf38..40e03d2 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,7 +1,8 @@ unstable_features = true newline_style = "Native" control_brace_style = "ClosingNextLine" -single_line_if_else_max_width = 100 reorder_imports = true imports_granularity = "Crate" edition = "2021" +single_line_if_else_max_width = 100 +single_line_let_else_max_width = 100