pyca / pynacl

Python binding to the Networking and Cryptography (NaCl) library
https://pynacl.readthedocs.io/
Apache License 2.0
1.06k stars 233 forks source link

On PyPy3.8rc3, libsodium configure does not run on 1.4.0, successfully runs on 1.3.0 #691

Closed mattip closed 2 years ago

mattip commented 2 years ago

Any thoughts why python -m pip wheel . fails to successfully run the configure script for libsodium on 1.4.0 but does run it on 1.3.0? Here is a snippet, and the complet configure.log is in the details

configure:3809: result: a.out
configure:3815: checking for suffix of executables
configure:3822: gcc -pthread -o conftest -DNDEBUG -O2  -pthread -shared conftest.c  >&5
configure:3826: $? = 0
configure:3848: resssult: 
configure:3870: checking whether we are cross compiling
configure:3878: gcc -pthread -o conftest -DNDEBUG -O2  -pthread -shared conftest.c  >&5
configure:3882: $? = 0
configure:3889: ./conftest
/home/matti/oss/pynacl/src/libsodium/configure: line 3891: 646753 Segmentation fault      (core dumped) ./conftest$ac_cv_exeext
configure:3893: $? = 139
configure:3900: error: in `/home/matti/oss/pynacl/build/temp.linux-x86_64-3.8':
configure:3902: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
``` This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libsodium configure 1.0.18, which was generated by GNU Autoconf 2.69. Invocation command line was $ /home/matti/oss/pynacl/src/libsodium/configure --disable-shared --enable-static --disable-debug --disable-dependency-tracking --with-pic --prefix /home/matti/oss/pynacl/build/temp.linux-x86_64-3.8 ## --------- ## ## Platform. ## ## --------- ## hostname = matti-ryzen uname -m = x86_64 uname -r = 5.4.0-88-generic uname -s = Linux uname -v = #99-Ubuntu SMP Thu Sep 23 17:29:00 UTC 2021 /usr/bin/uname -p = x86_64 /bin/uname -X = unknown /bin/arch = x86_64 /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /home/matti/miniconda3/envs/numpy/bin PATH: /home/matti/miniconda3/condabin PATH: /home/matti/bin PATH: /home/matti/.local/bin PATH: /home/matti/bin PATH: /usr/local/sbin PATH: /usr/local/bin PATH: /usr/sbin PATH: /usr/bin PATH: /sbin PATH: /bin PATH: /usr/games PATH: /usr/local/games PATH: /snap/bin ## ----------- ## ## Core tests. ## ## ----------- ## configure:2427: checking build system type configure:2441: result: x86_64-pc-linux-gnu configure:2461: checking host system type configure:2474: result: x86_64-pc-linux-gnu configure:2510: checking for a BSD-compatible install configure:2578: result: /usr/bin/install -c configure:2589: checking whether build environment is sane configure:2644: result: yes configure:2793: checking for a thread-safe mkdir -p configure:2832: result: /usr/bin/mkdir -p configure:2839: checking for gawk configure:2855: found /usr/bin/gawk configure:2866: result: gawk configure:2877: checking whether make sets $(MAKE) configure:2899: result: yes configure:2928: checking whether make supports nested variables configure:2945: result: yes configure:3034: checking whether UID '1000' is supported by ustar format configure:3037: result: yes configure:3044: checking whether GID '1000' is supported by ustar format configure:3047: result: yes configure:3055: checking how to create a ustar tar archive configure:3066: tar --version tar (GNU tar) 1.30 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. configure:3069: $? = 0 configure:3109: tardir=conftest.dir && eval tar --format=ustar -chf - "$tardir" >conftest.tar configure:3112: $? = 0 configure:3116: tar -xf - &5 gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:3710: $? = 0 configure:3699: gcc -pthread -v >&5 Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:hsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-17ubuntu1~20.04' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-HskZEa/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04) configure:3710: $? = 0 configure:3699: gcc -pthread -V >&5 gcc: error: unrecognized command line option '-V' gcc: fatal error: no input files compilation terminated. configure:3710: $? = 1 configure:3699: gcc -pthread -qversion >&5 gcc: error: unrecognized command line option '-qversion'; did you mean '--version'? gcc: fatal error: no input files compilation terminated. configure:3710: $? = 1 configure:3730: checking whether the C compiler works configure:3752: gcc -pthread -DNDEBUG -O2 -pthread -shared conftest.c >&5 configure:3756: $? = 0 configure:3804: result: yes configure:3807: checking for C compiler default output file name configure:3809: result: a.out configure:3815: checking for suffix of executables configure:3822: gcc -pthread -o conftest -DNDEBUG -O2 -pthread -shared conftest.c >&5 configure:3826: $? = 0 configure:3848: resssult: configure:3870: checking whether we are cross compiling configure:3878: gcc -pthread -o conftest -DNDEBUG -O2 -pthread -shared conftest.c >&5 configure:3882: $? = 0 configure:3889: ./conftest /home/matti/oss/pynacl/src/libsodium/configure: line 3891: 646753 Segmentation fault (core dumped) ./conftest$ac_cv_exeext configure:3893: $? = 139 configure:3900: error: in `/home/matti/oss/pynacl/build/temp.linux-x86_64-3.8': configure:3902: error: cannot run C compiled programs. If you meant to cross compile, use `--host'. See `config.log' for more details ## ---------------- ## ## Cache variables. ## ## ---------------- ## ac_cv_build=x86_64-pc-linux-gnu ac_cv_env_AR_set= ac_cv_env_AR_value= ac_cv_env_CCASFLAGS_set= ac_cv_env_CCASFLAGS_value= ac_cv_env_CCAS_set= ac_cv_env_CCAS_value= ac_cv_env_CC_set=set ac_cv_env_CC_value='gcc -pthread' ac_cv_env_CFLAGS_set=set ac_cv_env_CFLAGS_value='-DNDEBUG -O2' ac_cv_env_CPPFLAGS_set= ac_cv_env_CPPFLAGS_value= ac_cv_env_CPP_set= ac_cv_env_CPP_value= ac_cv_env_CWFLAGS_set= ac_cv_env_CWFLAGS_value= ac_cv_env_LDFLAGS_set=set ac_cv_env_LDFLAGS_value='-pthread -shared' ac_cv_env_LIBS_set= ac_cv_env_LIBS_value= ac_cv_env_LT_SYS_LIBRARY_PATH_set= ac_cv_env_LT_SYS_LIBRARY_PATH_value= ac_cv_env_SAFECODE_HOME_set= ac_cv_env_SAFECODE_HOME_value= ac_cv_env_build_alias_set= ac_cv_env_build_alias_value= ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= ac_cv_host=x86_64-pc-linux-gnu ac_cv_path_install='/usr/bin/install -c' ac_cv_path_mkdir=/usr/bin/mkdir ac_cv_prog_AWK=gawk ac_cv_prog_ac_ct_CC='gcc -pthread' ac_cv_prog_make_make_set=yes am_cv_make_support_nested_variables=yes am_cv_prog_tar_ustar=gnutar ## ----------------- ## ## Output variables. ## ## ----------------- ## ACLOCAL='${SHELL} /home/matti/oss/pynacl/src/libsodium/build-aux/missing aclocal-1.16' ALLOCA='' AMDEPBACKSLASH='' AMDEP_FALSE='' AMDEP_TRUE='#' AMTAR='$${TAR-tar}' AM_BACKSLASH='\' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' AM_DEFAULT_VERBOSITY='0' AM_V='$(V)' AR='' AS='' AUTOCONF='${SHELL} /home/matti/oss/pynacl/src/libsodium/build-aux/missing autoconf' AUTOHEADER='${SHELL} /home/matti/oss/pynacl/src/libsodium/build-aux/missing autoheader' AUTOMAKE='${SHELL} /home/matti/oss/pynacl/src/libsodium/build-aux/missing automake-1.16' AWK='gawk' CC='gcc -pthread' CCAS='' CCASDEPMODE='' CCASFLAGS='' CCDEPMODE='' CFLAGS='-DNDEBUG -O2' CFLAGS_AESNI='' CFLAGS_AVX2='' CFLAGS_AVX512F='' CFLAGS_AVX='' CFLAGS_MMX='' CFLAGS_PCLMUL='' CFLAGS_RDRAND='' CFLAGS_SSE2='' CFLAGS_SSE3='' CFLAGS_SSE41='' CFLAGS_SSSE3='' CPP='' CPPFLAGS='' CWFLAGS='' CYGPATH_W='echo' DEFS='' DEPDIR='.deps' DLLTOOL='' DLL_VERSION='24' DSYMUTIL='' DUMPBIN='' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='' EMSCRIPTEN_FALSE='' EMSCRIPTEN_TRUE='' ENABLE_VALGRIND_drd='' ENABLE_VALGRIND_helgrind='' ENABLE_VALGRIND_memcheck='' ENABLE_VALGRIND_sgcheck='' EXEEXT='' FGREP='' GREP='' HAVE_AMD64_ASM_FALSE='' HAVE_AMD64_ASM_TRUE='' HAVE_AMD64_ASM_V='' HAVE_AVX_ASM_FALSE='' HAVE_AVX_ASM_TRUE='' HAVE_AVX_ASM_V='' HAVE_CPUID_V='' HAVE_LD_OUTPUT_DEF_FALSE='' HAVE_LD_OUTPUT_DEF_TRUE='' HAVE_TI_MODE_FALSE='' HAVE_TI_MODE_TRUE='' HAVE_TI_MODE_V='' INSTALL_DATA='${INSTALL} -m 644' INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' LD='' LDFLAGS='-pthread -shared' LIBOBJS='' LIBS='' LIBTOOL='' LIBTOOL_DEPS='' LIBTOOL_EXTRA_FLAGS='' LIPO='' LN_S='' LTLIBOBJS='' LT_SYS_LIBRARY_PATH='' MAINT='#' MAINTAINER_MODE_FALSE='' MAINTAINER_MODE_TRUE='#' MAKEINFO='${SHELL} /home/matti/oss/pynacl/src/libsodium/build-aux/missing makeinfo' MANIFEST_TOOL='' MINIMAL_FALSE='' MINIMAL_TRUE='' MKDIR_P='/usr/bin/mkdir -p' NM='' NMEDIT='' OBJDUMP='' OBJEXT='' OTOOL64='' OTOOL='' PACKAGE='libsodium' PACKAGE_BUGREPORT='https://github.com/jedisct1/libsodium/issues' PACKAGE_NAME='libsodium' PACKAGE_STRING='libsodium 1.0.18' PACKAGE_TARNAME='libsodium' PACKAGE_URL='https://github.com/jedisct1/libsodium' PACKAGE_VERSION='1.0.18' PATH_SEPARATOR=':' PKGCONFIG_LIBS_PRIVATE='' PTHREAD_CC='' PTHREAD_CFLAGS='' PTHREAD_LIBS='' RANLIB='' SAFECODE_HOME='' SED='' SET_MAKE='' SHELL='/bin/bash' SODIUM_LIBRARY_MINIMAL_DEF='' SODIUM_LIBRARY_VERSION='26:0:3' SODIUM_LIBRARY_VERSION_MAJOR='10' SODIUM_LIBRARY_VERSION_MINOR='3' STRIP='' TEST_LDFLAGS='' VALGRIND='' VALGRIND_CHECK_RULES='' VALGRIND_ENABLED='' VALGRIND_ENABLED_FALSE='' VALGRIND_ENABLED_TRUE='' VERSION='1.0.18' WASI_FALSE='' WASI_TRUE='' ac_ct_AR='' ac_ct_CC='gcc -pthread' ac_ct_DUMPBIN='' am__EXEEXT_FALSE='' am__EXEEXT_TRUE='' am__fastdepCCAS_FALSE='' am__fastdepCCAS_TRUE='' am__fastdepCC_FALSE='' am__fastdepCC_TRUE='' am__include='include' am__isrc=' -I$(srcdir)' am__leading_dot='.' am__nodep='' am__quote='' am__tar='tar --format=ustar -chf - "$$tardir"' am__untar='tar -xf -' ax_pthread_config='' bindir='${exec_prefix}/bin' build='x86_64-pc-linux-gnu' build_alias='' build_cpu='x86_64' build_os='linux-gnu' build_vendor='pc' datadir='${datarootdir}' datarootdir='${prefix}/share' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' dvidir='${docdir}' exec_prefix='NONE' host='x86_64-pc-linux-gnu' host_alias='' host_cpu='x86_64' host_os='linux-gnu' host_vendor='pc' htmldir='${docdir}' includedir='${prefix}/include' infodir='${datarootdir}/info' install_sh='${SHELL} /home/matti/oss/pynacl/src/libsodium/build-aux/install-sh' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' localedir='${datarootdir}/locale' localstatedir='${prefix}/var' mandir='${datarootdir}/man' mkdir_p='$(MKDIR_P)' oldincludedir='/usr/include' pdfdir='${docdir}' prefix='/home/matti/oss/pynacl/build/temp.linux-x86_64-3.8' program_transform_name='s,x,x,' psdir='${docdir}' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target_alias='' valgrind_enabled_tools='' valgrind_tools='' ## ----------- ## ## confdefs.h. ## ## ----------- ## /* confdefs.h */ #define PACKAGE_NAME "libsodium" #define PACKAGE_TARNAME "libsodium" #define PACKAGE_VERSION "1.0.18" #define PACKAGE_STRING "libsodium 1.0.18" #define PACKAGE_BUGREPORT "https://github.com/jedisct1/libsodium/issues" #define PACKAGE_URL "https://github.com/jedisct1/libsodium" #define PACKAGE "libsodium" #define VERSION "1.0.18" configure: exit 1 ```

