conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.15k stars 971 forks source link

[question] cl.exe stucks when building libiconv/1.16 as CI job in gitlab (probably msys2 issue) #10830

Closed pananton closed 2 years ago

pananton commented 2 years ago

Hello! I have a problem with building libiconv and some other libraries which use msys2 on windows as part of gitlab CI job (run in powershell). Probably the cause of error is specific to gitlab, but maybe you can give some advice where to look for solution. When my CI job executes conan create libiconv/1.16@ . on windows I see the following output:

$ conan create . $recipe_ref@
Exporting package recipe
libiconv/1.16 exports: File 'conandata.yml' found. Exporting it...
libiconv/1.16 exports: Copied 1 '.yml' file: conandata.yml
libiconv/1.16: Calling export_sources()
libiconv/1.16 export_sources() method: Copied 1 '.patch' file: 0001-libcharset-fix-linkage.patch
libiconv/1.16: A new conanfile.py version was exported
libiconv/1.16: Folder: C:\Users\gitlab\.conan\data\libiconv\1.16\_\_\export
libiconv/1.16: Exported revision: 3ea7b7b834b5bb47060de1f36dfe43bd
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=Visual Studio
compiler.runtime=MD
compiler.version=16
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
libiconv/1.16: Forced build from source
msys2/cci.latest: Not found in local cache, looking in remotes...
msys2/cci.latest: Trying with '***'...
Downloading conanmanifest.txt
Downloading conanfile.py
Downloading conan_export.tgz
msys2/cci.latest: Downloaded recipe revision 0
libiconv/1.16 (test package): Installing package
Requirements
    libiconv/1.16 from local cache - Cache
Packages
    libiconv/1.16:3fb49604f9c2f729b85ba3115852006824e72cab - Build
Build requirements
    msys2/cci.latest from '***' - Downloaded
Build requirements packages
    msys2/cci.latest:eee3fba89db6d777329de6046[25](***)af8c30d46f080 - Download
Installing (downloading, building) binaries...
msys2/cci.latest: Retrieving package eee3fba89db6d777329de604625af8c30d46f080 from remote '***' 
Downloading conanmanifest.txt
Downloading conaninfo.txt
Downloading conan_package.tgz
.msys2/cci.latest: Package installed eee3fba89db6d777329de604625af8c30d46f080
msys2/cci.latest: Downloaded package revision 0
msys2/cci.latest: Creating MSYS_ROOT env var : C:\.conan\8c5bea\1\bin\msys64
msys2/cci.latest: Creating MSYS_BIN env var : C:\.conan\8c5bea\1\bin\msys64\usr\bin
msys2/cci.latest: Appending PATH env var with : C:\.conan\8c5bea\1\bin\msys64\usr\bin
libiconv/1.16: Applying build-requirement: msys2/cci.latest
libiconv/1.16: Configuring sources in C:\Users\gitlab\.conan\data\libiconv\1.16\_\_\source
libiconv/1.16: Copying sources to build folder
libiconv/1.16: Building your package in C:\Users\gitlab\.conan\data\libiconv\1.16\_\_\build\3fb49604f9c2f729b85ba3115852006824e72cab
libiconv/1.16: Generator txt created conanbuildinfo.txt
libiconv/1.16: Aggregating env generators
libiconv/1.16: Calling build()
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.8.5
** Copyright (c) 2020 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
libiconv/1.16: run_in_windows_bash: C:\.conan\8c5bea\1\bin\msys64\usr\bin\bash.exe --login -c ^"cd \^"/c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder\^" ^&^& PATH=\^"/c/.conan/8c5bea/1/bin/msys64/usr/bin:$PATH\^" ^&^& /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/configure --help ^"
----Running------
> C:\.conan\8c5bea\1\bin\msys64\usr\bin\bash.exe --login -c ^"cd \^"/c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder\^" ^&^& PATH=\^"/c/.conan/8c5bea/1/bin/msys64/usr/bin:$PATH\^" ^&^& /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/configure --help ^"
-----------------
`configure' configures libiconv 1.16 to adapt to many kinds of systems.
Usage: /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']
Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]
By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/libiconv]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]
Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-silent-rules   less verbose build output (undo: "make V=1")
  --disable-silent-rules  verbose build output (undo: "make V=0")
  --enable-dependency-tracking
                          do not reject slow dependency extractors
  --disable-dependency-tracking
                          speeds up one-time build
  --disable-largefile     omit support for large files
  --enable-static[=PKGS]  build static libraries [default=no]
  --enable-shared[=PKGS]  build shared libraries [default=yes]
  --enable-fast-install[=PKGS]
                          optimize for fast installation [default=yes]
  --disable-libtool-lock  avoid locking (might break parallel builds)
  --enable-relocatable    install a package that can be moved in the file
                          system
  --enable-extra-encodings
                          add support for a few rarely used encodings
  --disable-rpath         do not hardcode runtime library paths
  --disable-nls           do not use Native Language Support
Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --with-pic[=PKGS]       try to use only PIC/non-PIC objects [default=use
                          both]
  --with-aix-soname=aix|svr4|both
                          shared library versioning (aka "SONAME") variant to
                          provide on AIX, [default=aix].
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-sysroot[=DIR]    Search for dependent libraries within DIR (or the
                          compiler's sysroot if not specified).
  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
  --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
  --without-libiconv-prefix     don't search for libiconv in includedir and libdir
  --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
  --without-libintl-prefix     don't search for libintl in includedir and libdir
Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CPP         C preprocessor
  LT_SYS_LIBRARY_PATH
              User-defined run-time library search path.
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to the package provider.
libiconv/1.16: Calling:
 > /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/configure --enable-static --disable-shared --prefix=C:/Users/gitlab/.conan/data/libiconv/1.16/_/_/package/3fb49604f9c2f729b85ba3115852006824e72cab --host=x86_64-w64-mingw32
libiconv/1.16: run_in_windows_bash: C:\.conan\8c5bea\1\bin\msys64\usr\bin\bash.exe --login -c ^"cd \^"/c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder\^" ^&^& PATH=\^"/c/.conan/8c5bea/1/bin/msys64/usr/bin:$PATH\^" ^&^& /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/configure --enable-static --disable-shared --prefix=C:/Users/gitlab/.conan/data/libiconv/1.16/_/_/package/3fb49604f9c2f729b85ba3115852006824e72cab --host=x86_64-w64-mingw32 ^"
----Running------
> C:\.conan\8c5bea\1\bin\msys64\usr\bin\bash.exe --login -c ^"cd \^"/c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder\^" ^&^& PATH=\^"/c/.conan/8c5bea/1/bin/msys64/usr/bin:$PATH\^" ^&^& /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/configure --enable-static --disable-shared --prefix=C:/Users/gitlab/.conan/data/libiconv/1.16/_/_/package/3fb49604f9c2f729b85ba3115852006824e72cab --host=x86_64-w64-mingw32 ^"
-----------------
configure: loading site script /etc/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for x86_64-w64-mingw32-strip... :
checking for a thread-safe mkdir -p... /c/.conan/8c5bea/1/bin/msys64/usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make sets $(MAKE)... (cached) yes
checking for x86_64-w64-mingw32-gcc... /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/compile cl -nologo
checking whether the C compiler works... yes
checking for C compiler default output file name... conftest.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... obj
checking whether we are using the GNU C compiler... no
checking whether /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/compile cl -nologo accepts -g... no
checking for /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/compile cl -nologo option to accept ISO C89... none needed
checking whether /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/compile cl -nologo understands -c and -o together... yes
checking whether make supports the include directive... yes (GNU style)
checking dependency style of /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/compile cl -nologo... none
checking how to run the C preprocessor... /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/compile cl -nologo -E
checking for strip... /c/.conan/8c5bea/1/bin/msys64/usr/bin/strip
checking build system type... x86_64-w64-mingw32
checking host system type... x86_64-w64-mingw32
checking for grep that handles long lines and -e... /c/.conan/8c5bea/1/bin/msys64/usr/bin/grep
checking for egrep... /c/.conan/8c5bea/1/bin/msys64/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... no
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... no
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 whether _XOPEN_SOURCE should be defined... no
checking for Minix Amsterdam compiler... no
checking for x86_64-w64-mingw32-ar... /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/ar-lib lib
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... unknown
checking for _LARGE_FILES value needed for large files... unknown
checking how to print strings... printf
checking for a sed that does not truncate output... /c/.conan/8c5bea/1/bin/msys64/usr/bin/sed
checking for fgrep... /c/.conan/8c5bea/1/bin/msys64/usr/bin/grep -F
checking for non-GNU ld... link
checking if the linker (link) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... dumpbin -symbols
checking the name lister (dumpbin -symbols) interface... MS dumpbin
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 8192
checking how to convert x86_64-w64-mingw32 file names to x86_64-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 link option to reload object files... -r
checking for x86_64-w64-mingw32-objdump... no
checking for objdump... objdump
checking how to recognize dependent libraries... file_magic ^x86 archive import|^x86 DLL
checking for x86_64-w64-mingw32-dlltool... no
checking for dlltool... dlltool
checking how to associate runtime and link libraries... func_cygming_dll_for_implib
checking for x86_64-w64-mingw32-ar... (cached) /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/ar-lib lib
checking for archiver @FILE support... @
checking for x86_64-w64-mingw32-strip... (cached) :
checking for x86_64-w64-mingw32-ranlib... :
checking command to parse dumpbin -symbols output from /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/compile cl -nologo object... ok
checking for sysroot... no
checking for a working dd... /c/.conan/8c5bea/1/bin/msys64/usr/bin/dd
checking how to truncate binary pipes... /c/.conan/8c5bea/1/bin/msys64/usr/bin/dd bs=4096 count=1
checking for x86_64-w64-mingw32-mt... no
checking for mt... mt
checking if mt is a manifest tool... yes
checking for dlfcn.h... no
checking for x86_64-w64-mingw32-as... no
checking for as... as
checking for x86_64-w64-mingw32-dlltool... dlltool
checking for x86_64-w64-mingw32-objdump... objdump
checking for objdir... .libs
checking for /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/compile cl -nologo option to produce PIC... -DDLL_EXPORT -DPIC
checking if /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/compile cl -nologo PIC flag -DDLL_EXPORT -DPIC works... yes
checking if /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/compile cl -nologo static flag  works... yes
checking if /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/compile cl -nologo supports -c -o file.obj... yes
checking if /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/compile cl -nologo supports -c -o file.obj... (cached) yes
checking whether the /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/build-aux/compile cl -nologo linker (link) supports shared libraries... yes
checking dynamic linker characteristics... Win32 link.exe
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... no
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking for ld... link
checking if the linker (link) is GNU ld... no
checking for shared library path variable... PATH
checking whether to activate relocatable installation... no
checking how to copy files... cp -p
checking how to make hard links... ln
checking whether ln -s works... no, using cp -pR
checking for x86_64-w64-mingw32-windres... windres --target=pe-x86-64
checking for x86_64-w64-mingw32-windres... windres --target=pe-x86-64
checking for shared library run path origin... done
checking 32-bit host C ABI... no
checking for the common suffixes of directories in the library search path... lib,lib
checking for iconv... no, consider installing GNU libiconv
checking whether NLS is requested... yes
checking for msgfmt... /c/.conan/8c5bea/1/bin/msys64/usr/bin/msgfmt
checking for gmsgfmt... /c/.conan/8c5bea/1/bin/msys64/usr/bin/msgfmt
checking for xgettext... /c/.conan/8c5bea/1/bin/msys64/usr/bin/xgettext
checking for msgmerge... /c/.conan/8c5bea/1/bin/msys64/usr/bin/msgmerge
checking for CFPreferencesCopyAppValue... no
checking for CFLocaleCopyCurrent... no
checking for CFLocaleCopyPreferredLanguages... no
checking for GNU gettext in libc... no
checking for iconv... (cached) no, consider installing GNU libiconv
checking for GNU gettext in libintl... no
checking whether to use NLS... no
checking for mbstate_t... yes
checking for wchar_t... yes
checking for getc_unlocked... no
checking for mbrtowc... yes
checking for wcrtomb... yes
checking for mbsinit... no
checking for setlocale... yes
checking whether <wchar.h> is standalone... yes
checking for memmove... no
checking for nl_langinfo and CODESET... no
checking for unistd.h... (cached) no
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for sys/param.h... no
checking for limits.h... yes
checking for sys/stat.h... (cached) yes
checking for sys/time.h... no
checking for wchar.h... yes
checking for stdint.h... (cached) yes
checking for sys/socket.h... no
checking for symlink... no
checking for canonicalize_file_name... no
checking for getcwd... yes
checking for readlink... no
checking for realpath... no
checking for readlinkat... no
checking for getprogname... no
checking for getexecname... no
checking for lstat... no
checking for _set_invalid_parameter_handler... yes
checking for setenv... no
checking for working fcntl.h... no
checking for wchar.h... (cached) yes
checking for EILSEQ... yes
checking byte ordering... little endian
checking for size_t... yes
checking for working alloca.h... no
checking for alloca... yes
checking whether // is distinct from /... yes
checking whether realpath works... no
checking if environ is properly declared... yes
checking whether the preprocessor supports include_next... no
checking whether system header files limit the line length... no
checking for complete errno.h... no
checking absolute name of <errno.h>... "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\ucrt\\errno.h"
checking for EMULTIHOP value... no
checking for ENOLINK value... yes
checking for EOVERFLOW value... yes
checking whether strerror_r is declared... no
checking for strerror_r... no
checking whether strerror_r returns char *... no
checking for pid_t... no
checking for mode_t... no
checking for 64-bit off_t... no
checking for 64-bit st_size... no
checking absolute name of <limits.h>... "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.[28](***).[29](***)[33](***)3\\include\\limits.h"
checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... no
checking whether lstat correctly handles trailing slash... no
checking whether malloc, realloc, calloc are POSIX compliant... no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for unsigned long long int... yes
checking for long long int... yes
checking for sigset_t... no
checking for SIGPIPE... no
checking whether setenv is declared... no
checking for ssize_t... no
checking for uid_t in sys/types.h... no
checking whether C symbols are prefixed with underscore at the linker level... no
checking whether stat file-mode macros are broken... no
checking absolute name of <sys/stat.h>... "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18[36](***)2.0\\ucrt\\sys/stat.h"
checking for nlink_t... no
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for wint_t... yes
checking whether wint_t is too small... yes
checking absolute name of <stdint.h>... "C:\\Program Files (x[86](***))\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.28.2[93](***)33\\include\\stdint.h"
checking whether stdint.h conforms to C[99](***)... yes
checking whether stdint.h predates C++11... no
checking whether stdint.h has UINTMAX_WIDTH etc.... no
checking whether strerror(0) succeeds... yes
checking for C/C++ restrict keyword... no

After the last line the building stucks forever. I can see on my runner machine that cl.exe is started and that it locks some files in .conan/data/libiconv directory. If I killl cl.exe, then building continuesand the next lines are:

checking absolute name of <string.h>... "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\ucrt\\string.h"
checking absolute name of <sys/types.h>... "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.18362.0\\ucrt\\sys/types.h"
...

Then building stucks again, and killing cl.exe does the trick again, i.e., gitlab runner probably re-starts it and continues building. After several such kills libiconv successfully builds. My environment is:

Maybe you can give some me some advice where to look for the fix? Thanks in advance.

pananton commented 2 years ago

Forgot to mention, that if I directly login to runner's machine with the same user ('gitlab' in my case) and execute conan create in a powershell then everything works just fine. The problem is only when recipe is built as part of CI, so I'm almost sure that the problem is in it's settings, but maybe someone had the same issue..

pananton commented 2 years ago

I've changed libiconv recipe to use msys2/20210105 as dependency and everything works. Then I've tried to use msys2/20210105 recipe but make it download the same archive as current msys2/cci.latest (through conandata.yml) and received the same error. So I belive that the problem relates to msys2 itself. Any advices/opinions are appreciated)

SSE4 commented 2 years ago

is it possible that it spawns a dialog box (like runtime error, assertion failed or DLL load error)?

pananton commented 2 years ago

If I directly login to the CI runner machine with the same user as used by the runner and perform conan create directly no dialog boxes are opened... I've tried even to perform command that stucks directly and it also worked just fine. I mean, this command:

C:\.conan\8c5bea\1\bin\msys64\usr\bin\bash.exe --login -c ^"cd \^"/c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder\^" ^&^& PATH=\^"/c/.conan/8c5bea/1/bin/msys64/usr/bin:$PATH\^" ^&^& /c/users/gitlab/.conan/data/libiconv/1.16/_/_/build/3fb49604f9c2f729b85ba3115852006824e72cab/source_subfolder/configure --enable-static --disable-shared --prefix=C:/Users/gitlab/.conan/data/libiconv/1.16/_/_/package/3fb49604f9c2f729b85ba3115852006824e72cab --host=x86_64-w64-mingw32 ^"

Also I've tried to set custom CONAN_USER_HOME / CONAN_USER_HOME_SHORT , because runner is launched as a windows service and may not have a home directory or may be used concurrently by other jobs - and it also did not work (

pananton commented 2 years ago

Additional information. As I mentioned earlier build stucks during configure step (when configure script is working). I've looked through this script and find out that it creates conftest.c file and tries to compile it to check C compiler features. When build stucks (note that cl.exe exists in the active processes) conftest.c looks like this:

/* confdefs.h */
#define PACKAGE_NAME "libiconv"
#define PACKAGE_TARNAME "libiconv"
#define PACKAGE_VERSION "1.16"
#define PACKAGE_STRING "libiconv 1.16"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define PACKAGE "libiconv"
#define VERSION "1.16"
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define __EXTENSIONS__ 1
#define _ALL_SOURCE 1
#define _DARWIN_C_SOURCE 1
#define _GNU_SOURCE 1
#define _NETBSD_SOURCE 1
#define _OPENBSD_SOURCE 1
#define _POSIX_PTHREAD_SEMANTICS 1
#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
#define __STDC_WANT_IEC_60559_BFP_EXT__ 1
#define __STDC_WANT_IEC_60559_DFP_EXT__ 1
#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
#define __STDC_WANT_LIB_EXT2__ 1
#define __STDC_WANT_MATH_SPEC_FUNCS__ 1
#define _TANDEM_SOURCE 1
#define _HPUX_ALT_XOPEN_SOCKET_API 1
#define _DARWIN_USE_64_BIT_INODE 1
#define LT_OBJDIR ".libs/"
#define INSTALLPREFIX "C:/Users/gitlab/conan-recipe/.conan/data/libiconv/1.16/_/_/package/3fb49604f9c2f729b85ba3115852006824e72cab"
#define HAVE_VISIBILITY 0
#define ICONV_CONST 
#define HAVE_MBSTATE_T 1
#define HAVE_WCHAR_T 1
#define HAVE_MBRTOWC 1
#define HAVE_WCRTOMB 1
#define HAVE_SETLOCALE 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_LIMITS_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_WCHAR_H 1
#define HAVE_STDINT_H 1
#define HAVE_GETCWD 1
#define HAVE__SET_INVALID_PARAMETER_HANDLER 1
#define HAVE_WORKING_O_NOATIME 0
#define HAVE_WORKING_O_NOFOLLOW 0
#define HAVE_WCHAR_H 1
#define WORDS_LITTLEENDIAN 1
#define HAVE_ALLOCA 1
#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1
#define HAVE_ENVIRON_DECL 1
#define HAVE_DECL_STRERROR_R 0
#define pid_t int
#define mode_t int
#define HAVE_STDLIB_H 1
#define MALLOC_0_IS_NONNULL 1
#define HAVE_UNSIGNED_LONG_LONG_INT 1
#define HAVE_LONG_LONG_INT 1
#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1
#define HAVE_DECL_SETENV 0
#define ssize_t int
#define uid_t int
#define gid_t int
#define USER_LABEL_PREFIX 
#define nlink_t int
#define HAVE__BOOL 1
#define HAVE_WINT_T 1
#define restrict /**/
/* end confdefs.h.  */
#include <string.h>

This is the example how configure script tries to determine location of the <string.h> header. If i kill cl.exe the following line appears in my CI job log:

checking absolute name of <string.h>... "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\ucrt\\string.h"

The build process continues, but later stucks again. The content of conftest.c now is:

/* confdefs.h */
#define PACKAGE_NAME "libiconv"
#define PACKAGE_TARNAME "libiconv"
#define PACKAGE_VERSION "1.16"
#define PACKAGE_STRING "libiconv 1.16"
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define PACKAGE "libiconv"
#define VERSION "1.16"
#define STDC_HEADERS 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_MEMORY_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define __EXTENSIONS__ 1
#define _ALL_SOURCE 1
#define _DARWIN_C_SOURCE 1
#define _GNU_SOURCE 1
#define _NETBSD_SOURCE 1
#define _OPENBSD_SOURCE 1
#define _POSIX_PTHREAD_SEMANTICS 1
#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
#define __STDC_WANT_IEC_60559_BFP_EXT__ 1
#define __STDC_WANT_IEC_60559_DFP_EXT__ 1
#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
#define __STDC_WANT_LIB_EXT2__ 1
#define __STDC_WANT_MATH_SPEC_FUNCS__ 1
#define _TANDEM_SOURCE 1
#define _HPUX_ALT_XOPEN_SOCKET_API 1
#define _DARWIN_USE_64_BIT_INODE 1
#define LT_OBJDIR ".libs/"
#define INSTALLPREFIX "C:/Users/gitlab/conan-recipe/.conan/data/libiconv/1.16/_/_/package/3fb49604f9c2f729b85ba3115852006824e72cab"
#define HAVE_VISIBILITY 0
#define ICONV_CONST 
#define HAVE_MBSTATE_T 1
#define HAVE_WCHAR_T 1
#define HAVE_MBRTOWC 1
#define HAVE_WCRTOMB 1
#define HAVE_SETLOCALE 1
#define HAVE_STDLIB_H 1
#define HAVE_STRING_H 1
#define HAVE_LIMITS_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_WCHAR_H 1
#define HAVE_STDINT_H 1
#define HAVE_GETCWD 1
#define HAVE__SET_INVALID_PARAMETER_HANDLER 1
#define HAVE_WORKING_O_NOATIME 0
#define HAVE_WORKING_O_NOFOLLOW 0
#define HAVE_WCHAR_H 1
#define WORDS_LITTLEENDIAN 1
#define HAVE_ALLOCA 1
#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1
#define HAVE_ENVIRON_DECL 1
#define HAVE_DECL_STRERROR_R 0
#define pid_t int
#define mode_t int
#define HAVE_STDLIB_H 1
#define MALLOC_0_IS_NONNULL 1
#define HAVE_UNSIGNED_LONG_LONG_INT 1
#define HAVE_LONG_LONG_INT 1
#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1
#define HAVE_DECL_SETENV 0
#define ssize_t int
#define uid_t int
#define gid_t int
#define USER_LABEL_PREFIX 
#define nlink_t int
#define HAVE__BOOL 1
#define HAVE_WINT_T 1
#define restrict /**/
#define _USE_STD_STAT 1
#define HAVE_DECL_CLEARERR_UNLOCKED 0
#define HAVE_DECL_FEOF_UNLOCKED 0
#define HAVE_DECL_FERROR_UNLOCKED 0
#define HAVE_DECL_FFLUSH_UNLOCKED 0
#define HAVE_DECL_FGETS_UNLOCKED 0
#define HAVE_DECL_FPUTC_UNLOCKED 0
#define HAVE_DECL_FPUTS_UNLOCKED 0
#define HAVE_DECL_FREAD_UNLOCKED 0
#define HAVE_DECL_FWRITE_UNLOCKED 0
#define HAVE_DECL_GETC_UNLOCKED 0
#define HAVE_DECL_GETCHAR_UNLOCKED 0
#define HAVE_DECL_PUTC_UNLOCKED 0
#define HAVE_DECL_PUTCHAR_UNLOCKED 0
#define GNULIB_CANONICALIZE_LGPL 1
#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1
#define GNULIB_TEST_REALPATH 1
#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1
#define GNULIB_TEST_ENVIRON 1
#define HAVE_DECL_PROGRAM_INVOCATION_NAME 0
#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 0
#define HAVE_DECL___ARGV 1
#define GNULIB_TEST_LSTAT 1
#define GNULIB_TEST_MALLOC_POSIX 1
#define HAVE_MBSTATE_T 1
#define GNULIB_MSVC_NOTHROW 1
#define HAVE_DECL_PROGRAM_INVOCATION_NAME 0
#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 0
#define HAVE_RAISE 1
#define GNULIB_TEST_RAISE 1
#define GNULIB_TEST_READ 1
#define GNULIB_TEST_READLINK 1
#define HAVE_SEARCH_H 1
#define GNULIB_SIGPIPE 1
#define GNULIB_TEST_SIGPROCMASK 1
#define ssize_t int
#define GNULIB_TEST_STAT 1
#define __USE_MINGW_ANSI_STDIO 1
/* end confdefs.h.  */
#include <stdio.h>

If cl.exe is killed again the build process continues and the next line is CI job log is:

checking absolute name of <stdio.h>... "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.19041.0\\ucrt\\stdio.h"

Then process stucks again, killing cl.exe works, etc until build is finished. In all cases the content of conftest.c is very similar/ Among several defines there is only one line including some header (no main function etc). Other checks (when conftest.c contains main function) successfully pass.

pananton commented 2 years ago

Looks like the process stucks on the following command from configure script created by autoconf (I've replaced bash variables with actual values here):

gl_dirsep_regex='[/\\]'
gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
gl_header_literal_regex=`echo 'stdio.h' | sed -e "$gl_make_literal_regex_sed"`
gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
      s|^/[^/]|//&|
      p
      q
    }'
gl_cv_absolute_stdio_h=`(eval "cl -E conftest.c") 2>config.log | sed -n "$gl_absolute_header_sed"`

As you can see from the last line, configure calls cl.exe as C preprocessor to parse conftest.c (remember, that it contains include <stdio.h>). Then at some moment process stucks until cl.exe is manually killed. Because absolute path to stdio.h is correctly defined (this can be seen in conan's output too), I think that the problem is in sed command (I don't know it well, so can't say why it can stuck).. Any ideas?) Btw, cl.exe version is Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30141 for x64

SSE4 commented 2 years ago

if you execute just cl -E conftest.c, does it complete?

pananton commented 2 years ago

Yes

pananton commented 2 years ago

@SSE4 Hello! I finally figured out exact source of problem. As I've mentioned, libiconv/1.16 builds just fine with msys2/20210105 (I simply modified original recipe from conan-center-index to use it), but stucks when building it with msys2/cci.latest. Then I installed both msys2 versions in my runner's local cache and start to copy files from msys2/20210105 usr/bin to the same directory of msys2/cci.latest. Using something like binary search algorithm when copying, I've discovered, that replacing single file msys-2.0.dll is enough to fix the problem. I mean, if I install msys2/cci.latest,replace it's usr/bin/msys-2.0.dll to the same file from msys2/20210105 then libiconv is built as expected. What should I do next?) Maybe I should post this to conan-center-index?

SSE4 commented 2 years ago

I think it clearly indicates a bug in msys itself, consider opening an issue against MSYS2: https://github.com/msys2/msys2-packages/issues

pananton commented 2 years ago

Created an issue against msys2.. https://github.com/msys2/MSYS2-packages/issues/2893 . They already have a similar one, hope the problem will be solved soon. Thanks for advices.