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

'CZlib' libz.pc: warning: couldn't find pc file #41

Open
helenmasters opened this issue Jul 17, 2019 · 5 comments
Open

'CZlib' libz.pc: warning: couldn't find pc file #41

helenmasters opened this issue Jul 17, 2019 · 5 comments

Comments

@helenmasters
Copy link
Contributor

helenmasters commented Jul 17, 2019

Having run kitura init to generate a basic Swift application when I recompile it to use Kitura-NIO by setting export KITURA_NIO=1 I then get a warning from CZlib as follows:
....
Resolving https://github.com/apple/swift-nio-ssl.git at 2.1.1
'CZlib' libz.pc: warning: couldn't find pc file
[456/456] Linking ./.build/x86_64-apple-macosx/debug/MyKituraApp

The application runs ok but I don't like the warning as I now wonder what didn't work.

I'm running on: macOS Mojave v10.14.5

@weissi
Copy link

weissi commented Jul 17, 2019

If you want to fix the warning (which you don't have to), you can do brew install pkg-config. The warning is just fine though, zlib is part of the macOS SDK and Swift will be able to find it.

@ianpartridge
Copy link
Contributor

Seems odd that SPM generates warnings that can only be fixed by using Homebrew?

@weissi
Copy link

weissi commented Jul 17, 2019

Seems odd that SPM generates warnings that can only be fixed by using Homebrew?

Well, the Kitura-WebSocket-NIO Package.swift file says that it needs zlib and that zlib is contained in the libz pkg-config file. By default however, macOS doesn't ship any .pc files or pkg-config and therefore SwiftPM complains that it can't consider the libz.pc file for additional include/lib directories etc. For zlib that's not an issue because it's on the usual system include/lib paths so it works without a .pc file.

I guess the message is there that in case it requires some more esoteric package it would give you a hint on what you could do to fix the errors if you get any compilation/linker errors further down the line. SwiftPM will just attempt to build without the .pc file because the required headers/libs might just be installed on the system's defaults paths.

If you really want to remove this warning, I think you can also just drop the libz package config requirement, pretty much every UNIX under the sun will have that installed in the default dirs anyway, right? SwiftPM however can't assume that it's definitely there so it warns you that it couldn't confirm where zlib is installed...

@ianpartridge
Copy link
Contributor

Perhaps SPM shouldn't print this warning on macOS, unless it's also willing to advise people to install Homebrew (which I guess wouldn't be deemed OK).

@weissi
Copy link

weissi commented Jul 17, 2019

I'm not actually sure if SwiftPM actually shells out to pkg-config, I thought it parses the .pc files itself (might be wrong). So you can technically also just put the .pc files in place...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants