fix(build): forward selected toolchains to libjpeg-turbo #19625

Merged
IvanFogel merged 2 commits from upstream-pr/19625 into main 2026-11-13 21:46:33 +00:00
IvanFogel commented 2026-11-13 16:35:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by IvanFogel on 2026-11-13T16:35:55Z.


What

The nested libjpeg-turbo build receives the parent compiler but loses its selected CMake toolchain. A Linux-to-MinGW build then configures that child as a Linux project with a Windows compiler and fails to determine its pointer size. Forward CMAKE_TOOLCHAIN_FILE when supplied, retaining the existing native and Apple settings.

Add a production-helper regression whose nested C compilation requires a definition supplied only by the selected toolchain. The fixture uses paths with spaces; a native build without a toolchain remains supported. No JPEG decoding behavior is changed.

The registered regression now inherits its parent CMake generator, so non-Ninja builds do not require Ninja just to run this test.

Tested

Current main refresh: 4f4fa0b13e629d1de1dc3de5f8c5801e154e9b40 on d261fa6f56657357c39d1d4c26ba2546a94add7e. Every own range-diff entry is unchanged. Both selected-toolchain and native-control compiler probes pass with Ninja and Unix Makefiles. The Makefiles run uses a private PATH without Ninja, verifying the reported generator-portability issue remains fixed. Main already contains upstream CES revert bbc937d05536ad0dce4e7a91b90e0d20cbd21360; the four formerly timing-out cases pass under Wine on the current-main-based extrema candidate. This does not replace fresh upstream full Windows CI. Earlier exact-head results below remain historical, including external reports not rerun here. Refresh pins and full local qualification.

Linux x86-64 / CachyOS, GCC 16.2.1, CMake 4.4.5. Current candidate 617c139b045a460983d271d21686674520e44ed9 on main snapshot 5891d14d99b55999a211613839f9e8dcac31aeff.

  • Reproduced the generator review finding on original head 3213fc94d016b7d3f51561a47fbb7eec5ae74a62: both cases fail because the fixture requests Ninja, despite CMAKE_GENERATOR=Unix Makefiles and a private PATH with Make/compiler tools but no Ninja. The corrected native-control and selected-toolchain cases both pass in that same environment (1.39 seconds total), and with Ninja (0.95 seconds total).
  • Executed the actual registered jpeg_external_toolchain CTest from Makefiles and Ninja parents. Both pass; their registered environment overrides an intentionally incorrect inherited CMAKE_GENERATOR. This checks the production registration as well as the Python fixture.
  • Fresh build of actual pinned official libjpeg-turbo source c85e6b905bf237038faa936dab160ebfc5da0344 through the production helper using Arch mingw-w64-gcc 16.2.0-2.1 and the selected Windows toolchain: configure, compilation and archive installation pass. The 1,414,290-byte libturbojpeg.a contains only x86-64 PE/COFF objects.
  • The original forwarding patch rebased with identical range-diff. The current canonical overlap scan reports only this existing PR #19625; no other PR is reported. Conventions and whitespace checks pass. The original forwarding change had an independent read-only review; the subsequent generator correction was verified by the RED/GREEN and registered-test runs above.
  • Original forwarding RED evidence remains in the linked report: without toolchain propagation, the native control passes and selected-toolchain compilation fails at the missing-definition #error. This was the earlier test run, not a fresh negative-control run on the new commit.
  • Native Windows/macOS execution, a full Windows product build and JPEG algorithm/output comparisons were not run for this PR. No title-unblock, GPU or speed claim.

Full regression, fresh generator/MinGW qualification and original review evidence.

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
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5299204041 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19625). Originally posted by [IvanFogel](https://github.com/IvanFogel) on 2026-11-13T16:35:55Z. --- ### What The nested libjpeg-turbo build receives the parent compiler but loses its selected CMake toolchain. A Linux-to-MinGW build then configures that child as a Linux project with a Windows compiler and fails to determine its pointer size. Forward CMAKE_TOOLCHAIN_FILE when supplied, retaining the existing native and Apple settings. Add a production-helper regression whose nested C compilation requires a definition supplied only by the selected toolchain. The fixture uses paths with spaces; a native build without a toolchain remains supported. No JPEG decoding behavior is changed. The registered regression now inherits its parent CMake generator, so non-Ninja builds do not require Ninja just to run this test. ### Tested Current main refresh: `4f4fa0b13e629d1de1dc3de5f8c5801e154e9b40` on `d261fa6f56657357c39d1d4c26ba2546a94add7e`. Every own range-diff entry is unchanged. Both selected-toolchain and native-control compiler probes pass with Ninja and Unix Makefiles. The Makefiles run uses a private PATH without Ninja, verifying the reported generator-portability issue remains fixed. Main already contains upstream CES revert `bbc937d05536ad0dce4e7a91b90e0d20cbd21360`; the four formerly timing-out cases pass under Wine on the current-main-based extrema candidate. This does not replace fresh upstream full Windows CI. Earlier exact-head results below remain historical, including external reports not rerun here. [Refresh pins and full local qualification](https://gist.github.com/IvanFogel/e3096e7ad75390006640ba809885967d). <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Linux x86-64 / CachyOS, GCC 16.2.1, CMake 4.4.5. Current candidate `617c139b045a460983d271d21686674520e44ed9` on main snapshot `5891d14d99b55999a211613839f9e8dcac31aeff`. - Reproduced the generator review finding on original head `3213fc94d016b7d3f51561a47fbb7eec5ae74a62`: both cases fail because the fixture requests Ninja, despite CMAKE_GENERATOR=Unix Makefiles and a private PATH with Make/compiler tools but no Ninja. The corrected native-control and selected-toolchain cases both pass in that same environment (1.39 seconds total), and with Ninja (0.95 seconds total). - Executed the actual registered jpeg_external_toolchain CTest from Makefiles and Ninja parents. Both pass; their registered environment overrides an intentionally incorrect inherited CMAKE_GENERATOR. This checks the production registration as well as the Python fixture. - Fresh build of actual pinned official libjpeg-turbo source `c85e6b905bf237038faa936dab160ebfc5da0344` through the production helper using Arch mingw-w64-gcc 16.2.0-2.1 and the selected Windows toolchain: configure, compilation and archive installation pass. The 1,414,290-byte libturbojpeg.a contains only x86-64 PE/COFF objects. - The original forwarding patch rebased with identical range-diff. The current canonical overlap scan reports only this existing PR #19625; no other PR is reported. Conventions and whitespace checks pass. The original forwarding change had an independent read-only review; the subsequent generator correction was verified by the RED/GREEN and registered-test runs above. - Original forwarding RED evidence remains in the linked report: without toolchain propagation, the native control passes and selected-toolchain compilation fails at the missing-definition #error. This was the earlier test run, not a fresh negative-control run on the new commit. - Native Windows/macOS execution, a full Windows product build and JPEG algorithm/output comparisons were not run for this PR. No title-unblock, GPU or speed claim. [Full regression, fresh generator/MinGW qualification and original review evidence](https://gist.github.com/IvanFogel/cca1c77bffefde51d56c47b5185f350b). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!19625
No description provided.