I am not sure how to capture the config.log for a successful build for comparison.

reaperhulk commented 2 years ago

Do you see this on the main branch?

mattip commented 2 years ago

Yes, with PyPy3.8 commit ee93f9f13 fails as well.

mattip commented 2 years ago

Hmm, doing the following succeeded. I will close this and try to figure out what went wrong with my original effort.

git clone https://github.com/pyca/pynacl
wget https://downloads.python.org/pypy/pypy3.7-v7.3.6rc3-linux64.tar.bz2
tar -xf pypy3.7-v7.3.6rc3-linux64.tar.bz2
pypy3.7-v7.3.6rc3-linux64/bin/pypy -m ensurepip
pypy3.7-v7.3.6rc3-linux64/bin/pypy -m pip install wheel
cd pynacl
../pypy3.7-v7.3.6rc3-linux64/bin/pypy setup.py bdist_wheel
mattip commented 2 years ago

For future reference: one difference seems to be that CC='gcc' where it succeeds, and CC='gcc -pthread' where it fails.

stonebig commented 2 years ago

may we have a wheel for PyPy 3.8 on Windows ?

mattip commented 2 years ago

I think this project releases limited API wheels, like PyNaCl-1.4.0-cp35-abi3-win_amd64.whl that can work on any cpython 3.5+. PyPy does not yet have limitedAPI wheel support, even for cffi-based projects. See issue https://foss.heptapod.net/pypy/pypy/-/issues/3327. FWIW, you can get pynacl=1.4.0 via conda for pypy3.7 + windows.