Skip to content
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

Compatibility issue while installing emsdk 1.40.1 with M1 Mac #1327

Open
Akash1684 opened this issue Dec 29, 2023 · 5 comments
Open

Compatibility issue while installing emsdk 1.40.1 with M1 Mac #1327

Akash1684 opened this issue Dec 29, 2023 · 5 comments

Comments

@Akash1684
Copy link

Encountered compatibility issues installing emsdk 1.40.1 on my M1 Mac. The installation process fails with unexpected errors.

Installing tool 'releases-536568644fd67d53778f6111fdd5f64ad3f4c539-64bit'..
Error: Downloading URL 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/536568644fd67d53778f6111fdd5f64ad3f4c539/wasm-binaries-arm64.tar.xz': HTTP Error 404: Not Found
error: installation failed!

I understand there is no precompiled emsdk package for Apple's new M1 macs but wondering if there is any work around to install older version. I have a hard dependency on emsdk version 1.40.1

@Akash1684
Copy link
Author

Akash1684 commented Dec 29, 2023

Update: Tried enforcing EMSDK_ARCH=x86_64 as suggested in link to bypass the ARM check but facing following issue:

Done installing tool 'releases-536568644fd67d53778f6111fdd5f64ad3f4c539-64bit'.
Running post-install step: npm ci ...
Running post-install step: npm install [email protected]
Error running ['/Users/user/repos/emsdk/node/16.20.0_64bit/bin/npm', 'install', '--production', '--no-optional', '[email protected]']:
npm WARN config production Use `--omit=dev` instead.
npm WARN config optional Use `--omit=optional` to exclude optional dependencies, or
npm WARN config `--include=optional` to include them.
npm WARN config 
npm WARN config     Default value does install optional deps unless otherwise omitted.
npm WARN old lockfile 
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile 
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile 
npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"x64,x86"} (current: {"os":"darwin","arch":"arm64"})
npm ERR! notsup Valid OS:    darwin
npm ERR! notsup Valid Arch:  x64,x86
npm ERR! notsup Actual OS:   darwin
npm ERR! notsup Actual Arch: arm64

@Akash1684
Copy link
Author

I was able to get emsdk v1.40.1 up and running on M1 mac by following steps:

Get the emsdk repo

git clone https://github.com/emscripten-core/emsdk.git

Enter that directory

cd emsdk

Enforcing EMSDK_ARCH=x86_64 in emsdk.py

Update arm64 to x86_64 in line: 148:

emsdk/emsdk.py

Line 148 in 9347bc3

ARCH = 'arm64'

Installing google-closure-compiler-osx through Rosetta 2.

Steps: https://www.cypress.io/blog/2021/01/20/running-cypress-on-the-apple-m1-silicon-arm-architecture-using-rosetta-2 (instructions are for cypress but works for google-closure-compiler)

Tip: easier would be to use Rosetta with iterm than cloning native terminal

@sbc100
Copy link
Collaborator

sbc100 commented Jan 2, 2024

We do have support for M1 macs in emsdk but only with newer versions of emsdk and 1.40.1, which is 3.5 years old, pre-dates that support.

I'm glad you found a workaround.

Can I ask why you have a hard dependency on such an old version? Perhaps we can help you update?

@Akash1684
Copy link
Author

Can I ask why you have a hard dependency on such an old version? Perhaps we can help you update?

We do have hard dependency on older version because of our testing setup which fails on newer version (2+). The workaround I mentioned works well for us.

Perhaps we can help you update?

Can you help us understand the changes involved?

@sbc100
Copy link
Collaborator

sbc100 commented Jan 2, 2024

Can you help us understand the changes involved?

Can you share the build failures you are seeing when attempting to use newer versions of emscripten? Perhaps close this issue and open a new one in the emscripten repo for that?

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

No branches or pull requests

2 participants