Skip to content

gamedata_blobs: report a missing target as 'error:' with exit 1 - #8006

Closed
0xKaji wants to merge 1 commit into
ItsNotRexed:mainfrom
0xKaji:fix/gamedata-blobs-missing-target
Closed

0xKaji wants to merge 1 commit into
ItsNotRexed:mainfrom
0xKaji:fix/gamedata-blobs-missing-target

Conversation

@0xKaji

@0xKaji 0xKaji commented Nov 23, 2026

Copy link
Copy Markdown

gamedata_blobs.py printed 'ERROR: ... no such file or folder' and exited 2 for a missing target, while every other failure in the tool prints 'error:' and exits 1 (and the test expects that). Aligned the missing-target path with the rest.

Tested: python -I tests/test_gamedata_blobs.py (7 tests) passes; python -m compileall -q tools/gamedata_blobs.py passes.

AI-assisted.

@limpan1212

Copy link
Copy Markdown

Reproduced a regression on 6c3a3121f (Windows 11, Python 3.12.10, CPU-only, no game files): reverting tools/gamedata_blobs.py from ERROR: / exit 2 back to error: / exit 1 makes tests/test_gamedata_blobs.py pass at the expense of breaking tests/test_missing_input_exit_codes.py.

Why

Commit 22037f702 (#6701, tools: missing inputs are one ERROR line and exit 2 in five more tools) intentionally changed missing-input exits in tools/gamedata_blobs.py:365-366 to ERROR: + exit 2 and pinned that contract in tests/test_missing_input_exit_codes.py:30, while tests/test_gamedata_blobs.py:290 (BadCarveIndexTest.test_missing_file_names_what_is_wrong, from #5948) still asserted exit 1 / error:.

Reproduction

From a checkout of 6c3a3121f:

python -I tests/test_missing_input_exit_codes.py -v

Observed output on 6c3a3121f (the gamedata_blobs subtest passes on main dde82f27e and fails here):

FAIL: test_missing_input_is_exit_2_with_one_error_line (__main__.MissingInputExitCodeTests.test_missing_input_is_exit_2_with_one_error_line) (tool='gamedata_blobs')
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../tests/test_missing_input_exit_codes.py", line 52, in test_missing_input_is_exit_2_with_one_error_line
    self.assertEqual(p.returncode, 2, p.stderr)
AssertionError: 1 != 2 : error: cannot read .../tests/no-such-input-for-build-1046: no such file or folder

Suggested fix

Keep tools/gamedata_blobs.py:365-366 returning exit 2 with ERROR: (preserving #6701 / tests/test_missing_input_exit_codes.py) and update tests/test_gamedata_blobs.py:290 to expect exit 2 and ERROR: for a missing target so both test suites pass together.

AI-assisted review.

@neoisg8

neoisg8 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Confirmed on Windows 11 (CPython 3.14.3, CPU only, no game files).

Echoing @limpan1212's finding: changing tools/gamedata_blobs.py:365-366 from exit 2 (ERROR:) to exit 1 (error:) introduces a regression in tests/test_missing_input_exit_codes.py:

FAIL: test_missing_input_is_exit_2_with_one_error_line (tool='gamedata_blobs')
AssertionError: 1 != 2 : error: cannot read .../no-such-input-for-build-1046: no such file or folder

Commit 22037f702 (#6701, following BUILD-1046) standardized missing input paths across tools to output uppercase ERROR: and return exit code 2.

The proper fix is to leave tools/gamedata_blobs.py:365-366 as-is and instead update tests/test_gamedata_blobs.py:288-291 (test_missing_file_names_what_is_wrong) to expect exit code 2 and uppercase ERROR:, which brings both test suites into agreement.

AI-assisted review.

@0xKaji 0xKaji closed this by deleting the head repository Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants