Subject: bug#59444: closed (Re: bug#59444: ADVICE-ON-FAILURE sed syntax error)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 21 Nov 2022 12:50:02 +0000

Your bug report

#59444: ADVICE-ON-FAILURE sed syntax error

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
59444: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=59444
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#59444: ADVICE-ON-FAILURE sed syntax error
From: Gregory Heytings <[email-masked]>
To: Mattias Engdegård <[email-masked]>
Cc: [email-masked]
Date: Mon, 21 Nov 2022 12:49:50 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Thanks for your bug report.

>
> Right now on Emacs master (d9d8a2eba9), any build error results in
>

Is this new?  That part of the Makefile hasn't changed in the last two 
months, after it was introduced.

>
> The bug is here somewhere (Makefile.in:413):
>
> sed -n '/^# ADVICE-ON-FAILURE-BEGIN:${make-target}/,$${p;/^# ADVICE-ON-FAILURE-END:${make-target}/q};'
>
> Any reason why this isn't just written
>
> sed -n '/^# ADVICE-ON-FAILURE-BEGIN:${make-target}/,/^# ADVICE-ON-FAILURE-END:${make-target}/p'
>
> ? The latter would work with any standard `sed`.
>

Again I tested this with (GNU) sed with --posix, and it gave the expected 
result.  The reason I chose the former expression instead of the latter is 
because it's how I usually write such patterns.  After reading the POSIX 
standard, it turns out that a semicolon is required after the 'q'.  Fixed 
(a3b654e069) and closing.

Subject: ADVICE-ON-FAILURE sed syntax error
From: Mattias Engdegård <[email-masked]>
To: Emacs Bug Report <[email-masked]>
Cc: Gregory Heytings <[email-masked]>
Date: Mon, 21 Nov 2022 12:51:05 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Right now on Emacs master (d9d8a2eba9), any build error results in

***
*** "make all" failed with exit status 2.
***
sed: 1: "/^# ADVICE-ON-FAILURE-B ...": extra characters at the end of q command
make[1]: *** [advice-on-failure] Error 1
make: *** [all] Error 2

which is less than helpful. (This is with macOS 11.7, system tools.)

The bug is here somewhere (Makefile.in:413):

  sed -n '/^# ADVICE-ON-FAILURE-BEGIN:${make-target}/,$${p;/^# ADVICE-ON-FAILURE-END:${make-target}/q};'

Any reason why this isn't just written

  sed -n '/^# ADVICE-ON-FAILURE-BEGIN:${make-target}/,/^# ADVICE-ON-FAILURE-END:${make-target}/p'

? The latter would work with any standard `sed`.