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

druid-console can't be built on Mac M1 #13012

Closed
FrankChen021 opened this issue Sep 1, 2022 · 3 comments · Fixed by #13017
Closed

druid-console can't be built on Mac M1 #13012

FrankChen021 opened this issue Sep 1, 2022 · 3 comments · Fixed by #13017
Labels
Area - Dev For items related to the project itself, like dev docs and checklists, but not CI

Comments

@FrankChen021
Copy link
Member

druid-console module can't be built on Mac M1 during installation of Node saying error=86, Bad CPU type in executable

[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.11.3:npm (npm-install) on project druid-console: Failed to run task: 'npm ci' failed. java.io.IOException: Cannot run program "/Users/frankchen/source/open/druid/web-console/target/node/node" (in directory "/Users/frankchen/source/open/druid/web-console"): error=86, Bad CPU type in executable -> [Help 1]

This is because node 14.19.3 does not ship any release for Mac M1 chip, it installs x86 version on Mac M1.

[INFO] Installing node version v14.19.3
[INFO] Unpacking /Users/frankchen/.m2/repository/com/github/eirslett/node/14.19.3/node-14.19.3-darwin-x64.tar.gz into /Users/frankchen/source/open/druid/web-console/target/node/tmp
[INFO] Copying node binary from /Users/frankchen/source/open/druid/web-console/target/node/tmp/node-v14.19.3-darwin-x64/bin/node to /Users/frankchen/source/open/druid/web-console/target/node/node
[INFO] Installed node locally.

The Node 16.x (another LTS) contains release for Mac M1, see: https://nodejs.org/dist/v16.17.0/
But if we upgrade the node to such version, existing node-sass has also needed to be upgraded from 5.x to at least 6.x because node-sass 5.x fails to build on Node 16. Only node-sass 6.0+ support Node 16.

So, the upgrade becomes complicated, I don't if there any other modules incompatible with Node 16. It's out of ability to do that. So I have to install Rosetta on my Mac M1 to run x86 version of Node 14.

@vogievetsky Do you have any plan to upgrade Node to higher LTS version such as Node 16 so that druid-console can be built directly on Mac M1? If not, I will open a PR to update the dev-doc to let users know how to tackle the above problem that I encounter.

@FrankChen021 FrankChen021 added the Area - Dev For items related to the project itself, like dev docs and checklists, but not CI label Sep 1, 2022
@vogievetsky
Copy link
Contributor

yes, I really want to upgrade to Node 16. The only issue IIRC is something with node-sass as you mentioned which is why we stuck with 14 (when we last looked at it node-sass 6 was not out yet). Is upgrading to node-sass 6 trivial?

@FrankChen021
Copy link
Member Author

I gave up when I found node-sass has to be upgraded.
I'm not familiar with frontend packages and don't know what are these packages are for.

@FrankChen021
Copy link
Member Author

Unfortunately, this problem was not resolved.

I update to the lastest master, and tried to build again, the node-sass still fails to compile. Finally I found the the Mac M1 is still not supported by node-sass(sass/node-sass#3033)

There're some other solution on the internet to suggest using sass to replace node-sass, but since there's sass-loader which is dependent on node-sass, the replacing is still not possible at my local environment.

So, at last, I'm still using rosetta to use x64 version of node and node-sass on my Mac M1.

cc @vogievetsky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area - Dev For items related to the project itself, like dev docs and checklists, but not CI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants