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

[zlib] zlib/1.2.11: Build failed with apple clang 12 #2986

Closed
nikhiljain217 opened this issue Sep 22, 2020 · 10 comments
Closed

[zlib] zlib/1.2.11: Build failed with apple clang 12 #2986

nikhiljain217 opened this issue Sep 22, 2020 · 10 comments
Labels
bug Something isn't working

Comments

@nikhiljain217
Copy link

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: zlib/1.2.8
  • Operating System+version: MacOS 10.15.4
  • Compiler+version: Apple clang 12.0.0
  • Conan version: conan 1.29.2
  • Python version: Python 3.7.7

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

Put your profile output here

Configuration for profile default:

[settings]
os=Macos
os_build=Macos
arch=x86_64
arch_build=x86_64
compiler=apple-clang
compiler.version=12.0
compiler.libcxx=libc++
build_type=Release
[options]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

Try to build zlib 1.2.11 version with apple clang 12 (Xcode 12)

Logs (Include/Attach if Applicable)

Same issue as reported here: madler/zlib#509

Put your log output here

madler/zlib#509

@nikhiljain217 nikhiljain217 added the bug Something isn't working label Sep 22, 2020
@SpaceIm
Copy link
Contributor

SpaceIm commented Sep 23, 2020

Which revision of zlib recipe? Seems that this issue should have been fixed by #2403

conan install -u zlib/1.2.11@ -b outdated

@madebr
Copy link
Contributor

madebr commented Sep 23, 2020

@nikhiljain217
You might have closed madler/zlib#509 too soon as its CMakeLists.txt is incorrect.
It requires the same include checks, as the autotools script does.

@KaoCC
Copy link
Contributor

KaoCC commented Sep 23, 2020

I'm running into the exact same problem ...
This is one of the dependencies I'm trying to build:
zlib/1.2.11@conan/stable

@madebr
Copy link
Contributor

madebr commented Sep 23, 2020

@KaoCC @nikhiljain217
Can you try adding applying the following patch?

--- a/recipes/zlib/1.2.11/conanfile.py
+++ b/recipes/zlib/1.2.11/conanfile.py
@@ -88,6 +88,8 @@
         for patch in self.conan_data["patches"][self.version]:
             tools.patch(**patch)
 
+        os.unlink(os.path.join(self._source_subfolder, "zconf.h"))
+
         with tools.chdir(self._source_subfolder):
             # https://github.com/madler/zlib/issues/268
             tools.replace_in_file('gzguts.h',
@@ -96,7 +98,7 @@
 
             is_apple_clang12 = self.settings.compiler == "apple-clang" and tools.Version(self.settings.compiler.version) >= "12.0"
             if not is_apple_clang12:
-                for filename in ['zconf.h', 'zconf.h.cmakein', 'zconf.h.in']:
+                for filename in ['zconf.h.cmakein', 'zconf.h.in']:
                     tools.replace_in_file(filename,
                                           '#ifdef HAVE_UNISTD_H    '
                                           '/* may be set to #if 1 by ./configure */',
--- a/recipes/zlib/1.2.8/conanfile.py
+++ b/recipes/zlib/1.2.8/conanfile.py
@@ -46,6 +46,7 @@
             os.chmod(configure_file, st.st_mode | stat.S_IEXEC)
 
     def build(self):
+        os.unlink(os.path.join(self._source_subfolder, "zconf.h"))
         if self.settings.os != "Windows":
             with tools.chdir(self._source_subfolder):
                 env_build = AutoToolsBuildEnvironment(self)

@nikhiljain217
Copy link
Author

nikhiljain217 commented Sep 23, 2020

Which revision of zlib recipe? Seems that this issue should have been fixed by #2403

conan install -u zlib/1.2.11@ -b outdated

I have created a conanfile to install the dependency. I am adding this "zlib/1.2.11@conan/stable" to the self.requires. I did not realize that "zlib/1.2.11@conan/stable" is not cci recipe. Changing the recipe to use "zlib/1.2.11" worked. If it works for other people here. You can close this issue.

@Croydon
Copy link
Contributor

Croydon commented Sep 24, 2020

@username/channel is optional for a while now.

All packages in the Conan Center Index don't have a @username/channel anymore. Packages with a @username/channel do come from places like conan-community (@conan)) and Bincrafters (@bincrafters)) .

If packages are both in Conan Center Index AND in conan-community or Bincrafters, only the recipe in Conan Center Index is still maintained, so you should migrate to those recipes.

Short version: Use zlib/1.2.11 instead of zlib/1.2.11@conan/stable

@madebr
Copy link
Contributor

madebr commented Sep 24, 2020

@KaoCC
Is the problem still present from you?
#2986 (comment) says it is fixed.
If it is not for you, are you sure you're using the latest zlib version?
If it is still not working after that, can you try #2986 (comment)?

@KaoCC
Copy link
Contributor

KaoCC commented Sep 24, 2020

@madebr I will try again now. The thing is that I was not building zlib directly, but restinio/0.6.10 which transitively depends on zlib in one of its dependencies.

@KaoCC
Copy link
Contributor

KaoCC commented Sep 24, 2020

@madebr Hi, I changed in the [requires] the depended boost library from 1.70 to 1.73, which seemingly depends on zlib/1.2.11 (the cci version according to what is said on top) , and now it can be built correctly.

@madebr
Copy link
Contributor

madebr commented Sep 25, 2020

@KaoCC
Thanks for checking!

@nikhiljain217
You can close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants