Opened 9 years ago
Closed 9 years ago
#15561 closed defect (fixed)
freetype 2.3.5 is too old for some fonts of current systems.
Reported by: | charpent | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.1 |
Component: | packages: standard | Keywords: | r-project graphics interfaces |
Cc: | Merged in: | ||
Authors: | Emmanuel Charpentier, Volker Braun | Reviewers: | Volker Braun |
Report Upstream: | N/A | Work issues: | |
Branch: | u/charpent/ticket/15561 (Commits, GitHub, GitLab) | Commit: | c70498bb446188823dcb355b474938f3a8acfb8f |
Dependencies: | #15539 | Stopgaps: |
Description (last modified by )
The now-current freetype library has problems with newer fonts. This forbids its uses in some applications on machines having system fonts not supported by this version.
This was diagnosed on sage's R (see this thread) by Volker Braun.
A stopgap measure is to upgrade freetype to a more forgiving version of freetype, hence this ticket.
The current freetype tarball hits a snag in libpng, because it uses setjmp for exception handling, which triggers a compiler error due to this settinng up been made twice. So a small patch to the current libpng is part of this branch.
New tarball: http://download.savannah.gnu.org/releases/freetype/freetype-2.5.2.tar.bz2
Attachments (1)
Change History (28)
comment:1 Changed 9 years ago by
Branch: | → u/charpent/ticket/15561 |
---|---|
Created: | Dec 21, 2013, 7:49:59 AM → Dec 21, 2013, 7:49:59 AM |
Modified: | Dec 21, 2013, 7:49:59 AM → Dec 21, 2013, 7:49:59 AM |
comment:2 Changed 9 years ago by
Commit: | → f570a62601eea75502fa2bab4431643fa1cbc2c7 |
---|---|
Status: | new → needs_review |
comment:3 Changed 9 years ago by
Status: | needs_review → needs_work |
---|
I have two problems with this branch :
1) I seem to be unable to get this code back on an sage tree on another machine :
sage -dev checkout --ticket 15561 sage -dev diff
gives me an empty diff...
2) I added a new freetype tarball in upstream and deleted the previous one. None of this appears in the branch, at least as displayed on the trac page.
I'll have to beg some help on sage-support...
Changed 9 years ago by
Attachment: | freetype-2.5.2.tar.bz2 added |
---|
source tarball of the new versioj of freetype
comment:4 Changed 9 years ago by
This branch requires the tarball of the new version of freetype, which is also attached to this ticket.
comment:5 Changed 9 years ago by
Description: | modified (diff) |
---|---|
Status: | needs_work → needs_review |
Summary: | freetype 2.3.5 is too old for some fonts → freetype 2.3.5 is too old for some fonts of current systems. |
Okay, I am satisfied that my push *was* successful, and that the ansence of the new upstream tarball was intended. So I'm putting it up for review again.
comment:6 Changed 9 years ago by
Okay, I am satisfied that my push *was* successful, and that the ansence of the new upstream tarball was intended. So I'm putting it up for review again.
comment:7 Changed 9 years ago by
Description: | modified (diff) |
---|
comment:8 Changed 9 years ago by
Reviewers: | → Volker Braun |
---|---|
Status: | needs_review → positive_review |
comment:11 Changed 9 years ago by
Replying to vbraun:
Build errors: * http://build.sagemath.org/sage/builders/%20%20fast%20UW%20redhawk%20%28Ubuntu%2010.04%20x86_64%29%20incremental/builds/27/steps/compile/logs/freetype * http://build.sagemath.org/sage/builders/%20%20fast%20UW%20mod%20%28Ubuntu%208.04%20x86_64%29%20incremental/builds/26/steps/compile/logs/freetype
Ahiii ! That's the snag in libpng that triggered me to patch pngconf.h. How can i check that this patch has been applied ? This error (horror ?) originates in a code section that I #defined around...
Edit, Dec 25 : I see *another* build problem with PIL and freetype. but I could diagnose it only by creating a new sage tree and git'ing #15661 directly : adding #15561 to an already compiled tree does not force recompilation of PIL.
The problem :
[ ... ] gcc -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/home/charpent/sagebis/sage/local/include/freetype2 -IlibImaging -I/home/charpent/sagebis/sage/local/include -I/usr/include -I/home/charpent/sagebis/sage/local/include/python2.7 -c _imagingft.c -o build/temp.linux-x86_64-2.7/_imagingft.o _imagingft.c:68:31: fatal error: freetype/fterrors.h: Aucun fichier ou dossier de ce type #include <freetype/fterrors.h> ^ compilation terminated. error: command 'gcc' failed with exit status 1 [ ... ]
This happens twice (PIL attemps compilation with and without Tkinter support). This is caused by the fact that the directory containing freetype headers is no longer local/include/freetype but local/include/freetype2.
Since Pillow is now accepted in the next sage, my plan is :
- start a new tree
- fetch the Pillow branch (for rebase ?)
- fetch #15561 and adjust it.
Your thoughts ?
comment:13 follow-up: 16 Changed 9 years ago by
You should merge in the Pillow ticket, but its not ready yet (i.e. doesn't build).
comment:14 follow-up: 15 Changed 9 years ago by
You need to bump the libpng patchlevel to force a rebuild (libpng/package-version.txt). Otherwise it won't be built.
comment:15 Changed 9 years ago by
Replying to vbraun:
You need to bump the libpng patchlevel to force a rebuild (libpng/package-version.txt). Otherwise it won't be built.
This I do not understand : #15561 *does* bump libpng (from 1.2.35.p5 to 1.2.25p6) and freetype (from 2.3.5.p4 to 2.5.2.p0) ; #15539 does *not* touch libpng nor freetype (it *uses* them *as is*). Is there another proposed branch that bumps libpng ? If so, how can I find it ?
comment:16 Changed 9 years ago by
Replying to vbraun:
You should merge in the Pillow ticket, but its not ready yet (i.e. doesn't build).
Would that be a merge (i. e. creating a branch incorporating changes both from #15539 an #15561) or a rebase (i. e. creating a patch that *assumes* that #15539 has been incorporated) ?
Now that 15539 is closed as "fixed", rebasing sounds logical. What do you advise ?
comment:17 follow-up: 18 Changed 9 years ago by
You should always merge (and never rebase) branches that are already published on trac, since somebody else might have used that already as a base for their own branch.
Here is the full buildbot log: http://build.sagemath.org/sage/builders/%20%20fast%20UW%20mod%20%28Ubuntu%208.04%20x86_64%29%20incremental/builds/26
It did compile libpng-1.2.35.p6, so thats your ticket.
comment:18 Changed 9 years ago by
Replying to vbraun:
You should always merge (and never rebase) branches that are already published on trac, since somebody else might have used that already as a base for their own branch.
Okay. Can't say I fully understand it yet, but I did that.
Here is the full buildbot log: http://build.sagemath.org/sage/builders/%20%20fast%20UW%20mod%20%28Ubuntu%208.04%20x86_64%29%20incremental/builds/26 It did compile libpng-1.2.35.p6, so thats your ticket.
Indeed ! Don't understand it either. I just restarted a clean tree, used git (not sage's scripts) to fetch Pillow and #15561 in separate local branches, merged Pillow in 15561 and compiled (successfully).
In the full buildbot log, the error points at pngconf.h line 328. That's the place where the error takes places while using the *unpatched* pngconf.h ; with the patched pngconf.h, the error should take place on line 334.
Is it possible that buildbot's freetype compilation might pickup an unpatched (possibly system's) pngconf.h ? If so, how to prevent this from happening ?
comment:19 follow-up: 20 Changed 9 years ago by
Looking at build/deps, the freetype package does not depend on libpng so will potentially build at the same time. Might be a race condition.
comment:20 Changed 9 years ago by
Replying to vbraun:
Looking at build/deps, the freetype package does not depend on libpng so will potentially build at the same time. Might be a race condition.
Ouch ! Freetype depends on libpng, but libpng needs to be patched *first*, which means it can't be patched by freetype's branch, if I understand that correctly. The only way out I see is :
- create a new branch patching libpng in a ticket #xx
- wait for #xx to get reviewed and getting to state "fixed", and
- modify #15561 to depend on #xx.
I don't see how this can be made in one ticket. Do you have different thoughts ?
comment:22 Changed 9 years ago by
Replying to vbraun:
No, you can do everything in your current branch.
I don't see how to. Care to enlighten the dummy of the day ?
comment:23 follow-up: 26 Changed 9 years ago by
If that race is actually the problem then you only have to add the dependency to build/deps
. Then libpng will be built first (and patched as part of its build process), and then freetype will be built afterward. I think I'm missing the problem here, but in any case that should work (TM).
comment:24 Changed 9 years ago by
Commit: | f570a62601eea75502fa2bab4431643fa1cbc2c7 → c70498bb446188823dcb355b474938f3a8acfb8f |
---|
Branch pushed to git repo; I updated commit sha1. New commits:
c70498b | buid/deps : added a dependency of freetype on libpng in order to work around a build-time race condition.
|
bedf0d8 | Merge branch 'pillow' into ticket/15561
|
f005905 | pillow: depends on setuptools
|
adc90ce | Pillow -> pillow
|
8987381 | remove PIL (it has been replaced by Pillow)
|
2c055bd | Pillow: fix patch to work against 2.2.2
|
6690d97 | doc: remove now unused environment variables
|
3778f42 | Pillow: re-resolve #9864
|
6df0adb | replace PIL with Pillow
|
comment:25 Changed 9 years ago by
Status: | needs_work → needs_review |
---|
comment:26 Changed 9 years ago by
Replying to vbraun:
If that race is actually the problem then you only have to add the dependency to
build/deps
. Then libpng will be built first (and patched as part of its build process), and then freetype will be built afterward. I think I'm missing the problem here, but in any case that should work (TM).
Okay. I did that, pushed the commit and updated status to "needs review". I'm curious about the buildbot's behaviour...
Edit, a bit later : the resulting tree passes the '(make distclean ; make )' test in an enviroment where MAKE is "make -j8". So it *can* be built in a parallel setting.
comment:27 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | needs_review → closed |
freetype 2.5.2 installs flawlessly IFF libpng12 is patched to avoid a test for setting up error catching via setjmp in libpng12 (which freetype 2.5.2 does anyway).
The resulting sage passes make ptestlong and is able to draw a curve (from sage -R in console). So I think that this ticket is ready for review.
Since it installs a newer version of a standard package and paches another onte, I think that it should be reviewed on various system (at least Mac OS X and/or Cygwin, which seem to be the most difficult cases) before clearing it.