-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apple silicon builds #2474
Comments
I think we'd agree to do fat binaries as they seemed preferable for a number of reasons. In terms of hardware longer term, we should see if macstadium has a longer term answer for that now as having them provide the hardware is the easiest path for us. |
+1 to fat (again, I think? I don't recall). We used to do fat for x86+x64 until we ripped that out for io.js (and then Node 4). There's still echoes of the code to do it in nodejs/node Makefile and tools/ and it's certainly in the git history. For hardware, we really should have redundancy here too. Same approach as we have for x64. Rely on macstadium (assuming they'll let us use official hardware for this) but get our own and ask nearForm if they'll kindly host them for us as backups. |
We have PRs need to run on silicon too: nodejs/node#35986. |
@rvagg redundancy makes sense. I don't think we can order ARM mac mini H/W yet, correct me if I'm wrong on that and I can start the discussion with the Foundation. |
No, we're really just waiting to see Apple's announcement tomorrow. Rumours are suggesting laptops, which is probably not going to be helpful. But 🤞 we may get mini's out of this in which case we should jump straight on it. |
Yeah the event looks to be the announcement of just 2 laptops according to rumours at least - we might be another year or so away from iMacs and mac minis. |
Turns out they did announce new mac minis so it might be worth speaking with the guys at macstadium again to see their timeline. |
@mhdawson can you start the discussion with the Foundation about getting a couple of minis? And we'll need to make sure we have somewhere to put them, I guess we need to probe nearForm on this unless we have other options. |
just as an FYI I am working to get the DTKs into our regular regression runs to get some testing at least on the platform - I managed to brick one updating to the latest big sur but macstadium have swapped it out for another one. Im waiting to hear back if its safe to update the second one before I carry on. |
@rvagg last time we also asked for virtualization software so that we could have a 2 vms on each mac mini so that 1 for test and one for release would be good enough. Do you know if the same software will work on the arm machines? We'll also need to agree on the specs. From https://www.apple.com/ca/shop/buy-mac/mac-mini there only seem to be 2 choices, one with the only difference being the SSD size. |
Key difference this time is the minis are 8 core instead of 6 core so we may be able to get away with running 3 VMs on one mini, The next issue is VMware fusion which I cant seem to find any more mention besides "soon" or "we are working on it" for M1 support |
|
Oh, right yeah, the VM problem. I bet VMWare aren't treating this as a top priority. I wonder if we need to shop around for that. Maybe Orka is the only game in town for now unless we're happy to go bare metal for these? |
Looks like the license was updated around virtualisation https://blog.macstadium.com/blog/developers-big-sur-and-vindication |
So .. here's the key piece that someone needs to figure out - how do we get our toolchain to compile arm64 macos binaries on x64? Here's how we used to make fat binaries: https://github.com/nodejs/node/blob/archived-io.js-v0.10/Makefile#L291-L301 i.e. we could do a Here's some things I've tinkered with so far on my x64 mac:
But my latest failure is V8 related: I haven't got any further than that. Also, please don't count on me to solve all of these problems, I don't really have time to be doing any of this and was really just checking to see how far off we might be -- this all suggests that the answer is "quite a way off, and it will require coordinated effort across subsystems to make this happy". |
It seems |
https://developer.apple.com/documentation/xcode/building_a_universal_macos_binary Looks like Apple says to use |
Yeah, it's the two
Then I get what appears to be an arm64 binary:
That's probably not super useful other than confirming that it is possible to get a cross-compiled binary out of our toolchain, if lightly hacked. It doesn't suggest that path to getting this working properly though. At this stage I'm suspecting that something about the CFLAGS changed in GYP along the way that messed this up. I don't think xcode_emulation.py has really changed much in all that time, but make.py has, including some of the CFLAGS logic (including the _host and _target stuff). FTR the diff that gets me here is: diff --git a/common.gypi b/common.gypi
index 4745bb5ac7..1e00c64f0f 100644
--- a/common.gypi
+++ b/common.gypi
@@ -510,6 +510,7 @@
}],
['target_arch=="arm64"', {
'xcode_settings': {
+ 'SDKROOT': '/Library/Developer/CommandLineTools/SDKs/MacOSX11.0.sdk/',
'ARCHS': ['arm64'],
'OTHER_LDFLAGS!': [
'-Wl,-no_pie',
diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py
index 8af2b39f9a..fa1bd07ab7 100644
--- a/tools/gyp/pylib/gyp/xcode_emulation.py
+++ b/tools/gyp/pylib/gyp/xcode_emulation.py
@@ -663,7 +663,7 @@ class XcodeSettings(object):
# TODO: Supporting fat binaries will be annoying.
self._WarnUnimplemented("ARCHS")
archs = ["i386"]
- cflags.append("-arch " + archs[0])
+ # cflags.append("-arch " + archs[0])
if archs[0] in ("i386", "x86_64"):
if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"):
@@ -947,7 +947,7 @@ class XcodeSettings(object):
# TODO: Supporting fat binaries will be annoying.
self._WarnUnimplemented("ARCHS")
archs = ["i386"]
- ldflags.append("-arch " + archs[0])
+ # ldflags.append("-arch " + archs[0])
# Xcode adds the product directory by default.
# Rewrite -L. to -L./ to work around http://www.openradar.me/25313838 |
Oh, so here's the most plausible explanation as to why it used to work for our fat binary builds but now doesn't - the i386 build, simply using So it's this hard-wired @nodejs/gyp this is going to have to involve you to some degree, I don't know how familiar you are with xcode_emulation.py. |
A proposal for shoe-horning this in nodejs/gyp-next#78 (doesn't solve the SDKROOT issue though) |
we held a meeting today and come up with the following next steps as a starter:
as a note we need to figure out what breaking changes we might introduce with the apple silicon support and plan around targeting a specific release (e.g. 16.x) Also need to ensure we get a green CI run on the new hardware as there have been some untested (by us) prs around apple silicon land on master recently. |
Just want to confirm since I got one in the mail today. No compatibility problems with node, it just works - tested with a large/complex project - and even runs very well compared to Intel chips. So new owners should not be complaining this week. The work is still worth doing given the ~30% performance boost it unlocks. |
@nschonni Thanks. From the perspective of an outsider, I don't think Node has really explained their timeline or their progress on this issue. As someone at nodejs/TSC#886 pointed out: there is no single source of truth for those of us trying to get Node running on Also: These threads are the top results when Googling "Build Node on Apple Silicon" and similar. That's naturally going to funnel people here, unfortunately. If you want to avoid that in the future, when large-scale platform transitions occur, it would be a good idea to update the "releases" page at nodejs.org with a link that says something like, "Trying to build Node on that new M1 Mac? Here's what you need to know." Centralize the expertise and you won't be bothered by the unwashed idiot masses (me). |
There is a pinned issue on nodejs/node which is as up to date as to our progress - nodejs/node#37309 |
anyone get node 10 to work on apple silicon? I haven't been able too |
Can't get Node |
I would say that is expected. Node 15 supports M1. For older versions, use Rosetta Edit: Keep in mind this note at the top of #37309:
|
All my M1 mini is in route, while I am not a developer I want to assist in any way that I can. Even if it means picking up a new skill / helping test compilation or running various tests. |
Closing. Support for Apple silicon is 15.x and above, and the binaries will be released with the 16.x release next week |
No, and there are no more releases planned for v15.x |
@targos what about 14.17+? |
@7rulnik 14.x releases of apple silicon are currently not planned but the support is in the code base if you wish to build from source. |
@architchandra did you find a solution? |
@tsuki42 a workaround is documented here nvm-sh/nvm#2350 (comment) |
@johanneswuerbach That seems to have worked. Thanks! 🙏 |
refs: nodejs/TSC#886 (comment)
We need to kickstart the discussion again on how we plan to support the new Mac hardware which is due to be announced on Nov 10th.
We last had the discussion in the build meeting in july where we had some discussion as to whether to do 2 binaries or to go for fat binaries.
We also need to discuss sourcing hardware - We currently have two DTKs kindly donated by macstadium but no release machine as of yet and these DTKs will go back to apple at some point.
To Do:
The text was updated successfully, but these errors were encountered: