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

BugFix: Allow usage of clang+mingw with zlib #18283

Closed
wants to merge 4 commits into from

Conversation

seppeon
Copy link
Contributor

@seppeon seppeon commented Jul 2, 2023

Specify library name and version: lib/1.0

Without this change the following occurs:

libpng/1.6.39: RUN: cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="C:/Users/David/.conan2/p/b/libpn0015fee6450cb/b/build/Release/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/David/.conan2/p/b/libpn0015fee6450cb/p" -DCMAKE_MACOSX_BUNDLE="OFF" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "C:\Users\David\.conan2\p\b\libpn0015fee6450cb\b\src"

-- Using Conan toolchain: C:/Users/David/.conan2/p/b/libpn0015fee6450cb/b/build/Release/generators/conan_toolchain.cmake
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- The C compiler identification is Clang 16.0.5
-- The ASM compiler identification is Clang with GNU-like command-line
-- Found assembler: C:/utils/msys64/mingw64/bin/clang.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/utils/msys64/mingw64/bin/clang.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Conan: Target declared 'ZLIB::ZLIB'
CMake Error at C:/Users/David/.conan2/p/b/libpn0015fee6450cb/b/build/Release/generators/cmakedeps_macros.cmake:64 (message):
  Library 'zlib' not found in package.  If 'zlib' is a system library,
  declare it with 'cpp_info.system_libs' property
Call Stack (most recent call first):
  C:/Users/David/.conan2/p/b/libpn0015fee6450cb/b/build/Release/generators/ZLIB-Target-release.cmake:24 (conan_package_library_targets)
  C:/Users/David/.conan2/p/b/libpn0015fee6450cb/b/build/Release/generators/ZLIBTargets.cmake:26 (include)
  C:/Users/David/.conan2/p/b/libpn0015fee6450cb/b/build/Release/generators/ZLIBConfig.cmake:16 (include)
  CMakeLists.txt:51 (find_package)

This occurs because in zlib, you have a detection of mingw which was not correct. It didn't identify mingw when it is used with clang. I've added a fix for this.

@CLAassistant
Copy link

CLAassistant commented Jul 2, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 2, 2023

🤖 Beep Boop! This pull request is making changes to 'recipes/zlib//'.

👋 @Hopobcn you might be interested. 😉

@conan-center-bot

This comment has been minimized.

@ghost
Copy link

ghost commented Jul 2, 2023

I detected other pull requests that are modifying zlib/all recipe:

This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there.

@conan-center-bot

This comment has been minimized.

@seppeon
Copy link
Contributor Author

seppeon commented Jul 2, 2023

other pull requests that are modifying zlib/all recipe

That was marked as stale before being seen to completion. It also doesn't address cygwin.

@conan-center-bot

This comment has been minimized.

@@ -29,7 +29,11 @@ class ZlibConan(ConanFile):

@property
def _is_mingw(self):
return self.settings.os == "Windows" and self.settings.compiler == "gcc"
is_windows = self.settings.get_safe("os") == "Windows"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like a lot of "work" that will result in false in probably most cases (I don't have numbers but I assume mingw has quite a bit lower market share compared to gcc and msvc"
I guess it would still be better to get the short circuit behaviour compared to the old code where it returns false as soon as some condition is reached that makes it false.
I see later it is used for "if windows then _is_mingw()" but still thinks that it can do a lot lees most of the time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This a copy of conan-io/conan#12678 which still hasn't been merged. If you have any issues with it I recommend posting them there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I alright to resolve this?

Copy link
Contributor

@CJCombrink CJCombrink Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seppeon I still think this is overly complex for a simple check. I would still recommend considering early return (see my comment here)
I am also not a deciding voice so you can resolve if you don't intend to change 👍

@conan-center-bot

This comment has been minimized.

1 similar comment
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 3 (681a83daf62b80e8c62cfa890a99c290cac34b57):

  • zlib/1.2.13@:
    All packages built successfully! (All logs)

  • zlib/1.2.12@:
    All packages built successfully! (All logs)

  • zlib/1.2.11@:
    All packages built successfully! (All logs)


Conan v2 pipeline ❌

Note: Conan v2 builds may be required once they are on the v2 ready list

The v2 pipeline failed. Please, review the errors and note this will be required for pull requests to be merged in the near future.

See details:

Sorry, the build is only launched for Access Request users. You can request access writing in this issue.

@stale
Copy link

stale bot commented Oct 15, 2023

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 15, 2023
@ghost ghost mentioned this pull request Jan 23, 2024
3 tasks
@ghost ghost mentioned this pull request Feb 22, 2024
3 tasks
Copy link
Contributor

This pull request has been automatically closed because it has not had recent activity. Thank you for your contributions.

@github-actions github-actions bot closed this Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants