From 52d16f98049ea121f532e1699d6c9402dd49ae2d Mon Sep 17 00:00:00 2001 From: cadmic Date: Wed, 4 Sep 2024 12:51:35 -0700 Subject: [PATCH] CI fixes (#173) * Use bash as default shell * Pass binutils path to compile.sh --- .github/workflows/build.yml | 3 +++ configure.py | 2 +- tools/asm_processor/compile.sh | 2 +- tools/project.py | 7 +++++-- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c942cb5f..706804d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,9 @@ jobs: build: container: ghcr.io/zeldaret/oot-gc-vc-build:main runs-on: ubuntu-latest + defaults: + run: + shell: bash steps: # Checkout the repository (shallow clone) diff --git a/configure.py b/configure.py index 9b9a6544..1a84a420 100755 --- a/configure.py +++ b/configure.py @@ -49,7 +49,7 @@ ) parser.add_argument( "--binutils", - metavar="BINARY", + metavar="DIR", type=Path, help="path to binutils (optional)", ) diff --git a/tools/asm_processor/compile.sh b/tools/asm_processor/compile.sh index 5af66087..1517ca1e 100755 --- a/tools/asm_processor/compile.sh +++ b/tools/asm_processor/compile.sh @@ -29,6 +29,6 @@ $PYTHON tools/asm_processor/asm_processor.py "$IN" > "$TEMP/$STEM.c" $CC "$TEMP/$STEM.c" -c -o "$TEMP" $PYTHON tools/asm_processor/asm_processor.py "$IN" --post-process "$TEMP/$STEM.o" --assembler "$AS" --asm-prelude include/macros.inc # Remove sections that don't work with our reloc hacks -build/binutils/powerpc-eabi-objcopy --remove-section .mwcats.text --remove-section .comment "$TEMP/$STEM.o" "$OUT" +${BINUTILS_PATH:-build/binutils}/powerpc-eabi-objcopy --remove-section .mwcats.text --remove-section .comment "$TEMP/$STEM.o" "$OUT" # Copy depfile, replacing the first line with the correct input/output files ( echo "$OUT: $IN \\"; tail -n +2 "$TEMP/$STEM.d" ) > "${OUT%.*}.d" diff --git a/tools/project.py b/tools/project.py index 2f0cde32..bd030e89 100644 --- a/tools/project.py +++ b/tools/project.py @@ -548,9 +548,12 @@ def write_cargo_rule(): mwcc_sjis_implicit.append(transform_dep) mwcc_asm_processor_implicit.append(transform_dep) mwcc_asm_processor_sjis_implicit.append(transform_dep) + + mwcc_asm_processor_cmd = f'env "BINUTILS_PATH={binutils}" ' + mwcc_asm_processor_cmd + mwcc_asm_processor_sjis_cmd = f'env "BINUTILS_PATH={binutils}" ' + mwcc_asm_processor_sjis_cmd else: - mwcc_asm_processor_cmd = "sh " + mwcc_asm_processor_cmd - mwcc_asm_processor_sjis_cmd = "sh " + mwcc_asm_processor_sjis_cmd + mwcc_asm_processor_cmd = f'set "BINUTILS_PATH={binutils}" && sh ' + mwcc_asm_processor_cmd + mwcc_asm_processor_sjis_cmd = f'set "BINUTILS_PATH={binutils}" && sh ' + mwcc_asm_processor_sjis_cmd n.comment("Link ELF file") n.rule(