I am having trouble compiling emacs: *** *** "make all" failed with exit status 2. *** *** You could try to: *** - run "make bootstrap", which might fix the problem *** - run "make V=1", which displays the full commands invoked by make, *** to further investigate the problem *** make[1]: *** [Makefile:414: advice-on-failure] Error 2 Running "make V=1" gives a little more info: /bin/mkdir -p ./info (cd ./doc && \ AWK='gawk' ../build-aux/make-info-dir ../build-aux/dir_top emacs/emacs.texi lispintro/emacs-lisp-intro.texi lispref/elisp.texi misc/auth.texi misc/autotype.texi misc/bovine.texi misc/calc.texi misc/cc-mode.texi misc/cl.texi misc/dbus.texi misc/dired-x.texi misc/ebrowse.texi misc/ede.texi misc/ediff.texi misc/edt.texi misc/efaq.texi misc/eglot.texi misc/eieio.texi misc/emacs-gnutls.texi misc/emacs-mime.texi misc/epa.texi misc/erc.texi misc/ert.texi misc/eshell.texi misc/eudc.texi misc/eww.texi misc/flymake.texi misc/forms.texi misc/gnus.texi misc/htmlfontify.texi misc/idlwave.texi misc/ido.texi misc/info.texi misc/mairix-el.texi misc/message.texi misc/mh-e.texi misc/modus-themes.org misc/newsticker.texi misc/nxml-mode.texi misc/octave-mode.texi misc/org.org misc/pcl-cvs.texi misc/pgg.texi misc/rcirc.texi misc/reftex.texi misc/remember.texi misc/sasl.texi misc/sc.texi misc/semantic.texi misc/ses.texi misc/sieve.texi misc/smtpmail.texi misc/speedbar.texi misc/srecode.texi misc/todo-mode.texi misc/tramp.texi misc/transient.texi misc/url.texi misc/use-package.texi misc/vhdl-mode.texi misc/vip.texi misc/viper.texi misc/vtable.texi misc/widget.texi misc/wisent.texi misc/woman.texi \ ) >info/dir.tmp && mv info/dir.tmp info/dir ../build-aux/make-info-dir[104]: ${@?}: bad substitution make[1]: *** [Makefile:1169: info/dir] Error 1 Reproducible: Always
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(+)