Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 545502

Summary: AM_GNU_GETTEXT() fails on musl causing file collision with charset.alias
Product: Gentoo Linux Reporter: tt_1 <herrtimson>
Component: [OLD] UnspecifiedAssignee: Gentoo musl team <musl>
Status: RESOLVED FIXED    
Severity: normal CC: blueness, felix.janda, herrtimson
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 430702, 531846, 546890    
Attachments: build.log of hunspell-1.3.3-r99::hardened-development

Description tt_1 2015-04-04 12:23:33 UTC
Created attachment 400538 [details]
build.log of hunspell-1.3.3-r99::hardened-development

I am playing around with a amd64-stage-3-musl and tried to emerge app-text/hunspell which compiles fine but there is a file collision. as there is no difference in the locale.alias provided by e2fsprogs I simply deleted the file owned by e2fsprogs it, and so could merge app-text/hunspell.
Comment 1 Felix Janda 2015-04-05 06:41:26 UTC
This is not really specific to hunspell. The collision will occur for
any package with USE=nls and which includes a copy of gettext.

It actually shows that USE=nls generally is not really working as
intended with musl. The problem is that packages use the configure macro
AM_GNU_GETTEXT in order to ask for gettext and that this macro is very
eager about the GNU part. In particular there is a test
"for GNU gettext in libc" which fails on musl because it is testing for
the internal symbols _nls_msg_cat_cntr and _nls_domain_bindings.
(See /usr/share/aclocal/gettext.m4.) Now when this test fails, either
gettext is disabled or the internal gettext is used.
Comment 2 Felix Janda 2015-04-09 17:31:50 UTC
I forgot to say that a better workaround for hunspell and e2fsprogs is
to move locale.alias to INSTALL_MASK in make.conf.
Comment 3 Anthony Basile gentoo-dev 2015-05-13 17:50:34 UTC
(In reply to Felix Janda from comment #2)
> I forgot to say that a better workaround for hunspell and e2fsprogs is
> to move locale.alias to INSTALL_MASK in make.conf.

Currently we have 

    INSTALL_MASK="charset.alias"

in the profiles/hardened/linux/musl/make.defaults.  Should we add locale.alias too?  I can't think of a reason not to.
Comment 4 Felix Janda 2015-05-14 16:45:16 UTC
Adding locale.alias certainly does not hurt.

It still does not fix the underlying problem. See also

http://www.openwall.com/lists/musl/2015/04/16/3
http://lists.gnu.org/archive/html/bug-gettext/2015-04/msg00002.html
Comment 5 tt_1 2015-09-04 07:10:31 UTC
(In reply to Anthony Basile from comment #3)
> (In reply to Felix Janda from comment #2)
> > I forgot to say that a better workaround for hunspell and e2fsprogs is
> > to move locale.alias to INSTALL_MASK in make.conf.
> 
> Currently we have 
> 
>     INSTALL_MASK="charset.alias"
> 
> in the profiles/hardened/linux/musl/make.defaults.  Should we add
> locale.alias too?  I can't think of a reason not to.


there is a bunch of file collisions in the up to date stage-3, due to charset.alias. which is really strange as it should - and definitely is - included as INSTALL_MASK="charset.alias" in the make.defaults of the musl profile. this does not seems to be honored? 

affected packages are 

wget, grep, diffutils, tar, patch, coreutils, sed, findutils

workaround is to add INSTALL_MASK="charset.alias" to /etc/portage/make.conf
Comment 6 Anthony Basile gentoo-dev 2015-09-04 07:21:41 UTC
(In reply to tt_1 from comment #5)
> (In reply to Anthony Basile from comment #3)
> > (In reply to Felix Janda from comment #2)
> > > I forgot to say that a better workaround for hunspell and e2fsprogs is
> > > to move locale.alias to INSTALL_MASK in make.conf.
> > 
> > Currently we have 
> > 
> >     INSTALL_MASK="charset.alias"
> > 
> > in the profiles/hardened/linux/musl/make.defaults.  Should we add
> > locale.alias too?  I can't think of a reason not to.
> 
> 
> there is a bunch of file collisions in the up to date stage-3, due to
> charset.alias. which is really strange as it should - and definitely is -
> included as INSTALL_MASK="charset.alias" in the make.defaults of the musl
> profile. this does not seems to be honored? 
> 
> affected packages are 
> 
> wget, grep, diffutils, tar, patch, coreutils, sed, findutils
> 
> workaround is to add INSTALL_MASK="charset.alias" to /etc/portage/make.conf

the profile's INSTALL_MASK has never failed for me.  if it did, i would not even be able to build those stages.  i suspect something is broken at your end.  can you give me steps to reproduce.
Comment 7 tt_1 2015-09-04 07:32:55 UTC
I am testing this patch at the moment https://bugs.gentoo.org/show_bug.cgi?id=559520#c4. 

when reverting back to the in-tree musl there are no file collisions any more.
Comment 8 Felix Janda 2016-06-12 14:36:43 UTC
gettext.m4 is now fixed in sys-devel/gettext-0.19.4. Still, it will take
very long till most upstreams have updated their configure script.
Comment 9 Anthony Basile gentoo-dev 2016-06-12 14:39:23 UTC
(In reply to Felix Janda from comment #8)
> gettext.m4 is now fixed in sys-devel/gettext-0.19.4. Still, it will take
> very long till most upstreams have updated their configure script.

we'll have to backport one package at a time :(
Comment 10 Anthony Basile gentoo-dev 2017-09-03 15:38:48 UTC
(In reply to Anthony Basile from comment #9)
> (In reply to Felix Janda from comment #8)
> > gettext.m4 is now fixed in sys-devel/gettext-0.19.4. Still, it will take
> > very long till most upstreams have updated their configure script.
> 
> we'll have to backport one package at a time :(

this is no longer an issue with the latest version of hunspell in the tree.  re-open this if it comes up again.

See: https://github.com/gentoo/musl/pull/60#issuecomment-326811962