Skip to content

Fix NuttX simulator on macOS#18732

Merged
xiaoxiang781216 merged 2 commits intoapache:masterfrom
PeterBee97:fix_sim_mac
Apr 14, 2026
Merged

Fix NuttX simulator on macOS#18732
xiaoxiang781216 merged 2 commits intoapache:masterfrom
PeterBee97:fix_sim_mac

Conversation

@PeterBee97
Copy link
Copy Markdown
Contributor

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
image

bijunda 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>
@github-actions github-actions Bot added Arch: simulator Issues related to the SIMulator Size: S The size of the change in this PR is small labels Apr 14, 2026
@simbit18
Copy link
Copy Markdown
Contributor

Hi @PeterBee97, thank you very much !

@simbit18
Copy link
Copy Markdown
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.

===============================================================================```
=====
Configuration/Tool: stm32f4discovery/nsh,CONFIG_ARM_TOOLCHAIN_GNU_EABI
2026-04-14 09:32:23
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Building NuttX...
chip/stm32_gpio.c:44:11: note: '#pragma message: CONFIG_STM32_USE_LEGACY_PINMAP will be deprecated migrate board.h see tools/stm32_pinmap_tool.py'
   44 | #  pragma message "CONFIG_STM32_USE_LEGACY_PINMAP will be deprecated migrate board.h see tools/stm32_pinmap_tool.py"
      |           ^~~~~~~
  [1/1] Normalize stm32f4discovery/nsh
On branch fix_sim_mac
Your branch is up to date with 'origin/fix_sim_mac'.

Untracked files:
	defconfig.tmp-e

nothing added to commit but untracked files present
===============================================================================
```=====

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
Copy link
Copy Markdown
Contributor

anchao commented Apr 14, 2026

cc @xiaoxiang781216

@xiaoxiang781216 xiaoxiang781216 merged commit e874561 into apache:master Apr 14, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: simulator Issues related to the SIMulator Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants