Conan-center-index: [package] zlib/1.2.11: Fails to build on cygwin32

Created on 12 Nov 2020  路  4Comments  路  Source: conan-io/conan-center-index

Building zlib/1.2.11 on cygwin32 with the default options (shared=False) for i686-w64-mingw32 fails with the following message:

ERROR: zlib/1.2.11: Error in package() method, line 170
        self._rename_libraries()
while calling '_rename_libraries', line 139
        os.rename(current_lib, os.path.join(lib_path, "libzlib.a"))
        FileNotFoundError: [Errno 2] No such file or directory: '/cygdrive/c/Users/klinden/.conan/data/zlib/1.2.11/_/_/package/a92ac858c0d634e5c002154e7207c5330ee927bb/lib/libzlibstatic.a' -> '/cygdrive/c/Users/klinden/.conan/data/zlib/1.2.11/_/_/package/a92ac858c0d634e5c002154e7207c5330ee927bb/lib/libzlib.a'

Package and Environment Details

  • Package Name/Version: zlib/1.2.11
  • Operating System+version: Cygwin32 on Windows 10
  • Compiler+version: GCC 7.4.0
  • Conan version: conan 1.31.2
  • Python version: Python 3.8.3

Conan profile

$ conan profile show cygwin32
Configuration for profile cygwin32:

[settings]
os=Windows
os_build=Windows
arch=x86
arch_build=x86
compiler=gcc
compiler.version=7
compiler.libcxx=libstdc++11
build_type=Release
[options]
[build_requires]
[env]
AR=i686-w64-mingw32-ar
AS=i686-w64-mingw32-as
CC=i686-w64-mingw32-gcc
CXX=i686-w64-mingw32-g++
LD=i686-w64-mingw32-ld
RANLIB=i686-w64-mingw32-ranlib
RC=i686-w64-mingw32-windres
STRIP=i686-w64-mingw32-strip
CMAKE_LEGACY_CYGWIN_WIN32=0
CONAN_CMAKE_GENERATOR=Unix Makefiles

Steps to reproduce

Run conan install --profile=cygwin32 --build=missing zlib/1.2.11@ in a Cygwin32 installation.

Logs

Click to expand log

$ which i686-w64-mingw32-gcc
/usr/bin/i686-w64-mingw32-gcc

$ i686-w64-mingw32-gcc --version
i686-w64-mingw32-gcc (GCC) 7.4.0
Copyright (C) 2017 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.


$ which python3.8
/usr/bin/python3.8

$ python3.8 --version
Python 3.8.3

$ which conan
/usr/local/bin/conan

$ conan --version
Conan version 1.31.2

$ conan install --profile=cygwin32 --build=missing zlib/1.2.11@
Configuration:
[settings]
arch=x86
arch_build=x86
build_type=Release
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=7
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
AR=i686-w64-mingw32-ar
AS=i686-w64-mingw32-as
CC=i686-w64-mingw32-gcc
CMAKE_LEGACY_CYGWIN_WIN32=0
CONAN_CMAKE_GENERATOR=Unix Makefiles
CXX=i686-w64-mingw32-g++
LD=i686-w64-mingw32-ld
RANLIB=i686-w64-mingw32-ranlib
RC=i686-w64-mingw32-windres
STRIP=i686-w64-mingw32-strip
zlib/1.2.11: Not found in local cache, looking in remotes...
zlib/1.2.11: Trying with 'conan-center'...
Downloading conanmanifest.txt completed [0.40k]
Downloading conanfile.py completed [8.35k]
Downloading conan_export.tgz completed [0.33k]
Decompressing conan_export.tgz completed [0.00k]
zlib/1.2.11: Downloaded recipe revision 0
Installing package: zlib/1.2.11
Requirements
    zlib/1.2.11 from 'conan-center' - Downloaded
Packages
    zlib/1.2.11:a92ac858c0d634e5c002154e7207c5330ee927bb - Build

Installing (downloading, building) binaries...
Downloading conan_sources.tgz completed [7.26k]
Decompressing conan_sources.tgz completed [0.00k]
zlib/1.2.11: Configuring sources in /cygdrive/c/Users/klinden/.conan/data/zlib/1.2.11/_/_/source
Downloading zlib-1.2.11.tar.gz completed [593.46k]

zlib/1.2.11: Copying sources to build folder
zlib/1.2.11: Building your package in /cygdrive/c/Users/klinden/.conan/data/zlib/1.2.11/_/_/build/a92ac858c0d634e5c002154e7207c5330ee927bb
zlib/1.2.11: Generator cmake created conanbuildinfo.cmake
zlib/1.2.11: Calling build()
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc.exe
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++.exe
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Conan CMake Wrapper
-- Conan: called by CMake conan helper
-- Conan: called inside local cache
-- Conan: Adjusting output directories
-- Conan: Using cmake global configuration
-- Conan: Adjusting default RPATHs Conan policies
-- Conan: Adjusting language standard
-- Conan: Compiler GCC>=5, checking major version 7
-- Conan: Checking correct version: 7
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of off64_t
-- Check size of off64_t - done
-- Looking for fseeko
-- Looking for fseeko - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Renaming
--     /cygdrive/c/Users/klinden/.conan/data/zlib/1.2.11/_/_/build/a92ac858c0d634e5c002154e7207c5330ee927bb/source_subfolder/zconf.h
-- to 'zconf.h.included' because this file is included with zlib
-- but CMake generates it automatically in the build directory.
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CMAKE_INSTALL_BINDIR
    CMAKE_INSTALL_DATAROOTDIR
    CMAKE_INSTALL_INCLUDEDIR
    CMAKE_INSTALL_LIBDIR
    CMAKE_INSTALL_LIBEXECDIR
    CMAKE_INSTALL_OLDINCLUDEDIR
    CMAKE_INSTALL_SBINDIR


-- Build files have been written to: /cygdrive/c/Users/klinden/.conan/data/zlib/1.2.11/_/_/build/a92ac858c0d634e5c002154e7207c5330ee927bb/source_subfolder/_build
Scanning dependencies of target zlibstatic
[  6%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/adler32.o
[ 12%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/compress.o
[ 18%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/crc32.o
[ 25%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/deflate.o
[ 31%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/gzclose.o
[ 37%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/gzlib.o
[ 43%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/gzread.o
[ 50%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/gzwrite.o
[ 56%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/inflate.o
[ 62%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/infback.o
[ 68%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/inftrees.o
[ 75%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/inffast.o
[ 81%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/trees.o
[ 87%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/uncompr.o
[ 93%] Building C object source_subfolder/CMakeFiles/zlibstatic.dir/zutil.o
[100%] Linking C static library ../lib/libz.a
[100%] Built target zlibstatic
zlib/1.2.11: Package 'a92ac858c0d634e5c002154e7207c5330ee927bb' built
zlib/1.2.11: Build folder /cygdrive/c/Users/klinden/.conan/data/zlib/1.2.11/_/_/build/a92ac858c0d634e5c002154e7207c5330ee927bb
zlib/1.2.11: Generated conaninfo.txt
zlib/1.2.11: Generated conanbuildinfo.txt
zlib/1.2.11: Generating the package
zlib/1.2.11: Package folder /cygdrive/c/Users/klinden/.conan/data/zlib/1.2.11/_/_/package/a92ac858c0d634e5c002154e7207c5330ee927bb
zlib/1.2.11: Calling package()
ERROR: zlib/1.2.11: Error in package() method, line 170
        self._rename_libraries()
while calling '_rename_libraries', line 139
        os.rename(current_lib, os.path.join(lib_path, "libzlib.a"))
        FileNotFoundError: [Errno 2] No such file or directory: '/cygdrive/c/Users/klinden/.conan/data/zlib/1.2.11/_/_/package/a92ac858c0d634e5c002154e7207c5330ee927bb/lib/libzlibstatic.a' -> '/cygdrive/c/Users/klinden/.conan/data/zlib/1.2.11/_/_/package/a92ac858c0d634e5c002154e7207c5330ee927bb/lib/libzlib.a'

bug

Most helpful comment

The problem won't be solved by this,
but you should also set os.subsystem=cygwin in your profile.
See https://github.com/conan-io/conan/blob/201480146740d2ab298b9f360037ab9e56c2a6a5/conans/client/migrations_settings.py#L16

In the past, I noticed zilb has also problems when building in msys2.
I'll look into that, and ping you when I need more information.

All 4 comments

The problem won't be solved by this,
but you should also set os.subsystem=cygwin in your profile.
See https://github.com/conan-io/conan/blob/201480146740d2ab298b9f360037ab9e56c2a6a5/conans/client/migrations_settings.py#L16

In the past, I noticed zilb has also problems when building in msys2.
I'll look into that, and ping you when I need more information.

@madebr With #3200 it builds without errors. Thank you!

Thanks for verifying!

Was this page helpful?
0 / 5 - 0 ratings