Repository navigation
pal.h: only emit MSVC #pragma warning lines for MSVC - #1087
Open
Jason Sandlin (jasonsandlin) wants to merge 6 commits into
Open
Jason Sandlin (jasonsandlin) wants to merge 6 commits into
Jason Sandlin (jasonsandlin) wants to merge 6 commits into
Conversation
pal.h disabled C4062/C4702 behind a platform deny-list (not Android, Linux or Apple), so non-MSVC compilers for any other platform (PlayStation, Switch, Generic) saw the MSVC-only pragmas. pal.h is included by every public header, so every consumer TU got -Wunknown-pragmas, and -Werror builds failed. Gate on _MSC_VER instead, like json_cpp already does. Add libHttpClient.PublicHeaderCheck.Native/.Generic to the shared CMake unit-test function (Linux, macOS and sanitizer CI legs): compile-only targets that include every public header with -Werror=unknown-pragmas, for the native platform and for HC_PLATFORM_GENERIC as a stand-in for console platforms. The Generic variant fails without this fix. Fixes #1084 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Andy McCalib (amccalib)
approved these changes
Nov 30, 2026
Eight preprocessor conditionals used `#if _WIN32`. Non-Windows toolchains don't define _WIN32, so clang/gcc report -Wundef for each. pal.h is included by every public header, so every consumer TU got the warning and -Werror builds failed. Use `#if defined(_WIN32)` like the rest of the codebase; behavior is identical on every platform. Sites: Include/httpClient/pal.h, Source/Common/utils.h, Source/Logger/trace.cpp and five in Source/Task/AsyncLib.cpp. Extend the public header check with -Werror=undef so the public headers stay -Wundef clean on the native and Generic platforms. Fixes #1085 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Andy McCalib (amccalib)
approved these changes
Nov 30, 2026
A closed queue's last reference can be released on the timer worker or a pool thread after the standalone test's main() returns, racing process-exit destruction of TaskQueue/WaitTimer globals (TSan: data race / heap-use-after-free on g_timerQueue and ApiRefs::g_waitCv). - Make the final ApiRefs::GlobalRelease decrement and its notify one critical section under g_waitMutex, and use a predicate wait, so XTaskQueueUninitialize is a real barrier. - Call XTaskQueueUninitialize(5000) before exiting the poll-strand, starvation and concurrent-submit standalone tests. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
GitHub intermittently rejects release downloads (vcpkg.exe, ninja) with HTTP 618, which vcpkg treats as permanent, failing CI jobs at random. Restore-Vcpkg.ps1 and restore-vcpkg.sh now retry the bootstrap and vcpkg install up to 4 times with a 15/30/60s backoff. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
69ccc6cdf1515e872e86c06ba20076c376fce015↑ New header check passes for native Linux and Generic; portable suite 242/242.
↑ TSan exit-race fix: Windows TE suite 268/268; Linux TSan taskqueue label 30/30 locally.
↓ The TSan flake didn't reproduce locally without the fix either (0/30), so the fix isn't proven by a red run.
↑ vcpkg restore retry: both scripts verified locally (success with -Force; a forced failure retries 3 times and exits 1).
↓ CI for this revision is pending. The previous run passed everything except one job hit by a vcpkg.exe download error (HTTP 618).
↑ CI TSan stacks show the timer worker releasing the last queue ref while exit destructors free g_timerQueue and ApiRefs::g_waitCv.
↓ The TSan race isn't reproduced locally.
↓ Not verified with the actual PS5 SDK toolchain.
Fixes #1084
Problem
pal.hdisabled MSVC warnings C4062/C4702 behind a platform deny-list (not Android/Linux/Apple), so non-MSVC compilers for any other platform (PlayStation, Switch, Generic) saw the MSVC-only#pragma warning.pal.his included by every public header, so every consumer TU got-Wunknown-pragmas, and-Werrorbuilds failed.Fix
Gate on the compiler:
#if defined(_MSC_VER), matchingjson_cpp/details/json_parsing.hpp. MSVC behavior is unchanged.Test (red → green)
Adds
libHttpClient.PublicHeaderCheck.Native/.Genericto the shared CMake unit-test function (Build/libHttpClient.CMake/UnitTests.cmake), so it builds in the Linux, Linux sanitizer and macOS CI legs. These compile-only targets include every public header in a consumer TU with-Werror=unknown-pragmas, once for the native platform and once withHC_PLATFORM=HC_PLATFORM_GENERICas a stand-in for console platforms. Not added for MSVC builds.pal.h:9:9andpal.h:10:9unknown pragma ignored [-Werror,-Wunknown-pragmas].#1085 (
-Wundef) is a stacked follow-up that extends this check.CI fix: TSan exit race
taskqueue-poll-strand-linux(and, on main,taskqueue-concurrent-submit-linux) flaked under TSan: a closed queue's last reference can be released on the timer worker or a pool thread after the standalone test'smain()returns, racing exit-time destruction ofg_timerQueue/ApiRefs::g_waitCv. The finalApiRefs::GlobalReleasedecrement and notify now run in one critical section soXTaskQueueUninitializeis a real barrier, and the three XTaskQueue standalone tests call it before exiting.CI fix: vcpkg download retries
GitHub intermittently rejects release downloads (
vcpkg.exe,ninja) with HTTP 618, which vcpkg treats as permanent, so random Windows jobs failed during the dependency restore.Restore-Vcpkg.ps1andrestore-vcpkg.shnow retry the bootstrap andvcpkg installup to 4 times with a 15/30/60 s backoff.