Bug 985344

Summary: libdigidocpp does not build because /usr/include/minizip/crypt.h is not compatible with C++ compiler
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: libdigidocppAssignee: Mihkel Vain <mihkel.vain>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 26CC: antti.andreimann, kalevlember, klember, mihkel.vain, pertusus, praiskup, pschiffe, tuju
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://koji.fedoraproject.org/koji/taskinfo?taskID=5618593
Whiteboard:
Fixed In Version: zlib-1.2.8-3.fc20 libdigidocpp-3.12.3-1.fc24 libdigidocpp-3.12.3-1.fc25 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-03-05 20:49:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1415937    
Bug Blocks:    

Description Petr Pisar 2013-07-17 10:24:37 UTC
libdigidocpp-0.3.0-19.fc20 fails to build in rawhide because g++ complains on some constructs in a zlib header file:

[100%] Building CXX object src/CMakeFiles/_digidoc__PYTHON__.dir/digidocPYTHON_wrap.cxx.o
cd /builddir/build/BUILD/libdigidocpp-0.3.0/x86_64-redhat-linux-gnu/src && /usr/bin/c++   -DDIGIDOCPP_CONFIG_DIR=\"/etc/digidocpp\" -D_digidoc__PYTHON___EXPORTS -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches  -m64 -mtune=generic  -fPIC -I/usr/include/minizip -I/builddir/build/BUILD/libdigidocpp-0.3.0/x86_64-redhat-linux-gnu/src    -Wno-format  -I/usr/include/python2.7 -I/builddir/build/BUILD/libdigidocpp-0.3.0/x86_64-redhat-linux-gnu/src/python -I/builddir/build/BUILD/libdigidocpp-0.3.0/src -o CMakeFiles/_digidoc__PYTHON__.dir/digidocPYTHON_wrap.cxx.o -c /builddir/build/BUILD/libdigidocpp-0.3.0/x86_64-redhat-linux-gnu/src/digidocPYTHON_wrap.cxx
In file included from /usr/lib64/perl5/CORE/reentr.h:109:0,
                 from /usr/lib64/perl5/CORE/op.h:688,
                 from /usr/lib64/perl5/CORE/perl.h:3479,
                 from /builddir/build/BUILD/libdigidocpp-0.3.0/x86_64-redhat-linux-gnu/src/digidocPERL_wrap.cxx:744:
/usr/include/minizip/crypt.h:35:53: error: 'z_crc_t' does not name a type
 static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab)
                                                     ^
/usr/include/minizip/crypt.h:35:62: error: ISO C++ forbids declaration of 'pcrc_32_tab' with no type [-fpermissive]
 static int decrypt_byte(unsigned long* pkeys, const z_crc_t* pcrc_32_tab)

Comment 1 Kalev Lember 2013-07-24 21:24:37 UTC
Reassigning to zlib.

Looks like minizip.h is missing zconf.h include for z_crc_t.

Comment 2 Kalev Lember 2013-08-10 13:33:55 UTC
I've submitted a patch for this upstream at http://mail.madler.net/pipermail/zlib-devel_madler.net/2013-August/003081.html

Comment 3 Kalev Lember 2013-08-10 13:49:08 UTC
... and went ahead and did a zlib build for rawhide with the patch backported, zlib-1.2.8-3.fc20.

Comment 4 Pavel Raiskup 2017-01-24 07:02:54 UTC
I'm not able to see the upstream zlib report because the mail archive is
dead (already reported to admins).  But the fix seems to be wrong;  the
crypt.h file is not supposed to be included directly but rather via zip.h
or unzip.h.  Maybe this is related to NOUNCRYPT fixed by _totally_
undocumented commit 64704e73bce559f2bd1a in Fedora's zlib package, I
re-submitted this:
https://github.com/madler/zlib/pull/210

I noted that latest build of libdigidocpp still depends on libz.so.1
(correct), but I also see that the minizip is built as a part of
libdigidocpp which looks like a bug (you should depend on libminizip.so).
Because there's FTBFS bug 1415937 (IMHO issue in building yet another
bundled libraries, please don't if possible), I stopped further analyzing
for now.

Re-opened to let you know that the zlib fix zlib-1.2.8-minizip-include.patch
is going to be reverted soon, unless I'll be proven it is wrong decision.

Comment 5 Mihkel Vain 2017-02-19 18:23:48 UTC
Removing dependency from bundled minizip is easy.

Correct me if I'm wrong. zlib-1.2.8-minizip-include.patch is already reverted in rawhide?

If I remove bundled minizip and do a mock build against F25... all seems ok. Against rawhide, then there seems to be a problem with openssl 1.1 (reported to upstream).

Besides openssl issues I currently do not see any build problems with libdigidocpp in relevance of minizip. Ot am I missing something obvious here?



$ fedpkg diff
diff --git a/libdigidocpp.spec b/libdigidocpp.spec
index 5794e27..7b73ddb 100644
--- a/libdigidocpp.spec
+++ b/libdigidocpp.spec
@@ -1,6 +1,6 @@
 Name:           libdigidocpp
 Version:        3.12.2
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Library for creating and validating BDoc and DDoc containers
 License:        LGPLv2+
 URL:            https://github.com/open-eid/libdigidocpp
@@ -11,6 +11,7 @@ BuildRequires:  libdigidoc-devel
 BuildRequires:  openssl-devel
 BuildRequires:  xml-security-c-devel
 BuildRequires:  xsd
+BuildRequires:  minizip-devel
 # Provide xxd
 BuildRequires:  vim-common
 
@@ -45,6 +46,9 @@ The %{name}-doc package contains documentation provided by upstream.
 %prep
 %setup -q
 
+# Remove bundled minizip
+rm -rf minizip
+
 %build
 %{cmake} . \
  -DCMAKE_INSTALL_SYSCONFDIR=/etc \
@@ -86,6 +90,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Sun Feb 19 2017 Mihkel Vain <mihkel@fedoraproject.org> - 3.12.2-2
+- Remove bundled minizip
+
 * Sun Jul 10 2016 Mihkel Vain <mihkel@fedoraproject.org> - 3.12.2-1
 - New upstream release

Comment 6 Pavel Raiskup 2017-02-20 09:38:02 UTC
(In reply to Mihkel Vain from comment #5)
> Removing dependency from bundled minizip is easy.

Nice!  Glad to see that you also 'rm -r minizip' subdir and it works fine.

> Correct me if I'm wrong. zlib-1.2.8-minizip-include.patch is already
> reverted in rawhide?

Correct.

> If I remove bundled minizip and do a mock build against F25... all seems ok.
> Against rawhide, then there seems to be a problem with openssl 1.1 (reported
> to upstream).

Did you consider building (for now) against compat-openssl10-devel ?

> Besides openssl issues I currently do not see any build problems with
> libdigidocpp in relevance of minizip. Ot am I missing something obvious here?

Not something I would consider obvious :).

Comment 7 Mihkel Vain 2017-02-20 17:28:03 UTC
> 
> Did you consider building (for now) against compat-openssl10-devel ?
> 

Not that easy I think. I tried a mock build and it failed.

libdigidocpp also depends on xml-security-c-devel and this again depends on openssl-devel (not compat-openssl10-devel) and since we have really old version of xml-security-c in Fedora repos, it also has FTBFS reported. Meanwhile I managed to contact xml-security-c maintainer(anttix) and he gave committer rights to someone named bruno who requested those rights a while ago. Anttix is a busy guy and he is not actively participating as a package maintainer.

I also wrote an e-mail to bruno and asked is he able to update that package any time soon. No reply yet.

https://admin.fedoraproject.org/pkgdb/package/rpms/xml-security-c/

So. Lets keeps this report open, but I think in general it is actually resolved. But lets wait a bit and see. Basically all my packages need an updated xml-security-c.

Comment 8 Fedora Update System 2017-02-24 22:55:15 UTC
libdigidocpp-3.12.3-1.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-cc45511239

Comment 9 Fedora Update System 2017-02-24 23:13:22 UTC
libdigidocpp-3.12.3-1.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2017-ccdfb3688e

Comment 10 Fedora Update System 2017-02-26 04:51:05 UTC
libdigidocpp-3.12.3-1.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-ccdfb3688e

Comment 11 Fedora Update System 2017-02-26 05:26:06 UTC
libdigidocpp-3.12.3-1.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-cc45511239

Comment 12 Fedora End Of Life 2017-02-28 09:34:21 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 13 Fedora Update System 2017-03-05 20:49:49 UTC
libdigidocpp-3.12.3-1.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 14 Fedora Update System 2017-03-06 02:51:14 UTC
libdigidocpp-3.12.3-1.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.