-
Notifications
You must be signed in to change notification settings - Fork 161
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
Generate and install libgap.pc
for use with pkg-config
#5080
Conversation
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.
Thank you for working on this, much appreciated!
is there a good way to test this works as intended? Like a minimal invocation of the pkg-config tool we could put into a test script?
I'll see how to add a test with pkg-config. |
By the way, shouldn't |
it's also a bit strange that |
Not sure where the tests I added should be chained. Please advice. |
I guess we want to have it tested on CI. |
I don't grok |
One more discrepancy I noticed: in libgap tests code, includes don't have IMHO libgap tests should use |
no, it's actually a bug in makefile I introduced. I can't call |
OK, we're almost there. The test now fails as follows:
So the question is where to look for |
Hmm, no, libgmp-dev is installed all right, but on Ubuntu Bionic gmp.pc is not installed, cf https://packages.ubuntu.com/bionic/amd64/libgmp-dev/filelist (because it's quite old, it's GMP 6.1, not 6.2). Should we move to newer Ubuntu (Bionic will reach end of standard support in April 2023) ? |
I've updated PR #5026 now so that we could merge it (if e.g. @ChrisJefferson approves it), at which point the tests would be running in 20.04 or 22.04 (I forgot and didn't check but either has |
It should depend on all relevant targets, such as |
well, is it done, or something else needs to be done, still, here? |
CI is OK (except 32-bit one, which is due to broken system packages) |
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.
Thank you for working on this.
And my apologies, but yeah I still do have concerns... I can also try to take care of them myself later, but here are my remarks anyway
|
||
# test libgap's pkg-config's libgap flags fetching | ||
tst/testpkgconfigbuild: install | ||
$(eval PKG_REPORTED_CFLAGS := $(shell PKG_CONFIG_PATH=$(DESTDIR)$(libdir)/pkgconfig pkg-config --cflags libgap | cut -d' ' -f 1)/gap) |
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.
Why the cut
?
Ahh, I think it's to append /gap
to the first of include paths returned by--cflags
, right? But why to the first, and why is it OK to discard any other? Are there other?
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.
we need cut
, as pkg-config --cflags
adds a trailing space. For it's designed for convenience in the normal setups, not when you all of a sudden must add a nontrivial suffix for the include path. As I mentioned in a comment somewhere here, I'd rather have all the test code for libgap use headers with explicit gap/
prefix - then we'd need this weird hackery.
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.
I have to add gap/
here as libgap testing code uses #include <foo.h>
rather than #include <gap/foo.h>
.
@@ -13,6 +13,7 @@ | |||
/confdefs.h | |||
/conftest* | |||
/libtool | |||
/libgap.pc |
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.
BTW, why libgap.pc
and not gap.pc
? (I don't want to bikeshed, and I am fine with keeping it as-is! I am merely curious and wondering if there is a deeper rationale for these names that you are aware of. Looking at the pkgconfig
dir of one of my machines, I see gap.pc
, mpfr.pc
, zlib.pc
yet libcurl.pc
and libzmq.pc
-- so it seems pretty much random?
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.
To me, libgap.pc
is pretty much what's needed to include libgap
in the project. But gap.pc
is a bit unclear.
libgap.pc.in
Outdated
Description: Library containing the kernel of GAP, a computer algebra system | ||
URL: https://www.gap-system.org | ||
Version: @PACKAGE_VERSION@ | ||
Requires.private: gmp |
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.
wait, doesn't it also require zlib
, and possibly readline
, depending on the install options? Otherwise static linking won't work after all, will it?
Did you test this at all? Static linking libgmp doesn't strike me as very useful, so perhaps this line should just be removed?
I mean, I am also fine with keeping it, and won't block this PR over it; but it seems misleading?
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.
what, for libgap? Does libgap depend on zlib and readline?
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.
Sure, we always link against libz. Whether we link against GNU readline depends on configure
.
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.
perhaps, we should just remove Requires
line, and wait for possible bug reports (from some clever Linux distro which likes to underlink stuff...)
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.
Removing it would be fine by me.
Makefile.rules
Outdated
@@ -1268,6 +1271,27 @@ testlibgap: ${LIBGAPTESTS} | |||
$(v) -A -l $(top_srcdir) -q -T --nointeract >$(v).out && \ | |||
diff $(top_srcdir)/$(v).expect $(v).out && ) : | |||
|
|||
# test libgap's pkg-config's libgap version reporting | |||
tst/testpkgconfigversion: install-libgap |
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.
This target does not actually create tst/testpkgconfigversion
and as such should be added to .PHONY
(and then perhaps renamed testpkgconfigversion
).
tst/testpkgconfigversion: install-libgap | |
.PHONY: testpkgconfigversion | |
testpkgconfigversion: install-libgap |
Though it also does not set an exit code, so it'll never fail... Perhaps add an exit 1
in a suitable place?
Or just remove it here and add the same code into ci.sh
, where it can be rewritten without mangling shell code ;-). (The expected version could then be computed via make print-GAP_VERSION
)
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.
I'd rather keep the make version, as it allows testing locally in a normal way.
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.
I don't quite get the removal of tst/ - I thought it's a convention for test targets, no?
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.
No other test target has a tst/
prefix.
And you can invoke dev/ci.sh
locally, I regularly do it. But as I said, i won't quibble over this
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.
No other test target has a
tst/
prefix.
how about Makefile.rules:tst/testlibgap/%:
? Or Makefile.rules:tst/testkernel/%:
?
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.
Those are not test targets (in particular, they are not PHONY) but rather regular file targets that are then used by the test targets testlibgap
and testkernel
On Tue, 11 Oct 2022, 16:27 Max Horn, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Makefile.rules
<#5080 (comment)>:
> @@ -535,6 +535,7 @@ clean:
rm -f bin/gap.sh sysinfo.gap*
rm -f gap$(EXEEXT) gac ffgen
rm -f libgap.la
+ rm -f libgap.pc
You haven't answered my question yet: is the file libgap.pc ever useful
in the non-installed version?
I am going to assume the answer is "no".
nothing precludes you from using it, upon making sure it is in pkg-config
PKG_... path.
But indeed, normally it is used installed.
—
… Reply to this email directly, view it on GitHub
<#5080 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJXYHBCOUXDFD5THCL2ACLWCWBPJANCNFSM6AAAAAAQ44ALHA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Co-authored-by: Max Horn <[email protected]>
Co-authored-by: Max Horn <[email protected]>
to execute them, run make tst/testpkgconfigbuild tst/testpkgconfigversion
Co-authored-by: Max Horn <[email protected]>
Co-authored-by: Max Horn <[email protected]>
Co-authored-by: Max Horn <[email protected]>
use @GAP_VERSION@ for Version Co-authored-by: Max Horn <[email protected]>
Co-authored-by: Max Horn <[email protected]>
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.
Thank you!
thanks! |
libgap.pc
for use with pkg-config
Implement generation and installation of libgap.pc, to be used with pkg-config, as discussed in #275
Text for release notes
see title