From f4d828a3cd88d4975fa6aa94d960896ee05f58a2 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Wed, 3 Feb 2021 09:31:49 +0000 Subject: [PATCH 1/3] fix header file dependencies --- configure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.py b/configure.py index 9e97cc4d00..c88c723c06 100755 --- a/configure.py +++ b/configure.py @@ -207,12 +207,12 @@ async def main(): n.newline() n.rule("cc", - command=f"bash -o pipefail -c '{cpp} $cppflags $in -o - | $iconv | tools/$os/cc1 $cflags -o - | tools/$os/mips-nintendo-nu64-as -EB -G 0 - -o $out'", + command=f"bash -o pipefail -c '{cpp} $cppflags -MD -MF $out.d $in -o - | $iconv | tools/$os/cc1 $cflags -o - | tools/$os/mips-nintendo-nu64-as -EB -G 0 - -o $out'", description="cc $in", depfile="$out.d", deps="gcc") n.rule("cc_dsl", - command=f"bash -o pipefail -c '{cpp} $cppflags $in -o - | $python tools/compile_dsl_macros.py | $iconv | tools/$os/cc1 $cflags -o - | tools/$os/mips-nintendo-nu64-as -EB -G 0 - -o $out'", + command=f"bash -o pipefail -c '{cpp} $cppflags -MD -MF $out.d $in -o - | $python tools/compile_dsl_macros.py | $iconv | tools/$os/cc1 $cflags -o - | tools/$os/mips-nintendo-nu64-as -EB -G 0 - -o $out'", description="cc (with dsl) $in", depfile="$out.d", deps="gcc") From 267acf3ad32e70de430371150222195503815c66 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Mon, 1 Feb 2021 20:01:34 +0000 Subject: [PATCH 2/3] fix configure.py on old python for github actions --- configure.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.py b/configure.py index c88c723c06..95bdd2ccf8 100755 --- a/configure.py +++ b/configure.py @@ -454,4 +454,5 @@ async def main(): print(f"to compile '{TARGET}.z64'.") if __name__ == "__main__": - asyncio.run(main()) + loop = asyncio.get_event_loop() + loop.run_until_complete(main()) From e3f42531d83b47562d01af5f37a3442a2b8669f2 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Wed, 3 Feb 2021 11:33:47 +0000 Subject: [PATCH 3/3] check object checksums upon sha1 FAILED --- configure.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/configure.py b/configure.py index 95bdd2ccf8..d83ded4b46 100755 --- a/configure.py +++ b/configure.py @@ -287,25 +287,27 @@ async def main(): description="rom $in") n.newline() - n.rule("sha1sum", - command="sha1sum -c $in && touch $out", - description="compare") + objects, segments = read_splat("tools/splat.yaml") # no .o extensions! + c_files = (f for f in objects if f.endswith(".c")) # glob("src/**/*.c", recursive=True) + + n.rule("checksums", + command=f"(sha1sum -c checksum.sha1 && bash $out.bash > $out) || sha1sum -c $out --quiet", + description="compare", + rspfile="$out.bash", + rspfile_content=f"sha1sum {' '.join([obj(o) for o in objects])}") n.newline() n.rule("cc_modern_exe", command="cc $in -O3 -o $out") n.newline() - objects, segments = read_splat("tools/splat.yaml") # no .o extensions! - c_files = (f for f in objects if f.endswith(".c")) # glob("src/**/*.c", recursive=True) - n.comment("target") n.build("$builddir/$target.ld", "cpp", "$target.ld") n.build("$builddir/$target.elf", "link", "$builddir/$target.ld", implicit=[obj(o) for o in objects], implicit_outputs="$builddir/$target.map") n.build("$target.z64", "rom", "$builddir/$target.elf", implicit="tools/n64crc") - n.build("$builddir/is_ok", "sha1sum", "checksum.sha1", implicit="$target.z64") + n.build("$builddir/expected.sha1", "checksums", implicit="$target.z64") n.newline() - n.default("$builddir/is_ok") + n.default("$builddir/expected.sha1") n.newline() # generated headers