Update CI workflow & all dependencies

This commit is contained in:
Luke Street 2024-09-09 20:36:18 -06:00
parent 9dfdbb9301
commit 8b793b5616
6 changed files with 643 additions and 384 deletions

View File

@ -1,16 +1,17 @@
name: Build name: Build
on: on:
pull_request:
push: push:
paths-ignore: paths-ignore:
- '*.md' - '*.md'
- 'LICENSE*' - 'LICENSE*'
pull_request: workflow_dispatch:
env: env:
BUILD_PROFILE: release-lto BUILD_PROFILE: release-lto
CARGO_BIN_NAME: dtk
CARGO_TARGET_DIR: target CARGO_TARGET_DIR: target
CARGO_INCREMENTAL: 0
jobs: jobs:
check: check:
@ -78,7 +79,9 @@ jobs:
run: cargo test --release --all-features run: cargo test --release --all-features
build: build:
name: Build name: Build dtk
env:
CARGO_BIN_NAME: dtk
strategy: strategy:
matrix: matrix:
include: include:
@ -86,52 +89,52 @@ jobs:
target: x86_64-unknown-linux-musl target: x86_64-unknown-linux-musl
name: linux-x86_64 name: linux-x86_64
build: zigbuild build: zigbuild
features: default
- platform: ubuntu-latest - platform: ubuntu-latest
target: i686-unknown-linux-musl target: i686-unknown-linux-musl
name: linux-i686 name: linux-i686
build: zigbuild build: zigbuild
features: default
- platform: ubuntu-latest - platform: ubuntu-latest
target: aarch64-unknown-linux-musl target: aarch64-unknown-linux-musl
name: linux-aarch64 name: linux-aarch64
build: zigbuild build: zigbuild
features: default
- platform: ubuntu-latest - platform: ubuntu-latest
target: armv7-unknown-linux-musleabi target: armv7-unknown-linux-musleabi
name: linux-armv7l name: linux-armv7l
build: zigbuild build: zigbuild
features: default
- platform: windows-latest
target: i686-pc-windows-msvc
name: windows-x86
build: build
features: default
- platform: windows-latest - platform: windows-latest
target: x86_64-pc-windows-msvc target: x86_64-pc-windows-msvc
name: windows-x86_64 name: windows-x86_64
build: build build: build
features: default
- platform: windows-latest - platform: windows-latest
target: aarch64-pc-windows-msvc target: aarch64-pc-windows-msvc
name: windows-arm64 name: windows-arm64
build: build build: build
features: default
- platform: macos-latest - platform: macos-latest
target: x86_64-apple-darwin target: x86_64-apple-darwin
name: macos-x86_64 name: macos-x86_64
build: build build: build
features: default
- platform: macos-latest - platform: macos-latest
target: aarch64-apple-darwin target: aarch64-apple-darwin
name: macos-arm64 name: macos-arm64
build: build build: build
features: default
fail-fast: false fail-fast: false
runs-on: ${{ matrix.platform }} runs-on: ${{ matrix.platform }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Check git tag against Cargo version
if: startsWith(github.ref, 'refs/tags/')
shell: bash
run: |
set -eou
version=$(grep '^version' Cargo.toml | awk -F' = ' '{print $2}' | tr -d '"')
version="v$version"
tag='${{github.ref}}'
tag="${tag#refs/tags/}"
if [ "$tag" != "$version" ]; then
echo "::error::Git tag doesn't match the Cargo version! ($tag != $version)"
exit 1
fi
- name: Install dependencies - name: Install dependencies
if: matrix.packages != '' if: matrix.packages != ''
run: | run: |
@ -139,20 +142,20 @@ jobs:
sudo apt-get -y install ${{ matrix.packages }} sudo apt-get -y install ${{ matrix.packages }}
- name: Install cargo-zigbuild - name: Install cargo-zigbuild
if: matrix.build == 'zigbuild' if: matrix.build == 'zigbuild'
run: pip install ziglang==0.12.0 cargo-zigbuild==0.18.4 run: pip install ziglang==0.13.0 cargo-zigbuild==0.19.1
- name: Setup Rust toolchain - name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable uses: dtolnay/rust-toolchain@stable
with: with:
targets: ${{ matrix.target }} targets: ${{ matrix.target }}
- name: Cargo build - name: Cargo build
run: cargo ${{ matrix.build }} --profile ${{ env.BUILD_PROFILE }} --all-features --target ${{ matrix.target }} --bin ${{ env.CARGO_BIN_NAME }} run: >
cargo ${{ matrix.build }} --profile ${{ env.BUILD_PROFILE }} --target ${{ matrix.target }}
--bin ${{ env.CARGO_BIN_NAME }} --features ${{ matrix.features }}
- name: Upload artifacts - name: Upload artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ matrix.name }} name: ${{ env.CARGO_BIN_NAME }}-${{ matrix.name }}
path: | path: |
${{ 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 }}
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }}.exe ${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }}.exe
if-no-files-found: error if-no-files-found: error
@ -162,7 +165,23 @@ jobs:
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: [ build ] needs: [ build ]
permissions:
contents: write
steps: steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check git tag against Cargo version
shell: bash
run: |
set -eou pipefail
tag='${{github.ref}}'
tag="${tag#refs/tags/}"
version=$(grep '^version' Cargo.toml | head -1 | awk -F' = ' '{print $2}' | tr -d '"')
version="v$version"
if [ "$tag" != "$version" ]; then
echo "::error::Git tag doesn't match the Cargo version! ($tag != $version)"
exit 1
fi
- name: Download artifacts - name: Download artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
@ -170,12 +189,28 @@ jobs:
- name: Rename artifacts - name: Rename artifacts
working-directory: artifacts working-directory: artifacts
run: | run: |
set -euo pipefail
mkdir ../out mkdir ../out
for i in */*/$BUILD_PROFILE/$CARGO_BIN_NAME*; do for dir in */; do
mv "$i" "../out/$(sed -E "s/([^/]+)\/[^/]+\/$BUILD_PROFILE\/($CARGO_BIN_NAME)/\2-\1/" <<< "$i")" for file in "$dir"*; do
base=$(basename "$file")
name="${base%.*}"
ext="${base##*.}"
if [ "$ext" = "$base" ]; then
ext=""
else
ext=".$ext"
fi
arch="${dir%/}" # remove trailing slash
arch="${arch##"$name-"}" # remove bin name
dst="../out/${name}-${arch}${ext}"
mv "$file" "$dst"
done
done done
ls -R ../out ls -R ../out
- name: Release - name: Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2
with: with:
files: out/* files: out/*
draft: true
generate_release_notes: true

837
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@ name = "decomp-toolkit"
description = "Yet another GameCube/Wii decompilation toolkit." description = "Yet another GameCube/Wii decompilation toolkit."
authors = ["Luke Street <luke@street.dev>"] authors = ["Luke Street <luke@street.dev>"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
version = "0.9.6" version = "0.9.7"
edition = "2021" edition = "2021"
publish = false publish = false
repository = "https://github.com/encounter/decomp-toolkit" repository = "https://github.com/encounter/decomp-toolkit"
@ -20,56 +20,57 @@ panic = "abort"
[profile.release-lto] [profile.release-lto]
inherits = "release" inherits = "release"
lto = "thin" lto = "fat"
strip = "debuginfo" strip = "debuginfo"
codegen-units = 1
[dependencies] [dependencies]
anyhow = { version = "1.0.82", features = ["backtrace"] } anyhow = { version = "1.0", features = ["backtrace"] }
ar = { git = "https://github.com/bjorn3/rust-ar.git", branch = "write_symbol_table" } ar = { git = "https://github.com/bjorn3/rust-ar.git", branch = "write_symbol_table" }
argp = "0.3.0" argp = "0.3"
base16ct = "0.2.0" base16ct = "0.2"
base64 = "0.22.1" base64 = "0.22"
crossterm = "0.27.0" crossterm = "0.28"
cwdemangle = "1.0.0" cwdemangle = "1.0"
enable-ansi-support = "0.2.1" enable-ansi-support = "0.2"
filetime = "0.2.23" filetime = "0.2"
fixedbitset = "0.5.7" fixedbitset = "0.5"
flagset = { version = "0.4.5", features = ["serde"] } flagset = { version = "0.4", features = ["serde"] }
glob = "0.3.1" glob = "0.3"
hex = "0.4.3" hex = "0.4"
indent = "0.1.1" indent = "0.1"
indexmap = "2.2.6" indexmap = "2.5"
itertools = "0.12.1" itertools = "0.13"
log = "0.4.21" log = "0.4"
memchr = "2.7.2" memchr = "2.7"
memmap2 = "0.9.4" memmap2 = "0.9"
multimap = "0.10.0" multimap = "0.10"
nintendo-lz = "0.1.3" nintendo-lz = "0.1"
nodtool = "1.2.0" nodtool = "1.2"
#nodtool = { path = "../nod-rs/nodtool" } #nodtool = { path = "../nod-rs/nodtool" }
num_enum = "0.7.2" num_enum = "0.7"
objdiff-core = { git = "https://github.com/encounter/objdiff", rev = "a5a6a3928e392d5af5d92826e73b77e074b8788c", features = ["ppc"] } objdiff-core = { version = "2.0", features = ["ppc"] }
#objdiff-core = { path = "../objdiff/objdiff-core", features = ["ppc"] } #objdiff-core = { path = "../objdiff/objdiff-core", features = ["ppc"] }
object = { version = "0.35.0", features = ["read_core", "std", "elf", "write_std"], default-features = false } object = { version = "0.36", features = ["read_core", "std", "elf", "write_std"], default-features = false }
once_cell = "1.19.0" once_cell = "1.19"
orthrus-ncompress = "0.2.1" orthrus-ncompress = "0.2"
owo-colors = { version = "4.0.0", features = ["supports-colors"] } owo-colors = { version = "4.0", features = ["supports-colors"] }
path-slash = "0.2.1" path-slash = "0.2"
petgraph = { version = "0.6.4", default-features = false } petgraph = { version = "0.6", default-features = false }
ppc750cl = { git = "https://github.com/encounter/ppc750cl", rev = "6cbd7d888c7082c2c860f66cbb9848d633f753ed" } ppc750cl = "0.3"
rayon = "1.10.0" rayon = "1.10"
regex = "1.10.4" regex = "1.10"
rustc-hash = "1.1.0" rustc-hash = "2.0"
sanitise-file-name = "1.0.0" sanitise-file-name = "1.0"
serde = "1.0.199" serde = "1.0"
serde_json = "1.0.116" serde_json = "1.0"
serde_repr = "0.1.19" serde_repr = "0.1"
serde_yaml = "0.9.34" serde_yaml = "0.9"
sha-1 = "0.10.1" sha-1 = "0.10"
supports-color = "3.0.0" supports-color = "3.0"
syntect = { version = "5.2.0", features = ["parsing", "regex-fancy", "dump-load"], default-features = false } syntect = { version = "5.2", features = ["parsing", "regex-fancy", "dump-load"], default-features = false }
tracing = "0.1.40" tracing = "0.1"
tracing-attributes = "0.1.27" tracing-attributes = "0.1"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] } tracing-subscriber = { version = "0.3", features = ["env-filter"] }
xxhash-rust = { version = "0.8.10", features = ["xxh3"] } xxhash-rust = { version = "0.8", features = ["xxh3"] }
zerocopy = { version = "0.7.34", features = ["derive"] } zerocopy = { version = "0.7", features = ["derive"] }

View File

@ -308,7 +308,7 @@ fn fixup(args: FixupArgs) -> Result<()> {
let mut addr_to_sym: BTreeMap<SectionId, BTreeMap<u32, SymbolId>> = BTreeMap::new(); let mut addr_to_sym: BTreeMap<SectionId, BTreeMap<u32, SymbolId>> = BTreeMap::new();
for symbol in in_file.symbols() { for symbol in in_file.symbols() {
// Skip section and file symbols, we wrote them above // Skip section and file symbols, we wrote them above
if matches!(symbol.kind(), SymbolKind::Section | SymbolKind::File | SymbolKind::Null) { if matches!(symbol.kind(), SymbolKind::Section | SymbolKind::File) {
symbol_ids.push(None); symbol_ids.push(None);
continue; continue;
} }

View File

@ -28,7 +28,7 @@ pub fn process_code(
section: &ObjSection, section: &ObjSection,
config: &DiffObjConfig, config: &DiffObjConfig,
) -> Result<ProcessCodeResult> { ) -> Result<ProcessCodeResult> {
let arch = objdiff_core::arch::ppc::ObjArchPpc {}; let arch = objdiff_core::arch::ppc::ObjArchPpc { extab: None };
let orig_relocs = section let orig_relocs = section
.relocations .relocations
.range(symbol.address as u32..symbol.address as u32 + symbol.size as u32) .range(symbol.address as u32..symbol.address as u32 + symbol.size as u32)
@ -224,8 +224,11 @@ fn print_line(ins_diff: &ObjInsDiff, base_addr: u64) -> Vec<Span> {
base_color = COLOR_ROTATION[diff.idx % COLOR_ROTATION.len()] base_color = COLOR_ROTATION[diff.idx % COLOR_ROTATION.len()]
} }
} }
DiffText::BranchDest(addr) => { DiffText::BranchDest(addr, diff) => {
label_text = format!("{addr:x}"); label_text = format!("{addr:x}");
if let Some(diff) = diff {
base_color = COLOR_ROTATION[diff.idx % COLOR_ROTATION.len()]
}
} }
DiffText::Symbol(sym) => { DiffText::Symbol(sym) => {
let name = sym.demangled_name.as_ref().unwrap_or(&sym.name); let name = sym.demangled_name.as_ref().unwrap_or(&sym.name);
@ -297,6 +300,7 @@ fn to_objdiff_symbol(
flags, flags,
addend, addend,
virtual_address: None, virtual_address: None,
original_index: None,
} }
} }

View File

@ -299,7 +299,7 @@ where P: AsRef<Path> {
} }
// Generate symbols // Generate symbols
if matches!(symbol.kind(), SymbolKind::Null | SymbolKind::File) if matches!(symbol.kind(), SymbolKind::File)
|| matches!(symbol.section_index(), Some(idx) if section_indexes[idx.0].is_none()) || matches!(symbol.section_index(), Some(idx) if section_indexes[idx.0].is_none())
{ {
symbol_indexes.push(None); symbol_indexes.push(None);