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

[bug] Autotools in Conan with MSYS2 #8476

Closed
Facon opened this issue Feb 10, 2021 · 35 comments · Fixed by #10429
Closed

[bug] Autotools in Conan with MSYS2 #8476

Facon opened this issue Feb 10, 2021 · 35 comments · Fixed by #10429

Comments

@Facon
Copy link

Facon commented Feb 10, 2021

Environment Details (include every applicable attribute)

  • Operating System+version: Windows 10
  • Compiler+version: GCC 10
  • Conan version: 1.33.1
  • Python version: 3.8.7

Steps to reproduce (Include if Applicable)

  1. Install MSYS2 environment.
  2. Open MSYS2 MINGW32 console and install Python, Autotools, CMake, GCC, etc.
  3. Install conan with "pip install conan".
  4. Create a profile that uses GCC from MSYS2 MINGW32.
  5. Follow the example tutorial from Conan.io at https://docs.conan.io/en/latest/getting_started.html.

Logs

Output from conan:

User@DESKTOP-LC9EG87 MINGW32 /c/Users/User/Documents/Sources/testing/conan_examples
$ conan install . -pr=mingw32debug -b=missing
Configuration:
[settings]
arch=x86
arch_build=x86
build_type=Debug
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=10
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
CC=C:\msys64\mingw32\bin\gcc.exe
CXX=C:\msys64\mingw32\bin\g++.exe
WARN: apr-util/1.6.1: requirement expat/2.2.9 overridden by poco/1.10.1 to expat/2.2.10
WARN: libmysqlclient/8.0.17: requirement openssl/1.1.1i overridden by poco/1.10.1 to openssl/1.1.1h
apr/1.7.0: WARN: Package binary is corrupted, removing: 945174b4e713b95463410bd3cc7cfb90a533f4d8
conanfile.txt: Installing package
Requirements
    apr/1.7.0 from 'conan-center' - Cache
    apr-util/1.6.1 from 'conan-center' - Cache
    bzip2/1.0.8 from 'conan-center' - Cache
    expat/2.2.10 from 'conan-center' - Cache
    libmysqlclient/8.0.17 from 'conan-center' - Cache
    libpq/11.5 from 'conan-center' - Cache
    openssl/1.1.1h from 'conan-center' - Cache
    pcre/8.41 from 'conan-center' - Cache
    poco/1.10.1 from 'conan-center' - Cache
    sqlite3/3.33.0 from 'conan-center' - Cache
    zlib/1.2.11 from 'conan-center' - Cache
Packages
    apr/1.7.0:945174b4e713b95463410bd3cc7cfb90a533f4d8 - Build
    apr-util/1.6.1:288e3d670eaf4a8a1e5b0006b6e12ea124720cad - Build
    bzip2/1.0.8:edfce3a0e290919b9e7cbafd94376d77ab0c6318 - Build
    expat/2.2.10:c05b71b08ce696895c444032cdc4b6e85e543504 - Build
    libmysqlclient/8.0.17:b6168742f081ed2c7b6590e11e1b7a20752b5d34 - Build
    libpq/11.5:978cbe2ad36c8d6883724e5802629f937f4e04dc - Build
    openssl/1.1.1h:c05b71b08ce696895c444032cdc4b6e85e543504 - Build
    pcre/8.41:1396defb007c4ec2127342ce7a3148dd2b63b84d - Build
    poco/1.10.1:c3cde9fcc10e439075f205e6702758f6d5cc1ce4 - Build
    sqlite3/3.33.0:86afd448bdb9d7a2c7e688f41249b42c45c51eb8 - Build
    zlib/1.2.11:c05b71b08ce696895c444032cdc4b6e85e543504 - Build
Build requirements
    7zip/19.00 from 'conan-center' - Cache
    lzma_sdk/9.20 from 'conan-center' - Cache
    make/4.2.1 from 'conan-center' - Cache
    msys2/20200517 from 'conan-center' - Cache
    nasm/2.15.05 from 'conan-center' - Cache
Build requirements packages
    7zip/19.00:d1731d2bafd7a336110c1f1efa0fac1b92e752ee - Build
    lzma_sdk/9.20:d1731d2bafd7a336110c1f1efa0fac1b92e752ee - Build
    make/4.2.1:0d7df5b82d79a3322204208f1e9ae55770f9ebd3 - Build
    msys2/20200517:02335dedca0a2cdcde89828f81194929ef12d610 - Build
    nasm/2.15.05:0d7df5b82d79a3322204208f1e9ae55770f9ebd3 - Build

Installing (downloading, building) binaries...
apr/1.7.0: WARN: Build folder is dirty, removing it: C:/Users/User/.conan/data/apr/1.7.0/_/_/build/945174b4e713b95463410bd3cc7cfb90a533f4d8
apr/1.7.0: Copying sources to build folder
apr/1.7.0: Building your package in C:/Users/User/.conan/data/apr/1.7.0/_/_/build/945174b4e713b95463410bd3cc7cfb90a533f4d8
apr/1.7.0: Generator cmake created conanbuildinfo.cmake
apr/1.7.0: Calling build()
apr/1.7.0: WARN: Error running `configure --help`: Error 1 while executing source_subfolder/configure --help
apr/1.7.0: Calling:
 > source_subfolder/configure --with-installbuilddir=${prefix}/bin/build-1 --enable-shared=no --enable-static=yes apr_cv_mutex_robust_shared=yes --prefix=C:/Users/User/.conan/data/apr/1.7.0/_/_/package/945174b4e713b95463410bd3cc7cfb90a533f4d8 --build=x86_64-w64-mingw32 --host=i686-w64-mingw32
'source_subfolder' is not recognized as an internal or external command,
operable program or batch file.
apr/1.7.0:
apr/1.7.0: ERROR: Package '945174b4e713b95463410bd3cc7cfb90a533f4d8' build failed
apr/1.7.0: WARN: Build folder C:/Users/User/.conan/data/apr/1.7.0/_/_/build/945174b4e713b95463410bd3cc7cfb90a533f4d8
ERROR: apr/1.7.0: Error in build() method, line 92
        autotools = self._configure_autotools()
while calling '_configure_autotools', line 76
        self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder)
        ConanException: Error 1 while executing source_subfolder/configure --with-installbuilddir=${prefix}/bin/build-1 --enable-shared=no --enable-static=yes apr_cv_mutex_robust_shared=yes --prefix=C:/Users/User/.conan/data/apr/1.7.0/_/_/package/945174b4e713b95463410bd3cc7cfb90a533f4d8 --build=x86_64-w64-mingw32 --host=i686-w64-mingw32

Output from executing the same command in the folder:

User@DESKTOP-LC9EG87 MINGW32 /c/Users/User/.conan/data/apr/1.7.0/_/_/build/01f0ca60306617d3e089e0db90f80156111a6c01/source_subfolder
$ head -20 configure
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##

# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
  emulate sh
  NULLCMD=:
  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which

User@DESKTOP-LC9EG87 MINGW32 /c/Users/User/.conan/data/apr/1.7.0/_/_/build/01f0ca60306617d3e089e0db90f80156111a6c01/source_subfolder
$ configure --with-installbuilddir=${prefix}/bin/build-1 --enable-shared=no --enable-static=yes apr_cv_mutex_robust_shared=yes --prefix=C:/Users/User/.conan/data/apr/1.7.0/_/_/package/01f0ca60306617d3e089e0db90f80156111a6c01 --build=x86_64-w64-mingw32 --host=i686-w64-mingw32
bash: configure: command not found

User@DESKTOP-LC9EG87 MINGW32 /c/Users/User/.conan/data/apr/1.7.0/_/_/build/01f0ca60306617d3e089e0db90f80156111a6c01/source_subfolder
$ ./configure --with-installbuilddir=${prefix}/bin/build-1 --enable-shared=no --enable-static=yes apr_cv_mutex_robust_shared=yes --prefix=C:/Users/User/.conan/data/apr/1.7.0/_/_/package/01f0ca60306617d3e089e0db90f80156111a6c01 --build=x86_64-w64-mingw32 --host=i686-w64-mingw32
configure: loading site script C:/msys64/mingw32/etc/config.site
checking build system type... x86_64-w64-mingw32
checking host system type... i686-w64-mingw32
checking target system type... i686-w64-mingw32
Configuring APR library
Platform: i686-w64-mingw32
checking for working mkdir -p... yes
APR Version: 1.7.0
checking for chosen layout... apr
checking for i686-w64-mingw32-gcc... i686-w64-mingw32-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether i686-w64-mingw32-gcc accepts -g... yes
checking for i686-w64-mingw32-gcc option to accept ISO C89... none needed
checking for a sed that does not truncate output... /usr/bin/sed
Applying APR hints file rules for i686-w64-mingw32
  setting INTERNAL_CPPFLAGS to "-DBINPATH=/c/Users/User/.conan/data/apr/1.7.0/_/_/build/01f0ca60306617d3e089e0db90f80156111a6c01/source_subfolder/test/.libs"
  setting CPPFLAGS to "-DWIN32 -D__MSVCRT__"
  setting LDFLAGS to "-Wl,--enable-auto-import,--subsystem,console"
  setting have_unicode_fs to "1"
  setting have_proc_invoked to "1"
  setting apr_lock_method to "win32"
  setting apr_process_lock_is_global to "yes"
  setting apr_cv_use_lfs64 to "yes"
  setting apr_cv_osuuid to "yes"
  setting apr_cv_tcp_nodelay_with_cork to "no"
  setting apr_thread_func to "__stdcall"
  setting ac_cv_o_nonblock_inherited to "yes"
  setting ac_cv_tcp_nodelay_inherited to "yes"
  setting ac_cv_file__dev_zero to "no"
  setting ac_cv_func_setpgrp_void to "no"
  setting ac_cv_func_mmap to "yes"
  setting ac_cv_define_sockaddr_in6 to "yes"
  setting ac_cv_working_getaddrinfo to "yes"
  setting ac_cv_working_getnameinfo to "yes"
  setting ac_cv_func_gai_strerror to "yes"
  setting apr_has_xthread_files to "1"
  setting apr_has_user to "1"
  setting apr_procattr_user_set_requires_password to "1"
  setting ac_cv_func_sendfile to "yes"
