Mac M1 Support

Open
#1,004 12 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp, javascript, node.js

Research direction

Start by reproducing npm install on an M1 Mac and inspect the release download path for nodegui-binary-v0.59.0-darwin-arm64.tar.gz. Follow the listed Qt 6.4 and NodeGui build commands, then verify that the artifact is published where the installer expects it and that installation succeeds.

Written by the indexing model from the issue text.

Description

help wanted

Hi,
Following this closed issue: https://github.com/nodegui/nodegui/issues/969

When npm attempts to install nodegui on an M1 mac, it tries to download nodegui-binary-v0.59.0-darwin-arm64.tar.gz. An error is given that this package is not found. When looking at the release page, an arm64.tar.gz package does not exist.

Here is the error from the log regarding this issue:

Error: Error while downloading Precompiled NodeGui binary:https://github.com/nodegui/nodegui/releases/download/v0.59.0/nodegui-binary-v0.59.0-darwin-arm64.tar.gz. Not Found.

Temporary solution

As temporary solution, we can build ourself the artifact and add it to the cache:

cd /tmp

# 1. Build Qt
git clone git://code.qt.io/qt/qt5.git
cd qt5
git checkout 6.4

./init-repository --module-subset=essential -f
git submodule init qtsvg
git submodule update qtsvg

cd ..
mkdir qt5-6.4-macOS-release
cd qt5-6.4-macOS-release

../qt5/configure -release QMAKE_APPLE_DEVICE_ARCHS=arm64 -opensource -confirm-license -nomake examples -nomake tests -skip qt3d -skip webengine -skip qtactiveqt -skip qtcanvas3d  -skip qtdeclarative -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtcharts -skip qtgraphicaleffects -skip qtlocation  -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtscript

make -j15
make install

# 2. Add this to .bashrc or .zshrc
export QT_INSTALL_DIR="/usr/local/Qt-6.4.3"

# 3. Build nodegui
cd ..
gcl https://github.com/nodegui/nodegui.git
cd nodegui
npm install
npm run build

# Save the artifact to the cache directory
cd build/Release
tar -czf nodegui-binary-v0.59.0-darwin-arm64.tar.gz nodegui_core.node
mkdir -p ~/Library/Caches/nodegui-core-nodejs
mv nodegui-binary-v0.59.0-darwin-arm64.tar.gz ~/Library/Caches/nodegui-core-nodejs/.

Long-term solution

We should definitely add the artifact nodegui-binary-v0.59.0-darwin-arm64.tar.gz to the official release. What is the process to do it ?

Thanks.

Dominant language
C++
Stars
9.2k
Forks
315
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nodegui/nodegui

All issues in nodegui/nodegui

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.