Skip to content

fix(tools): report JobManager dependency audit failures - #11812

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
StoneDC:fix/job-reference-audit-errors
Oct 29, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
StoneDC:fix/job-reference-audit-errors

Conversation

@StoneDC

@StoneDC StoneDC commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What

Treat import_audit.AuditError as a known dependency-audit failure in the JobManager reference runner. Malformed native dependencies follow the existing diagnostic/exit-2 path instead of escaping as an uncaught traceback. The explicitly named exception preserves unexpected programming errors.

The Windows CI follow-up fixes the artifact-path assertion: the runner resolves the output path, while Windows temporary directories can use an 8.3 short spelling. Compare against artifact.resolve() so the assertion checks the same canonical path. This follow-up changes only that assertion; production behavior and the other regression assertions are retained.

Tested

Exact tested head: 92b79217e12a3f2b417452b5024485057932b07e, rebased onto upstream main 801d5b9bc11049e6274daca09d70690bd5b8d0a9.

Windows: Python 3.14.3, MinGW GCC 15.2.0, CMake/CTest 4.3.1, Ninja. WSL Ubuntu: Python 3.14.4, GCC 15.2.0, CMake/CTest 4.2.3, Ninja.

The original failure was Windows job 122091750463: four tests compared a RUNNER~1 temporary path against the canonical runneradmin spelling printed by the runner.

Real Windows short-path control: create temporary directories on the local Windows volume, obtain their actual 8.3 aliases through GetShortPathNameW, and verify each alias refers to the same directory. Run the existing five tests with those aliases supplied as their temporary paths. The old assertion produces four failures and no errors; the final assertion passes all five tests with no skips. This uses actual filesystem aliases, not a mocked Path.resolve() result.

Configured with -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_RELINKER_ONLY=ON, then ran ctest --test-dir <build> -R '^(job_reference_errors|import_audit)$' --parallel 4 -V --output-junit <report>.

  • windows, import_audit: 154 unittest cases, 3 skips, zero failures; 12.55 s.
  • windows, job_reference_errors: 5 unittest cases, 0 skips, zero failures; 0.37 s.
  • linux, import_audit: 154 unittest cases, 2 skips, zero failures; 0.86 s.
  • linux, job_reference_errors: 5 unittest cases, 0 skips, zero failures; 0.19 s.

Both registered CTest groups pass on both hosts. Platform-specific skips in the broader import-audit suite are not counted as executed passes; the JobManager suite has no skips. XML skip-policy checks pass. Each group finishes below 30 seconds.

The five JobManager tests exercise real main -> stage_libraries -> read_host_imports with ELF/PE fixtures: transitive staging, truncated ELF, truncated PE, missing runtime and valid runtime. They still check diagnostics, exit statuses and the artifact directory. Only the native-launch run() boundary is replaced by local staging; parsing and staging implementations are not copied or replaced. No original JobManager module is launched.

Native relinker-only builds and relinker --help pass on Windows and Linux. Current-main conventions, whitespace, test-script registration audit (203 scripts) and Python 3.9 grammar parsing pass. Grammar parsing is not execution on an older Python runtime.

The original publication overlap scan and ten-PR integrations were recorded for the earlier head; they are not presented as final-head integration runs. This follow-up changes one assertion on the rebased PR and adds no test registration or production change beyond the original topic. No prerequisite PR is required.

New hosted CI is triggered for this head; the previous head's results do not validate it. Not run locally: native macOS, an older Python runtime, full system-library builds, game/PS5 or GPU execution. This establishes host dependency/error handling rather than JobManager scheduling semantics or crash durability. No performance improvement is claimed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (host tools only)
  • AI-assisted: yes

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed head 5fa2c30 against current main. read_host_imports raises the dedicated AuditError for malformed/truncated ELF and PE data; adding that exception to the runner's existing CLI handler turns those cases into exit 2 while leaving unrelated exceptions uncaught. The catch still surrounds staging before the relinker is launched, and no label/comment-like side effect is involved. I extracted the exact PR blobs and their fixture dependencies, then ran the focused test suite under Python 3.11: 5 tests passed, 0 failures. The current-main merge tree is clean. Conventions, eligibility, intake, labels, ASan and Ubuntu relinker pass; product jobs are skipped and Windows/macOS relinker jobs are pending.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 674 CMakeLists.txt
PR 1835 CMakeLists.txt
PR 3786 CMakeLists.txt
PR 5021 CMakeLists.txt
PR 9508 CMakeLists.txt
PR 9539 CMakeLists.txt

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up after refreshing CI: the Windows relinker job fails the new job_reference_errors test (4/5 cases). Each failure is the assertion at test_job_reference_errors.py:54: str(artifact) uses an 8.3 temporary path such as C:\\Users\\RUNNER~1\\..., while the captured output contains the equivalent long path C:\\Users\\runneradmin\\.... The Linux suite passes, but this Windows path representation makes the required cross-platform test fail. Please compare the reported artifact path with the expected directory using filesystem identity (Path.samefile) or an equivalent Windows-aware normalization, then rerun the Windows relinker suite. This changes my prior approval; the production exception handling itself is not what this CI failure implicates.

@StoneDC
StoneDC force-pushed the fix/job-reference-audit-errors branch from 5fa2c30 to 92b7921 Compare October 27, 2026 09:42
@babyhuey

Copy link
Copy Markdown
Contributor

Windows run of this head 92b79217e12, merged onto main 8ff4baf5348 (clean merge, local only), with the selection CI's skipped Windows product job uses: Windows 11, Ryzen 7 5800X, RTX 3080, WinLibs GCC 15.2, Release, BUILD_TESTING=ON. The tree was configured fresh after the merge, then select_tests.py select / ninja -f select.ninja selected / --target libs / select_tests.py ctest --parallel 4 --timeout 120.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the build label Oct 27, 2026

@THEMANnt THEMANnt left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 92b79217e12a3f2b417452b5024485057932b07e — approve. JobManager reference staging catches the existing import-audit exception and returns its normal diagnostic failure instead of exposing a traceback.

Windows/Python 3.11: 5/5 focused cases passed, including valid transitive staging and malformed PE/ELF inputs. The same current tests against old production produce two uncaught AuditError exceptions from the real import parser. No title execution is claimed.

The hosted Windows relinker job merged this exact head and completed successfully. Product jobs were skipped; no full product build is claimed.

@adriadam10 adriadam10 self-assigned this Oct 28, 2026
@adriadam10
adriadam10 dismissed MarcZX10’s stale review October 28, 2026 16:50

Dismissing a stale review: the requested changes were addressed after it (new head) and the merge queue blocks on it. Please request changes again if anything is still open.

@adriadam10
adriadam10 merged commit b6f7133 into boykopovar:main Oct 29, 2026
13 of 14 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked that AuditError is raised by read_host_imports for truncated ELF/PE and now reaches the CLI's exit-2 path; the new job_reference_errors test is registered in ctest, fails on the old handler (uncaught AuditError) and its path assertion uses artifact.resolve(). Relinker (Windows/Linux/macOS/asan) and Windows jobs green on this head, confirmed by @MarcZX10, @THEMANnt and @babyhuey; merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants