From df6d75326c1ce70385d5fd15e2c65f347e39fd8f Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Sat, 18 Apr 2026 10:27:33 +0200 Subject: [PATCH] Make coc deterministic --- tools/coc/bytes_build.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/coc/bytes_build.py b/tools/coc/bytes_build.py index 2fb6d3ed..3b2f61e7 100644 --- a/tools/coc/bytes_build.py +++ b/tools/coc/bytes_build.py @@ -24,7 +24,9 @@ def build_bytes_def(self): ostr = "" ostr += "/* binary arrays */\n" ostr += "be_define_const_bytes_empty();\n" - for k in self.map: + # sort to ensure deterministic output so the generated header only + # changes when its content actually changes (avoids spurious rebuilds) + for k in sorted(self.map): ostr += "be_define_const_bytes(" ostr += k + ", " + ", ".join( [ "0x" + k[i:i+2] for i in range(0, len(k), 2)] ) ostr += ");\n" @@ -35,7 +37,7 @@ def build_bytes_ext(self): ostr = "" ostr += "/* extern binary arrays */\n" ostr += "extern const binstance_arg3 be_const_instance_;\n" - for k in self.map: + for k in sorted(self.map): ostr += "extern const binstance_arg3 be_const_instance_" + k + ";\n" return ostr \ No newline at end of file