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

python3: Build failure due to "missing" libbsd dependency #21161

Closed
jefferyto opened this issue May 24, 2023 · 1 comment · Fixed by #21166
Closed

python3: Build failure due to "missing" libbsd dependency #21161

jefferyto opened this issue May 24, 2023 · 1 comment · Fixed by #21166

Comments

@jefferyto
Copy link
Member

Maintainer: me
Environment: all probably

Description:
python3 failed to build on buildbots for aarch64_generic. From https://downloads.openwrt.org/snapshots/faillogs/aarch64_generic/packages/python3/compile.txt:

checking for flock declaration... yes
checking for flock... yes
checking for flock in -lbsd... yes
...
aarch64-openwrt-linux-musl-gcc -shared -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/lib -znow -zrelro -L/builder/shared-workdir/build/sdk/build_dir/target-aarch64_generic_musl/Python-3.11.3 -L/builder/shared-workdir/build/sdk/staging_dir/target-aarch64_generic_musl/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/target-aarch64_generic_musl/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/lib -znow -zrelro -L/builder/shared-workdir/build/sdk/build_dir/target-aarch64_generic_musl/Python-3.11.3 -L/builder/shared-workdir/build/sdk/staging_dir/target-aarch64_generic_musl/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/target-aarch64_generic_musl/lib -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/lib -znow -zrelro -L/builder/shared-workdir/build/sdk/build_dir/target-aarch64_generic_musl/Python-3.11.3 -L/builder/shared-workdir/build/sdk/staging_dir/target-aarch64_generic_musl/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/target-aarch64_generic_musl/lib -Os -pipe -mcpu=generic -fno-caller-saves -fno-plt -fhonour-copts -ffile-prefix-map=/builder/shared-workdir/build/sdk/build_dir/target-aarch64_generic_musl/Python-3.11.3=Python-3.11.3 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/usr/include -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/include/fortify -I/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/include build/temp.linux-aarch64-3.11/builder/shared-workdir/build/sdk/build_dir/target-aarch64_generic_musl/Python-3.11.3/Modules/fcntlmodule.o -L. -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/lib -L/builder/shared-workdir/build/sdk/build_dir/target-aarch64_generic_musl/Python-3.11.3 -L/builder/shared-workdir/build/sdk/staging_dir/target-aarch64_generic_musl/usr/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/aarch64-openwrt-linux-musl/lib -L/builder/shared-workdir/build/sdk/staging_dir/toolchain-aarch64_generic_gcc-12.3.0_musl/lib/gcc -lbsd -o build/lib.linux-aarch64-3.11/fcntl.cpython-311.so
...
Package python3-light is missing dependencies for the following libraries:
libbsd.so.0
make[3]: *** [Makefile:425: /builder/shared-workdir/build/sdk/bin/packages/aarch64_generic/packages/python3-light_3.11.3-1_aarch64_generic.ipk] Error 1
time: package/feeds/packages/python3/compile#1744.22#89.42#1441.43

Looks like configure found libbsd on the buildbot and wanted to link to it for flock.

@nxhack
Copy link
Contributor

nxhack commented May 24, 2023

This was able to fix the issue.

--- a/configure.ac
+++ b/configure.ac
@@ -4694,11 +4694,6 @@ AC_CACHE_CHECK([for flock declaration],
     [ac_cv_flock_decl=no]
   )
 ])
-dnl Linking with libbsd may be necessary on AIX for flock function.
-AS_VAR_IF([ac_cv_flock_decl], [yes],
-  AC_CHECK_FUNCS([flock])
-  AC_CHECK_LIB([bsd], [flock], [FCNTL_LIBS="-lbsd"])
-)
 
 PY_CHECK_FUNC([getpagesize], [#include <unistd.h>])
 

jefferyto added a commit to jefferyto/openwrt-packages that referenced this issue May 25, 2023
configure will try to link with libbsd for flock, even when flock is
available without it.

Fixes openwrt#21161.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
jefferyto added a commit to jefferyto/openwrt-packages that referenced this issue May 25, 2023
configure will try to link with libbsd for the flock function, even when
flock is available without it.

Fixes openwrt#21161.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
jefferyto added a commit to jefferyto/openwrt-packages that referenced this issue May 25, 2023
configure will try to link with libbsd for the flock function, even when
flock is available without it.

Fixes openwrt#21161.

Fixes: 2445fe9 ("python3: Update to 3.11.3, refresh/redo patches")
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
jefferyto added a commit to jefferyto/openwrt-packages that referenced this issue May 25, 2023
configure will try to link with libbsd for the flock function, even when
flock is available without it.

Fixes: openwrt#21161
Fixes: 2445fe9 ("python3: Update to 3.11.3, refresh/redo patches")
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 60bf01c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants