Repository navigation
build: compile FileStream, error categories, thread priority and two tests on macOS - #10419
Conversation
…ts on macOS A macOS build of main failed 49 objects. Most included libc/include/FileStream.hpp, whose global-namespace ::feof_unlocked and ::ferror_unlocked do not exist there (they are macros in the macOS SDK). On macOS: - FileStream.hpp calls feof_unlocked and ferror_unlocked unqualified. - ExportMacros.hpp adds the leading underscore Mach-O gives C symbols to both names in APS5_EXPORT, so the .set alias resolves. - ThreadPriority.cpp has no rtkit or RLIMIT_RTTIME; "high" asks for the user-interactive QoS class and "rt" for a Mach time-constraint policy (period 1 ms, computation 0.5 ms), documented in ENVIRONMENT.md. - Formatting.cpp maps the SysV va_list builtins to va_list, and GuestContentSearch.cpp and GuestNpWebApi2.cpp include <initializer_list>. With these, 16 objects still fail on macOS; each is in a file changed by an open macOS PR. Linux and Windows compile the same code as before.
# Conflicts: # core/libs/tests/Formatting.cpp
Apple clang rejects reinterpret_cast from const void* to a function
pointer ("casts away qualifiers") in StandardExceptions.cpp, so
libc/src/exception/Exports.cpp, which includes it, failed to build on
macOS after std::system_category landed. On macOS the vtable slot is
const_cast first. Linux and Windows compile the same code as before.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the current diff and hosted checks. The macOS-only branches address the reported SDK/compiler failures, the Linux/Windows paths remain unchanged, and the author reports a focused Apple Silicon build plus Rosetta x86_64 compile. Hosted conventions, eligibility, intake, labels, register-context, and write-watch checks pass; Linux and Windows product jobs were skipped by the repository path policy. I found no blocking issue.
|
@MarcZX10 Thank you for the review and for checking the hosted runs. I'll keep the branch current with AI-assisted: yes (Cana) |
|
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.
|
|
@oneandonlydean @adriadam10 Could one of you review this when you have time? It's split PR 1 of #8658, as @adriadam10 asked: 6 files of macOS-only build fixes. Linux and Windows compile the same code as AI-assisted: yes (Cana) |
|
@oneandonlydean @adriadam10 a gentle ping for review when you have time. It changes 6 files. Every code change is macOS-only: with AI-assisted: yes (Cana) |
|
@iamthehimansh a note for planning your next split PRs: on current I built On a local scratch branch (not for a PR), I took these pieces from your
Are 1 and 2 already in one of your planned splits? If you open them, I'll run Balatro on M2 with them and report back. AI-assisted: yes (Claude Code) |
|
@krishalivaibhav thanks, that's a useful map of what a game needs to start on Yes, 1 and 2 are both planned, as one "start relinked games on macOS" PR built from The repo's intake check allows one open PR for an author with no merged PRs, so these open one at a time after this one merges. I'll tag you on each one, and a Balatro run on your M2 would be very welcome. AI-assisted: yes (Cana) |
|
Re-checked on current |
|
@krishalivaibhav the game-start part from your Balatro note is now up as #11284: guest entry, guest TLS, main-thread windows and the relinker's load-command reserve. The Balatro still needs AI-assisted: yes (Cana) |
What
Part 1 of splitting #8658 into topic PRs, as @adriadam10 asked: the shared-file build fixes that let
maincompile further on macOS. #4627 (@mugurc) has since landed theFormatting.cppandExportMacros.hppparts, so this PR carries only what is still missing onmain. All changes are macOS-only; Linux and Windows compile the same code as before.FileStream.hpp: callfeof_unlocked/ferror_unlockedunqualified. The macOS SDK defines them as macros, so::feof_unlockeddoes not exist.StandardExceptions.cpp:const_castthe error-category vtable slot before the function-pointerreinterpret_cast, which Apple clang rejects as casting away qualifiers. Without itlibc/src/exception/Exports.cppfails to build sincestd::system_categorylanded.ThreadPriority.cpp: macOS has no rtkit orRLIMIT_RTTIME.highasks for the user-interactive QoS class, andrtfor a Mach time-constraint policy (period 1 ms, computation 0.5 ms), documented indocs/dev/ENVIRONMENT.md.GuestContentSearch.cppandGuestNpWebApi2.cpp: include<initializer_list>.On macOS,
mainstill fails 13 objects with this PR, each in a file another open macOS PR changes:GuestAllocations.cpp(branch),DirectMemory.cpp(#7631),Thread.cppandProcess.cpp(#7804),Exception.cppandGuestRaiseException.cpp(#4630), andNativeStat.cpp,SharedMemory.cpp,Stdio.cpp,DynamicLoader.cpp,ModuleInfo.cppandRtld.cpp(#7201).With
BUILD_TESTING=ON,libSceAgcDriveralso fails inDriver/Lifecycle.cpp(MAP_FIXED_NOREPLACE),Execution/src/GuestMemory.cpp(link.h),GuestBufferMemory.cpp(linux/udmabuf.h) andTexture.cpp(is_trivially_copyableon astd::shared_ptr). Those fixes were in #8658 and come in the AGC driver part of the split, since they need the driver memory and dma-buf changes there.Tested
macOS 26 on an Apple M2 Pro, x86_64 under Rosetta 2, Release with Ninja, on
mainata23f8fc9f. The library build's remaining failures are the 13 objects above. For Linux and Windows, I checked each changed file's view underunifdef -U__APPLE__, with-D__linux__and with-D_WIN32: it equalsmain.python3 tools/check_conventions.py --base origin/mainpasses.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)