Skip to content

fix(libs): build getifaddrs and two tests on macOS hosts - #8279

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
mugurc:fix/libs-macos-build-main
Oct 23, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
mugurc:fix/libs-macos-build-main

Conversation

@mugurc

@mugurc mugurc commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

What

Three recent changes on main use what only Linux has, so libc and two tests no longer compile on macOS. Part of the macOS series announced on #1 (#1 (comment)).

Tested

macOS 26.5.1, Apple M5 Max, Apple clang 21, x86-64 build under Rosetta 2. The libraries do not link on macOS without the rest of the macOS series, so the run is on main 3fd1cc3 with the series (ci/macos-series-2 on my fork), the open macOS fixes #7524 and #7937, and three changes from #7332.

  • Without this PR: Interfaces.cpp fails on linux/if_link.h, GuestInterfaces.cpp on netpacket/packet.h, GuestNetCtlAp.cpp on the braced list and BdaResources.cpp on MFD_CLOEXEC. With it, ninja and ninja libs finish.
  • guest_interfaces, guest_netctl_ap and guest_netctl_ap_dialog pass.
  • ctest -j4: 1648 tests, 1009 passed, 24 failed, the rest skipped (no Vulkan loader in the environment). 22 of the failures were already there in my run on yesterday's base 9127ea3 with the same series, and none of them is in a test this PR touches. guest_path_name_length is new: since fix(libc): fail an oversized guest path name with ENAMETOOLONG #8164 it expects a guest path of exactly 1023 bytes to be accepted, and macOS fails it with ENAMETOOLONG; I have not looked into it yet. patched_libraries timed out in the parallel run and passed when run alone.
  • Linux and Windows: not run. On Linux __linux__ is defined, so the code that is built is the same as before; on Windows nothing changes.

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 (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: none; the AGC change only stops building the views case on macOS
  • AI-assisted: yes

Three recent changes use what only Linux has, so libc and two tests no
longer compile on macOS:

- The AF_LINK entries that getifaddrs lists on Linux use linux/if_link.h,
  netpacket/packet.h, sockaddr_ll and rtnl_link_stats, and were built on
  every host but Windows. They are now built on Linux only: macOS lists
  the IPv4 and IPv6 addresses as before, as Windows does, and the
  interface test checks the AF_LINK entries on Linux only.
- The NetCtlAp test loops over a braced list without including
  <initializer_list>, which libc++ does not pull in through the test's
  other headers.
- The import block test backs its 16 KiB views with memfd_create. The
  views case is now built on Linux only; macOS runs the case without
  views, as Windows does.
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 8658 core/libs/prx/libc/src/Interfaces.cpp L7-8, L10-12, L162, L173, L255, L290, L304
core/libs/tests/GuestInterfaces.cpp L10-12, L79, L153, L167, L195, L214, L298
core/libs/tests/GuestNetCtlAp.cpp L4
PR 10128 docs/dev/debt/libc.md L113-114

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.

Pull request Shared files not compared
PR 3965 docs/dev/debt/libc.md
PR 4448 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 5021 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/debt/libc.md
PR 5303 docs/dev/debt/libc.md
PR 6044 core/libs/tests/GuestInterfaces.cpp
PR 6197 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6412 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6628 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6918 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 7081 docs/dev/debt/libc.md
PR 7201 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 7465 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 7642 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 7648 docs/dev/debt/libc.md
PR 7715 docs/dev/debt/libc.md
PR 8150 docs/dev/debt/libc.md
PR 8306 docs/dev/debt/libc.md
PR 8380 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 8965 docs/dev/debt/libc.md
PR 9133 docs/dev/debt/libc.md
PR 9408 docs/dev/debt/libc.md
PR 9447 docs/dev/debt/libc.md
PR 9508 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 9526 docs/dev/debt/libc.md
PR 9527 docs/dev/debt/libc.md
PR 9552 docs/dev/debt/libc.md
PR 9669 docs/dev/debt/libc.md
PR 9929 docs/dev/debt/libc.md
PR 10193 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp

@ycbuzi

ycbuzi commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Windows run of 57e3e7c merged onto main 7ce3b1d (a2d00c7db2, clean), one of the hosts the description lists as not run. Windows 11 Home 10.0.26200, MinGW-w64 GCC 15.2.0 (ucrt-posix-seh r7), Release, BUILD_TESTING=ON.

Built libc, libSceAgcDriver, agc_driver_graphics_tests, guest_interface_tests and guest_netctl_ap_tests with no errors; ctest --repeat until-fail:2 on the 29 tests those executables register (guest_netctl_ap, guest_interfaces, agc_driver_graphics and the agc_* cases): all pass on both repeats. Not run: Linux.

@krishalivaibhav

Copy link
Copy Markdown
Contributor

Code review: moving the AF_PACKET/sysfs code under __linux__ is the right split. Windows and Linux behaviour should be unchanged, and ycbuzi's Windows run supports that. It overlaps #8658 on the linux/if_link.h include and #6044 on GuestInterfaces.cpp; since this one is smaller, it would be easiest to land it first and let #8658 drop its copy of that hunk. A refreshed rebase on current main and overlap check would help a maintainer approve. (Diff review only.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants