pkgconf is hard to build on windows #118

Closed
opened 2017-06-04 23:09:51 +00:00 by dankegel · 7 comments
dankegel commented 2017-06-04 23:09:51 +00:00 (Migrated from github.com)

pkgconf is easy to build on windows if you want to use cygwin, msys, or the like...
but hard to build on mostly 'bare' windows. In my case, I have cygwin available
for running scripts, but use native tools to build all C/C++ binaries.
For me, it would be nice if there were an easy way to build pkgconf with native Windows tools
(where native includes nice things like cmake and ninja).

So, https://github.com/dankegel/pkgconf/tree/cmakeify is a draft WIP to add a cmake port. I'll speak up when it's ready to consider merging.

pkgconf is easy to build on windows if you want to use cygwin, msys, or the like... but hard to build on mostly 'bare' windows. In my case, I have cygwin available for running scripts, but use native tools to build all C/C++ binaries. For me, it would be nice if there were an easy way to build pkgconf with native Windows tools (where native includes nice things like cmake and ninja). So, https://github.com/dankegel/pkgconf/tree/cmakeify is a draft WIP to add a cmake port. I'll speak up when it's ready to consider merging.
dankegel commented 2017-06-06 04:05:12 +00:00 (Migrated from github.com)

OK, it's passing all tests on Linux, and all but four tests on Windows; it's pretty slow on
Windows, too.

libs_circular[12] fail strangely, getting the order wrong; I don't understand the code there.

simple jams a path in the output; I don't understand the code there.

virtual_variable is broken because get_default_pkgconfig_path() does some
monkey business.

I also haven't verified that it has ; rather than : in directory lists on windows everywhere it should.

Here's the output at the moment:

$ kyua report
===> Failed tests
tests/basic:libs_circular1  ->  failed: atf-check failed; see the output of the test for details  [3.740s]
tests/basic:libs_circular2  ->  failed: atf-check failed; see the output of the test for details  [5.637s]
tests/provides:simple  ->  failed: atf-check failed; see the output of the test for details  [0.318s]
tests/regress:virtual_variable  ->  failed: atf-check failed; see the output of the test for details  [0.456s]
===> Summary
Results read from /home/buildbot/.kyua/store/results.home_buildbot_xsrc_pkgconf_btmp.20170606-035600-154583.db
Test cases: 104 total, 0 skipped, 0 expected failures, 0 broken, 4 failed
Total time: 56.499s

$ tests/basic libs_circular1
Executing command [ pkgconf --libs circular-1 ]
Fail: stdout does not match expected value
--- /tmp/atf-check.fIb8mR	2017-06-05 20:59:25.480243700 -0700
+++ /tmp/check.7u3M7Q/stdout	2017-06-05 20:59:25.464611800 -0700
@@ -1 +1 @@
--lcircular-1 -lcircular-2 -lcircular-3 
+-lcircular-2 -lcircular-3 -lcircular-1 

$ tests/basic libs_circular2
Executing command [ pkgconf --libs circular-3 ]
Fail: stdout does not match expected value
--- /tmp/atf-check.QYukax	2017-06-05 20:59:33.511505800 -0700
+++ /tmp/check.z7MeKz/stdout	2017-06-05 20:59:33.495889700 -0700
@@ -1 +1 @@
--lcircular-3 -lcircular-1 -lcircular-2 
+-lcircular-1 -lcircular-2 -lcircular-3 

$ tests/provides simple
Executing command [ pkgconf --print-provides provides ]
Fail: stdout does not match expected value
--- /tmp/atf-check.RWVagI	2017-06-05 20:59:38.792764700 -0700
+++ /tmp/check.GUZhSa/stdout	2017-06-05 20:59:38.792764700 -0700
@@ -4,4 +4,4 @@
 provides-test-quux < 1.2.0
 provides-test-moo <= 1.2.0
 provides-test-meow != 1.3.0
-provides = 1.2.3
+C:/cygwin64/home/buildbot/xsrc/pkgconf/tests/lib1/provides = 1.2.3

$ tests/regress virtual_variable
Executing command [ pkgconf --variable=pc_path pkg-config ]
Fail: stdout does not match expected value
--- /tmp/atf-check.gNCdp0	2017-06-05 20:59:49.527165800 -0700
+++ /tmp/check.UGpBER/stdout	2017-06-05 20:59:49.527165800 -0700
@@ -1 +1 @@
-C:/Program Files (x86)/pkgconf/lib/pkgconfig:C:/Program Files (x86)/pkgconf/share/pkgconfig
+../lib/pkgconfig;../share/pkgconfig
OK, it's passing all tests on Linux, and all but four tests on Windows; it's pretty slow on Windows, too. libs_circular[12] fail strangely, getting the order wrong; I don't understand the code there. simple jams a path in the output; I don't understand the code there. virtual_variable is broken because get_default_pkgconfig_path() does some monkey business. I also haven't verified that it has ; rather than : in directory lists on windows everywhere it should. Here's the output at the moment: ``` $ kyua report ===> Failed tests tests/basic:libs_circular1 -> failed: atf-check failed; see the output of the test for details [3.740s] tests/basic:libs_circular2 -> failed: atf-check failed; see the output of the test for details [5.637s] tests/provides:simple -> failed: atf-check failed; see the output of the test for details [0.318s] tests/regress:virtual_variable -> failed: atf-check failed; see the output of the test for details [0.456s] ===> Summary Results read from /home/buildbot/.kyua/store/results.home_buildbot_xsrc_pkgconf_btmp.20170606-035600-154583.db Test cases: 104 total, 0 skipped, 0 expected failures, 0 broken, 4 failed Total time: 56.499s $ tests/basic libs_circular1 Executing command [ pkgconf --libs circular-1 ] Fail: stdout does not match expected value --- /tmp/atf-check.fIb8mR 2017-06-05 20:59:25.480243700 -0700 +++ /tmp/check.7u3M7Q/stdout 2017-06-05 20:59:25.464611800 -0700 @@ -1 +1 @@ --lcircular-1 -lcircular-2 -lcircular-3 +-lcircular-2 -lcircular-3 -lcircular-1 $ tests/basic libs_circular2 Executing command [ pkgconf --libs circular-3 ] Fail: stdout does not match expected value --- /tmp/atf-check.QYukax 2017-06-05 20:59:33.511505800 -0700 +++ /tmp/check.z7MeKz/stdout 2017-06-05 20:59:33.495889700 -0700 @@ -1 +1 @@ --lcircular-3 -lcircular-1 -lcircular-2 +-lcircular-1 -lcircular-2 -lcircular-3 $ tests/provides simple Executing command [ pkgconf --print-provides provides ] Fail: stdout does not match expected value --- /tmp/atf-check.RWVagI 2017-06-05 20:59:38.792764700 -0700 +++ /tmp/check.GUZhSa/stdout 2017-06-05 20:59:38.792764700 -0700 @@ -4,4 +4,4 @@ provides-test-quux < 1.2.0 provides-test-moo <= 1.2.0 provides-test-meow != 1.3.0 -provides = 1.2.3 +C:/cygwin64/home/buildbot/xsrc/pkgconf/tests/lib1/provides = 1.2.3 $ tests/regress virtual_variable Executing command [ pkgconf --variable=pc_path pkg-config ] Fail: stdout does not match expected value --- /tmp/atf-check.gNCdp0 2017-06-05 20:59:49.527165800 -0700 +++ /tmp/check.UGpBER/stdout 2017-06-05 20:59:49.527165800 -0700 @@ -1 +1 @@ -C:/Program Files (x86)/pkgconf/lib/pkgconfig:C:/Program Files (x86)/pkgconf/share/pkgconfig +../lib/pkgconfig;../share/pkgconfig ```

Sorry, for some reason Github is not sending me notifications on pkgconf right now.

I agree, I think bringing pkgconf to Windows is the next step.

Hmm, those test failures are likely just due to differences in the order the windows build loads files. Those tests are kind of fragile and really I just use them as smoketesting to see if there is a regression in how the solver orders packages in it's solution. I pushed a fix for the provides/simple test. virtual_variable test likely needs to be skipped on Windows.

It would probably be nice to include an "official" CMake macro for querying pkgconf alongside the CMake files, we should install it on the autotools side too.

I think we would want to keep the autotools build system for now for non-Windows, though.

Sorry, for some reason Github is not sending me notifications on pkgconf right now. I agree, I think bringing pkgconf to Windows is the next step. Hmm, those test failures are likely just due to differences in the order the windows build loads files. Those tests are kind of fragile and really I just use them as smoketesting to see if there is a regression in how the solver orders packages in it's solution. I pushed a fix for the provides/simple test. virtual_variable test likely needs to be skipped on Windows. It would probably be nice to include an "official" CMake macro for querying pkgconf alongside the CMake files, we should install it on the autotools side too. I think we would want to keep the autotools build system for now for non-Windows, though.

The Makefile.am needs to contain the CMake files in EXTRA_DIST, so they are included in the release tarballs. I use make distcheck to handle this.

The Makefile.am needs to contain the CMake files in EXTRA_DIST, so they are included in the release tarballs. I use `make distcheck` to handle this.

Overall it looks OK, but as previously mentioned, we likely want to retain the autotools build system. Once the minor concerns I mentioned on your commits (check github notifications maybe they work for you :)) are addressed, I'll merge it.

Overall it looks OK, but as previously mentioned, we likely want to retain the autotools build system. Once the minor concerns I mentioned on your commits (check github notifications maybe they work for you :)) are addressed, I'll merge it.

actually, thinking on it more, we definitely need to retain the autotools build system, as most distributions aren't going to want to make CMake a bootstrap component.

actually, thinking on it more, we definitely need to retain the autotools build system, as most distributions aren't going to want to make CMake a bootstrap component.

I merged the WIP branch and am going to clean it up a little.
I think that we should add support for --msvc-syntax using a fragment translation method.

I merged the WIP branch and am going to clean it up a little. I think that we should add support for `--msvc-syntax` using a fragment translation method.

I guess we will use Meson instead, as that seems more popular on the UNIX side, and will allow us to have one build system that everyone is (un)happy with.

I guess we will use Meson instead, as that seems more popular on the UNIX side, and will allow us to have one build system that everyone is (un)happy with.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ariadne/pkgconf#118
There is no content yet.