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
fail to make libffi.a on MacOS #2360
Comments
Which OS and shell are you using? The error message says that Maybe your sudo shell is |
I'm also encountering this and I'm running make without sudo. The output is below.
I'm on an Intel Macbook Pro using zsh. I've checked on sh, bash and zsh and I'm able to manually execute Switching from zsh to bash or sh, and then running |
Attempting to use
This also seems related to libffi? |
Solved it for my case. Despite there being no changes in the files tracked by git, I thought maybe there might some sort of cache in the untracked files (sorry I haven't looked too closely into what's going on). Anyway, I deleted the entire folder the Pyodide source was in, and then cloned it again fresh. After that, I tried running |
Yes, MacOS build support is not very good right now. So it's expected that you would run into some edge cases. Docker on linux should work, and probably indeed better not to mix the two. |
So I hit this and managed to get past it: diff --git a/cpython/Makefile b/cpython/Makefile
index 5f069db0..37cc5d37 100644
--- a/cpython/Makefile
+++ b/cpython/Makefile
@@ -119,8 +119,7 @@ $(INSTALL)/lib/libbz2.a: $(BZIP2TARBALL)
$(INSTALL)/lib/libffi.a :
rm -rf $(FFIBUILD)
git clone $(LIBFFIREPO) $(FFIBUILD) --shallow-exclude upstream-base
- source $(PYODIDE_ROOT)/emsdk/emsdk/emsdk_env.sh
- cd $(FFIBUILD) && git checkout $(LIBFFI_COMMIT) && ./build.sh && make install
+ . $(PYODIDE_ROOT)/emsdk/emsdk/emsdk_env.sh && cd $(FFIBUILD) && git checkout $(LIBFFI_COMMIT) && pwd && ./build.sh && make install
cp $(FFIBUILD)/target/include/*.h $(BUILD)/Include/
mkdir -p $(INSTALL)/lib
cp $(FFIBUILD)/target/lib/libffi.a $(INSTALL)/lib/ It seems one should not try to
Any idea what version of autoconf/automake should work? |
Ok, latest autoconf (2.71) from Homebrew was fine. That error was due to missing libtool. |
Yes, a reasonably recent one should work. FYI I also tried to make the build work with conda on MacOS in #1912 but got blocked by conda compilers not interacting well with the emscripten ones. Probably because I wasn't not doing something right, I don't have a Mac. If you manage to make it work with Homebrew that would be perfect. Also make sure you have a recent enough version of |
Otherwise using the Docker image is still the easiest way to build including on MacOS (both intel and M1 CPUs) |
Thanks for the heads up. I'm currently relying (I believe) on the native Mac compilers and everything else from Homebrew. I'm stubborn, so I'll keep at it natively. It's now failing with:
but I haven't been able to dig it out any further. |
That's a problem with sed. As per the comment on line 23, lines 21 through 49 are supposed to be removed from |
Thanks a lot for your perseverance! Yes, sed is another one that's not exactly the same. Maybe installing gnu-sed from Homebrew would help. |
Installing |
when I run
pyodide % sudo make
It looks fine until it gets to this error
source pyodide/emsdk/emsdk/emsdk_env.sh
make[1]: source: No such file or directory
make[1]: *** [pyodide/cpython/installs/python-3.10.2/lib/libffi.a] Error 1
make: *** [pyodide/cpython/installs/python-3.10.2/lib/python3.10] Error 2
when I check I can see that there is in fact no file called libffi.a in
pyodide/cpython/installs/python-3.10.2/lib/
Any help would be greatly apprecaited!
The text was updated successfully, but these errors were encountered: