Summary: | app-editors/emacs-29.3-r1: "make all" failed with exit status 2 with app-alternatives/sh[mksh] (app-shells/mksh) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Felix Janda <felix.janda> |
Component: | Current packages | Assignee: | GNU Emacs project <gnu-emacs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | contact, felix.janda, proxy-maint, tg |
Priority: | Normal | Keywords: | UPSTREAM |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://debbugs.gnu.org/70484 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 526268 | ||
Attachments: |
build.log
emerge --info * build-aux/make-info-dir: Avoid bashism (bug#70484). |
Description
Felix Janda
2024-04-15 22:44:09 UTC
Created attachment 890890 [details]
build.log
Created attachment 890891 [details]
emerge --info
``` ) >info/dir.tmp && mv info/dir.tmp info/dir ../build-aux/make-info-dir[104]: ${@?}: bad substitution ``` Your emerge --info has `sh mksh 59c`. Looks like ${@?} or more generally ${PARAMETER?} is a bashism. Can you report this upstream please? (In reply to Ulrich Müller from comment #4) > Looks like ${@?} or more generally ${PARAMETER?} is a bashism. Or maybe not. POSIX specifies it in https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02: ${parameter:?[word]} Indicate Error if Null or Unset. If parameter is unset or null, the expansion of word (or a message indicating it is unset if word is omitted) shall be written to standard error and the shell exits with a non-zero exit status. Otherwise, the value of parameter shall be substituted. An interactive shell need not exit. In the parameter expansions shown previously, use of the <colon> in the format shall result in a test for a parameter that is unset or null; omission of the <colon> shall result in a test for a parameter that is only unset. Thanks. I can confirm that it compiles successfully if I switch to bash. Hope to take a closer look, and potentially report to upstream soon. Indeed this looks like an mksh bug where even it's own manpage mentions "${name:?word}". None of the following, either interactively or in a shell script works: echo "${@?}" echo "${@?empty}" echo "${@:?}" echo "${@:?empty}" Meanwhile those works so likely due to $@ being a very special case: echo "${HOME:?empty}" echo "${HOME?empty}" echo "${HOM?empty}" echo "${HOM?}" mksh developer here. POSIX (Issue 8d4) specifically prefixes with… | If _parameter_ is '*' or '@', the result of the expansion is unspecified. … the section about ${parameter{-,=,?,+}word}, documents the same inline for ${#parameter}, and the same plus '#' for ${parameter{%,%%,#,##}word}. And in mksh, you cannot assign or trim a vector, so the expansion results in an error. Conforming scripts may not use it anyway. Upstream should just check $# instead. (In reply to mirabilos from comment #8) > POSIX (Issue 8d4) specifically prefixes with… > > | If _parameter_ is '*' or '@', the result of the expansion is unspecified. > > … the section about ${parameter{-,=,?,+}word}, documents the same inline for > ${#parameter}, and the same plus '#' for ${parameter{%,%%,#,##}word}. AFAICS the condition about its being unspecified with * or @ applies to ${#parameter} and ${parameter{%,%%,#,##}word}. However, I don't see it in the paragraph about ${parameter{-,=,?,+}word} (then again, the wording of that section is somewhat confusing, so maybe I am missing something). > Upstream should just check $# instead. I tend to agree. :) (In reply to Ulrich Müller from comment #4) > Can you report this upstream please? @Felix Janda: Please do (GNU Emacs upstream, that is). > AFAICS the condition about its being unspecified with * or @ applies to ${#parameter} and
> ${parameter{%,%%,#,##}word}.
That was in Issue 7. In Issue 8, it’s been deliberately changed: * and @ only for {-,=,?,+} and ${#var}, * and @ and # for {%,%%,#,##}.
That doesn’t mean that GNU Emacs should use it now before Issue 8 is fully released (expected sometime this year, basically “RSN”).
I've reported the bug upstream: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=70484 Created attachment 891424 [details, diff] * build-aux/make-info-dir: Avoid bashism (bug#70484). Does Emacs build with mksh when you apply attached patch? Tg(In reply to Ulrich Müller from comment #13) > Created attachment 891424 [details, diff] [details, diff] > * build-aux/make-info-dir: Avoid bashism (bug#70484). > > Does Emacs build with mksh when you apply attached patch? That works, thanks. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/emacs-patches.git/commit/?id=d844a2770af0f7ea9de097401f81c0b5e8282ee4 commit d844a2770af0f7ea9de097401f81c0b5e8282ee4 Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2024-04-23 19:47:21 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2024-04-23 19:47:21 +0000 26.3, 27.2, 28.2, 29.3: Fix build with mksh Bug: https://bugs.gentoo.org/930086 Signed-off-by: Ulrich Müller <ulm@gentoo.org> emacs/26.3/10_all_make-info-dir.patch | 29 +++++++++++++++++++++++++++++ emacs/27.2/12_all_make-info-dir.patch | 29 +++++++++++++++++++++++++++++ emacs/29.3/04_all_make-info-dir.patch | 29 +++++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f209f6283f44692afafea6933296fb65730bd465 commit f209f6283f44692afafea6933296fb65730bd465 Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2024-04-23 20:08:32 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2024-04-23 20:10:06 +0000 app-editors/emacs: Fix build with mksh, fix for autoconf-2.72 Closes: https://bugs.gentoo.org/930502 Closes: https://bugs.gentoo.org/930086 Signed-off-by: Ulrich Müller <ulm@gentoo.org> app-editors/emacs/Manifest | 4 + app-editors/emacs/emacs-26.3-r18.ebuild | 379 +++++++++++++++++++ app-editors/emacs/emacs-27.2-r16.ebuild | 445 +++++++++++++++++++++++ app-editors/emacs/emacs-28.2-r12.ebuild | 540 +++++++++++++++++++++++++++ app-editors/emacs/emacs-29.3-r2.ebuild | 627 ++++++++++++++++++++++++++++++++ 5 files changed, 1995 insertions(+) |