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

Failure to build Julia master on ARM-macOS due to libuv #44585

Closed
fxcoudert opened this issue Mar 12, 2022 · 5 comments · Fixed by #44588
Closed

Failure to build Julia master on ARM-macOS due to libuv #44585

fxcoudert opened this issue Mar 12, 2022 · 5 comments · Fixed by #44588
Labels
building Build system, or building Julia or its dependencies system:apple silicon Affects Apple Silicon only (Darwin/ARM64) - e.g. M1 and other M-series chips

Comments

@fxcoudert
Copy link
Contributor

fxcoudert commented Mar 12, 2022

We're seeing a build error on ARM-macOS, for julia master, due to libuv. We build with:

make VERBOSE=1 USE_BINARYBUILDER=0 prefix=/opt/homebrew/Cellar/julia/HEAD-258ddc0 sysconfdir=/opt/homebrew/etc USE_SYSTEM_CSL=1 USE_SYSTEM_LIBUNWIND=1 USE_SYSTEM_PCRE=1 USE_SYSTEM_OPENLIBM=1 USE_SYSTEM_BLAS=1 USE_SYSTEM_LAPACK=1 USE_SYSTEM_GMP=1 USE_SYSTEM_MPFR=1 USE_SYSTEM_LIBSUITESPARSE=1 USE_SYSTEM_UTF8PROC=1 USE_SYSTEM_MBEDTLS=1 USE_SYSTEM_LIBSSH2=1 USE_SYSTEM_NGHTTP2=1 USE_SYSTEM_CURL=1 USE_SYSTEM_LIBGIT2=1 USE_SYSTEM_PATCHELF=1 USE_SYSTEM_ZLIB=1 USE_SYSTEM_P7ZIP=1 LIBBLAS=-lopenblas LIBBLASNAME=libopenblas LIBLAPACK=-lopenblas LIBLAPACKNAME=libopenblas USE_BLAS64=0 PYTHON=python3 MACOSX_VERSION_MIN=12 TAGGED_RELEASE_BANNER='Built by Homebrew (vHEAD-258ddc0)' install

and its fails with:

cd scratch/libuv-c2d8a538b79e135176c2b0653e04d287aada2891/ && \
	/private/tmp/julia-20220312-60681-1gwak3d/deps/srccache/libuv-c2d8a538b79e135176c2b0653e04d287aada2891//configure --with-pic --prefix=/private/tmp/julia-20220312-60681-1gwak3d/usr --build=arm64-apple-darwin21.3.0 --libdir=/private/tmp/julia-20220312-60681-1gwak3d/usr/lib --bindir=/private/tmp/julia-20220312-60681-1gwak3d/usr/tools  LDFLAGS="-Wl,-rpath,/opt/homebrew/opt/curl/lib -Wl,-rpath,/opt/homebrew/opt/mbedtls@2/lib -Wl,-rpath,/opt/homebrew/opt/openblas/lib -Wl,-rpath,/opt/homebrew/opt/gcc/lib/gcc/11 -Wl,-rpath,/opt/homebrew/lib -Wl,-rpath,/usr/lib -Wl,-rpath,'@loader_path/'" F77="gfortran -mmacosx-version-min=12 -mcpu=apple-a12 -Wa,-q" CC="clang -mmacosx-version-min=12 -mcpu=apple-a12 -integrated-as" CXX="clang++ -mmacosx-version-min=12 -mcpu=apple-a12 -integrated-as" LD="ld" LDFLAGS="-Wl,-rpath,/opt/homebrew/opt/curl/lib -Wl,-rpath,/opt/homebrew/opt/mbedtls@2/lib -Wl,-rpath,/opt/homebrew/opt/openblas/lib -Wl,-rpath,/opt/homebrew/opt/gcc/lib/gcc/11 -Wl,-rpath,/opt/homebrew/lib -Wl,-rpath,/usr/lib  -v" CFLAGS=" -O2 "
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /private/tmp/julia-20220312-60681-1gwak3d/deps/srccache/libuv-c2d8a538b79e135176c2b0653e04d287aada2891/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking build system type... Invalid configuration `arm64-apple-darwin21.3.0': machine `arm64-apple' not recognized
configure: error: /bin/sh /private/tmp/julia-20220312-60681-1gwak3d/deps/srccache/libuv-c2d8a538b79e135176c2b0653e04d287aada2891/config.sub arm64-apple-darwin21.3.0 failed
make[2]: *** [scratch/libuv-c2d8a538b79e135176c2b0653e04d287aada2891/build-configured] Error 1
make[1]: *** [julia-deps] Error 2
make: *** [/private/tmp/julia-20220312-60681-1gwak3d/doc/_build/html/en/index.html] Error 2

The build mechanism is trying to compile libuv with --build=arm64-apple-darwin21.3.0, but the correct target triplet is aarch64-apple-darwin21.3.0. I'm not sure where that arm64 is coming from, and I think it's new behaviour.

Full build output: https://gist.github.com/fxcoudert/aec0e68bef24bcc555786c1ea8ca7aaa

@giordano giordano added building Build system, or building Julia or its dependencies system:apple silicon Affects Apple Silicon only (Darwin/ARM64) - e.g. M1 and other M-series chips labels Mar 12, 2022
@giordano
Copy link
Contributor

giordano commented Mar 12, 2022

This is weird. I believe this should be taken care of by this patch contributed by Keno and, as far as I can tell, libuv's config.sub is more recent than that.

@fxcoudert
Copy link
Contributor Author

Nope:

fx@meau julia-20220312-63375-lqa3co % head deps/srccache/libuv-c2d8a538b79e135176c2b0653e04d287aada2891/config.sub   
#! /bin/sh
# Configuration validation subroutine script.
#   Copyright 1992-2018 Free Software Foundation, Inc.

timestamp='2018-02-22'

# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.

I see:

$ cat deps/libuv.version 
LIBUV_BRANCH=julia-uv2-1.44.1
LIBUV_SHA1=c2d8a538b79e135176c2b0653e04d287aada2891

but this commit does not even belong to the branch… JuliaLang/libuv@c2d8a53

@vtjnash
Copy link
Member

vtjnash commented Mar 12, 2022

I regenerated that file with Ubuntu, and didn't realize how out-of-date that distro would be.

@giordano
Copy link
Contributor

Ok, I looked at the wrong branch. Indeed the commit you pointed to has an old config.sub.

@giordano
Copy link
Contributor

@vtjnash is someone wanted to do a pull request to update the config.sub file, which branch should they target?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
building Build system, or building Julia or its dependencies system:apple silicon Affects Apple Silicon only (Darwin/ARM64) - e.g. M1 and other M-series chips
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants