pmret / papermario

Decompilation of Paper Mario (2000)
https://papermar.io
1.35k stars 128 forks source link

Improve error messages if deps or compilers are missing or out of date #1186

Open Darxoon opened 6 months ago

Darxoon commented 6 months ago

Currently, when papermario's dependencies (which are installed with install_deps or install_copilers) are out of date and not on the correct version, splat and ninja will just fail with obscure error messages, e.g.:

Error message with splat configure: configuring version us splat 0.21.5 (powered by spimdisasm 1.20.0) Loading symbols (symbol_addrs): 100%|████████████████████████████████████████████████████████████████████████████████████| 26306/26306 [00:01<00:00, 15187.18it/s] Scanning charset: 1%|█ | 11/1037 [00:00<00:46, 22.14it/s] Traceback (most recent call last): File "/home/laura/projects/papermario/tools/build/configure.py", line 1440, in configure.split(not args.no_split_assets, args.split_code, args.shift, args.debug) File "/home/laura/projects/papermario/tools/build/configure.py", line 424, in split split.main( File "/home/laura/projects/papermario-venv/lib/python3.11/site-packages/splat/scripts/split.py", line 528, in main do_scan(all_segments, rom_bytes, stats, cache) File "/home/laura/projects/papermario-venv/lib/python3.11/site-packages/splat/scripts/split.py", line 280, in do_scan segment.scan(rom_bytes) File "/home/laura/projects/papermario-venv/lib/python3.11/site-packages/splat/segtypes/common/group.py", line 131, in scan sub.scan(rom_bytes) File "/home/laura/projects/papermario/tools/splat_ext/pm_charset_palettes.py", line 27, in scan palette = N64SegPalette.parse_palette_bytes(data[i : i + 0x10]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: type object 'N64SegPalette' has no attribute 'parse_palette_bytes'
Error message with ninja [1/9486] cc_272 src/os/epirawdma.c FAILED: ver/us/build/src/os/epirawdma.c.o bash -o pipefail -c 'COMPILER_PATH=tools/build/cc/gcc2.7.2/ tools/build/cc/gcc2.7.2//gcc -Iver/us/include -Iver/us/build/include -Iinclude -Isrc -Iassets/us -D_LANGUAGE_C -D_FINALROM -DVERSION=us -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc -DVERSION_US -c -G0 -mgp32 -mfp32 -mips3 -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes -Wno-redundant-decls -O3 src/os/epirawdma.c -o ver/us/build/src/os/epirawdma.c.o && mips-linux-gnu-objcopy -N src/os/epirawdma.c ver/us/build/src/os/epirawdma.c.o' bash: line 1: tools/build/cc/gcc2.7.2//gcc: No such file or directory [2/9486] cc_272 src/os/epiwrite.c FAILED: ver/us/build/src/os/epiwrite.c.o bash -o pipefail -c 'COMPILER_PATH=tools/build/cc/gcc2.7.2/ tools/build/cc/gcc2.7.2//gcc -Iver/us/include -Iver/us/build/include -Iinclude -Isrc -Iassets/us -D_LANGUAGE_C -D_FINALROM -DVERSION=us -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc -DVERSION_US -c -G0 -mgp32 -mfp32 -mips3 -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes -Wno-redundant-decls -O3 src/os/epiwrite.c -o ver/us/build/src/os/epiwrite.c.o && mips-linux-gnu-objcopy -N src/os/epiwrite.c ver/us/build/src/os/epiwrite.c.o' bash: line 1: tools/build/cc/gcc2.7.2//gcc: No such file or directory [3/9486] cc_272 src/os/epilinkhandle.c FAILED: ver/us/build/src/os/epilinkhandle.c.o bash -o pipefail -c 'COMPILER_PATH=tools/build/cc/gcc2.7.2/ tools/build/cc/gcc2.7.2//gcc -Iver/us/include -Iver/us/build/include -Iinclude -Isrc -Iassets/us -D_LANGUAGE_C -D_FINALROM -DVERSION=us -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc -DVERSION_US -c -G0 -mgp32 -mfp32 -mips3 -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes -Wno-redundant-decls -O3 src/os/epilinkhandle.c -o ver/us/build/src/os/epilinkhandle.c.o && mips-linux-gnu-objcopy -N src/os/epilinkhandle.c ver/us/build/src/os/epilinkhandle.c.o' bash: line 1: tools/build/cc/gcc2.7.2//gcc: No such file or directory [4/9486] cc_272 src/os/piacs.c FAILED: ver/us/build/src/os/piacs.c.o bash -o pipefail -c 'COMPILER_PATH=tools/build/cc/gcc2.7.2/ tools/build/cc/gcc2.7.2//gcc -Iver/us/include -Iver/us/build/include -Iinclude -Isrc -Iassets/us -D_LANGUAGE_C -D_FINALROM -DVERSION=us -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc -DVERSION_US -c -G0 -mgp32 -mfp32 -mips3 -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes -Wno-redundant-decls -O3 src/os/piacs.c -o ver/us/build/src/os/piacs.c.o && mips-linux-gnu-objcopy -N src/os/piacs.c ver/us/build/src/os/piacs.c.o' bash: line 1: tools/build/cc/gcc2.7.2//gcc: No such file or directory [5/9486] cc_272 src/os/epidma.c FAILED: ver/us/build/src/os/epidma.c.o bash -o pipefail -c 'COMPILER_PATH=tools/build/cc/gcc2.7.2/ tools/build/cc/gcc2.7.2//gcc -Iver/us/include -Iver/us/build/include -Iinclude -Isrc -Iassets/us -D_LANGUAGE_C -D_FINALROM -DVERSION=us -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc -DVERSION_US -c -G0 -mgp32 -mfp32 -mips3 -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes -Wno-redundant-decls -O3 src/os/epidma.c -o ver/us/build/src/os/epidma.c.o && mips-linux-gnu-objcopy -N src/os/epidma.c ver/us/build/src/os/epidma.c.o' bash: line 1: tools/build/cc/gcc2.7.2//gcc: No such file or directory [6/9486] cc_272 src/os/pimgr.c FAILED: ver/us/build/src/os/pimgr.c.o bash -o pipefail -c 'COMPILER_PATH=tools/build/cc/gcc2.7.2/ tools/build/cc/gcc2.7.2//gcc -Iver/us/include -Iver/us/build/include -Iinclude -Isrc -Iassets/us -D_LANGUAGE_C -D_FINALROM -DVERSION=us -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc -DVERSION_US -c -G0 -mgp32 -mfp32 -mips3 -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes -Wno-redundant-decls -O3 src/os/pimgr.c -o ver/us/build/src/os/pimgr.c.o && mips-linux-gnu-objcopy -N src/os/pimgr.c ver/us/build/src/os/pimgr.c.o' bash: line 1: tools/build/cc/gcc2.7.2//gcc: No such file or directory [7/9486] cc_272 src/os/cartrominit.c FAILED: ver/us/build/src/os/cartrominit.c.o bash -o pipefail -c 'COMPILER_PATH=tools/build/cc/gcc2.7.2/ tools/build/cc/gcc2.7.2//gcc -Iver/us/include -Iver/us/build/include -Iinclude -Isrc -Iassets/us -D_LANGUAGE_C -D_FINALROM -DVERSION=us -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc -DVERSION_US -c -G0 -mgp32 -mfp32 -mips3 -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes -Wno-redundant-decls -O3 src/os/cartrominit.c -o ver/us/build/src/os/cartrominit.c.o && mips-linux-gnu-objcopy -N src/os/cartrominit.c ver/us/build/src/os/cartrominit.c.o' bash: line 1: tools/build/cc/gcc2.7.2//gcc: No such file or directory [8/9486] cc_272 src/os/epiread.c FAILED: ver/us/build/src/os/epiread.c.o bash -o pipefail -c 'COMPILER_PATH=tools/build/cc/gcc2.7.2/ tools/build/cc/gcc2.7.2//gcc -Iver/us/include -Iver/us/build/include -Iinclude -Isrc -Iassets/us -D_LANGUAGE_C -D_FINALROM -DVERSION=us -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc -DVERSION_US -c -G0 -mgp32 -mfp32 -mips3 -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes -Wno-redundant-decls -O3 src/os/epiread.c -o ver/us/build/src/os/epiread.c.o && mips-linux-gnu-objcopy -N src/os/epiread.c ver/us/build/src/os/epiread.c.o' bash: line 1: tools/build/cc/gcc2.7.2//gcc: No such file or directory [9/9486] cc_272 src/os/devmgr.c FAILED: ver/us/build/src/os/devmgr.c.o bash -o pipefail -c 'COMPILER_PATH=tools/build/cc/gcc2.7.2/ tools/build/cc/gcc2.7.2//gcc -Iver/us/include -Iver/us/build/include -Iinclude -Isrc -Iassets/us -D_LANGUAGE_C -D_FINALROM -DVERSION=us -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc -DVERSION_US -c -G0 -mgp32 -mfp32 -mips3 -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes -Wno-redundant-decls -O3 src/os/devmgr.c -o ver/us/build/src/os/devmgr.c.o && mips-linux-gnu-objcopy -N src/os/devmgr.c ver/us/build/src/os/devmgr.c.o' bash: line 1: tools/build/cc/gcc2.7.2//gcc: No such file or directory [10/9486] cc_272 src/os/aigetlength.c FAILED: ver/us/build/src/os/aigetlength.c.o bash -o pipefail -c 'COMPILER_PATH=tools/build/cc/gcc2.7.2/ tools/build/cc/gcc2.7.2//gcc -Iver/us/include -Iver/us/build/include -Iinclude -Isrc -Iassets/us -D_LANGUAGE_C -D_FINALROM -DVERSION=us -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc -DVERSION_US -c -G0 -mgp32 -mfp32 -mips3 -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes -Wno-redundant-decls -O3 src/os/aigetlength.c -o ver/us/build/src/os/aigetlength.c.o && mips-linux-gnu-objcopy -N src/os/aigetlength.c ver/us/build/src/os/aigetlength.c.o' bash: line 1: tools/build/cc/gcc2.7.2//gcc: No such file or directory [11/9486] cc_272 src/os/aisetfrequency.c FAILED: ver/us/build/src/os/aisetfrequency.c.o bash -o pipefail -c 'COMPILER_PATH=tools/build/cc/gcc2.7.2/ tools/build/cc/gcc2.7.2//gcc -Iver/us/include -Iver/us/build/include -Iinclude -Isrc -Iassets/us -D_LANGUAGE_C -D_FINALROM -DVERSION=us -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc -DVERSION_US -c -G0 -mgp32 -mfp32 -mips3 -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes -Wno-redundant-decls -O3 src/os/aisetfrequency.c -o ver/us/build/src/os/aisetfrequency.c.o && mips-linux-gnu-objcopy -N src/os/aisetfrequency.c ver/us/build/src/os/aisetfrequency.c.o' bash: line 1: tools/build/cc/gcc2.7.2//gcc: No such file or directory [12/9486] cc_272 src/os/aigetstatus.c FAILED: ver/us/build/src/os/aigetstatus.c.o bash -o pipefail -c 'COMPILER_PATH=tools/build/cc/gcc2.7.2/ tools/build/cc/gcc2.7.2//gcc -Iver/us/include -Iver/us/build/include -Iinclude -Isrc -Iassets/us -D_LANGUAGE_C -D_FINALROM -DVERSION=us -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc -DVERSION_US -c -G0 -mgp32 -mfp32 -mips3 -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes -Wno-redundant-decls -O3 src/os/aigetstatus.c -o ver/us/build/src/os/aigetstatus.c.o && mips-linux-gnu-objcopy -N src/os/aigetstatus.c ver/us/build/src/os/aigetstatus.c.o' bash: line 1: tools/build/cc/gcc2.7.2//gcc: No such file or directory [13/9486] cc_272 src/os/aisetnextbuf.c FAILED: ver/us/build/src/os/aisetnextbuf.c.o bash -o pipefail -c 'COMPILER_PATH=tools/build/cc/gcc2.7.2/ tools/build/cc/gcc2.7.2//gcc -Iver/us/include -Iver/us/build/include -Iinclude -Isrc -Iassets/us -D_LANGUAGE_C -D_FINALROM -DVERSION=us -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 -nostdinc -DVERSION_US -c -G0 -mgp32 -mfp32 -mips3 -Wmissing-braces -Wimplicit -Wredundant-decls -Wstrict-prototypes -Wno-redundant-decls -O3 src/os/aisetnextbuf.c -o ver/us/build/src/os/aisetnextbuf.c.o && mips-linux-gnu-objcopy -N src/os/aisetnextbuf.c ver/us/build/src/os/aisetnextbuf.c.o' bash: line 1: tools/build/cc/gcc2.7.2//gcc: No such file or directory [14/9486] as src/os/osInvalDCache.s ninja: build stopped: subcommand failed.

It would be good to enforce that the dependencies have the correct version so that it can give a clear error message telling the user what to do instead.

bates64 commented 6 months ago

The issue title is intractable without using something like nix but yes we could improve the error messages in cases like