Skip to content

fix(platform): match CPython 3.14 platform.platform() output (#713) - #722

Merged
espetro merged 4 commits into
masterfrom
work/713
Oct 27, 2026
Merged

espetro merged 4 commits into
masterfrom
work/713

Conversation

@espetro

@espetro espetro commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Rewrite ps_platform_platform in src/pyscriptc/runtime/ps_osmore.c to emit the CPython 3.14 platform.platform() shape per target: macOS-<release>-<machine>-<processor>-<bits>-Mach-O on macOS (processor falling back to machine, bitness from sizeof(void*)), <sysname>-<release>-<machine>-with-glibc<version> on glibc Linux via gnu_get_libc_version(), and the plain uname triple elsewhere.
  • Drop the PLATFORM_DIVERGENCE reference (constant and probe kwarg) in tests/test_stdlib_call_table.py; the platform probe now compares against CPython directly. Also drops MIRRORED_DIVERGENCE since the fix(unicodedata): mirrored returns bool where CPython 3.14 returns int #712 fix is stacked underneath.
  • Sync src/pyscriptc/stdmore.py with the work/712 head so the stacked diff shows only this issue's changes.

Verification

  • New C compiles clean under gcc -fsyntax-only -Wall against the runtime header set.
  • No native execution in this environment: verification is structural (blob-exact file sync, compile-only check of the new C, call-table probe accounting still 153/153).

Stacking

Closes #713

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Deploying pyscriptc with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9233f90
Status:🚫  Build failed.

View logs

@espetro
espetro force-pushed the work/712 branch 2 times, most recently from 147006c to c831ec7 Compare October 27, 2026 08:14
espetro and others added 3 commits October 27, 2026 01:24
CPython's platform.platform() is not a raw uname triple. On macOS it is
"macOS-<release>-<machine>-<processor>-<bits>-Mach-O"; on glibc Linux it
appends "-with-glibc<version>". ps_platform_platform formatted
"%s-%s-%s", so the host batch of the call-table sweep diverged on this
row.

Rewrite it per platform: the macOS shape with the Mach-O ABI suffix, the
glibc suffix via gnu_get_libc_version(), and the plain triple elsewhere
(musl, WASI). Windows keeps its existing stand-in.

Closes #713
The unicodedata.mirrored row is fixed by #712 (stacked under this PR) and
platform.platform is fixed by this PR, so both probes now run clean and
only the #714 realpath divergence reference remains.
@espetro espetro added this to the v0.7.0 milestone Oct 27, 2026
@espetro
espetro changed the base branch from work/712 to master October 27, 2026 08:25
@espetro
espetro merged commit 3fa9634 into master Oct 27, 2026
33 of 34 checks passed
@espetro
espetro deleted the work/713 branch October 27, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(platform): platform.platform output differs from CPython 3.14

1 participant