conan-center-index: [package] zlib/1.2.11: Build error on Windows 10 using clang-cl
Package and Environment Details (include every applicable attribute)
- Package Name/Version: zlib/1.2.11
- Operating System+version: Windows 10
- Compiler+version: clang-cl 10.0
- Docker image:
- Conan version: conan 1.32.1
- Python version: Python 3.7.5
Conan profile (output of conan profile show default
or conan profile show <profile>
if custom profile is in use)
Configuration for profile default:
[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=16
build_type=Release
[options]
[build_requires]
[env]
Steps to reproduce (Include if Applicable)
conan install zlib/1.2.11@/ -e CONAN_CMAKE_GENERATOR=Ninja -e CXX=clang-cl -e CC=clang-cl -s compiler=clang -s compiler.version=10 -s build_type=Debug --build zlib
Please note:
The command works perfectly with Release build_type.
The bug is at line 142 of zlib conanfile.py: the script attempts to rename ‘C:\.conan\cc74c4245ace\1\lib\zlibstatic.lib’ but the library is named with the debug suffix ‘d’ (same as for MSVC compiler).
I think the fix should be identical to line 135: I’ve applied that on my machine and it is working as expected.
Logs (Include/Attach if Applicable)
Click to expand log
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=clang
compiler.version=10
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
CC=clang-cl
CONAN_CMAKE_GENERATOR=Ninja
CXX=clang-cl
zlib/1.2.11: Forced build from source
Installing package: zlib/1.2.11
Requirements
zlib/1.2.11 from 'conan-center' - Cache
Packages
zlib/1.2.11:38db1396108875c94ba870e5a30c6c7c1e2a4677 - Build
Installing (downloading, building) binaries...
zlib/1.2.11: Copying sources to build folder
zlib/1.2.11: Building your package in C:\.conan\3b522013fac65\1
zlib/1.2.11: Generator cmake created conanbuildinfo.cmake
zlib/1.2.11: Calling build()
zlib/1.2.11: Found Visual Studio 16
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.4.1
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
-- The C compiler identification is Clang 10.0.0 with MSVC-like command-line
-- The CXX compiler identification is Clang 10.0.0 with MSVC-like command-line
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang-cl.exe
-- Check for working C compiler: C:/Program Files/LLVM/bin/clang-cl.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: C:/Program Files/LLVM/bin/clang-cl.exe
-- Check for working CXX compiler: C:/Program Files/LLVM/bin/clang-cl.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 Clang>=8, checking major version 10
-- Conan: Checking correct version: 10
-- 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 - failed
-- Looking for fseeko
-- Looking for fseeko - not found
-- Looking for unistd.h
-- Looking for unistd.h - not found
-- Renaming
-- C:/.conan/3b522013fac65/1/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: C:/.conan/3b522013fac65/1/source_subfolder/_build
zlib/1.2.11: Found Visual Studio 16
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.4.1
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'
"[16/16 0.541] "Linking C static library lib\zlibstaticd.lib
zlib/1.2.11: Package '38db1396108875c94ba870e5a30c6c7c1e2a4677' built
zlib/1.2.11: Build folder C:\.conan\3b522013fac65\1
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 C:\.conan\cc74c4245ace\1
zlib/1.2.11: Calling package()
ERROR: zlib/1.2.11: Error in package() method, line 171
self._rename_libraries()
while calling '_rename_libraries', line 143
os.rename(current_lib, os.path.join(lib_path, "zlib.lib"))
FileNotFoundError: [WinError 2] The system cannot find the file specified: 'C:\\.conan\\cc74c4245ace\\1\\lib\\zlibstatic.lib' -> 'C:\\.conan\\cc74c4245ace\\1\\lib\\zlib.lib'
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (19 by maintainers)
cut copy paste from https://github.com/conan-io/conan-center-index/issues/4028#issuecomment-752743624 [settings] arch=x86_64 arch_build=x86_64 build_type=Debug compiler=Visual Studio compiler.toolset=ClangCL compiler.runtime=MDd compiler.version=16 os=Windows os_build=Windows [options] [build_requires] [env]
Found https://github.com/conan-io/conan/issues/5896, should be fixed in Conan 1.33
Maybe you can use this workaround until then https://github.com/conan-io/conan/issues/5896#issuecomment-746360528