Summary: | app-text/ghostscript-gpl built on Gentoo behaves differently from official build | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Guillaume Ayoub <xovni> |
Component: | Current packages | Assignee: | Codec Project <codec> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | gentoo, mgorny, orzel, printing, proteuss, sam |
Priority: | Normal | Keywords: | PMASKED |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=851141 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 862133 | ||
Attachments: | PDF sample |
Description
Guillaume Ayoub
2022-05-13 22:40:51 UTC
Created attachment 778649 [details]
PDF sample
Were older versions fine? (In reply to Sam James from comment #2) > Were older versions fine? Yes, there’s no problem with 9.55.0. (In reply to Guillaume Ayoub from comment #3) > (In reply to Sam James from comment #2) > > Were older versions fine? > > Yes, there’s no problem with 9.55.0. Could you try building from source and see if it makes any difference? Like, manually, w/oo ebuild, etc? Want to narrow it down as much as possible. (In reply to Sam James from comment #4) > (In reply to Guillaume Ayoub from comment #3) > > (In reply to Sam James from comment #2) > > > Were older versions fine? > > > > Yes, there’s no problem with 9.55.0. > > Could you try building from source and see if it makes any difference? Like, > manually, w/oo ebuild, etc? Want to narrow it down as much as possible. I’ve downloaded the source tarball and compiled it ("./configure", "make", no explicit option). The problem also appears with this manually compiled version. The problem is not in the ebuild… Do you have another idea to find where it comes from? I’ve let Ghostscript’s configure use its own default C and C++ compilation options: - C compiler: x86_64-pc-linux-gnu-gcc -DHAVE_RESTRICT=1 -DUSE_LIBPAPER -Wall -W - C++ compiler: x86_64-pc-linux-gnu-g++ -std=c++17 It doesn’t fix the problem. (In reply to Guillaume Ayoub from comment #5) > (In reply to Sam James from comment #4) > > (In reply to Guillaume Ayoub from comment #3) > > > (In reply to Sam James from comment #2) > > > > Were older versions fine? > > > > > > Yes, there’s no problem with 9.55.0. > > > > Could you try building from source and see if it makes any difference? Like, > > manually, w/oo ebuild, etc? Want to narrow it down as much as possible. > > I’ve downloaded the source tarball and compiled it ("./configure", "make", > no explicit option). > > The problem also appears with this manually compiled version. The problem is > not in the ebuild… Do you have another idea to find where it comes from? I'm really struggling here. I've compared the ebuilds to Fedora and Arch's packaging, but it looks.. fine. And if it happens when building manually, it must be one of our dependencies, right? But if the Fedora or Arch binaries work for you, given they don't statically link stuff, it means it must be in how it was built. The only thing I can think of is some bundled library copy they're using, but it still doesn't make sense if a manual build fails with no patching. We did have a bug with lcms2 a little while ago, but it got fixed upstream (and we'd backported the patch before they made a fix release even): bug 832520. Perhaps if someone has some time, they could try using Fedora or Arch packages on Gentoo (if they are compatible with Gentoo's shared libraries). (In reply to Michał Górny from comment #8) > Perhaps if someone has some time, they could try using Fedora or Arch > packages on Gentoo (if they are compatible with Gentoo's shared libraries). Arch’s package has the bug when used on my Gentoo laptop. But there’s no bug on Arch. (If anyone wants to try, download and unzip Arch’s ghostscript and libjpeg-turbo packages, and set LD_LIBRARY_PATH=<unzip-path>/usr/lib/ GS_LIB=<unzip-path>/usr/share/ghostscript/Resource/Init/ environment variables. Arch’s libjpeg-turbo package is not compatible with Gentoo’s.) (In reply to Guillaume Ayoub from comment #9) > (In reply to Michał Górny from comment #8) > > Perhaps if someone has some time, they could try using Fedora or Arch > > packages on Gentoo (if they are compatible with Gentoo's shared libraries). > > Arch’s package has the bug when used on my Gentoo laptop. But there’s no bug > on Arch. > > (If anyone wants to try, download and unzip Arch’s ghostscript and > libjpeg-turbo packages, and set LD_LIBRARY_PATH=<unzip-path>/usr/lib/ > GS_LIB=<unzip-path>/usr/share/ghostscript/Resource/Init/ environment > variables. Arch’s libjpeg-turbo package is not compatible with Gentoo’s.) Okay, I think this is helpful. Next step is to compare the versions dependencies of GS dependencies on Arch vs Gentoo (not the versions listed in the ebuild, just the versions of each dependency in reality that are installed). (In reply to Sam James from comment #10) > Okay, I think this is helpful. Next step is to compare the versions > dependencies of GS dependencies on Arch vs Gentoo (not the versions listed > in the ebuild, just the versions of each dependency in reality that are > installed). I’ve tried to find some differences, but nothing obvious. OK. It’s time to find the source of the problem. FOR REAL. It’s BISECT TIME 🤯. The bug has been introduced by http://git.ghostscript.com/?p=ghostpdl.git;a=commit;h=42dca5ca192296b4cf40dd61f2eb61e062a1d449 Especially this part: http://git.ghostscript.com/?p=ghostpdl.git;a=blobdiff;f=base/fapi_ft.c;h=39dccc7d4f1d9ecdd9f34dcaca33a2cc3a76b74e;hp=d02453b795cdbce7972e93264613e5dbcf879589;hb=42dca5ca192296b4cf40dd61f2eb61e062a1d449;hpb=5e3eee0376626bc7d978b5136ac3f9d73d116bc5 Applying the reverse patch makes 9.56.1 work correctly for me. Random thoughts: - Arch’s package may work because it doesn’t remove in-tree freetype [1] as Gentoo’s ebuild does [2]. I’ve tried to keep the freetype folder in Gentoo’s ebuild, but it doesn’t work. Long story short: I have no idea of what’s going on. - The sample attached in this bug uses small fonts (makes sense), but that’s probably not the case of bug 851141. [1] https://github.com/archlinux/svntogit-packages/blob/packages/ghostscript/trunk/PKGBUILD#L51 [2] https://gitweb.gentoo.org/repo/gentoo.git/tree/app-text/ghostscript-gpl/ghostscript-gpl-9.56.1.ebuild#n74 (In reply to Guillaume Ayoub from comment #12) > The bug has been introduced by > http://git.ghostscript.com/?p=ghostpdl.git;a=commit; > h=42dca5ca192296b4cf40dd61f2eb61e062a1d449 > > Especially this part: > http://git.ghostscript.com/?p=ghostpdl.git;a=blobdiff;f=base/fapi_ft.c; > h=39dccc7d4f1d9ecdd9f34dcaca33a2cc3a76b74e; > hp=d02453b795cdbce7972e93264613e5dbcf879589; > hb=42dca5ca192296b4cf40dd61f2eb61e062a1d449; > hpb=5e3eee0376626bc7d978b5136ac3f9d73d116bc5 > > Applying the reverse patch makes 9.56.1 work correctly for me. > > Random thoughts: > > - Arch’s package may work because it doesn’t remove in-tree freetype [1] as > Gentoo’s ebuild does [2]. I’ve tried to keep the freetype folder in Gentoo’s > ebuild, but it doesn’t work. Long story short: I have no idea of what’s > going on. > > - The sample attached in this bug uses small fonts (makes sense), but that’s > probably not the case of bug 851141. > > [1] > https://github.com/archlinux/svntogit-packages/blob/packages/ghostscript/ > trunk/PKGBUILD#L51 > [2] > https://gitweb.gentoo.org/repo/gentoo.git/tree/app-text/ghostscript-gpl/ > ghostscript-gpl-9.56.1.ebuild#n74 Fantastic! Could you report it upstream? (In reply to Sam James from comment #13) > Fantastic! Could you report it upstream? Before reporting the bug upstream, we’d probably like to solve the last mystery: why does it work on other distributions? Ghostscript’s binary works on Gentoo, the distribution package (built from the sources) works on Arch. For now, there’s no evidence that the "bug" can be reproduced on any distribution other than Gentoo, and that’s a problem if we want the Ghostscript’s devs to reproduce and solve it. As Arch’s package has the bug when used on Gentoo, we can assume that the root of the bug is in another package (Freetype?) that’s different when built on Gentoo and on Arch. If anyone has an idea to find where the problem is, I can spend more time on this issue, but currently I don’t really know what to do :/. I would start by playing with freetype's USE flags. (In reply to Michał Górny from comment #15) > I would start by playing with freetype's USE flags. While checking the differences of the build options of Freetype on Gentoo and Arch, I’ve tried to apply the patch on Gentoo’s package instead of building from the sources. This way, I thought I could at least have Ghostscript’s ebuild working on my computer without the bug. But now, I’m desperate. - When building 9.56.1 from the git repository (ghostpdl-9.56.1 tag), I get the bug. - When building 9.56.1 from the git repository (ghostpdl-9.56.1 tag) with the reverse patch, I do not get the bug. - When building 9.56.1 from the ebuild, I get the bug. - When building 9.56.1 from the ebuild with the reverse patch, I GET THE BUG 😡. I’ve checked everything. I can see that the patch is applied when building from the ebuild, I’m sure that the patch applied to the git repository is exactly the same as the one applied to the ebuild. But it doesn’t fix the bug for the ebuild, only for the git repository. And of course, everything works WITHOUT the patch on other distributions, and even on Gentoo when we use the official build. It doesn’t make sense. I can try to play with Freetype’s USE flags, but I doubt that there’s something wrong with them from what I can say of Arch’s build options. Ghostscript includes its own copy of Freetype, I don’t know the differences with upstream and just "bisecting" these differences could take days. And that’s only for Freetype, but the same applies to other bundled libraries. I’ll try different random things when I can find more time. I can feel your pain. Believe me, I know what you're going through and even more I'd like to thank you for trying to figure this out. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7e7e2e1e67ce3374bafba51b9cdd271f29b48d2 commit a7e7e2e1e67ce3374bafba51b9cdd271f29b48d2 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-08-02 03:38:32 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-08-02 03:38:57 +0000 profiles: mask broken ghostscript-gpl-9.56.1 We should've done this earlier, even. Bug: https://bugs.gentoo.org/844115 Bug: https://bugs.gentoo.org/851141 Signed-off-by: Sam James <sam@gentoo.org> profiles/package.mask | 4 ++++ 1 file changed, 4 insertions(+) |