Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 862462 - app-editors/emacs-24.5-r11 fails to compile (MUSL): print.c:780:10: error: assignment of read-only variable stderr
Summary: app-editors/emacs-24.5-r11 fails to compile (MUSL): print.c:780:10: error: as...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: GNU Emacs project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: musl-porting
  Show dependency tree
 
Reported: 2022-07-31 07:36 UTC by Agostino Sarubbo
Modified: 2022-07-31 09:18 UTC (History)
0 users

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


Attachments
build.log (build.log,120.81 KB, text/plain)
2022-07-31 07:36 UTC, Agostino Sarubbo
Details
Suggested fix (10_all_musl.patch,314 bytes, patch)
2022-07-31 08:47 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-07-31 07:36:51 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: app-editors/emacs-24.5-r11 fails to compile (MUSL).
Discovered on: amd64 (internal ref: tinderbox_musl)

NOTE:
This machine uses MUSL libc
Comment 1 Agostino Sarubbo gentoo-dev 2022-07-31 07:36:53 UTC
Created attachment 795988 [details]
build.log

build log and emerge --info
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-31 07:41:28 UTC
I'd suggest masking on musl profiles unless/until someone expresses an interest in :24.

Newer versions are fine.
Comment 3 Ulrich Müller gentoo-dev 2022-07-31 08:36:18 UTC
This doesn't look too difficult to fix.

What is the canonical way to test for MUSL libc? Looks like there's no __MUSL__ macro?
Comment 4 Ulrich Müller gentoo-dev 2022-07-31 08:41:25 UTC
(In reply to Sam James from comment #2)
> I'd suggest masking on musl profiles unless/until someone expresses an
> interest in :24.

Don't give up so soon. :)

> Newer versions are fine.

Does "newer" include slot 25? From looking at the code, I'd conclude that slots 23, 24 and 25 are affected.
Comment 5 Ulrich Müller gentoo-dev 2022-07-31 08:47:41 UTC
Created attachment 796006 [details, diff]
Suggested fix

Please test if attached patch fixes the issue.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-31 08:48:24 UTC
(In reply to Ulrich Müller from comment #4)
> (In reply to Sam James from comment #2)
> > I'd suggest masking on musl profiles unless/until someone expresses an
> > interest in :24.
> 
> Don't give up so soon. :)
> 

Heh, I just didn't want to let the bug rot given I don't have an interest in it. But these bugs are definitely usually quite easy.

But fixes are good if you're willing!

> > Newer versions are fine.
> 
> Does "newer" include slot 25? From looking at the code, I'd conclude that
> slots 23, 24 and 25 are affected.

24/25 fail with this error
26 fails with a segfault when pdumping
27/28 work

Interestingly: https://github.com/gentoo/musl/blob/9b17d6983e42c3cb2799184672c2c54750cfc62c/app-editors/emacs/files/emacs-24.3-stderr.patch. But the patch is not great.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-31 08:52:04 UTC
(In reply to Ulrich Müller from comment #5)
> Created attachment 796006 [details, diff] [details, diff]
> Suggested fix
> 
> Please test if attached patch fixes the issue.

24 passes that build failure but dies later on. Do you want me to file the log here or a new bug?

Can't test 25 b/c segfault. I can report that too if it's not known (AFAICT it isn't).
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-31 08:52:35 UTC
(In reply to Sam James from comment #7)
> (In reply to Ulrich Müller from comment #5)
> > Created attachment 796006 [details, diff] [details, diff] [details, diff]
> > Suggested fix
> > 
> > Please test if attached patch fixes the issue.
> 
> 24 passes that build failure but dies later on. Do you want me to file the
> log here or a new bug?
> 

(it appears unrelated: "Error in GnuTLS initialization: ASN1 parser: Element was not found. make[1]: *** [Makefile:816: bootstrap-emacs] Error 1")
Comment 9 Ulrich Müller gentoo-dev 2022-07-31 08:57:42 UTC
(In reply to Sam James from comment #6)
> 24/25 fail with this error
> 26 fails with a segfault when pdumping
> 27/28 work

Later versions don't assign stderr, but do this properly using dup2(2). IMHO not worth backporting.

> Interestingly:
> https://github.com/gentoo/musl/blob/9b17d6983e42c3cb2799184672c2c54750cfc62c/app-editors/emacs/files/emacs-24.3-stderr.patch.
> But the patch is not great.

Right, that's a similar approach. (But I wasn't aware of that patch, so no credit for them. :)
Comment 10 Ulrich Müller gentoo-dev 2022-07-31 09:04:06 UTC
(In reply to Sam James from comment #7)
> 24 passes that build failure but dies later on. Do you want me to file the
> log here or a new bug?

Now is the time to go back to comment #2, I guess.
Comment 11 Larry the Git Cow gentoo-dev 2022-07-31 09:05:22 UTC
The bug has been referenced in the following commit(s):

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

commit dc6e94fb1eb9852873b6e45b512c295dc3714e73
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2022-07-31 09:03:04 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2022-07-31 09:05:00 +0000

    profiles/features/musl: package.mask app-editors/emacs:24
    
    Bug: https://bugs.gentoo.org/862462
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 profiles/features/musl/package.mask | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Comment 12 Larry the Git Cow gentoo-dev 2022-07-31 09:18:27 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18615f81471f13a8dd57810b111380db4e89c363

commit 18615f81471f13a8dd57810b111380db4e89c363
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2022-07-31 09:18:15 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2022-07-31 09:18:15 +0000

    profiles/features/musl: package.mask app-editors/emacs:25 and :26
    
    Bug: https://bugs.gentoo.org/862462
    Bug: https://bugs.gentoo.org/862489
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 profiles/features/musl/package.mask | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)