sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.45k stars 481 forks source link

Upgrade to libpng 1.6.29 #22159

Closed jdemeyer closed 7 years ago

jdemeyer commented 7 years ago

Tarball: http://download.sourceforge.net/libpng/libpng-1.6.29.tar.gz

Depends on #22163

CC: @jpflori @frederichan-IMJPRG

Component: packages: standard

Keywords: atelierpari2017

Author: Jeroen Demeyer, Jean-Pierre Flori

Branch/Commit: aa28f4c

Reviewer: Jean-Pierre Flori, Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/22159

jdemeyer commented 7 years ago

Branch: u/jdemeyer/upgrade_to_latest_libpng

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Commit: f8bbf69

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

f8bbf69Upgrade to libpng-1.6.28
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

7467913Upgrade to libpng-1.6.28
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 7 years ago

Changed commit from f8bbf69 to 7467913

jpflori commented 7 years ago

Reviewer: Jean-Pierre Flori

jpflori commented 7 years ago
comment:5

Looks good to me. Let the patchbots do their job.

jdemeyer commented 7 years ago

Dependencies: #22163

jdemeyer commented 7 years ago
comment:7

I have some doubts regarding giac. Setting this back to needs_work for now...

jdemeyer commented 7 years ago

Changed keywords from none to atelierpari2017

vbraun commented 7 years ago
comment:10

Fails in giac

[giac-1.2.2.103] /bin/bash ../libtool --tag=CXX   --mode=link g++  -g -O2 -fno-strict-aliasing -DGIAC_GENERIC_CONSTANTS  -L/home/buildbot/slave/sage_git/build/local/lib -Wl,-rpath,/home/buildbot/slave/sage_git/build/local/lib  -o aide aide.o libxcas.la -lreadline  -ldl -lpng -lm -lmpfi -lmpfr -lgmp  -lgsl -lgslcblas  -lrt -lpthread -ldl -lpng -lm -lmpfi -lmpfr -lgmp 
25420[giac-1.2.2.103] libtool: link: g++ -g -O2 -fno-strict-aliasing -DGIAC_GENERIC_CONSTANTS -Wl,-rpath -Wl,/home/buildbot/slave/sage_git/build/local/lib -o .libs/aide aide.o  -L/home/buildbot/slave/sage_git/build/local/lib ./.libs/libxcas.a /home/buildbot/slave/sage_git/build/local/var/tmp/sage/build/giac-1.2.2.103/src/src/.libs/libgiac.so -lntl -lpari -lreadline -lgsl -lgslcblas -lrt -lpthread -ldl -lpng -lm -lmpfi -lmpfr -lgmp -Wl,-rpath -Wl,/home/buildbot/slave/sage_git/build/local/lib
25421[giac-1.2.2.103] /home/buildbot/slave/sage_git/build/local/var/tmp/sage/build/giac-1.2.2.103/src/src/.libs/libgiac.so: undefined reference to `png_set_longjmp_fn'
25422[giac-1.2.2.103] collect2: error: ld returned 1 exit status
25423[giac-1.2.2.103] Makefile:574: recipe for target 'icas' failed
25424[giac-1.2.2.103] make[5]: *** [icas] Error 1
25425[giac-1.2.2.103] /home/buildbot/slave/sage_git/build/local/var/tmp/sage/build/giac-1.2.2.103/src/src/.libs/libgiac.so: undefined reference to `png_set_longjmp_fn'
25426[giac-1.2.2.103] collect2: error: ld returned 1 exit status
25427[giac-1.2.2.103] Makefile:571: recipe for target 'aide' failed
jdemeyer commented 7 years ago
comment:11

Is this using ccache? I remember a similar error where it turned out to be a ccache bug. Just to be sure, could you try again with CCACHE_DISABLE=1?

vbraun commented 7 years ago
comment:12

Also happens on buildbot without ccache

jdemeyer commented 7 years ago
comment:13

OK, thanks for the info.

frederichan-IMJPRG commented 7 years ago
comment:15

On fedora 25 where my system libpng is 1.6.27 I was able to built giac with your libpng 1.6.28.

On a debian system with libpng12 installed I was able to reproduce the above error.

But cd in src/src/.libs and edit libgiac.la with -lpng16 instead of -lpng and I was able to end the built.

Does it worth a patch (do you have a similar pb elsewhere?) or should I ask parisse if it is possible to add a --disable-png in configure?

jpflori commented 7 years ago
comment:16

Worth a patch. See #22163 comment:4

frederichan-IMJPRG commented 7 years ago
comment:17

I have configured giac with --disable-png in #22101 so this should not happen anymore with the 1.2.3.25 giac spkg

edd8e884-f507-429a-b577-5d554626c0fe commented 7 years ago
comment:18

Replying to @frederichan-IMJPRG:

I have configured giac with --disable-png in #22101 so this should not happen anymore with the 1.2.3.25 giac spkg

I would be +1 for the patch as well, since i need to compile giac with png and fltk support for Sage Debian Live, since i provide xcas through Sage. So, if it is possible, it is better to fix the issue than to skip it.

frederichan-IMJPRG commented 7 years ago
comment:19

Replying to @sagetrac-tmonteil:

Replying to @frederichan-IMJPRG:

I have configured giac with --disable-png in #22101 so this should not happen anymore with the 1.2.3.25 giac spkg

I would be +1 for the patch as well, since i need to compile giac with png and fltk support for Sage Debian Live, since i provide xcas through Sage. So, if it is possible, it is better to fix the issue than to skip it.

The problem occurs when you have a libpng12 system wide installed and sage libpng1.6. If you built giac with the system wide libpng12 then I guess that you will have the same error as in comment 10. Are you using 2 libpng in sage debian live? Now if you built giac with -lpng16 instead of -lpng I don't know if it will work with your fltk because I guess it is linked to the system libpng12?

edd8e884-f507-429a-b577-5d554626c0fe commented 7 years ago
comment:20

Replying to @frederichan-IMJPRG:

The problem occurs when you have a libpng12 system wide installed and sage libpng1.6. If you built giac with the system wide libpng12 then I guess that you will have the same error as in comment 10. Are you using 2 libpng in sage debian live? Now if you built giac with -lpng16 instead of -lpng I don't know if it will work with your fltk because I guess it is linked to the system libpng12?

Indeed: apt-rdepends libfltk1.3-dev | grep -E '^[a-zA-Z0-9]' | grep png leads to libpng12-0 Fortunately, the next Debian stable will ship libpng16.

frederichan-IMJPRG commented 7 years ago
comment:21

Replying to @sagetrac-tmonteil:

Replying to @frederichan-IMJPRG:

The problem occurs when you have a libpng12 system wide installed and sage libpng1.6. If you built giac with the system wide libpng12 then I guess that you will have the same error as in comment 10. Are you using 2 libpng in sage debian live? Now if you built giac with -lpng16 instead of -lpng I don't know if it will work with your fltk because I guess it is linked to the system libpng12?

Indeed: apt-rdepends libfltk1.3-dev | grep -E '^[a-zA-Z0-9]' | grep png leads to libpng12-0 Fortunately, the next Debian stable will ship libpng16.

NB: giac/xcas has now an official package in debian unstable:

https://packages.debian.org/source/unstable/giac

so in next releases you may not need the spkg for xcas.

edd8e884-f507-429a-b577-5d554626c0fe commented 7 years ago
comment:22

Indeed: apt-rdepends libfltk1.3-dev | grep -E '^[a-zA-Z0-9]' | grep png leads to libpng12-0 Fortunately, the next Debian stable will ship libpng16.

Actually, i wonder whether giac from Sage could produce png with libpng16 (shipped with Sage once this ticket gets merged) and the xcas GUI could be displayed with fltk using system's libpng12 without any conflict. I will try such an option anyway (also, libfltk1.3-dev has no dependency on libpng12-dev so that i can remove it during giac compilation, so there should not be any problem there).

Replying to @frederichan-IMJPRG:

NB: giac/xcas has now an official package in debian unstable:

https://packages.debian.org/source/unstable/giac

so in next releases you may not need the spkg for xcas.

Well, it did not enter stretch, which is now frozen, hence it will not be shipped with the next stable :(

dimpase commented 7 years ago
comment:23

I suspect that something is not perfect with libpng in Sage. In particular, on FreeBSD (#22679) with Sage's current libpng (1.2.51) I see

sage: loads(dumps(B)) == B ## line 827 ##
libpng warning: Application was compiled with png.h from libpng-1.6.27+apng
libpng warning: Application  is  running with png.c from libpng-1.2.51
GD Error: gd-png: fatal libpng error: Incompatible libpng version in application and library

**********************************************************************
----------------------------------------------------------------------
sage -t --long src/sage/coding/binary_code.pyx  # Killed due to segmentation fault

so it looks as if somewhere wrong or absent -I/... is used for compilation.

dimpase commented 7 years ago
comment:24

Replying to @dimpase:

I suspect that something is not perfect with libpng in Sage. In particular, on FreeBSD (#22679) with Sage's current libpng (1.2.51) I see

sage: loads(dumps(B)) == B ## line 827 ##
libpng warning: Application was compiled with png.h from libpng-1.6.27+apng
libpng warning: Application  is  running with png.c from libpng-1.2.51
GD Error: gd-png: fatal libpng error: Incompatible libpng version in application and library

**********************************************************************
----------------------------------------------------------------------
sage -t --long src/sage/coding/binary_code.pyx  # Killed due to segmentation fault

so it looks as if somewhere wrong or absent -I/... is used for compilation.

unsurprisingly, upgrading to the branch in this ticket makes this crash go away.

dimpase commented 7 years ago
comment:25

Replying to @dimpase:

I suspect that something is not perfect with libpng in Sage. In particular, on FreeBSD (#22679) with Sage's current libpng (1.2.51) I see

sorry for noise, that was FreeBSD-specific leftover from an old port that caused this. No problem, in fact.

jpflori commented 7 years ago
comment:26

Can we try to merge it in 8.0? The giac issue is solved in a giac ticket isn't it?

edd8e884-f507-429a-b577-5d554626c0fe commented 7 years ago
comment:27

Replying to @jpflori:

Can we try to merge it in 8.0?

Sure.

The giac issue is solved in a giac ticket isn't it?

Well, the issue is avoided in #22101 (which disables png support), but i think we should not consider this as a permanent solution, and provide a full-featured giac (which can draw pictures).

jpflori commented 7 years ago
comment:28

I think we can live with a giac without png support. We already live with a completely borken giac outside x86_64...

jpflori commented 7 years ago
comment:29

And note that giac build system should be fixed to use proper -lpng1x rather than -lpng. Not libpng...

jpflori commented 7 years ago
comment:30

From my point of view it is enough to rebase this ticket, I'll do it.

jpflori commented 7 years ago

New commits:

61ff918Merge remote-tracking branch 'trac/u/jdemeyer/upgrade_to_latest_libpng' into libpng1629
aa28f4cBump to libpng 1.6.29.
jpflori commented 7 years ago

Changed branch from u/jdemeyer/upgrade_to_latest_libpng to public/libpng1629

jpflori commented 7 years ago

Description changed:

--- 
+++ 
@@ -1 +1 @@
-**Tarball**: http://download.sourceforge.net/libpng/libpng-1.6.28.tar.gz
+**Tarball**: http://download.sourceforge.net/libpng/libpng-1.6.29.tar.gz
jpflori commented 7 years ago

Changed author from Jeroen Demeyer to Jeroen Demeyer, Jean-Pierre Flori

jpflori commented 7 years ago

Changed commit from 7467913 to aa28f4c

tscrim commented 7 years ago

Changed reviewer from Jean-Pierre Flori to Jean-Pierre Flori, Travis Scrimshaw

tscrim commented 7 years ago
comment:32

Built for me. Back to the buildbots.

vbraun commented 7 years ago

Changed branch from public/libpng1629 to aa28f4c