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

Fix MacOS M1 and M2 builds, Maybe link zlib and libuv statically in macOS #34

Closed
cirospaciari opened this issue Nov 13, 2022 · 6 comments
Labels

Comments

@cirospaciari
Copy link
Owner

cirospaciari commented Nov 13, 2022

Add zlib and libuv statically instead of dynamically linked, this will avoid problems with people that don't run.

brew install libuv
brew install zlib

or

apt install libuv1 zlib1g

Discussion: #10 (reply in thread)

(Should fix arm m2)

@cirospaciari cirospaciari added enhancement New feature or request up-for-grabs labels Nov 13, 2022
@cirospaciari cirospaciari changed the title Link zlib and libuv statically in macOS and linux builds Fix MacOS M1 and M2 builds, Link zlib and libuv statically in macOS and linux builds is an option Nov 23, 2022
@cirospaciari
Copy link
Owner Author

@seanr3 I'm trying to fix the build for Apple Silicon, today i will fix that, sorry for the delay, but now is the priority.

cirospaciari added a commit that referenced this issue Nov 23, 2022
@cirospaciari
Copy link
Owner Author

cirospaciari commented Nov 23, 2022

Still not solved
image

_uv_async_init error on is libuv not being detected or properly linked on macOS ARM

Related issues:
nodejs/node#39210
laverdet/isolated-vm#238
JuliaLang/julia#44585
xmrig/xmrig#2323

Possible solution:
github/roadmap#528 (comment)
actions/runner-images#2187

@cirospaciari cirospaciari changed the title Fix MacOS M1 and M2 builds, Link zlib and libuv statically in macOS and linux builds is an option Fix MacOS M1 and M2 builds, Maybe link zlib and libuv statically in macOS Nov 23, 2022
@sean324
Copy link

sean324 commented Nov 23, 2022

Yup same here.

@cirospaciari
Copy link
Owner Author

cirospaciari commented Nov 24, 2022

Still trying to figure it out an pre-build for Apple Silicon, but for now the only way is building from source, github has a roadmap to include M1 powered runners and an paid version is available from CirrusLabs but is just too expensive for this project at this stage (without more funding or customers), I'm also checking the possibility of using macOS M1 from AWS to build this, and checking an way to statically link cross compiled libuv and zlib for M1, i think that in this week (or even today) i can fix the build

Manual build:

brew install libuv
brew install zlib
brew install libuv --HEAD
brew install zlib --HEAD

#clone and update submodules
git clone https://github.com/cirospaciari/socketify.py.git
cd ./socketify.py
git submodule update --init --recursive --remote
cd ./src/socketify/native/ && make macos-arm64 && cd ../../../
#install local pip
python3 -m pip install .

@cirospaciari
Copy link
Owner Author

cirospaciari commented Nov 24, 2022

@seanr3 Good news, i created an new process to cross-compile libuv statically using cmake and things worked here!
image

No need to build manually anymore. Please uninstall and reinstall again

 pip uninstall socketify
 # or
 python3 -m pip uninstall socketify
pip install git+https://github.com/cirospaciari/socketify.py.git
 # or
python3 -m pip install git+https://github.com/cirospaciari/socketify.py.git

Please reopen this issue if you got some other type of errors.

@sean324
Copy link

sean324 commented Nov 25, 2022

Works! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants