-
-
Notifications
You must be signed in to change notification settings - Fork 481
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 libpng #27186
Comments
comment:1
That said, my Ubuntu build machine has a kinda old libpng12, and while I'm not saying we should support that, I'm curious to see if it will work... |
comment:2
Also, we should probably not use the system libpng at all on OSX (unless in homebrew or something, but I don't know if we explicitly support that yet...) |
comment:3
What's wrong with OSX's system libpng? |
comment:4
It's unusable. See the SPKG.txt for libpng. |
comment:5
Okay, at least on my Ubuntu 14.04 machine libpng 1.2 worked just fine actually. Did a full |
comment:6
Replying to @embray:
I don't read it this way. I read it as "it won't conflict with the one built by Sage". |
comment:7
I think you are misreading. The point is that if you just blindly link One workaround is to explicitly ask for one of the ABI-specific names like |
comment:8
Although I may also be misreading some too. ISTM the libPng.dylib on OSX only comes from the ImageIO framework, whatever that is, so I don't know if it on the linker path by default in the first place. The problem is just that we can't use the SONAME (or whatever the OSX equivalent is) of libpng when linking modules in our own packages because then it will conflict with anything that uses the ImageIO framework. This goes to show how little I understand about OSX. |
comment:9
Replying to @embray:
This still sounds as if using system's libPng would lead to various library conflicts (with other Sage-installed versions of stuff also available on the system), i.e. if we go far enough with our plan it would not matter... Anyhow, I just checked that Homebrew also does not use system's libPng, but installs its own libpng16.dylib. One way or another, I think we should not block the usage of Homebrew (or conda) libs, i.e. there should not be a rule saying "we're on OSX! install from source"). PS. Last time I checked (few months ago), it's possible to build and run Sage under Homebrew. Basically, it's an environment where lots of stuff lives in /usr/local... |
comment:10
Volker's OSX buildbot also has a libpng16 that lives in the |
comment:11
Replying to @embray:
Not since 2010 or so, I guess :-) |
comment:12
the following works: SAGE_SPKG_CONFIGURE([libpng], [
dnl First try checking for libpng with pkg-config
PKG_CHECK_MODULES([LIBPNG], [libpng16], [], [
dnl Fallback to manually grubbing around for headers and libs
AC_CHECK_HEADERS([libpng16/png.h], [sage_spkg_install_libpng=no; break], [sage_spkg_install_libpng=yes])
AC_SEARCH_LIBS([png_get_io_ptr], [libpng16], [], [sage_spkg_install_libpng=yes])
])
]) |
comment:14
I found that there is no reason to require libpng16 specifically (unless I'm wrong / there is some optional package I'm missing that requires a newer version)? I was thinking we might do something pretty similar to this, but instead of just |
comment:15
If that overcomplicates things though, the above is fine. libpng just tends to be problematic, so I thought it would be good to be flexible in which versions we accept so long as there is no explicit need for 1.6. |
comment:16
in
It suggests that libpng16 is needed. |
comment:17
I don't think so: This patch was made because the libpng package in Sage delete the normal I don't think it has to be libpng16 specifically; that patch just specifies |
comment:18
Removing most of the rest of my open tickets out of the 8.7 milestone, which should be closed. |
comment:19
I looked a bit into OSX libPng, and I see no trace of it on OSX 10.14. |
Author: Dima Pasechnik |
Branch: u/dimpase/packages/png-config |
Commit: |
New commits:
|
comment:33
no, why? neither is a dependency of the other. |
comment:34
but there is the bloody mess with configure package versions I am complaining about, sure. |
comment:35
once you start depending on generated stuff, it's like crack ;-) |
comment:36
Well, this branch contains the diff: diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt
index 4dab36b..dda3451 100644
--- a/build/pkgs/configure/package-version.txt
+++ b/build/pkgs/configure/package-version.txt
@@ -1 +1 @@
-317
+318 which to make sense I thought would need #27265, which supplies configure-317. |
comment:37
well, one has no control over version numbers of configure spkg. for different branches they may clash, be unrelated, etc. |
comment:38
For that reason, if nothing else, maybe we should do like I suggested elsewhere and combine several of these together into a single ticket (once we're satisfied that they work individually). |
comment:39
sure, I'm all for it - but we need more of these actually positively reviewed ;-) |
comment:41
removed configure bump and rebased over 8.8.beta5 for the ease of reviewing. |
Reviewer: François Bissey |
comment:42
Part of series of ticket. |
comment:43
Please merge together with #27825 |
comment:44
I think the zlib <-> libpng stuff here could still be improved. First, trivia; this should be quoted to avoid syntax errors if the variable has a space in it:
Now, the only reason we're checking for
It's wrapped in a zlib version check, so... does anything bad happen if we simply ignore the matter? That is, drop the |
comment:45
Replying to @orlitzky:
We only check for PS. I think it's a good example of how vendoring of everything leads to a relentless upgrading spiral (cause a vendored version gets broken on one particular system, or due to conflicts with system libraries that happens for one or another reason...) |
comment:46
Replying to @dimpase:
But are you sure? This code is taken from sage's libpng:
and that's the only occurrence of "inflateValidate" in the libpng source code. Since that whole block will be ignored for old zlib, I don't think we actually need (inflateValidate was introduced in zlib commit 9852c209 on 2016-09-20, and ZLIB_VERNUM was set to 0x1290 in commit 2fa463bacf on 2016-12-31, so the check above in libpng should work) |
comment:47
Oh, I see what you're saying now, thanks. Well, assuming there is one and only zlib, so that ZLIB_VERNUM correctly identifies the presence of |
Changed branch from u/dimpase/packages/png-config to |
Changed commit from |
comment:49
Let me point that there is an issue with |
comment:50
It appears to me that this does not work for tachyon. In tachyon's
This won't work if libpng's headers have not been installed to |
comment:51
It appears that tachyon is ignoring the CFLAGS that were used when ./configure ran. |
comment:52
what is “not working”? it certainly is possible to use system libpng everywhere in sage. All I did I changed But otherwise it works, e.g. I have
on Gentoo |
comment:53
Replying to @saraedum:
right. It's quite a mess indeed. |
Also should be done for #27168
Note libpng comes in a number of different ABI versions, usually indicated in the library filename as a suffix like "12" (for 1.2.x) up through "16" (for 1.6.x), where 16 is the most current and currently supported by Sage. Distros like Debian has separate packages for each libpng ABI version.
I think to keep it simple we should specifically check for and require libpng16. I don't know if all of Sage's dependencies support older libpngs.
configure tarball: https://github.com/sagemath/sage-prod/files/10659243/configure-318.tar.gz
CC: @kiwifb
Component: packages: standard
Author: Dima Pasechnik
Branch:
adc901c
Reviewer: François Bissey
Issue created by migration from https://trac.sagemath.org/ticket/27186
The text was updated successfully, but these errors were encountered: