tidev / node-ios-device

Queries connected iOS devices and installs apps
Other
122 stars 37 forks source link

Missing darwin-arm64 in prebuilds #75

Closed zcmgyu closed 2 years ago

zcmgyu commented 2 years ago

I've known from version v3.1.1, node-ios-device has already supported build for arm64 chipset. When I adapt this library, except darwin-ia32 darwin-x64, it seems missing darwin-arm64 in node_modules/node-ios-device/prebuilds folder. Do we need to add this build manually by the command yarn prebuild-arm64? Thanks in advance 🙇🏻

ewanharris commented 2 years ago

I think the issue might just be that the prepublishOnly script is not running prebuild-arm64 too. @cb1kenobi was that intentional given that arm64 support is untested?

cb1kenobi commented 2 years ago

Yeah, at the time, I did not have a Apple silicon machine to build the binaries on... and I still don't.

We can't just add && npm run prebuild-arm64 until the node-ios-device builds are exclusively performed on an Apple silicon machine. Ideally the builds would be performed via Github actions, however Github doesn't support Apple silicon yet.

Since node-ios-device uses node-gyp-build, if the binary isn't found, it'll run node-gyp build and compile the binary.

So, this is a valid ticket. We do not have darwin-arm64 prebuilds. However it's a low priority since we have a workaround. Unless a very kind person would like donate an Apple silicon machine to me, we will have to wait until Github actions support Apple silicon.

zcmgyu commented 2 years ago

@cb1kenobi Could you please just build an alpha version? I'll attempt to run the test on my Mac M1.

cb1kenobi commented 2 years ago

@zcmgyu How would that help? The binaries are built during "prepublishOnly". If I enable arm64 builds, then do the publish, it'll prebuild the binaries and error out.

ewanharris commented 2 years ago

@cb1kenobi I don't think the assertion that creating arm64 builds requires an M1 machine is correct. I introduced arm64 versions to the 1.x branch, they build with no issues on an Intel mac and work

cb1kenobi commented 2 years ago

@ewanharris OK, you are correct. Xcode 13.2.1 can indeed target arm64. It sounds like Xcode 12 will also, though when I search I find a lot of issues.

In any case, I created #76 to add the arm64 task to the prepublishOnly script as well as some housekeeping.

ewanharris commented 2 years ago

This is not published yet as Jenkins ran into some issues, then when I attempted to publish myself I'm unable to build the i386 arch as Xcode 13 no longer supports it. @cb1kenobi is i386 support actually required?

ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /Users/awam/git/node-ios-device/build/MobileDevice.framework/MobileDevice, missing required architecture i386 in file /Users/awam/git/node-ios-device/build/MobileDevice.framework/MobileDevice (2 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd (4 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libc++.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libc++.tbd (3 slices)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd (3 slices)
ld: dynamic main executables must link with libSystem.dylib for architecture i386
cb1kenobi commented 2 years ago

Hmm, do we need i386/ia32? I don't think so. However, when I built node-ios-device last week using Xcode 13.2.1, I don't recall there being an issue building for i386. So, I'm cool with removing ia32 support.

ewanharris commented 2 years ago

Weird, I'm using 13.2.1 too. All the MobileDevice.framework's on my machine only contain x86_64 and arm64 architectures so maybe you have a different version than me? Wanna try publish?

ewanharris commented 2 years ago

@zcmgyu version 3.2.0 should now be released