Fix NuttX simulator on macOS#18732
Merged
xiaoxiang781216 merged 2 commits intoapache:masterfrom Apr 14, 2026
Merged
Conversation
added 2 commits
April 14, 2026 16:59
macOS does not ship X11 headers and libraries in the default system search paths, so sim:fb fails to build unless the XQuartz installation prefix is detected explicitly. Probe /opt/X11 first and fall back to /usr/X11 so the simulator can find the required X11 headers and libs on common macOS setups. This fixes the sim:fb build failure on macOS hosts that rely on XQuartz for X11 development files. Signed-off-by: Peter Bee <bijunda@bytedance.com>
macOS does not provide full POSIX timer support for the host-side simulator build, so references to timer_t and timer_create can fail when building sim:fb on Apple hosts. Replace the POSIX timer path with a Grand Central Dispatch timer on macOS while keeping the existing POSIX implementation for other hosts. The dispatch timer raises SIGALRM from its event handler so the host side keeps the same timer-driven behavior expected by the simulator. This preserves the existing timing model and fixes the macOS host build failure for sim:fb. Signed-off-by: Peter Bee <bijunda@bytedance.com>
simbit18
approved these changes
Apr 14, 2026
Contributor
|
Hi @PeterBee97, thank you very much ! |
jerpelea
approved these changes
Apr 14, 2026
Contributor
|
Hi @PeterBee97 I'm testing this PR with this new tool for macOS jobs. Workflow for test PRs in their own repository We received this report. https://github.com/simbit18/manual-nuttx-ci/actions/runs/24391224285/job/71237605138#logs Of course, it's not related to this PR. It could be related to the sed tool at this point ? https://github.com/apache/nuttx/blob/master/tools/Unix.mk#L770-L771 This was added today with this PR #18715 |
anchao
approved these changes
Apr 14, 2026
Contributor
xiaoxiang781216
approved these changes
Apr 14, 2026
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.
Summary
Fix NuttX sim broken on mac by Commit 29bf45c .
Impact
Replace the POSIX timer path with a Grand Central Dispatch timer on macOS while keeping the existing POSIX implementation for other hosts.
Provides more robust X11(XQuartz) include and library paths.
Testing
sim:fb now compiles and works
