Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1402577 - trojita FTBFS on ppc64 and ppc64le
Summary: trojita FTBFS on ppc64 and ppc64le
Keywords:
Status: VERIFIED
Alias: None
Product: Fedora
Classification: Fedora
Component: trojita
Version: rawhide
Hardware: ppc64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Raphael Groner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: FE-ExcludeArch-ppc64, F-ExcludeArch-ppc64
TreeView+ depends on / blocked
 
Reported: 2016-12-07 20:56 UTC by Raphael Groner
Modified: 2017-12-18 00:22 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1402580 (view as bug list)
Environment:
Last Closed:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1401716 None None None Never
Red Hat Bugzilla 1402580 None None None Never
Red Hat Bugzilla 1423680 None None None Never
Red Hat Bugzilla 1450505 None None None Never

Internal Links: 1401716 1402580 1423680 1450505

Description Raphael Groner 2016-12-07 20:56:28 UTC
Description of problem:
trojita FTBFS on ppc64 and ppc64le
 
/builddir/build/BUILD/trojita-0.7/src/Imap/Parser/Rfc5322HeaderParser.cpp:2238:3: error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing]

Version-Release number of selected component (if applicable):
0.7-5

How reproducible:
yes

Steps to Reproduce:
1. koji build --scratch rawhide trojita-0.7-5.srpm
2.
3.

Actual results:
build.log has many times of the above mentioned error message.

Expected results:
builds successfully

Additional info:

Comment 1 Raphael Groner 2016-12-07 20:58:12 UTC
Temporarily solved by adding ExcludeArch.

Comment 2 Dan Horák 2016-12-07 22:21:52 UTC
adding -fsigned-char to CFLAGS should help, proper fix is to change the variable from char to either int or explicit "signed char"

Comment 3 Jan Kundrát 2016-12-08 00:40:38 UTC
Yeah, this is exactly why Trojita ships a pregenerated .cpp file created by a patched [1] Ragel in our git.

Unfortunately, Ragel upstream closed their git tree [2] with a funny explanation. I sent that patch upstream years ago, but I don't remember where exactly that communication went. I recall that they had a new, rewritten version in the making at that time.

[1] http://repo.or.cz/ragel-jkt.git/commitdiff/dc238e78cd3024889b6fb2618fe5bbc20179a132
[2] http://www.colm.net/news/2014/10/24/ragel-now-maintained-by-colm-networks.html

Comment 4 Raphael Groner 2016-12-08 17:56:27 UTC
(In reply to Jan Kundrát from comment #3)
> Yeah, this is exactly why Trojita ships a pregenerated .cpp file created by
> a patched [1] Ragel in our git.

Do you mean bug #1402582?
trojita FTBFS on armv7hl because ragel core dumps

Comment 5 Dan Horák 2017-02-20 13:20:41 UTC
I suggest to use something like

diff --git a/trojita.spec b/trojita.spec
index fdb33d6..6bb1a1f 100644
--- a/trojita.spec
+++ b/trojita.spec
@@ -11,7 +11,7 @@ Release:        0.7.%{gitdate}git%(c=%{commit0}; echo ${c:0:7} )%{?dist}.1
 Source0:        %{srcurl}/archive/%{commit0}.tar.gz#/%{name}-%{commit0}.tar.gz
 %else
 Version:        0.7
-Release:        7%{?dist}
+Release:        8%{?dist}
 Source0:        %{srcurl}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 %endif
 # manually generated manpage with help2man
@@ -42,9 +42,6 @@ License:        GPLv2+
 Summary:        IMAP e-mail client
 URL:            http://%{name}.flaska.net
 
-# rhbz#1402577 FIXME: src/Imap/Parser/Rfc5322HeaderParser.cpp:2238:3:
-# error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing]
-ExcludeArch:    ppc64 ppc64le aarch64
 # rhbz#1402582 FIXME: ragel core dumps
 ExcludeArch:    armv7hl
 
@@ -73,8 +70,13 @@ Requires:       qt5-qtsvg
 BuildRequires:  pkgconfig(zlib)
 BuildRequires:  qtkeychain-qt5-devel
 %if 0%{?fedora}
+# rhbz#1402577 FIXME: src/Imap/Parser/Rfc5322HeaderParser.cpp:2238:3:
+# error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing]
+# use prebuilt file on non-x86
+%ifarch %{ix86} x86_64
 BuildRequires:  ragel
 %endif
+%endif
 
 # (optional) support for GPG and S/MIME
 BuildRequires:  gnupg2-smime

because it makes very little sense to depend on ragel that is known to produce incorrect code, but rather use the pregenerated, but correct, source file.

And remove the ExcludeArch: arm too ...

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

Comment 7 Raphael Groner 2017-03-01 19:23:55 UTC
Hi Dan,

thanks for your contribution. Are you interested to become co-maintainer, at least for ppc64? From my side, I don't use ppc64 at all, so I must trust what koji tells me about success with builds and executed available unit tests.

Comment 8 Raphael Groner 2017-03-01 19:37:35 UTC
(In reply to Dan Horák from comment #5)
…
> because it makes very little sense to depend on ragel that is known to
> produce incorrect code, but rather use the pregenerated, but correct, source
> file.

No.
https://fedoraproject.org/wiki/Packaging:Guidelines#Use_of_pregenerated_code
 
> And remove the ExcludeArch: arm too ...

Why? There's another blocked bug for aarch64, see bug #1402580. Should I close as a duplication? I thought it's better to open that bug to difference the trackers.
https://fedoraproject.org/wiki/Packaging:Guidelines#Architecture_Build_Failures

Comment 9 Daniel Black 2017-12-18 00:22:16 UTC
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf 6.2.5(3) 

"If any other character is stored in a char object, the resulting value is implementation-defined"

Correct solution is to used "signed char" for whenever implementations rely on -ve values. This is going to solve all architecture bugs on this. This obviously applies to other bugs of similar form.


Note You need to log in before you can comment on or make changes to this bug.