Skip to content

fix(metagen): target the macOS SDK version, as iOS does - #104

Open
NathanWalker wants to merge 1 commit into
mainfrom
fix/metagen-macos-sdk-target
Open

NathanWalker wants to merge 1 commit into
mainfrom
fix/metagen-macos-sdk-target

Conversation

@NathanWalker

Copy link
Copy Markdown
Contributor

Summary

 macos: {
   targets: {
-    x86_64: "x86_64-apple-macos11.0",
-    arm64: "arm64-apple-macos11.0",
+    x86_64: `x86_64-apple-macos${getSDKVersion("macosx")}`,
+    arm64: `arm64-apple-macos${getSDKVersion("macosx")}`,
   },
 },

The metadata generator leaves out declarations introduced after its -target OS. macOS was pinned to 11.0, so the embedded metadata of @nativescript/macos-node-api has nothing newer than macOS 11. That rules out ScreenCaptureKit's capture classes, even though ScreenCaptureKit is in MACOS_FRAMEWORKS, as well as Liquid Glass and everything else from 12 onward. iOS already targets the SDK version. A class the running OS doesn't have resolves to undefined, as on iOS.

Evidence

The same generator binary and SDK (macOS 27.0) were used for both runs. Only the target differs. The metadata was loaded into a 0.5.0-beta.0 runtime with METADATA_PATH:

  • Before (arm64-apple-macos11.0, 4.7 MB):
    SCStream undefined, SCShareableContent undefined, SCScreenshotManager undefined, NSGlassEffectView undefined
    After (arm64-apple-macos27.0, 6.5 MB):
    SCStream function, SCShareableContent function, SCScreenshotManager function, NSGlassEffectView function

Found while building the ns-edge desktop hosts. They stream a window with SCStream and have been bundling separately generated metadata to work around this.

Merge Danger

Door: two-way

Revert to restore the 11.0 target.

Blast Radius: metadata

The macOS metadata grows by about 1.8 MB. Generated typings and metadata for macOS now include APIs newer than macOS 11. Code that relied on a newer class being undefined in metadata on every OS would now see it defined where the OS has it.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dc81bbca-105b-4663-96d7-219b7378ad17

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

macOS metadata was generated for macos11.0, and the generator leaves out
declarations introduced after the target, so everything newer than macOS 11
was missing from the embedded metadata: ScreenCaptureKit's SCStream (12.3),
SCScreenshotManager (14.0), NSGlassEffectView (26.0) and the rest. iOS already
targets the SDK version.
@NathanWalker
NathanWalker force-pushed the fix/metagen-macos-sdk-target branch from d32a75a to 42ca06a Compare November 20, 2026 21:24

This branch has not been deployed

No deployments
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.

1 participant