build(deps): check for pthread_getname_np symbol before bundling libuv#33288
build(deps): check for pthread_getname_np symbol before bundling libuv#33288whouishere wants to merge 1 commit intoneovim:masterfrom
pthread_getname_np symbol before bundling libuv#33288Conversation
…buv. Problem: On systems that use a musl version prior to 1.2.3 neovim fails to link because the bundled libuv uses `pthread_getname_np`, which was implemented in musl 1.2.3. Solution: Check for the `pthread_getname_np` symbol before bundling libuv. If not found, require to use the system libuv library, which may not need `pthread_getname_np`.
|
Surprised to see more than half of checks failing because it tries to use the system libuv. Especially since Ubuntu should have I'm going to investigate it and fix it. |
| include(CheckSymbolExists) | ||
| check_symbol_exists(pthread_getname_np "pthread.h" HAVE_PTHREAD_GETNAME_NP) | ||
|
|
||
| if(HAVE_PTHREAD_GETNAME_NP) | ||
| include(BuildLibuv) | ||
| else() | ||
| set(USE_BUNDLED_LIBUV OFF) | ||
| endif() |
There was a problem hiding this comment.
I would prefer this check to be at the top around the "# Options" comment, then it can be rewritten as the following:
include(CheckSymbolExists)
check_symbol_exists(pthread_getname_np "pthread.h" HAVE_PTHREAD_GETNAME_NP)
option(USE_BUNDLED_LIBUV "Use the bundled libuv." ${USE_BUNDLED} AND ${HAVE_PTHREAD_GETNAME_NP})That last line might be need to be rewritten as a basic if-def like it's done with USE_BUNDLED_GETTEXT, but that's still easier IMO.
|
do you plan to address dundar's comment? |
|
Oh yeah, I will soon fix it and refactor the PR as dundar suggested. I just haven't got the time in the past weeks, will soon get around to spin up all of the VMs to test it! |
|
This has been closed since a request for information has not been answered for 30 days. It can be reopened when the requested information is provided. |
On systems that use a musl version prior to 1.2.3 neovim fails to link because the bundled libuv uses
pthread_getname_np, which was implemented in musl 1.2.3.Our solution is to check for the
pthread_getname_npsymbol before bundling libuv. If not found, require to use the system libuv library, which may not needpthread_getname_np.Fixes #32613