node-webrtc icon indicating copy to clipboard operation
node-webrtc copied to clipboard

Support for macOS aarch64

Open Martin-Palringo opened this issue 5 years ago • 26 comments

Installation on Apple M1 hardware running node.js v15.3.0 fails with the following message:

Error: 404 status code downloading tarball https://node-webrtc.s3.amazonaws.com/wrtc/v0.4.7/Release/darwin-arm64.tar.gz

Presumably ARM64 binaries are not currently being built for the macOS platform. Is this something that could be supported?

Martin-Palringo avatar Jan 24 '21 10:01 Martin-Palringo

+1

nadimkobeissi avatar Mar 14 '21 10:03 nadimkobeissi

I've looked into this a bit. Leaving some links:

https://groups.google.com/g/discuss-webrtc/c/s6-f6OtU4wM/m/b8FEQmjTCQAJ

building chromium for arm macs: https://chromium.googlesource.com/chromium/src/+/master/docs/mac_arm64.md#building-on-arm-macs

kevzettler avatar Apr 16 '21 18:04 kevzettler

+1

rishuSehrawat avatar Apr 24 '21 02:04 rishuSehrawat

+1

esarthou avatar Apr 24 '21 17:04 esarthou

+1

alew3 avatar May 05 '21 14:05 alew3

+1

nc avatar May 25 '21 16:05 nc

@kevzettler were you able to build successfully using those links?

uberbinge avatar May 28 '21 21:05 uberbinge

@waah42 I was able to build successfully but wasn't able to test or verify the build.

kevzettler avatar May 28 '21 22:05 kevzettler

+1, I would like this too

makinori avatar Jun 06 '21 02:06 makinori

+1

AdamMikacich avatar Jul 14 '21 18:07 AdamMikacich

+1

Hus1ein avatar Aug 20 '21 21:08 Hus1ein

+1

Casuallynoted avatar Sep 12 '21 20:09 Casuallynoted

+1

fabioruxo avatar Sep 24 '21 09:09 fabioruxo

+1

taylorjdawson avatar Sep 28 '21 17:09 taylorjdawson

@waah42 I was able to build successfully but wasn't able to test or verify the build.

@kevzettler Could you please include reproducible build steps for others to follow such that we are able to build upon your progress, thanks!

taylorjdawson avatar Sep 28 '21 17:09 taylorjdawson

@taylorjdawson I left the links. Thats what I followed. That was months ago and have lost memory and further context. I imagine the chromium codebase has continued developing as well. Good luck.

kevzettler avatar Sep 28 '21 21:09 kevzettler

@kevzettler do we need to build the whole of Chromium for this to work, or is there a way to build only WebRTC.framework?

corwin-of-amber avatar Sep 30 '21 13:09 corwin-of-amber

@corwin-of-amber I think that @kevzettler has made it clear that he's posted everything he knows and beyond that we're on our own. That being said, after looking into this myself the chromium links are more of a guide on what flags need to be set when building. The commands that @kevzettler used to try and compile are in this issue #690 -- He never posted the working commands but if you start there you might be able to get it to work.

If you do happen to build the correct binaries please share them here as this is in the spirit of Open Source 🙂

taylorjdawson avatar Sep 30 '21 16:09 taylorjdawson

any updates on this?

thisisamir98 avatar Nov 03 '21 10:11 thisisamir98

Update: I have been able to build wrtc.node on M1 (native). I will post my patches in my fork of node-webrtc.

Mainly, @kevzettler's error came from this part of the build files: https://github.com/node-webrtc/node-webrtc/blob/685aa433623b9bf98e8c7c0124e7864e01b883e6/CMakeLists.txt#L145

Need to skip target_os="linux" in case you're building for macOS.

corwin-of-amber avatar Nov 06 '21 22:11 corwin-of-amber

https://github.com/corwin-of-amber/node-webrtc/tree/port/macos-arm64

Note: building on an M1 machine requires a newer version of depot tools and a newer branch of Chromium. So the latter is set to branch_heads/4500 with the appropriate source changes. Building for M1 on an Intel Mac works fine with the original depot tools and branch_heads/4280. So this is a viable alternative in case problems ensue.

corwin-of-amber avatar Nov 07 '21 16:11 corwin-of-amber

any status update on this? I'm running into this issue and have no idea how to proceed. It's been awhile since it was reported for the first time, hopefully it's resolved some how by now?

dmitryame avatar Jul 11 '22 02:07 dmitryame

I have a solution using an existing binary that I use described here.

boblund avatar Jul 29 '22 16:07 boblund

@dmitryame @boblund, there is a port made by @koush (I helped) which uses a newer version of Chromium that is M1-compatible. You can use it by npm i @koush/wrtc. (See the discussion in https://github.com/node-webrtc/node-webrtc/issues/698).

Also looks like someone found a way to install it using @mapbox/node-pre-gyp (@k8w, see https://github.com/node-webrtc/node-webrtc/issues/729#issuecomment-1162849267).

corwin-of-amber avatar Jul 30 '22 16:07 corwin-of-amber

Open since 2021 one jan. wanted to install orbit-db and ipfs Same error ;-( . Does not work with Rosetta either. Workaround Switch to my old Mac 2012 for OrbitDB. Here it works. Hopefully this error is fixed some day. Has anybody made experience with docker ? I think maybe on a linux devcontainer it will run.

Error on M1

node-pre-gyp ERR! stack Error: 404 status code downloading tarball https://node-webrtc.s3.amazonaws.com/wrtc/v0.4.7/Release/darwin-arm64.tar.gz node-pre-gyp ERR! stack at Request. (/Users/ek/dev/orbit/code/node_modules/node-pre-gyp/lib/install.js:149:27)

no error on Catalina

Found another workaround Use a interactive docker container linked to your directory and derived from a M1 image

FROM --platform=linux/arm64 node:16-alpine

the error does not appear here. So no need to carry my old 2012 MAC with me ;-) I think the error comes from the platform specific build of the electron extension for webrtc

erhard avatar Oct 26 '22 11:10 erhard

Has anyone been able to compile it for a M2 mac ?

rija1 avatar Jun 08 '23 09:06 rija1

See https://github.com/node-webrtc/node-webrtc/pull/766

duvallj avatar May 01 '24 22:05 duvallj