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

Compilation from source on macOS fails in libuv #45200

Closed
fxcoudert opened this issue May 5, 2022 · 3 comments · Fixed by JuliaLang/libuv#21
Closed

Compilation from source on macOS fails in libuv #45200

fxcoudert opened this issue May 5, 2022 · 3 comments · Fixed by JuliaLang/libuv#21
Labels
building Build system, or building Julia or its dependencies external dependencies Involves LLVM, OpenBLAS, or other linked libraries system:mac Affects only macOS

Comments

@fxcoudert
Copy link
Contributor

Running make USE_BINARYBUILDER=0 VERBOSE=1 on macOS 12 on julia master gives:

/private/tmp/julia/deps/srccache/libuv-f872be3b6438b90b4690fe3ee7692c50bfd9c7c7/src/unix/process.c:290:12: error: implicit declaration of function 'execvpe' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return execvpe(file, argv, envp);
           ^
1 error generated.
make[2]: *** [src/unix/libuv_la-process.lo] Error 1
make[1]: *** [scratch/libuv-f872be3b6438b90b4690fe3ee7692c50bfd9c7c7/build-compiled] Error 2
make: *** [julia-deps] Error 2

The code in question is:

#ifdef __GLIBC_PREREQ
# if (__GLIBC_PREREQ(2,11))
  /* Old glibc did not have execvpe at all, so we always emulate it. */
  if (envp == environ)
    return execvpe(file, argv, envp);
#endif
#else
  /* Assume all other environments have execvpe. */
  if (envp == environ)
    return execvpe(file, argv, envp);
#endif

but execvpe is not available on macOS. I suppose either the code should be fixed, or be compiled with -Wno-implicit-function-declaration on compilers that enable it by default (clang).

@fxcoudert
Copy link
Contributor Author

This does not happen with julia 1.8.0-rc3. The regression was introduced in this commit: JuliaLang/libuv@88ad470 @tkelman @vtjnash

@giordano giordano added building Build system, or building Julia or its dependencies system:mac Affects only macOS external dependencies Involves LLVM, OpenBLAS, or other linked libraries labels May 6, 2022
@fxcoudert
Copy link
Contributor Author

The use of execvpe() was inside an #ifdef __linux__ block before that commit, and was moved to be unconditional. In fact, the whole uv__execvpe() function is only ever called on Linux, and should be wrapped in a preprocessor conditional. I've created a PR to do that: JuliaLang/libuv#21

@fxcoudert
Copy link
Contributor Author

The patch in libuv was merged, but the build error on julia master is still there: I think it's not picking up the new version of libuv.

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 external dependencies Involves LLVM, OpenBLAS, or other linked libraries system:mac Affects only macOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants