-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
spkg-configure.m4 for freetype #27168
Comments
comment:1
I think we already have a generic ticket about this, so let's have this one just focus specifically on freetype. |
comment:2
Perhaps of interest, from cairo's own We can probably reuse much of this. |
comment:3
I actually do not know how to deal with freetype's deps: bzip2, libpng (and zlib - not explicitly listed, but a dep of libpng). Naturally, if we have to build any of these, we cannot use a system's freetype. Which brings up the need for a proper dependencies resolver, and raises the question whether we are doing all this right. IMHO a better plan would be to spin off some, and then all, |
comment:4
I understand what you're saying and have thought about this problem as well, albeit without a completely clear solution. On the one hand I think it should be possible to use a system package regardless of its dependencies. On the other hand it is asking for trouble doing something like, as in your example, building a bz2 for Sage, but then using a libfreetype from the system which was compiled against its system libbz2. This may "just work" but mostly only by luck. This was less of a problem when this mechanism was used only for a handful of packages that didn't live somewhere deep in the package dependency graph (the old configure.ac checked for these packages in more or less arbitrary order, and that is still the case unfortunately. I don't agree with your idea of bundling a bunch of packages together but I'm not sure I understand it either. I think there are a couple things to do here: Using the freetype/bz2 example again: if we add a spkg-configure.m4 for one package, we should also do so for all its build dependencies. That way, assuming they are detected properly, it will properly use the system packages for the entire dependency tree rooted at freetype. However, I should also add some logic to SAGE_SPKG_COLLECT (likely with an external helper script) to actually load the package dependency graph and do these checks in a reasonable such that we don't even try to use a package from the system unless we've already detected all its dependencies from the system. |
comment:5
Replying to @embray:
Well, perhaps bundling is a wrong word, but the idea is that once you removed a lot of stuff from Sage, you need means to build few missing pieces in a coherent way.
I don't see why this always be the case. E.g. our current libgd is pretty old, and Often (freetype is a good example) Sage dependencies get updated just because something breaks on version N of BlaFoo OS, without much regard to whether this might break |
comment:6
Thinking more about it, I should take a part of my comments above back - I have not quite understood the whole scheme of things. That is, for freetype this means that also libpng and bzip2 must also get spkg-configure.m4's. Thus the title change. |
This comment has been minimized.
This comment has been minimized.
comment:7
Here is 1st try for bzip2, appears working: SAGE_SPKG_CONFIGURE([bzip2], [
AC_SEARCH_LIBS([BZ2_bzCompress], [bz2], [], [sage_spkg_install_bzip2=yes])
AC_CHECK_HEADER(bzlib.h, [], [sage_spkg_install_bzip2=yes])
AC_CHECK_PROG(bzip2, [break], [sage_spkg_install_bzip2=yes])
]) |
Author: Dima Pasechnik |
comment:8
Replying to @dimpase:
I agree with this ofc. If for some reason Sage (or really some other dependency of Sage) specifically needs some recent-enough libbz2 (for example) then we really need to check for that version on the system (either by actual version number, though better by feature checks if possible). If not found, then we have to build our own copy. And my point is that in that case we then need to also, at least by default, build all other dependencies that depend on that libbz2, regardless whether they can otherwise be found on the system. |
comment:9
Replying to @dimpase:
That looks good, though I think we need to switch the order of |
comment:10
OK. Do you think we need to check the version of bzip2 (it's been 1.0.6 for 5+ years already)? |
comment:11
I'll make a specific ticket for adding an spkg-configure.m4 for bzip2 and add it as a dependency of this ticket. I'm testing this out right now. My general feeling about version checks is to avoid it until and unless we know a specific reason we need it. |
comment:12
Here the reason would be to avoid nasty surprises for people installing Sage in weird places. Actually, while I was at it
outputs 1.0.6, as needed. (then one can steal the rest of version-checking from spkg-configure.m4 of patch spkg, say, to check the version). |
comment:13
I'm not sure what nasty surprises you have in mind. I don't think many people use this package directly. |
comment:14
Forgot to add here: #27182 |
Dependencies: #27182 |
comment:16
Replying to @embray:
Somebody starts installing Sage on an HPC cluster with typical semi-obsolete 10 years-old Linux version, and it fails as it picks up system's bzlib2 from previous century... |
comment:17
I mean, that's fine. If it doesn't pick it up then it doesn't, and installs Sage's instead. |
comment:19
Ticket retargeted after milestone closed (if you don't believe this ticket is appropriate for the Sage 8.8 release please retarget manually) |
comment:31
Thanks! And how about its dependency, #27186 ? |
comment:32
Please merge together with #27825 |
Changed keywords from none to spkg-configure freetype |
comment:33
Please never set these to positive review until I've had a chance to OK them on Cygwin. |
comment:34
I don't like this:
I think if we need this variable at all (which it seems we do currently for building libgd) it should either be an actual filesystem path or empty for consistency's sake. If some random package (like again, libgd) requires you to pass
or something along those lines. |
comment:35
Yep, I agree that it's inconsistent with way such an inconsistency is dealt with in Flint, I'll fix this. |
comment:36
I also noticed some inconsistencies in the formatting of some of the messages, as compared to the stuff in #27822 since I change the messages in those ticket to be more consistent with the style of other autoconf messages (e.g. using mostly lower-case, like "no" instead of "No."). This is just trivial nitpick though. I can fix those up if you want. |
comment:38
Here are some minor updates that incorporate my review comments from earlier in this ticket, and a few other minor tweaks that seemed worth including. Please review. New commits:
|
Changed reviewer from François Bissey to François Bissey, Erik Bray |
Changed branch from u/dimpase/packages/freetype-config to public/packages/freetype-config |
comment:39
this ought to be rebased over 8.8.beta6... |
comment:40
OK, this looks good, I've cherry-picked these into |
comment:41
ideally, we should be adding an extra parameter to (It could even be the 2nd parameter, and we then mass-edit all the spkg-configure.m4 to make use of it) |
comment:42
It doesn't necessarily have to be an argument to |
It gets ugly with library conflicts, so more libraries available on the system should be used instead of ones shipped by Sage, e.g.
freetype
is a good example. Freetype may be used by R packages, and they in turn might depend on other system libraries we don't even know about, cf. e.g. #27163.Ticket closed as duplicate after the corresponding changes were integrated in #27825.
Depends on #27186
CC: @embray @mkoeppe @orlitzky
Component: build: configure
Keywords: spkg-configure freetype
Author: Dima Pasechnik
Branch/Commit: public/packages/freetype-config @
8b2cf94
Reviewer: François Bissey, Erik Bray
Issue created by migration from https://trac.sagemath.org/ticket/27168
The text was updated successfully, but these errors were encountered: