Subject: bug#18109: 24.4.50; `compilation-error-regexp-alist-alist': wrong regexp for Maven

From: Mattias Engdegård <[email-masked]>
Date: Sun, 6 Dec 2020 16:05:20 +0100

6 dec. 2020 kl. 15.22 skrev Filipp Gunbin <[email-masked]>:

> Hm, I rarely use Maven these days (many projects switched to Gradle),
> and I'm not on Windows any more, so I cannot reproduce the original
> problem now.  If you think it's very improbable to have non-prefixed
> message - just make the regexp more strict, and let's see whether
> someone reports it again.

Thank you, maybe we should indeed do that.

It is good to have someone knowing Gradle! That pattern could need some work as well. It currently is (in rx form):

(rx bol
   (| (group "w") nonl)
   ":"
   (* " ")     ; ??
   (group
    (? (in "A-Za-z") ":")
    (+ (not (in "\n:"))))
   ":"
   (* " ")     ; ??
   "("
   (group (+ (in "0-9")))
   ","
   (* " ")     ; ??
   (group (+ (in "0-9")))
   ")")

but the examples (from compilation.txt) look like:

e: /src/Test.kt: (34, 15): foo: bar
w: /src/Test.kt: (34, 15): foo: bar

Thus it looks like we can expect exactly one space each after the first and second colon and after the comma, instead of zero-or-more spaces (the '??' comments above). As a Gradle user, can you confirm this?

The way the pattern is written makes it prone to matching other messages entirely or partly, with potential negative consequences for correctness, performance or both.