diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 974fa07..5686506 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -9,6 +9,7 @@ on: workflow_dispatch: env: + BUILD_PROFILE: release-lto CARGO_BIN_NAME: objdiff CARGO_TARGET_DIR: target @@ -30,9 +31,25 @@ jobs: with: components: rustfmt, clippy - name: Cargo check - run: cargo check --all-features + run: cargo check - name: Cargo clippy - run: cargo clippy --all-features + run: cargo clippy + + fmt: + name: Format + runs-on: ubuntu-latest + env: + RUSTFLAGS: -D warnings + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Rust toolchain + # We use nightly options in rustfmt.toml + uses: dtolnay/rust-toolchain@nightly + with: + components: rustfmt + - name: Cargo fmt + run: cargo fmt --all --check deny: name: Deny @@ -52,6 +69,7 @@ jobs: test: name: Test + if: 'false' # No tests yet strategy: matrix: platform: [ ubuntu-latest, windows-latest, macos-latest ] @@ -68,7 +86,7 @@ jobs: - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@stable - name: Cargo test - run: cargo test --release --all-features + run: cargo test --release build: name: Build @@ -103,16 +121,16 @@ jobs: with: targets: ${{ matrix.target }} - name: Cargo build - run: cargo build --release --all-features --target ${{ matrix.target }} --bin ${{ env.CARGO_BIN_NAME }} + run: cargo build --profile ${{ env.BUILD_PROFILE }} --target ${{ matrix.target }} --bin ${{ env.CARGO_BIN_NAME }} - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: ${{ matrix.name }} path: | - ${{ env.CARGO_TARGET_DIR }}/release/${{ env.CARGO_BIN_NAME }} - ${{ env.CARGO_TARGET_DIR }}/release/${{ env.CARGO_BIN_NAME }}.exe - ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/release/${{ env.CARGO_BIN_NAME }} - ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/release/${{ env.CARGO_BIN_NAME }}.exe + ${{ env.CARGO_TARGET_DIR }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }} + ${{ env.CARGO_TARGET_DIR }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }}.exe + ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }} + ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }}.exe if-no-files-found: error release: @@ -129,8 +147,8 @@ jobs: working-directory: artifacts run: | mkdir ../out - for i in */*/release/$CARGO_BIN_NAME*; do - mv "$i" "../out/$(sed -E "s/([^/]+)\/[^/]+\/release\/($CARGO_BIN_NAME)/\2-\1/" <<< "$i")" + for i in */*/$BUILD_PROFILE/$CARGO_BIN_NAME*; do + mv "$i" "../out/$(sed -E "s/([^/]+)\/[^/]+\/$BUILD_PROFILE\/($CARGO_BIN_NAME)/\2-\1/" <<< "$i")" done ls -R ../out - name: Release diff --git a/Cargo.toml b/Cargo.toml index ebb3315..691e86a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,8 @@ A local diffing tool for decompilation projects. publish = false build = "build.rs" -[profile.release] +[profile.release-lto] +inherits = "release" lto = "thin" strip = "debuginfo" diff --git a/deny.toml b/deny.toml index 49dc2fe..d3e84a7 100644 --- a/deny.toml +++ b/deny.toml @@ -47,13 +47,7 @@ yanked = "warn" notice = "warn" # A list of advisory IDs to ignore. Note that ignored advisories will still # output a note when they are encountered. -ignore = [ - "RUSTSEC-2023-0022", - "RUSTSEC-2023-0023", - "RUSTSEC-2023-0024", - "RUSTSEC-2023-0034", - "RUSTSEC-2023-0044", -] +ignore = [] # Threshold for security vulnerabilities, any vulnerability with a CVSS score # lower than the range specified will be ignored. Note that ignored advisories # will still output a note when they are encountered. @@ -76,6 +70,7 @@ unlicensed = "deny" allow = [ "MIT", "Apache-2.0", + "Apache-2.0 WITH LLVM-exception", "ISC", "BSD-2-Clause", "BSD-3-Clause", @@ -159,7 +154,7 @@ registries = [ # https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html [bans] # Lint level for when multiple versions of the same crate are detected -multiple-versions = "warn" +multiple-versions = "allow" # Lint level for when a crate version requirement is `*` wildcards = "allow" # The graph highlighting used when creating dotgraphs for crates diff --git a/src/diff/data.rs b/src/diff/data.rs index ea33dd4..80e9e65 100644 --- a/src/diff/data.rs +++ b/src/diff/data.rs @@ -393,7 +393,7 @@ pub fn diff_data_lev(left: &mut ObjSection, right: &mut ObjSection) -> Result<() left.data_diff = left_diff; right.data_diff = right_diff; - return Ok(()); + Ok(()) } pub fn no_diff_data(section: &mut ObjSection) {