unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#59444: ADVICE-ON-FAILURE sed syntax error
@ 2022-11-21 11:51 Mattias Engdegård
  2022-11-21 12:49 ` Gregory Heytings
  0 siblings, 1 reply; 4+ messages in thread
From: Mattias Engdegård @ 2022-11-21 11:51 UTC (permalink / raw)
  To: 59444; +Cc: Gregory Heytings

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`.






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#59444: ADVICE-ON-FAILURE sed syntax error
  2022-11-21 11:51 bug#59444: ADVICE-ON-FAILURE sed syntax error Mattias Engdegård
@ 2022-11-21 12:49 ` Gregory Heytings
  2022-11-21 13:11   ` Mattias Engdegård
  0 siblings, 1 reply; 4+ messages in thread
From: Gregory Heytings @ 2022-11-21 12:49 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: 59444-done


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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#59444: ADVICE-ON-FAILURE sed syntax error
  2022-11-21 12:49 ` Gregory Heytings
@ 2022-11-21 13:11   ` Mattias Engdegård
  2022-11-21 13:17     ` Gregory Heytings
  0 siblings, 1 reply; 4+ messages in thread
From: Mattias Engdegård @ 2022-11-21 13:11 UTC (permalink / raw)
  To: Gregory Heytings; +Cc: 59444

21 nov. 2022 kl. 13.49 skrev Gregory Heytings <gregory@heytings.org>:

> Again I tested this with (GNU) sed with --posix, and it gave the expected result.

Then what we should learn from this is that GNU sed --posix cannot be trusted blindly to reject non-POSIX features.
This is unsurprising -- it can be difficult to keep all extensions from leaking past the gate.

>  The reason I chose the former expression instead of the latter is because it's how I usually write such patterns.

That doesn't answer the question. Why that roundabout way, rather than the simpler direct approach?

> Fixed (a3b654e069) and closing.

That seems to work. Thank you!






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#59444: ADVICE-ON-FAILURE sed syntax error
  2022-11-21 13:11   ` Mattias Engdegård
@ 2022-11-21 13:17     ` Gregory Heytings
  0 siblings, 0 replies; 4+ messages in thread
From: Gregory Heytings @ 2022-11-21 13:17 UTC (permalink / raw)
  To: Mattias Engdegård; +Cc: 59444


>> Again I tested this with (GNU) sed with --posix, and it gave the 
>> expected result.
>
> Then what we should learn from this is that GNU sed --posix cannot be 
> trusted blindly to reject non-POSIX features. This is unsurprising -- it 
> can be difficult to keep all extensions from leaking past the gate.
>

Do you know of any computer program that can be trusted blindly? ;-)

>> The reason I chose the former expression instead of the latter is 
>> because it's how I usually write such patterns.
>
> That doesn't answer the question. Why that roundabout way, rather than 
> the simpler direct approach?
>

I write such expressions that way because with that expression only the 
first matching block is printed.  Which is admittedly not important in 
this case, but habits being what they are...





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-21 13:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-21 11:51 bug#59444: ADVICE-ON-FAILURE sed syntax error Mattias Engdegård
2022-11-21 12:49 ` Gregory Heytings
2022-11-21 13:11   ` Mattias Engdegård
2022-11-21 13:17     ` Gregory Heytings

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).