(Default will be unix)
checking whether make sets $(MAKE)... yes
checking how to run the C preprocessor... i686-w64-mingw32-gcc -E
checking for gawk... gawk
checking whether ln -s works... no, using cp -pR
checking for i686-w64-mingw32-ranlib... no
checking for ranlib... ranlib
configure: WARNING: using cross tools not prefixed with host triplet
checking for a BSD-compatible install... /usr/bin/install -c
checking for rm... rm
checking for as... as
checking for cpp... cpp
checking for i686-w64-mingw32-ar... no
checking for ar... ar
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for library containing strerror... none required
checking whether system uses EBCDIC... no
performing libtool configuration...
checking for i686-w64-mingw32-as... (cached) as
checking for i686-w64-mingw32-dlltool... no
checking for dlltool... dlltool
checking for i686-w64-mingw32-objdump... no
checking for objdump... objdump
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /usr/bin/sed
checking for fgrep... /usr/bin/grep -F
checking for ld used by i686-w64-mingw32-gcc... C:/msys64/mingw32/i686-w64-mingw32/bin/ld.exe
checking if the linker (C:/msys64/mingw32/i686-w64-mingw32/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... no
checking for i686-w64-mingw32-dumpbin... no
checking for i686-w64-mingw32-link... no
checking for dumpbin... no
checking for link... link -dump
checking the name lister (nm) interface... BSD nm
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-w64-mingw32 file names to i686-w64-mingw32 format... func_convert_file_msys_to_w32
checking how to convert x86_64-w64-mingw32 file names to toolchain format... func_convert_file_msys_to_w32
checking for C:/msys64/mingw32/i686-w64-mingw32/bin/ld.exe option to reload object files... -r
checking for i686-w64-mingw32-objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for i686-w64-mingw32-dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for i686-w64-mingw32-ar... ar
checking for archiver @FILE support... @
checking for i686-w64-mingw32-strip... no
checking for strip... strip
checking for i686-w64-mingw32-ranlib... ranlib
checking command to parse nm output from i686-w64-mingw32-gcc object... ok
checking for sysroot... no
checking for a working dd... /usr/bin/dd
checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1
checking for i686-w64-mingw32-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking for dlfcn.h... no
checking for objdir... .libs
checking if i686-w64-mingw32-gcc supports -fno-rtti -fno-exceptions... no
checking for i686-w64-mingw32-gcc option to produce PIC... -DDLL_EXPORT -DPIC
checking if i686-w64-mingw32-gcc PIC flag -DDLL_EXPORT -DPIC works... yes
checking if i686-w64-mingw32-gcc static flag -static works... yes
checking if i686-w64-mingw32-gcc supports -c -o file.o... rm: cannot remove 'conftest*': No such file or directory
yes
checking if i686-w64-mingw32-gcc supports -c -o file.o... (cached) yes
checking whether the i686-w64-mingw32-gcc linker (C:/msys64/mingw32/i686-w64-mingw32/bin/ld.exe) supports shared libraries... yes
checking dynamic linker characteristics... Win32 ld.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes

Check for compiler flags...
  adding "-DAPR_DECLARE_STATIC" to CPPFLAGS
checking whether the compiler provides atomic builtins... no
checking whether to enable -D_LARGEFILE64_SOURCE... (cached) yes
  adding "-D_LARGEFILE64_SOURCE" to CPPFLAGS

Checking for libraries...
  setting LIBS to "-lshell32 -ladvapi32 -lws2_32 -lrpcrt4 -lmswsock"

Checking for Threads...
APR will use threads
checking for gethostbyname in -lc_r... no
checking for gethostbyaddr in -lc_r... no
checking for getservbyname in -lc_r... no
checking for gethostbyname_r... no
checking for gethostbyaddr_r... no
checking for getservbyname_r... no
checking for sigsuspend... no
checking for sigwait... no
checking for poll... no
checking for kqueue... no
checking for port_create... no
checking for epoll support... no
checking for epoll_create1 support... no
checking for dup3 support... no
checking for accept4 support... no
checking for SOCK_CLOEXEC support... no
checking for fdatasync... no
checking for epoll_create1 support... (cached) no
checking for asio -> message queue support... no
checking for dup3 support... (cached) no
checking for accept4 support... (cached) no
checking for SOCK_CLOEXEC support... (cached) no
checking for getpwnam_r... no
checking for getpwuid_r... no
checking for getgrnam_r... no
checking for getgrgid_r... no

Checking for Shared Memory Support...
checking for library containing shm_open... no
checking for sys/types.h... (cached) yes
checking sys/mman.h usability... no
checking sys/mman.h presence... no
checking for sys/mman.h... no
checking sys/ipc.h usability... no
checking sys/ipc.h presence... no
checking for sys/ipc.h... no
checking sys/mutex.h usability... no
checking sys/mutex.h presence... no
checking for sys/mutex.h... no
checking sys/shm.h usability... no
checking sys/shm.h presence... no
checking for sys/shm.h... no
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/socket.h usability... no
checking sys/socket.h presence... no
checking for sys/socket.h... no
checking kernel/OS.h usability... no
checking kernel/OS.h presence... no
checking for kernel/OS.h... no
checking os2.h usability... no
checking os2.h presence... no
checking for os2.h... no
checking windows.h usability... yes
checking windows.h presence... yes
checking for windows.h... yes
checking for net/if.h... no
checking for mmap... (cached) yes
checking for munmap... no
checking for shm_open... no
checking for shm_unlink... no
checking for shmget... no
checking for shmat... no
checking for shmdt... no
checking for shmctl... no
checking for create_area... no
checking for mprotect... yes
checking for MAP_ANON in sys/mman.h... no
checking for /dev/zero... (cached) no
decision on anonymous shared memory allocation method... Windows CreateFileMapping()
decision on namebased memory allocation method... Windows shared memory
checking for size_t... yes
checking for working alloca.h... no
checking for alloca... yes
checking for calloc... yes
checking for setsid... no
checking for isinf... no
checking for isnan... yes
checking for getenv... yes
checking for putenv... yes
checking for setenv... no
checking for unsetenv... no
checking for writev... no
checking for getifaddrs... no
checking for utime... yes
checking for utimes... no
checking for setrlimit... no
checking for getrlimit... no
checking for sendfilev in -lsendfile... no
checking for sendfile... (cached) yes
checking for send_file... no
checking for sendfilev... no
checking for sigaction... no
checking whether sys_siglist is declared... no
checking for fork... no
checking for inet_addr... yes
checking for inet_network... yes
checking for _getch... yes
checking for strerror_r... no
checking for mmap... (cached) yes
checking for memmove... yes
checking for getpass... no
checking for getpassphrase... no
checking for gmtime_r... no
checking for localtime_r... no
checking for mkstemp... yes
checking whether sigwait takes one argument... no
checking for ANSI C header files... (cached) yes
checking ByteOrder.h usability... no
checking ByteOrder.h presence... no
checking for ByteOrder.h... no
checking conio.h usability... yes
checking conio.h presence... yes
checking for conio.h... yes
checking crypt.h usability... no
checking crypt.h presence... no
checking for crypt.h... no
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking dir.h usability... yes
checking dir.h presence... yes
checking for dir.h... yes
checking dirent.h usability... yes
checking dirent.h presence... yes
checking for dirent.h... yes
checking dl.h usability... no
checking dl.h presence... no
checking for dl.h... no
checking for dlfcn.h... (cached) no
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking grp.h usability... no
checking grp.h presence... no
checking for grp.h... no
checking for inttypes.h... (cached) yes
checking io.h usability... yes
checking io.h presence... yes
checking for io.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking mach-o/dyld.h usability... no
checking mach-o/dyld.h presence... no
checking for mach-o/dyld.h... no
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for memory.h... (cached) yes
checking netdb.h usability... no
checking netdb.h presence... no
checking for netdb.h... no
checking osreldate.h usability... no
checking osreldate.h presence... no
checking for osreldate.h... no
checking poll.h usability... no
checking poll.h presence... no
checking for poll.h... no
checking process.h usability... yes
checking process.h presence... yes
checking for process.h... yes
checking pwd.h usability... no
checking pwd.h presence... no
checking for pwd.h... no
checking semaphore.h usability... yes
checking semaphore.h presence... yes
checking for semaphore.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sysapi.h usability... no
checking sysapi.h presence... no
checking for sysapi.h... no
checking sysgtime.h usability... no
checking sysgtime.h presence... no
checking for sysgtime.h... no
checking termios.h usability... no
checking termios.h presence... no
checking for termios.h... no
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking tpfeq.h usability... no
checking tpfeq.h presence... no
checking for tpfeq.h... no
checking tpfio.h usability... no
checking tpfio.h presence... no
checking for tpfio.h... no
checking for unistd.h... (cached) yes
checking unix.h usability... no
checking unix.h presence... no
checking for unix.h... no
checking for windows.h... (cached) yes
checking winsock2.h usability... yes
checking winsock2.h presence... yes
checking for winsock2.h... yes
checking arpa/inet.h usability... no
checking arpa/inet.h presence... no
checking for arpa/inet.h... no
checking for kernel/OS.h... (cached) no
checking net/errno.h usability... no
checking net/errno.h presence... no
checking for net/errno.h... no
checking netinet/in.h usability... no
checking netinet/in.h presence... no
checking for netinet/in.h... no
checking netinet/sctp.h usability... no
checking netinet/sctp.h presence... no
checking for netinet/sctp.h... no
checking netinet/sctp_uio.h usability... no
checking netinet/sctp_uio.h presence... no
checking for netinet/sctp_uio.h... no
checking for sys/file.h... (cached) yes
checking sys/ioctl.h usability... no
checking sys/ioctl.h presence... no
checking for sys/ioctl.h... no
checking for sys/mman.h... (cached) no
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/poll.h usability... no
checking sys/poll.h presence... no
checking for sys/poll.h... no
checking sys/resource.h usability... no
checking sys/resource.h presence... no
checking for sys/resource.h... no
checking sys/select.h usability... no
checking sys/select.h presence... no
checking for sys/select.h... no
checking sys/sem.h usability... no
checking sys/sem.h presence... no
checking for sys/sem.h... no
checking sys/sendfile.h usability... no
checking sys/sendfile.h presence... no
checking for sys/sendfile.h... no
checking sys/signal.h usability... no
checking sys/signal.h presence... no
checking for sys/signal.h... no
checking for sys/socket.h... (cached) no
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking for sys/stat.h... (cached) yes
checking sys/sysctl.h usability... no
checking sys/sysctl.h presence... no
checking for sys/sysctl.h... no
checking sys/syslimits.h usability... no
checking sys/syslimits.h presence... no
checking for sys/syslimits.h... no
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking sys/uio.h usability... no
checking sys/uio.h presence... no
checking for sys/uio.h... no
checking sys/un.h usability... no
checking sys/un.h presence... no
checking for sys/un.h... no
checking sys/wait.h usability... no
checking sys/wait.h presence... no
checking for sys/wait.h... no
checking for netinet/tcp.h... no
checking for off_t... yes
checking for pid_t... yes
checking for size_t... (cached) yes
checking for uid_t in sys/types.h... no
checking for ssize_t... yes
checking for inline... inline
checking for an ANSI C-conforming const... yes
checking whether setpgrp takes no argument... (cached) no
checking for socklen_t... no
checking size of void*... 4
checking size of char... 1
checking size of short... 2
checking size of int... 4
checking size of long... 4
checking size of long long... 8
checking whether int64_t and int use fmt %d... no
checking whether int64_t and long use fmt %ld... no
checking whether int64_t and long long use fmt %lld... yes
checking for INT64_C... yes
checking size of pid_t... 8
checking whether ssize_t and long use fmt %ld... no
checking whether ssize_t and int use fmt %d... yes
checking whether size_t and unsigned long use fmt %lu... no
checking whether size_t and unsigned int use fmt %u... yes
checking size of ssize_t... 8
checking which format to use for apr_ssize_t... %d
checking size of size_t... 8
checking which format to use for apr_size_t... %u
checking size of off_t... 8
checking which type to use for apr_off_t... checking whether off_t and long use fmt %ld... yes
off_t
configure: using apr_int64_t for ino_t
checking whether byte ordering is bigendian... no
checking size of struct iovec... 0
checking for strnicmp... yes
checking for strncasecmp... yes
checking for stricmp... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strstr... yes
checking for memchr... yes
checking for _strtoi64... yes

Checking for DSO...

Checking for Processes...
checking for waitpid... no
checking for Variable Length Arrays... yes
checking struct rlimit... no

Checking for Locking...
checking for semget... no
checking for semctl... no
checking for semop... no
checking for semtimedop... no
checking for flock... no
checking for semaphore.h... (cached) yes
checking for library containing sem_open... none required
checking for sem_close... yes
checking for sem_unlink... yes
checking for sem_post... yes
checking for sem_wait... yes
checking for sem_timedwait... yes
checking OS.h usability... no
checking OS.h presence... no
checking for OS.h... no
checking for create_sem... no
checking for acquire_sem... no
checking for acquire_sem_etc... no
checking for working sem_open... no
checking for union semun in sys/sem.h... no
checking for LOCK_EX in sys/file.h... no
checking for F_SETLK in fcntl.h... no
checking for SEM_UNDO in sys/sem.h... no
checking for POLLIN in poll.h sys/poll.h... no
checking for PTHREAD_PROCESS_SHARED in pthread.h... yes
checking for pthread_mutex_timedlock... yes
checking for pthread_mutexattr_setpshared... yes
checking for robust cross-process mutex support... (cached) yes
checking for pthread_condattr_setpshared... yes
decision on apr_lock implementation method... win32
no
checking if all interprocess locks affect threads... yes
checking if POSIX sems affect threads in the same process... no
checking if SysV sems affect threads in the same process... no
checking if fcntl locks affect threads in the same process... no
checking if flock locks affect threads in the same process... no
checking sys/random.h usability... no
checking sys/random.h presence... no
checking for sys/random.h... no
checking for getrandom... no
checking sys/syscall.h usability... no
checking sys/syscall.h presence... no
checking for sys/syscall.h... no
checking linux/random.h usability... no
checking linux/random.h presence... no
checking for linux/random.h... no
checking whether SYS_getrandom is declared... no
checking for arc4random_buf... no
checking for entropy source... /dev/urandom

Checking for File Info Support...
checking for struct stat.st_blocks... no
checking for struct stat.st_atimensec... no
checking for struct stat.st_ctimensec... no
checking for struct stat.st_mtimensec... no
checking for struct stat.st_atim.tv_nsec... no
checking for struct stat.st_ctim.tv_nsec... no
checking for struct stat.st_mtim.tv_nsec... no
checking for struct stat.st_atime_n... no
checking for struct stat.st_ctime_n... no
checking for struct stat.st_mtime_n... no
checking for inode member of struct dirent... d_ino
checking for file type member of struct dirent... no

Checking for OS UUID Support...
checking uuid.h usability... no
checking uuid.h presence... no
checking for uuid.h... no
checking uuid/uuid.h usability... no
checking uuid/uuid.h presence... no
checking for uuid/uuid.h... no
checking sys/uuid.h usability... no
checking sys/uuid.h presence... no
checking for sys/uuid.h... no
checking for library containing uuid_create... no
checking for library containing uuid_generate... no
checking for uuid_create... no
checking for uuid_generate... no
checking for os uuid usability... (cached) yes

Checking for Time Support...
checking for struct tm.tm_gmtoff... no
checking for struct tm.__tm_gmtoff... no

Checking for Networking support...
checking for type in_addr... yes
checking if fd == socket on this platform... no
checking if TCP_NODELAY setting is inherited from listening sockets... (cached) yes
checking if O_NONBLOCK setting is inherited from listening sockets... (cached) yes
checking whether TCP_NODELAY and TCP_CORK can both be enabled... (cached) no
checking for TCP_CORK in netinet/tcp.h... no
checking for TCP_NOPUSH in netinet/tcp.h... no
checking for SO_ACCEPTFILTER in sys/socket.h... no
checking whether SCTP is supported... no
checking for struct ip_mreq... no
checking for set_h_errno... no

Checking for IPv6 Networking support...
checking for library containing getaddrinfo... no
checking for library containing gai_strerror... no
checking for library containing getnameinfo... no
checking for gai_strerror... (cached) yes
checking for if_nametoindex... no
checking for if_indextoname... no
checking for working getaddrinfo... (cached) yes
checking for negative error codes for getaddrinfo... no
checking for working getnameinfo... (cached) yes
checking for sockaddr_in6... (cached) yes
checking for sockaddr_storage... no
checking for sockaddr_un... no
checking for working AI_ADDRCONFIG... no
checking if APR supports IPv6... yes
checking langinfo.h usability... no
checking langinfo.h presence... no
checking for langinfo.h... no
checking for nl_langinfo... no

Restore user-defined environment settings...
  restoring CPPFLAGS to ""
  setting EXTRA_CPPFLAGS to "-DWIN32 -D__MSVCRT__ -DAPR_DECLARE_STATIC -D_LARGEFILE64_SOURCE"
  restoring CFLAGS to ""
  setting EXTRA_CFLAGS to "-g -O2"
  restoring LDFLAGS to ""
  setting EXTRA_LDFLAGS to "-Wl,--enable-auto-import,--subsystem,console"
  restoring LIBS to ""
  setting EXTRA_LIBS to "-lshell32 -ladvapi32 -lws2_32 -lrpcrt4 -lmswsock"
  restoring INCLUDES to ""
  setting EXTRA_INCLUDES to ""
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/apr.h
config.status: creating build/apr_rules.mk
config.status: creating build/pkg/pkginfo
config.status: creating apr-1-config
config.status: creating apr.pc
config.status: creating test/Makefile
config.status: creating test/internal/Makefile
config.status: creating include/arch/unix/apr_private.h
config.status: executing libtool commands
rm: cannot remove 'libtoolT': No such file or directory
config.status: executing default commands
@danimtb
Copy link
Member

danimtb commented Feb 11, 2021

Have you tried running the configure from outside the source_subdolder? I guess the part failing here is the source_subdfolder/configure call. Can you verify if this command works outside of the conan execution?

@danimtb danimtb self-assigned this Feb 11, 2021
@Facon
Copy link
Author

Facon commented Feb 15, 2021

I works with building without conan like this:

User@DESKTOP-LC9EG87 MINGW32 /c/Users/User/.conan/data/apr/1.7.0/_/_/build/01f0ca60306617d3e089e0db90f80156111a6c01
$ source_subfolder/configure --with-installbuilddir=${prefix}/bin/build-1 --enable-shared=no --enable-static=yes apr_cv_mutex_robust_shared=yes --prefix=C:/Users/User/.conan/data/apr/1.7.0/_/_/package/01f0ca60306617d3e089e0db90f80156111a6c01 --build=x86_64-w64-mingw32 --host=i686-w64-mingw32
configure: loading site script /mingw32/etc/config.site
checking build system type... x86_64-w64-mingw32
checking host system type... i686-w64-mingw32
checking target system type... i686-w64-mingw32
Configuring APR library
Platform: i686-w64-mingw32
checking for working mkdir -p... yes
APR Version: 1.7.0
checking for chosen layout... apr
checking for i686-w64-mingw32-gcc... i686-w64-mingw32-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... yes
...

@SSE4
Copy link
Contributor

SSE4 commented Feb 15, 2021

both syntaxes are valid in MinGW shell:

sse4@DESKTOP-LAD63V0 MINGW32 ~
$ source_subfolder/configure
configure

sse4@DESKTOP-LAD63V0 MINGW32 ~
$ ./source_subfolder/configure
configure

from the output, it turns out conan launches the configure command in the incorrect shell. e.g.:

'source_subfolder' is not recognized as an internal or external command,
operable program or batch file.

is clearly a typicial cmd.exe error message, while:

bash: configure: command not found

is clearly bash error message.
probably, either win_bash is incorrectly set, or run_in_windows_bash malfunctions, I am checking...

@SSE4
Copy link
Contributor

SSE4 commented Feb 15, 2021

okay, it turns out to be a recipe issue, it doesn't set win_bash. after the simple fix it starts to build:

--- a/recipes/apr/all/conanfile.py
+++ b/recipes/apr/all/conanfile.py
@@ -62,7 +62,7 @@ class AprConan(ConanFile):
     def _configure_autotools(self):
         if self._autotools:
             return self._autotools
-        self._autotools = AutoToolsBuildEnvironment(self)
+        self._autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
         self._autotools.libs = []
         yes_no = lambda v: "yes" if v else "no"
         conf_args = [

I'll create PR to fix it.

@SSE4
Copy link
Contributor

SSE4 commented Feb 15, 2021

actually, it's a bit more complex story :)
there are two ways of launching conan, it might go either from Windows python, or from MSYS python.
for Windows python, it uses cmd.exe as a shell (which is used by default for things like subprocess), while MSYS python uses bash.
conan in Windows python works in MSYS shell after the win_bash fix above.
conan in MSYS python doesn't work with that fix:

ERROR: apr/1.7.0: Error in build() method, line 92
        autotools = self._configure_autotools()
while calling '_configure_autotools', line 76
        self._autotools.configure(args=conf_args, configure_dir=self._source_subfolder)
        ConanException: Command only for Windows operating system

this requires another fix in conan codebase (not recipe)

@SSE4
Copy link
Contributor

SSE4 commented Feb 15, 2021

anyway, it seems like apr doesn't compile on MinGW as is, I am running into https://bz.apache.org/bugzilla/show_bug.cgi?id=56342

C:/msys64/mingw32/i686-w64-mingw32/include/objidl.h:9538:9: error: unknown type name 'CLIPFORMAT'
 9538 | typedef CLIPFORMAT *LPCLIPFORMAT;
      |         ^~~~~~~~~~
C:/msys64/mingw32/i686-w64-mingw32/include/objidl.h:9540:5: error: unknown type name 'CLIPFORMAT'
 9540 |     CLIPFORMAT cfFormat;
      |     ^~~~~~~~~~
C:/msys64/mingw32/i686-w64-mingw32/include/objidl.h:9946:9: error: unknown type name 'HMETAFILEPICT'
 9946 |         HMETAFILEPICT hMetaFilePict;
      |         ^~~~~~~~~~~~~

(and many many errors like that)
I'll try to apply patch from the bugzilla

@SSE4
Copy link
Contributor

SSE4 commented Feb 15, 2021

still doesn't build after applying the patch. @madebr can I ask you for a help? were you able to actually build apr for MinGW?

@cchulo
Copy link
Contributor

cchulo commented Aug 29, 2021

@sfhacker what python environment is conan running on? what is your profile? are you building from within MinGW/MSYS2 terminal?

@memsharded
Copy link
Member

memsharded commented Aug 29, 2021

As a note, Conan 1.39 is introducing a new mechanism to define the Windows-bash environment (win_bash=True as argument to self.run(), and configuration items like tools.microsoft.bash:subsystem). See https://docs.conan.io/en/latest/systems_cross_building/windows_subsystems.html#self-win-bash

@memsharded
Copy link
Member

I have read on several fora that conan doesn't work very well and it should be avoided.

Hundreds of ConanCenter recipes build in windows with Msys2 (actually, a Msys2 Conan package used as build_require), using different build systems, Autotools and others. Conan is used in production everyday by many thousands of companies (see some at https://conan.io/tribe.html), from startups to Fortune 100 ones. Of course there might be rough edges and things to improve, like any other tool, and we work hard to keep improving. For example, Conan test suite has recently added test for Msys2, Mingw, etc, to make sure this subsystems are better supported: https://github.com/conan-io/conan/blob/develop/conans/test/functional/subsystems_build_test.py, and we added new configuration items in conan-io/docs#2152.

Saying "it should be avoided" is not only unnecessary but also simply not true. Conan is delivering a huge value to many tons of teams out there, and using it can really help and save a lot of time.

@cchulo
Copy link
Contributor

cchulo commented Aug 29, 2021

@memsharded thank you for your suggestion, lightbulb went off in my head and was actually successful in getting autotools detected in mingw/msys2:

  • I cloned conan index project
  • by tweaking apr conanfile.py recipe, I added self.win_bash = true
  • installed the base-devel on msys2

After I did those two things I reattempted to create the apr package and conan was able to pick up autotools, and so was finally able to start compiling... until I stumbled on the error: unknown type name that SSE4 previously reported. @SSE4 also posted a link to a bugzilla where the last reply indicates that we need to specify COM_NO_WINDOWS_H in order to avoid the compile issues, but I am unsure if this needs to be applied to apr source code itself or its a flag that is passed in some mingw configuration, or something that should be set in the recipe itself.

btw is there a way of setting self.win_bash without modifying conanfile.py recipe? no right?

@cchulo
Copy link
Contributor

cchulo commented Aug 29, 2021

@sfhacker the only reason I want to compile with mingw is to ensure cross compatibility, not accidentally use anything that is platform specific in my applications, but also I strongly dislike Visual Studio itself, and how bloated the installation is (even if you are installing MSVC and Windows SDK, it is still a heavy installation). I strongly believe conan can succeed, so as long as devs keep bringing these issues up and trying to solve them, eventually there will be motivation for moving more open source libraries from autotools to cmake, potentially.

@memsharded
Copy link
Member

btw is there a way of setting self.win_bash without modifying conanfile.py recipe? no right?

No, it is not possible, no way to inject it from downstream, need to modify (fork) recipe.
We are now starting a process to modernize ConanCenter recipes to use the new build system integrations, it will take some time (months), but at least it has started.

Maybe @SSE4 can help with the specifics of the APR package and that COM_NO_WINDOWS_H issue?

@ericLemanissier
Copy link
Contributor

Is it me, or doesn't the new Autotools helper not support win_bash and msys2 ?

@memsharded
Copy link
Member

@ericLemanissier if you mean AutotoolsToolchain, AutotoolsDeps, etc, they should support it, but there is a different syntax and mechanisms now to define it (more explicit)

@ericLemanissier
Copy link
Contributor

Then there is something I don't understand, because I get this error 'C:\Users\runneradmin\.conan\data\binutils\2.37\_\_\build\0a420ff5c47119e668867cdb51baff0eca1fdb68\source_subfolder/configure' is not recognized as an internal or external command when using this recipe https://github.com/ericLemanissier/conan-center-index/blob/6cc6bcb805ddb7af5a8e185d5c8b665885f3672c/recipes/binutils/all/conanfile.py

@memsharded
Copy link
Member

You are right, it seems there could be something missing there, lets have a look.

@cchulo
Copy link
Contributor

cchulo commented Jan 25, 2022

Is it me, or doesn't the new Autotools helper not support win_bash and msys2 ?

Eric, what are you trying to install/build with MSYS2? Maybe I can help.

I think I finally figured out (at least a little bit) conan building, was finally able to clear the "Get Started" tutorial on Conan docs using MSYS2, Mingw-w64 GCC and Windows. Was able to build Poco 1.9.4 from scratch after a lot of digging here and there.

@memsharded
Copy link
Member

@cchulo we are interested in that feedback, the new toolchains are maturing to be ready for 2.0, and the intention is that supporting msys2 should be relatively easy with the new integrations

@cchulo
Copy link
Contributor

cchulo commented Jan 25, 2022

@cchulo we are interested in that feedback, the new toolchains are maturing to be ready for 2.0, and the intention is that supporting msys2 should be relatively easy with the new integrations

So I have other tools installed that are exposed in the windows PATH, I had to override this in my profile, and point it to my Mingw installation (under MSYS2)

In MSYS2 I installed base-devel mingw-w64-x86_64-toolchain, and mingw-w64-cmake.
The last piece of the puzzle, since one or more of Poco's libraries requires location to Windows SDK I had to also include this in the PATH as well. Finally I came up with this profile:

[settings]
os_build=Windows
os=Windows
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=11.2
compiler.libcxx=libstdc++11
compiler.threads=posix
build_type=Release
[options]
[build_requires]
[env]
CC=C:/msys64/mingw64/bin/gcc
CXX=C:/msys64/mingw64/bin/g++
PATH=[C:/msys64/mingw64/bin, C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x64]

I was not able to build the getting started tutorial at all before this. I have a theory about installing mingw-w64-autotools, I think you may be able to build by following this strategy (unless autotools for windows is absolutely a lost case, I'm not too familiar with it)

@cchulo
Copy link
Contributor

cchulo commented Jan 25, 2022

do note that the Windows SDK can be installed separately using Visual Studio Build tools no need for installing the entire Visual Studio software suite

@ericLemanissier
Copy link
Contributor

@memsharded I just tried to set win_bash = True attribute on the recipe, but it now fails with ConanException: The config 'tools.microsoft.bash:subsystem' is needed to run commands in a Windows subsystem. Documentation indicates that the path to msys has to be specified in the profile, but it does not seem compatible with the fact that msys2 comes as a build requirement of the recipe being built.

@cchulo
Copy link
Contributor

cchulo commented Jan 25, 2022

I didn't have to install any Windows SDK. I believe it is already included when installing MinGW, I guess?

nice! yeah I'd have to check out PocoMacros.cmake for that version to see if they removed dependency on Windows SDK, for Poco 1.9.4 it's there

@cchulo
Copy link
Contributor

cchulo commented Jan 25, 2022

Just built Poco 1.9.4 from source on exactly the same environment as of version 11.1.1. No issues at all.

@sfhacker Interesting, what does your profile look like? You are using Conan right? ultimately that's what determines cmake's behavior (though I could be wrong about this)

The error message I received building Poco without adding Windows SDK is that PocoMacros.cmake failed because it could not find compiler. This error is raised when targeting Windows.

@memsharded
Copy link
Member

Hi!

I would like to comment that now, the new integrations AutotoolToolchain, AutotoolsDeps, etc, have automatic tests in our test suite, for different configurations:

Note that this are not the integrations used in ConanCenter recipes, but the plan is to start migrating as soon as possible, to be ready for 2.0.

With these tests, it seems that good Msys support for Autotools is provided, so after merging #10429, this issue will be closed automatically. If there are any pending issues, it would be great to open a new ticket with a reproducible case using the new integrations. Thanks!

@memsharded
Copy link
Member

#10429 merged, please open new tickets if necessary, basing them on the above tests would be very useful. Thanks all for the feedback!

@ericLemanissier
Copy link
Contributor

@memsharded Thanks. I fail to see how #10429 is related to the issue I faced, so I made a test case on conan-io/conan-center-index#9091

@memsharded
Copy link
Member

@ericLemanissier I responded in conan-io/conan-center-index#9091 (comment). So far it seems ConanCenter related issues, not lack of support in the client side.

First point, it is a ConanCenter hook issue, not sure how the AutotoolsToolchain would be connected with that. The other error is missing configuration. Part of the new integrations design is stop trying to guess things, and require explicit configuration instead. You can try locally adding those [conf] to your profile. Please have a look and let me know.

@memsharded
Copy link
Member

memsharded commented Jan 26, 2022

Following conan-io/conan-center-index#9091 (comment), it could be that changing the default toolchain datadir to "res" instead of "share" would be more aligned with ConanCenter requested layouts, lets check it.

Created new issue #10430 to track this.

@SpaceIm
Copy link
Contributor

SpaceIm commented Sep 25, 2022

I've opened #12194 to improve autotools handling on Windows. Please provide feedbacks (though no autotools based recipes compatible with Windows have been migrated to conan v2 in conan-center for the moment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants
@Facon @SSE4 @ericLemanissier @cchulo @danimtb @memsharded @SpaceIm and others