-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[vcpkg] Don't override pkg-config prefix #17205
Conversation
First round of breaking ports: x64-windows-static, x86-windows, x64-windows
x64-linux
x64-osx
I will investigae step by step in my personal pipeline. |
looks like a hidden dependency somewhere
requires additional brew package. See #17073 (comment)
Strange since freetype installs pc files. |
Indeed. A local vcpkg install fontconfig on Ubuntu 18.04 worked as expected, picking the vcpkg freetype via pkgconfig. |
Maybe
(On Azure pipelines Ubuntu 18.04, vcpkg proposed to |
Comparing PKG_CONFIG_PATH in fontconfig config.log and in plain MSYS2 MinGW64 shell, I came to the conclusion that even on Windows, this should use |
|
On the download errors: |
I have to take this back. Pkg-config documentation and source code say that
For the record, So I need to go one step back and find the actual cause for the fontconfig issue. |
@@ -721,7 +741,6 @@ function(vcpkg_configure_make) | |||
set(_LINK_CONFIG_BACKUP "$ENV{_LINK_}") | |||
set(ENV{_LINK_} "${LINK_ENV_${_VAR_SUFFIX}}") | |||
endif() | |||
set(ENV{PKG_CONFIG} "${PKGCONFIG} --define-variable=prefix=${_VCPKG_INSTALLED}${PATH_SUFFIX_${_buildtype}}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, this was setting an environment variable. With this removed, pkg-config is taken from PATH
, and this may lead to the MSYS version which doesn't understand the Windows path separator :
.
Build errors unrelated to PR.
|
Please re-run. No longer blocked by libidn2/libtasn1. |
New build, new mix of build failures....
|
x64-osx:libmicrohttpd
and similar. The configuration of libmicrohttpd tests for dependencies, but the port doesn't declare any dependencies.
On macOS, it could pick up files provided either from brew or from a port if it is installed. The mixing of brew and overridden prefix creates volatile configurations. Changed debug build configuration: Failed build (debug):
Original build (debug):
Changed release build configuration: Failed build (release):
Build (release) before this change:
The transition from |
Collection of ports that are known to have pc files which contain an invalid prefix (not yet passed through
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@dg0yt I would like to understand what this difference means; or more accurately, what the original thing was trying to fix. Is there a reason it was done this way, and why does it no longer have to be done that way? |
@strega-nil-ms: Just merge it. the define-prefix was necessary because there was a time when |
@strega-nil-ms You cannot really ask me what the original thing was trying to fix because I didn't add it. This PR is my way of asking that question to the vcpkg maintainers, in the light of the side effects it causes. So I can give a summary of what I took out of the feedback and from additional digging in the repository history:
|
Ah, okay, thanks y'all! |
Describe the pull request
What does your PR fix?
This PR fixes breaking builds when pkg-config picks up .pc files from system directories: Overriding the prefix will invalidate include and lib paths.
Example case: gdal, picking up system OpenEXR in Azure Pipelines' Ubuntu image.
Which triplets are supported/not supported? Have you updated the CI baseline?
-/-
Does your PR follow the maintainer guide?
-/-
.pc file from vcpkg ports should be safe when properly using
$(pcfiledir)
andvcpkg_fixup_pkgconfig
.Related discussion: #10402 (comment)