Repository navigation
fix(tests): name the raise-exception test's signal so macOS builds it - #12076
Conversation
The test declared its own `static constexpr int SIGUSR1 = 30;`, and the macOS SDK defines `SIGUSR1` as a macro in <sys/signal.h>, which libc++ reaches through <stdlib.h> and <sys/wait.h>. The declaration then expands to `static constexpr int 30 = 30;` and the translation unit does not compile, so `guest_raise_exception_tests` and every full macOS build with BUILD_TESTING=ON stop there. Rename it to GUEST_SIGUSR1, the name the other signal tests already use. The value and every use stay the same.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head 76c419a. The change consistently renames the test's guest signal constant to GUEST_SIGUSR1, avoiding the macOS SDK macro collision while preserving the value and all call sites. The author reports that the exact x86-64 macOS object, which failed before the rename, now compiles; this is the relevant verification because the Windows and Linux signal name was not conflicting. Hosted Windows and conventions checks pass, and the current-main merge preview and diff check are clean. No test behavior changed. Approved.
|
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
I had approved this exact head earlier after reviewing the rename and the reported macOS compile check. The later overlap report flagged shared edits to GuestRaiseException.cpp. I checked the current heads: this PR merges cleanly with main by itself, but pairwise merge-tree checks conflict when combined with both open #11872 and open #11969. Please coordinate an order and declare the required Depends on entries (or rebase after those changes land) so the macro rename is not lost during integration. No issue with the rename itself.
| #endif | ||
|
|
||
| static constexpr int SIGUSR1 = 30; | ||
| static constexpr int GUEST_SIGUSR1 = 30; |
There was a problem hiding this comment.
|
Windows run of this head
AI-assisted: yes (Claude Code) |
THEMANnt
left a comment
There was a problem hiding this comment.
Reviewed 76c419a5728dd4b4b992636a50b5fb7d8ab6be30 — approve. The guest signal constant avoids the host SIGUSR1 macro without changing its value or uses.
Windows/GCC 15.2: compiling the exact source with SIGUSR1 defined as 30 passes on head and fails at the constant declaration on base, reproducing the macro collision independently of Apple headers. An exact token-renaming comparison confirms the identifier rename is the only source change, including all uses. This is a syntax/control check, not a macOS SDK build or exception-runtime test. Hosted Build reports success.
|
@MarcZX10 I checked the overlap again on today's heads, and the picture has changed since the report the bot posted:
Neither can merge as it stands, and neither of them closes this break: both still declare I did measure the rebase before deciding. On Current One more note for the integration order: If you still prefer |
MarcZX10
left a comment
There was a problem hiding this comment.
Re-check — changes still requested
The old references to #11872 and #11969 are no longer actionable because both are closed. Their replacement PRs #12682 and #12688 are open and now conflict with this PR in GuestRaiseException.cpp; #4630 also remains open and conflicts in that file and the debt document. The current code-only fix still builds according to the author, but its merge order has not been recorded for the current open PRs.
What I checked
- Refreshed the current PR, its latest author response, and hosted checks.
- Read the full current diff: it renames the test’s guest signal constant references.
- Compared the current head with
mainand ran pairwise merge previews with #12682, #12688, and #4630. - Ran
git diff --check; no local build/test was run.
Results
| Check | Result |
|---|---|
| Current-main merge preview | Clean |
git diff --check |
Pass |
| Pairwise preview with #12682 | Conflict in GuestRaiseException.cpp |
| Pairwise preview with #12688 | Conflict in GuestRaiseException.cpp |
| Pairwise preview with #4630 | Conflicts in GuestRaiseException.cpp and docs/dev/debt/libkernel.md |
| Hosted Windows and conventions | Passed |
| Hosted Linux and specialized jobs | Skipped |
| Author-reported macOS compile result | Current head compiled; full build still has unrelated failures |
Unedited local merge-check output
$ git rev-list --left-right --count upstream/main...refs/review/upstream-12076
1507 1
$ git merge-tree --write-tree upstream/main refs/review/upstream-12076
cbeb65c637a39342b317710425064c137243040c
$ git merge-tree --write-tree refs/review/upstream-12076 refs/review/upstream-12682
506a7db62c2580ab1668c78a0782a550d6e94d84
CONFLICT (content): core/libs/tests/GuestRaiseException.cpp
$ git merge-tree --write-tree refs/review/upstream-12076 refs/review/upstream-12688
e6d509fe6f02e96f57ea6b41b88fcfdbbd2c5089
CONFLICT (content): core/libs/tests/GuestRaiseException.cpp
$ git merge-tree --write-tree refs/review/upstream-12076 refs/review/upstream-4630
4a41e5a064465a027b0da9ec47061a016d9526af
CONFLICT (content): core/libs/tests/GuestRaiseException.cpp
CONFLICT (content): docs/dev/debt/libkernel.md
$ git diff --stat upstream/main...refs/review/upstream-12076
core/libs/tests/GuestRaiseException.cpp | 56 ++++++++++++++++-----------------
1 file changed, 28 insertions(+), 28 deletions(-)
$ git diff --check upstream/main...refs/review/upstream-12076
(no output; exit status 0)
Findings
Blocking
Please agree an order with the authors of the currently open #12682, #12688 and #4630, then record it in the relevant Depends on checklists or explain the chosen direct rebase strategy. The previous #11872/#11969 conflict report is obsolete; the replacements are separate open PRs, so resolve against their current heads.
Non-blocking
I found no new issue with the signal-constant rename itself. The author reports the current head removes this test file from the macOS compile failures. The reported full macOS build still has unrelated failures.
Sources
- Current PR head
76c419a5728dd4b4b992636a50b5fb7d8ab6be30 - Current upstream
mainedf6804cf52c62eacafc592dd6142cb4efe5bd05 - Author’s overlap update
- Current open successor #12682
- Current open successor #12688
- Current #4630 overlap
- Repository overlap-order rule
Not verified
I did not independently reproduce the author’s macOS build results.
|
Checked that the diff is only the |
What
guest_raise_exception_testsstops a full macOS build withBUILD_TESTING=ON, and no open pull request covers it:The test declares
static constexpr int SIGUSR1 = 30;(fromdd2890c1c5). On Windows and Linux that name is free in this translation unit; on macOS the SDK definesSIGUSR1as a macro in<sys/signal.h>, which libc++ reaches through<stdlib.h>→<sys/wait.h>, so the declaration expands tostatic constexpr int 30 = 30;.Rename it to
GUEST_SIGUSR1, the nameGuestPthreadCreateSuspended.cpp:18andGuestSignalList.cpp:10-13already use. The value and all 28 uses stay the same, so no behaviour changes.GuestRaiseNestedSleep.cpphas the same declaration but its target is insideif(WIN32)(libkernel/CMakeLists.txt:1205), so it never reaches a macOS build and is left alone.Tested
mainc547deaacb,-DBUILD_TESTING=ON -DCMAKE_OSX_ARCHITECTURES=x86_64.GuestRaiseException.cpp:21:22: error: expected unqualified-id, as quoted above.guest_raise_exception_testsstill does not link onmain:libkernelneeds feat(libkernel): direct memory mappings on macOS hosts #7631, feat(libkernel): process, thread and clock queries on macOS hosts #7804, fix(libkernel): build the file, module and rtld calls on macOS hosts #10552 and build(libkernel): compile Exception on macOS #11249 to build on macOS, so this removes one object that stops the build and nothing more.python3 tools/check_conventions.py --base origin/main: all conventions checks passed.python3 tools/pr_overlap.py --branch fix/macos-raise-exception-signal-name: no overlap with open pull requests.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)