build(libkernel): compile Process on macOS #11282
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11282"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by iamthehimansh on 2026-10-25T23:42:44Z.
What
Next part of splitting #8658:
libkernel'sSystem/src/Process.cppdoes not compile on macOS (sched_getcpu,RUSAGE_THREAD). Each change is macOS-only; Linux and Windows compile the same code as before._NSGetArgc/_NSGetArgv, since macOS has no procfs command line.sceKernelGetCurrentCpu: Darwin cannot report the current core, so macOS passes host CPU 0 toGuestCpuFromHost. That still maps into the thread's guest affinity, so the result is always a CPU the thread is allowed on.getrusagefor the calling thread: macOS has noRUSAGE_THREAD. User and system time come fromthread_info(THREAD_BASIC_INFO)on the thread's Mach port. The other fields come from the processgetrusage.I compared the added lines with every open PR that touches
Process.cpp. #11108 shares one line and nothing else does, so no open PR carries this macOS code.Tested
macOS 26 on an Apple M2 Pro, x86_64 under Rosetta 2, Release with Ninja, on
mainatb90d009d9:System/src/Process.cpp.ocompiles, wheremainfails it. Thelibkerneltests cannot run on macOS until the rest oflibkernelbuilds, so this is a compile check only. In #8658's full macOS run the same code passedguest_process_arguments,guest_current_cpu,guest_getrusage,guest_process_timeandguest_thread_cpu_clock. For Linux and Windows, I checked the 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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T23:45:15Z.
Review: APPROVED
Reviewed exact head
3ac106f1dd623f8d8e5d9efdbc47ba18c306102e. The platform-specific branches are scoped to__APPLE__; argument acquisition uses Darwin’s_NSGetArgc/_NSGetArgv, and thread CPU times come fromthread_info(THREAD_BASIC_INFO)while process usage remains fromgetrusage(RUSAGE_SELF). I found no blocking correctness issue in the diff. The author reports the macOS 26 arm64/Rosetta object compile; hosted eligibility, conventions, intake, labels and report checks pass. Product and relinker jobs are skipped for these paths, so this is not a hosted full-build result.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T00:49:39Z.
Review: CHANGES_REQUESTED
I found a material overlap that the PR body misses. #7201 (
Macos port, currently open and labeledneeds rebase) adds the same__APPLE__branches inProcess.cpp:_NSGetArgc/_NSGetArgvargument loading,thread_info(THREAD_BASIC_INFO)for thread usage, andsceKernelGetCurrentCpureturning host CPU 0. #7804 and #5021 also carry the argument-loading and thread-usage changes in this file. This is overlapping implementation work, not just an unrelated shared-file warning.Please coordinate merge order with the affected PR authors, update the overlap/
Depends oninformation to record the agreed integration path, and clarify how this focused split is distinct from the existing open macOS work. I am not asking anyone to close a PR. Until the overlap is reconciled, the checklist'sDepends on: noneand the statement that only #11108 shares a line are not accurate.Pull request closed