question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[libpng] libpng/1.6.38: Regression (does not build anymore on Clang for Windows)

See original GitHub issue

Description

libpng/1.6.37 was building fine with our Clang/Windows Conan profile. 1.6.38 does not build anymore, with an error during _patch_source().

ERROR: libpng/1.6.38: Error in build() method, line 166
        self._patch_source()
while calling '_patch_source', line 108
        replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"),
        ConanException: replace_in_file didn't find pattern 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $<TARGET_LINKER_FILE_NAME:${S_TARGET}> $<TARGET_LINKER_FILE_DIR:${S_TARGET}>/${DEST_FILE}' in 'C:\Users\adn\.conan\data\libpng\1.6.38\_\_\build\1c035d0350b06e767d064f73457b0db056f51647\src\CMakeLists.txt' file.

Package and Environment Details

  • Package Name/Version: libpng/1.6.38
  • Operating System+version: Windows 10
  • Compiler+version: Clang 15 (scoop install llvm)
  • Conan version: conan 1.53.0

Conan profile

[settings] arch=x86_64 arch_build=x86_64 build_type=Debug compiler=clang compiler.cppstd=20 compiler.version=15 os=Windows os_build=Windows [options] [build_requires] *: cmake/3.24.1 [env] CONAN_CMAKE_GENERATOR=Unix Makefiles [conf] tools.cmake.cmaketoolchain:generator=Unix Makefiles

Steps to reproduce

conan install -pr:h clang15-win-dev libpng/1.6.38@ --build=libpng

Logs

Click to expand log
libpng/1.6.38: Applying build-requirement: cmake/3.24.1
libpng/1.6.38: WARN: Build folder is dirty, removing it: C:\Users\adn\.conan\data\libpng\1.6.38\_\_\build\1c035d0350b06e767d064f73457b0db056f51647
libpng/1.6.38: Copying sources to build folder
libpng/1.6.38: Building your package in C:\Users\adn\.conan\data\libpng\1.6.38\_\_\build\1c035d0350b06e767d064f73457b0db056f51647
libpng/1.6.38: Generator txt created conanbuildinfo.txt
libpng/1.6.38: Calling generate()
libpng/1.6.38: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
libpng/1.6.38: Preset 'debug' added to CMakePresets.json. Invoke it manually using 'cmake --preset debug'
libpng/1.6.38: If your CMake version is not compatible with CMakePresets (<3.19) call cmake like: 'cmake <path> -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=C:\Users\adn\.conan\data\libpng\1.6.38\_\_\build\1c035d0350b06e767d064f73457b0db056f51647\build\generators\conan_toolchain.cmake -DCMAKE_MACOSX_BUNDLE=OFF -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=Debug'
libpng/1.6.38: WARN: Using the new toolchains and generators without specifying a build profile (e.g: -pr:b=default) is discouraged and might cause failures and unexpected behavior
libpng/1.6.38: Aggregating env generators
libpng/1.6.38: Calling build()
libpng/1.6.38: apply_conandata_patches(): No patches defined in conandata
libpng/1.6.38:
libpng/1.6.38: ERROR: Package '1c035d0350b06e767d064f73457b0db056f51647' build failed
libpng/1.6.38: WARN: Build folder C:\Users\adn\.conan\data\libpng\1.6.38\_\_\build\1c035d0350b06e767d064f73457b0db056f51647\build\Debug
ERROR: libpng/1.6.38: Error in build() method, line 166
        self._patch_source()
while calling '_patch_source', line 108
        replace_in_file(self, os.path.join(self.source_folder, "CMakeLists.txt"),
        ConanException: replace_in_file didn't find pattern 'COMMAND "${CMAKE_COMMAND}" -E copy_if_different $<TARGET_LINKER_FILE_NAME:${S_TARGET}> $<TARGET_LINKER_FILE_DIR:${S_TARGET}>/${DEST_FILE}' in 'C:\Users\adn\.conan\data\libpng\1.6.38\_\_\build\1c035d0350b06e767d064f73457b0db056f51647\src\CMakeLists.txt' file.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
ericLemanissiercommented, Nov 10, 2022

Ok, I pushed another fix (hopefully the last one). Can you please retry ?

0reactions
Adnncommented, Nov 10, 2022

Great: it now works in my environment!

Thank you @ericLemanissier.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why isn't Clang Compiler for Windows availiable anymore?
What I want to know is where I can get the Clang Compiler for Windows and why it doesn't show up anymore. Screenshots...
Read more >
Scan-build on Windows - Clang Frontend - LLVM Discourse
I've tried to check GitHub - glennrp/libpng: LIBPNG: Portable Network Graphics support, official libpng repository with scan-build like ...
Read more >
Error in installing libpng for windows x64 - Stack Overflow
I installed libpng successfully following the steps from that answer just now.I don't think you installed it correctly because I once saw ...
Read more >
Release Notes | Clang Power Tools
If you don't have LLVM installed manually, the process of auto-install fails ... LLVM version is installed; Fixed regression on Windows 8 /...
Read more >
Visual Studio 16.7 Preview 3 regression for clang-tidy code ...
I upgraded from VS 16.7 from Preview 2, no errors or issues. Build worked OK. However if I try switch on cland code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found