#2 really require the exact jbig2dec version
Merged 3 years ago by akhaitov. Opened 3 years ago by mjg.
rpms/ mjg/ghostscript master  into  master

file modified
+8 -6
@@ -39,8 +39,7 @@ 

  %global google_droid_fontpath %%(dirname $(fc-list : file | grep "DroidSansFallback"))

  

  # Desired jbig2dec header files and library version

- # Oldest possible, will be used in Requires and in configure script to check

- # if the correct header files and libraries are installed

+ # Apparantly, ghostscript complains even about newer versions

  # Please update if needed.

  %global jbig2dec_version 0.18

  
@@ -49,7 +48,7 @@ 

  Name:             ghostscript

  Summary:          Interpreter for PostScript language & PDF

  Version:          9.52

- Release:          6%{?dist}

+ Release:          7%{?dist}

  

  License:          AGPLv3+

  
@@ -57,7 +56,7 @@ 

  Source:           https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs%{version_short}/ghostscript-%{version}.tar.xz

  

  Requires:         libgs%{?_isa} = %{version}-%{release}

- Requires:         jbig2dec-libs >= %{jbig2dec_version}

+ Requires:         jbig2dec-libs = %{jbig2dec_version}

  

  # Auxiliary build requirements:

  BuildRequires:    automake
@@ -75,8 +74,8 @@ 

  BuildRequires:    dbus-devel

  BuildRequires:    fontconfig-devel

  BuildRequires:    freetype-devel

- BuildRequires:    jbig2dec-devel >= %{jbig2dec_version}

- BuildRequires:    jbig2dec-libs >= %{jbig2dec_version}

+ BuildRequires:    jbig2dec-devel = %{jbig2dec_version}

+ BuildRequires:    jbig2dec-libs = %{jbig2dec_version}

  BuildRequires:    lcms2-devel

  BuildRequires:    libidn-devel

  BuildRequires:    libijs-devel
@@ -467,6 +466,9 @@ 

  # =============================================================================

  

  %changelog

+ * Thu Jul 02 2020 Michael J Gruber <mjg@fedoraproject.org> - 9.52-7

+ - really require the exact jbig2dec version

+ 

  * Sat Jun 27 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 9.52-6

  - standard packages should not require -devel packages

  

673c823 ("Require the exact jbig2dec version in both build and runtime
dependencies", 2020-06-24) introduced a lower bound for the version. But
apparantly ghostscript complains even about newer versions (see e.g.
https://bodhi.fedoraproject.org/updates/FEDORA-2020-df4550580d).

So, make this a check on the exact jbig2dec version (but not the full
package version).

Note: jbig2dec maintainer tries to keep jbig2dec ABI stable within versions (upstream does not).

Thank you for the PR, LGTM

Pull-Request has been merged by akhaitov

3 years ago

Hi @mjg,

actually it is not ghostscript complaining about versions, but jbig2dec itself. The error comes out from jbig2_ctx_new_imp() function, which is called from jbig2_ctx_new() jbig2dec library function (used in ghostscript).
jbig2_ctx_new_imp() does the exact comparison of versions, which causes this error when ghostscript isn't rebuilt with the current jbig2dec (which should be announced/coordinated/done by jbig2dec maintainer).

IMO the correct fix can be:

1) contact jbig2dec upstream and ask whether the exact comparison is needed (API/ABI changes between releases), and if it is, consider using versioned soname, so those changes can be tracked. Or just adjust the check in jbig2dec code.
2) or take every new jbig2dec release as a soname bump and act accordingly - announce or rebuild dependent packages and then create an update containing jbig2dec and ghostscript. @akhaitov can make you ghostscript co-maintainer for smoothing the rebuild process if you want.

Requiring the exact jbig2dec version in ghostscript just shifts the problem to ghostscript - '''gs''' will still fail if jbig2dec gets an update and it is built with the older one - with no value for user IMO.

To sum it up, currently a coordination is needed between jbig2dec and ghostscript builds and updates if jbig2dec gets new release, because the version check causes the same thing as soname bump does.