Skip to content

Conversation

@kraenhansen
Copy link
Collaborator

@kraenhansen kraenhansen commented Oct 26, 2025

This needs to be rebased on main to pick up #288 (once merged).

@kraenhansen kraenhansen self-assigned this Oct 26, 2025
@kraenhansen kraenhansen added enhancement New feature or request Apple 🍎 Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.) Ferric 🦀 labels Oct 26, 2025
@kraenhansen kraenhansen requested a review from Copilot October 26, 2025 19:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for x86_64 iOS simulator builds in the Ferric package, enabling Rust Node-API modules to run on Intel-based iOS simulators. This complements the existing ARM64 simulator support.

Key Changes:

  • Enabled x86_64-apple-ios as a valid Rust target for iOS simulator builds
  • Updated universal library creation to combine both ARM64 and x86_64 simulator architectures into a single universal binary
  • Added validation assertions and improved error messages in the library combination logic

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/ferric/src/targets.ts Uncommented and documented x86_64-apple-ios as a supported iOS simulator target
packages/ferric/src/cargo.ts Updated XCFramework mapping to create universal simulator binaries combining ARM64 and x86_64 architectures
packages/ferric/src/build.ts Refactored library combination logic to handle iOS simulator libraries separately and create universal binaries for both macOS and iOS simulator
packages/ferric/src/program.ts Made the build command the default command for the ferric CLI
packages/host/src/node/prebuilds/apple.ts Added input validation and improved error messages in universal library creation function

"x86_64-apple-ios": "ios-arm64_x86_64-simulator", // Universal

// "aarch64-apple-ios-macabi": "", // Catalyst
// "x86_64-apple-ios": "ios-x86_64",
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commented-out line is now obsolete since x86_64-apple-ios has been added to the active configuration on line 27. The outdated comment should be removed to avoid confusion.

Suggested change
// "x86_64-apple-ios": "ios-x86_64",

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree - and expect this will go away in a future PR 👍

Comment on lines +318 to +319
if (libraryPaths.length === 0) {
return [];
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty array check is unnecessary because the function is called with pre-filtered groups (darwinLibraries and iosSimulatorLibraries). If either group is empty, it should not be included in the input array to avoid processing empty groups. Consider filtering out empty groups before calling this function.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

@kraenhansen kraenhansen Oct 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we're also exporting this function, I don't want to make too many assumptions on how it's called. Also, it seems the call pattern is much simpler here than if we had to not pass the array argument (darwinLibraries or iosSimulatorLibraries) if it's empty.

@kraenhansen kraenhansen force-pushed the kh/ferric-x86-ios-simulator branch from 7d36b10 to fad29d9 Compare October 26, 2025 21:53
@kraenhansen kraenhansen merged commit 9411a8c into main Oct 26, 2025
6 checks passed
@kraenhansen kraenhansen deleted the kh/ferric-x86-ios-simulator branch October 26, 2025 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Apple 🍎 Anything related to the Apple platform (iOS, macOS, Cocoapods, Xcode, XCFrameworks, etc.) enhancement New feature or request Ferric 🦀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants