-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[pkg-config] new port #17487
[pkg-config] new port #17487
Conversation
I wonder how if this port might interact with |
vcpkg_find_aquire_program does not look into the installed tree by default and thus there is no interaction. Since pkg-config is just used to discover libs/flags via standarized pc files the output should always be the same unless there is a bug. For system deps pkg-config probably uses the default behavior or relies on env variables. |
Well, ports shouldn't depend on discovered pc files files anyway, so differences in discovered .pc file should not occur when dependencies are controlled properly. TBH I'm surprised that the port is so straigtforward. Does this apply to using this port, too?
Was this tested in some real project? Maybe it only needs some README how to use it correctly, unless it is really just a plain port dependency. |
@dg0yt The real challenge is to bootstrap glib without pkg-config after #13100 is merged. Meson does not make it that simple.
You need to setup
No but there is no magic here. It is just the pkg-config executable build using vcpkg. In the future vcpkg might want to fallback to this as a host-port after script stabilization. Then the real challenge lies in bootstrapping the port and its dependencies without using pkg-config. @ras0219-msft @strega-nil: If you intend to merge this one please run a CI test run where this is installed first. Otherwise CMake might pick up a lot of optional dependencies in ports which can suddenly be found due to |
vote up |
I think pkg-config must be built for the host because it needs to run on the host. And then you will also have to set |
Should we replace uses of |
requires building of glib without pkg-config. Can be done, but is a bit more complicated. |
OK, then 99% sure this is OK but want to ask a few folks to confirm |
Would it be easier when building |
Agreed, I think this is the appropriate approach here.
Unfortunately, it's not quite as clean as that. Most users build targeting their host machines and there are some things that we need to get from there (C library, drivers, core OS components). Users that want to opt-in to 100% host isolation can |
I think we could bootstrap glib with |
Since pkgconf seems like a strictly better pkg-config, is there a reason to merge both of these tools? Noting that we would really like to switch to using host ports instead of msys for pkg-config. |
Any real proof for that instead of people just saying it? |
@Neumann-A I mean if you have opinions to the contrary, I'd love to hear them; I think we still need msys2 for autoconf on windows, so I'd like to avoid it, and I'd also like for us to standardize upon exactly one pkg-config solution. |
There are lots of ports that need only pkgconfig though. |
Why we can't have both and let the user decide what to install with vcpkg? |
MSYS2 switch to pkgconf in November 2020, msys2/MINGW-packages#7263
Somewhat OT for this PR, but how many ports do really need to run autoconf when using official tarballs? |
@Neumann-A @dg0yt Can you vote here? |
I think it's good, but I should wait for the consent of other members. |
I understand now: pkg-config requires a bunch of msys things anyway so that wouldn't actually fix anything. If we want a better non-msys provider for this, it seems like it would be better to use the existing port If we don't intend to replace the |
AFAIU |
all |
The major issues at the moment are:
And the second point (or generally finding tools) is hard to fix without knowing host installation path. |
I have tried to add pkgconfig to the vcpkg toolchain but failed: the path to find the pc file is not recognized. |
Did you also set the search path variables, as done e.g. in |
I wish to automatically use the pkgconfig installed by vcpkg and add lib/pkgconfig / debug/lib/pkgconfig to the search path.
Both them are failed. |
Okay. I will try again. We will find a way to share the WIP and review. In any case, we need to provide the host install path to cmake user projects, for the benefit of all types of host tool dependencies. I would like to hear opinions before jumping into implementations. |
@dg0yt After that, I can make a new feature to vcpkg to automaticly print the pkgconfig usage like cmake. |
cmake 3.22 will support |
the following ports alreday use FindPkgConfig:
|
Fun fact: The Perl installation added by vcpkg on Windows comes with a perl-only implementation of |
Will continue review this PR untill cmake update to 3.22 or later. |
Note that there are some good reasons to avoid updating the cmake version; going forward, that breaks Alpine: #21218 |
Depends on #21456. |
[offtopic] |
pkgconfig is gradually becoming a way to use packages provided by cmake, so we should provide these methods like cmake. |
Please don't. There is no benefit over using |
@JackBoosY This PR really never dependent on the cmake update to 3.22. the pkgconf PR did which is why the CMake update was an issues. |
revived from an old PR since host tools are now a thing