Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 669946 - net-mail/mailutils-3.4-r3 - In file included from common.c:95: /usr/include/bits/wchar2.h: In function ‘wcrtomb’: /usr/include/bits/wchar2.h:448:3: error: #error "Assumed value of MB_LEN_MAX wrong"
Summary: net-mail/mailutils-3.4-r3 - In file included from common.c:95: /usr/include/b...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Net-Mail Packages
URL:
Whiteboard:
Keywords:
: 673718 677498 691164 691800 691894 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-10-30 09:19 UTC by Arnim Eijkhoudt
Modified: 2020-01-28 07:02 UTC (History)
13 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emergeinfo.txt,16.60 KB, text/plain)
2018-10-30 09:20 UTC, Arnim Eijkhoudt
Details
pull in correct defintion from limits.h (mailutils-3.4-MB_LEN_MAX.patch,567 bytes, patch)
2019-01-19 18:42 UTC, Petr Cerny [:hrosik]
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arnim Eijkhoudt 2018-10-30 09:19:14 UTC
During compilation of net-mail/mailutils-3.4-r3, the compile phase fails in the 'frm' src dir. I'm unsure what causes this; attempting to find similar issues online has not produced anything resembling this error so far. There are no user/custom patches present on the system for any packages.

---

make[3]: Entering directory '/var/tmp/portage/net-mail/mailutils-3.4-r3/work/mailutils-3.4/frm'
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -I. -I../include -I../lib -I../lib/gnu -I../lib/gnu -I.. -I../include  -DSYSCONFDIR=\"/etc\"  -march=westmere -O2 -pipe -fomit-frame-pointer -fno-strict-aliasing -Wall -Wdeclaration-after-statement -c -o frm.o frm.c
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -I. -I../include -I../lib -I../lib/gnu -I../lib/gnu -I.. -I../include  -DSYSCONFDIR=\"/etc\"  -march=westmere -O2 -pipe -fomit-frame-pointer -fno-strict-aliasing -Wall -Wdeclaration-after-statement -c -o common.o common.c
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -I. -I../include -I../lib -I../lib/gnu -I../lib/gnu -I.. -I../include  -DSYSCONFDIR=\"/etc\"  -march=westmere -O2 -pipe -fomit-frame-pointer -fno-strict-aliasing -Wall -Wdeclaration-after-statement -c -o from.o from.c
In file included from /usr/include/wchar.h:850,
                 from ../lib/gnu/wchar.h:87,
                 from common.c:95:
/usr/include/bits/wchar2.h: In function ‘wcrtomb’:
/usr/include/bits/wchar2.h:448:3: error: #error "Assumed value of MB_LEN_MAX wrong"
 # error "Assumed value of MB_LEN_MAX wrong"
   ^~~~~
make[3]: *** [Makefile:1146: common.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/var/tmp/portage/net-mail/mailutils-3.4-r3/work/mailutils-3.4/frm'

Reproducible: Always

Steps to Reproduce:
1. emerge -v =net-mail/mailutils-3.4-r3
2.
3.
Actual Results:  
Nothing else needed, compilation fails consistently at this step.

Expected Results:  
Successful compilation.
Comment 1 Arnim Eijkhoudt 2018-10-30 09:20:41 UTC
Created attachment 553666 [details]
emerge --info

emerge --info
Comment 2 Mark Gomersbach 2018-11-24 16:55:01 UTC
Running into the same issue here too on 3.4-r2
Comment 3 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2018-11-25 18:23:50 UTC
A bit of debugging. I've added some kind of "printing" the values of MB_LEN_MAX and the value it's checked for:

```
In file included from /usr/include/wchar.h:850:0,
                 from ../lib/gnu/wchar.h:87,
                 from common.c:95:
/usr/include/bits/wchar2.h: In function ‘wcrtomb’:
/usr/include/bits/wchar2.h:452:9: note: #pragma message: __WCHAR_MB_LEN_MAX=16
 #pragma message(VAR_NAME_VALUE(__WCHAR_MB_LEN_MAX))
         ^~~~~~~
/usr/include/bits/wchar2.h:453:9: note: #pragma message: MB_LEN_MAX=4
 #pragma message(VAR_NAME_VALUE(MB_LEN_MAX))
         ^~~~~~~
/usr/include/bits/wchar2.h:456:3: error: #error "Assumed value of MB_LEN_MAX wrong"
 # error "Assumed value of MB_LEN_MAX wrong"
   ^~~~~
```

So, next step is to find why do they differ...
Comment 4 Vadim A. Misbakh-Soloviov (mva) gentoo-dev 2018-11-25 18:32:52 UTC
The problem is in file named `${S}/frm/frm.h` on line 38.
It has the following:
```
L37 #ifndef MB_LEN_MAX
L38 # define MB_LEN_MAX 4
L39 #endif
```

If I replace the definition here to `#include <limits.h>` (the same what bits/wchar.h does for getting MB_LEN_MAX value), all the things compiles fine...

Although, I'm not sure if it is a right fix...
Comment 5 Chicago 2018-12-02 23:29:14 UTC
Same issue here with:

In file included from /usr/include/wchar.h:850:0,
                 from ../lib/gnu/wchar.h:87,
                 from common.c:95:
/usr/include/bits/wchar2.h: In function ‘wcrtomb’:
/usr/include/bits/wchar2.h:448:3: error: #error "Assumed value of MB_LEN_MAX wrong"
 # error "Assumed value of MB_LEN_MAX wrong"
Comment 6 Chicago 2018-12-03 00:32:39 UTC
USE="-clients" will allow the build to complete.
Comment 7 Rolf Eike Beer archtester 2019-01-08 07:33:52 UTC
*** Bug 673718 has been marked as a duplicate of this bug. ***
Comment 8 Petr Cerny [:hrosik] 2019-01-19 18:42:06 UTC
Created attachment 562206 [details, diff]
pull in correct defintion from limits.h

Looks like a forgotten #include in mailutils.

The error is ultimately coming from /usr/include/bits/wchar2.h which is from glibc very much like /usr/include/limits.h. Checking the former you'll find a note, that they are intentionally not including the latter as not to pollute their namespace - the offending check serves as a safeguard against mixing incompatible headers.
Comment 9 Larry the Git Cow gentoo-dev 2019-02-07 13:14:01 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=122460d2688bed562f0806ad34c192d5ac231a84

commit 122460d2688bed562f0806ad34c192d5ac231a84
Author:     Eray Aslan <eras@gentoo.org>
AuthorDate: 2019-02-07 13:13:38 +0000
Commit:     Eray Aslan <eras@gentoo.org>
CommitDate: 2019-02-07 13:13:38 +0000

    net-mail/mailutils: bump to 3.5
    
    and add missing header file
    Closes: https://bugs.gentoo.org/669946
    Package-Manager: Portage-2.3.59, Repoman-2.3.12
    Signed-off-by: Eray Aslan <eras@gentoo.org>

 net-mail/mailutils/Manifest                        |   1 +
 .../files/mailutils-3.5-add-include.patch          |  10 ++
 net-mail/mailutils/mailutils-3.5.ebuild            | 131 +++++++++++++++++++++
 3 files changed, 142 insertions(+)
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2019-02-08 14:17:45 UTC
*** Bug 677498 has been marked as a duplicate of this bug. ***
Comment 11 Brian Evans (RETIRED) gentoo-dev 2019-07-31 17:49:13 UTC
*** Bug 691164 has been marked as a duplicate of this bug. ***
Comment 12 Thomas Beutin 2019-08-09 10:18:35 UTC
(In reply to Larry the Git Cow from comment #9)
> The bug has been closed via the following commit(s):
> 
> https://gitweb.gentoo.org/repo/gentoo.git/commit/
> ?id=122460d2688bed562f0806ad34c192d5ac231a84
> 
> commit 122460d2688bed562f0806ad34c192d5ac231a84
> Author:     Eray Aslan <eras@gentoo.org>
> AuthorDate: 2019-02-07 13:13:38 +0000
> Commit:     Eray Aslan <eras@gentoo.org>
> CommitDate: 2019-02-07 13:13:38 +0000
> 
>     net-mail/mailutils: bump to 3.5

That's not in tree (anymore?), just the old broken version.
Comment 13 Thomas Beutin 2019-08-09 10:37:42 UTC
(In reply to Thomas Beutin from comment #12)
> (In reply to Larry the Git Cow from comment #9)
> > The bug has been closed via the following commit(s):
> > 
> > https://gitweb.gentoo.org/repo/gentoo.git/commit/
> > ?id=122460d2688bed562f0806ad34c192d5ac231a84
> > 
> > commit 122460d2688bed562f0806ad34c192d5ac231a84
> > Author:     Eray Aslan <eras@gentoo.org>
> > AuthorDate: 2019-02-07 13:13:38 +0000
> > Commit:     Eray Aslan <eras@gentoo.org>
> > CommitDate: 2019-02-07 13:13:38 +0000
> > 
> >     net-mail/mailutils: bump to 3.5
> 
> That's not in tree (anymore?), just the old broken version.

Ok, it's fixed in (current unstable) v.3.7
Comment 14 matthias.grobarek 2019-08-10 07:43:13 UTC
*** Bug 691800 has been marked as a duplicate of this bug. ***
Comment 15 Dhalsim 2019-08-10 09:10:16 UTC
*** Bug 691894 has been marked as a duplicate of this bug. ***
Comment 16 Jaak Ristioja 2019-09-10 13:40:02 UTC
Stable users still run into this issue with net-mail/mailutils-3.4-r3.
Comment 17 Marcel Schilling 2020-01-28 07:02:11 UTC
This bug is not resolved. Why is it marked as such?
While there is https://bugs.gentoo.org/show_bug.cgi?id=663264, I still run into this with the latest tree.
Shouldn't there be a -r4 with the fix in instead of stabilizing the broken -r3?