From aad27acfb18b37ffcb22758c7c4b4c2bdca6888f Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:43:14 +0100 Subject: [PATCH 1/2] restofworld_model_join: ask report_paths for the report-path guard --- tools/restofworld_model_join.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/restofworld_model_join.py b/tools/restofworld_model_join.py index fc6796983d..52fb241850 100644 --- a/tools/restofworld_model_join.py +++ b/tools/restofworld_model_join.py @@ -46,6 +46,11 @@ import time import zlib +ROOT = os.path.dirname(os.path.abspath(__file__)) +if ROOT not in sys.path: + sys.path.insert(0, ROOT) +from report_paths import same_report_path # noqa: E402 + ZHDR = re.compile(rb"\x78[\x01\x5e\x9c\xda]|KB2[a-z]") SYS_BASE = 0x50000000 GFX_BASE = 0x60000000 @@ -1263,21 +1268,14 @@ def byte_count_arg(text): def _aliases_input(out_path, source_path): - if os.path.normcase(os.path.realpath(out_path)) == os.path.normcase(os.path.realpath(source_path)): + if same_report_path(out_path, source_path): return True - try: - if os.path.samefile(out_path, source_path): - return True - except OSError: - pass if os.path.isdir(source_path): index_path = os.path.join(source_path, "index.json") - if os.path.normcase(os.path.realpath(out_path)) == os.path.normcase(os.path.realpath(index_path)): + if same_report_path(out_path, index_path): return True if not os.path.isfile(out_path): return False - if os.path.isfile(index_path) and os.path.samefile(out_path, index_path): - return True src_root = os.path.normcase(os.path.abspath(source_path)) target = os.path.normcase(os.path.abspath(out_path)) if os.path.dirname(target) == src_root and target.endswith((".bin", ".bk2")): From a129dfd962abad6b66ad66cd838015139f63831d Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:43:15 +0100 Subject: [PATCH 2/2] tests: list restofworld_model_join in SHARED The reviewers' red test: with this entry on main, test_switched_tools_import_the_helper_and_define_no_copy fails with "'from report_paths import same_report_path' not found"; with this branch it passes. --- tests/test_report_paths.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_report_paths.py b/tests/test_report_paths.py index 5a22fe2cc5..5d5876386b 100644 --- a/tests/test_report_paths.py +++ b/tests/test_report_paths.py @@ -22,8 +22,8 @@ # Tools that use report_paths and must not define their own copy again. SHARED = ("anim_index", "awc_manifest", "bink_index", "gamedata_index", "gamedata_xml", "gen_d3d12_stubs", - "glb_inspect", "meshlet_page", "navmesh_index", "rpf_probe", "tile_probe", "world_index", - "world_lights_paths", "world_names") + "glb_inspect", "meshlet_page", "navmesh_index", "restofworld_model_join", "rpf_probe", "tile_probe", + "world_index", "world_lights_paths", "world_names") # The one tool that still carries its own copy (an open pull request edits its call site). Do not add to this list: # import report_paths instead. LEGACY_COPIES = {"navmesh_decode"}