* bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors @ 2024-05-05 22:14 Rudolf Adamkovič 2024-05-11 8:56 ` Eli Zaretskii 0 siblings, 1 reply; 7+ messages in thread From: Rudolf Adamkovič @ 2024-05-05 22:14 UTC (permalink / raw) To: 70797 [-- Attachment #1: Type: text/plain, Size: 13 bytes --] Tags: patch [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Make-the-Compilation-mode-recognize-non-legacy-Kotli.patch --] [-- Type: text/patch, Size: 2855 bytes --] From 8ff95a02a321d730e2c3171b18ddb55f3a554d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= <rudolf@adamkovic.org> Date: Thu, 2 May 2024 19:06:11 +0200 Subject: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors The Compilation mode recognizes Kotlin/Gradle errors but only in the old format. The new format, which has been in wide use for about a year, is not supported. This patch adds support for the new format. * etc/compilation.txt: (symbols): Add a non-legacy Kotlin/Gradle warning and error. * lisp/progmodes/compile.el: (compilation-error-regexp-alist-alist): Rename 'gradle-kotlin' to 'gradle-kotlin-legacy' and add 'grade-kotlin' that matches errors and warnings outputted by non-legacy Kotlin/Gradle. --- etc/compilation.txt | 13 +++++++++++-- lisp/progmodes/compile.el | 20 +++++++++++++++++--- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/etc/compilation.txt b/etc/compilation.txt index 05f0829864c..e4e361ecfc7 100644 --- a/etc/compilation.txt +++ b/etc/compilation.txt @@ -186,13 +186,22 @@ Warning near line 10 file arrayclash.f: Module contains no executable Nonportable usage near line 31 col 9 file assign.f: mixed default and explicit -* Gradle with kotlin-gradle-plugin +* Gradle with Kotlin plugin -symbol: gradle-kotlin +symbol: grade-kotlin + +e: file:///src/Test.kt:267:5 foo: bar +w: file:///src/Test.kt:267:5 foo: bar + + +* Gradle with Kotlin plugin (legacy) + +symbol: gradle-kotlin-legacy e: /src/Test.kt: (34, 15): foo: bar w: /src/Test.kt: (34, 15): foo: bar + * Gradle Android resource linking symbol: gradle-android diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index b18eb81fee1..76a89bea4fc 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -258,10 +258,24 @@ compilation-error-regexp-alist-alist "\\(^Warning .*\\)? line[ \n]\\([0-9]+\\)[ \n]\\(?:col \\([0-9]+\\)[ \n]\\)?file \\([^ :;\n]+\\)" 4 2 3 (1)) - ;; Gradle with kotlin-gradle-plugin (see - ;; GradleStyleMessagerRenderer.kt in kotlin sources, see - ;; https://youtrack.jetbrains.com/issue/KT-34683). (gradle-kotlin + ,(rx bol + (| (group "w") ; 1: warning + (group (in "iv")) ; 2: info + "e") ; error + ": " + "file://" + (group ; 3: file + (? (in "A-Za-z") ":") + (+ (not (in "\n:")))) + ":" + (group (+ digit)) ; 4: line + ":" + (group (+ digit)) ; 5: column + " ") + 3 4 5 (1 . 2)) + + (gradle-kotlin-legacy ,(rx bol (| (group "w") ; 1: warning (group (in "iv")) ; 2: info -- 2.39.3 (Apple Git-146) [-- Attachment #3: Type: text/plain, Size: 255 bytes --] -- "All you have to do is write one true sentence. Write the truest sentence that you know." --- Ernest Miller Hemingway (1899-1961) Rudolf Adamkovič <rudolf@adamkovic.org> [he/him] Studenohorská 25, 84103 Bratislava, Slovakia, European Union ^ permalink raw reply related [flat|nested] 7+ messages in thread
* bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors 2024-05-05 22:14 bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors Rudolf Adamkovič @ 2024-05-11 8:56 ` Eli Zaretskii 2024-05-25 7:46 ` Eli Zaretskii 2024-06-13 14:44 ` Rudolf Adamkovic 0 siblings, 2 replies; 7+ messages in thread From: Eli Zaretskii @ 2024-05-11 8:56 UTC (permalink / raw) To: Rudolf Adamkovič; +Cc: 70797 > From: Rudolf Adamkovič <rudolf@adamkovic.org> > Date: Mon, 06 May 2024 00:14:04 +0200 > > >From 8ff95a02a321d730e2c3171b18ddb55f3a554d20 Mon Sep 17 00:00:00 2001 > From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= <rudolf@adamkovic.org> > Date: Thu, 2 May 2024 19:06:11 +0200 > Subject: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle > errors > > The Compilation mode recognizes Kotlin/Gradle errors but only in the old > format. The new format, which has been in wide use for about a year, is > not supported. This patch adds support for the new format. > > * etc/compilation.txt: > (symbols): Add a non-legacy Kotlin/Gradle warning and error. > * lisp/progmodes/compile.el: > (compilation-error-regexp-alist-alist): Rename 'gradle-kotlin' to > 'gradle-kotlin-legacy' and add 'grade-kotlin' that matches errors and > warnings outputted by non-legacy Kotlin/Gradle. > --- > etc/compilation.txt | 13 +++++++++++-- > lisp/progmodes/compile.el | 20 +++++++++++++++++--- > 2 files changed, 28 insertions(+), 5 deletions(-) Thanks, but: . applying this fails compile-tests in the test suite, so I guess some adjustment there is also needed; . you removed the comment with the pointer to kotlin sources, which might be still useful for the legacy format (unless the URL is no longer valid), so please restore that if the pointer can still be useful Thanks. ^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors 2024-05-11 8:56 ` Eli Zaretskii @ 2024-05-25 7:46 ` Eli Zaretskii 2024-06-08 11:44 ` Eli Zaretskii 2024-06-13 14:44 ` Rudolf Adamkovic 1 sibling, 1 reply; 7+ messages in thread From: Eli Zaretskii @ 2024-05-25 7:46 UTC (permalink / raw) To: rudolf; +Cc: 70797 Ping! Can we please make progress with resolving this issue? > Cc: 70797@debbugs.gnu.org > Date: Sat, 11 May 2024 11:56:02 +0300 > From: Eli Zaretskii <eliz@gnu.org> > > > From: Rudolf Adamkovič <rudolf@adamkovic.org> > > Date: Mon, 06 May 2024 00:14:04 +0200 > > > > >From 8ff95a02a321d730e2c3171b18ddb55f3a554d20 Mon Sep 17 00:00:00 2001 > > From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= <rudolf@adamkovic.org> > > Date: Thu, 2 May 2024 19:06:11 +0200 > > Subject: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle > > errors > > > > The Compilation mode recognizes Kotlin/Gradle errors but only in the old > > format. The new format, which has been in wide use for about a year, is > > not supported. This patch adds support for the new format. > > > > * etc/compilation.txt: > > (symbols): Add a non-legacy Kotlin/Gradle warning and error. > > * lisp/progmodes/compile.el: > > (compilation-error-regexp-alist-alist): Rename 'gradle-kotlin' to > > 'gradle-kotlin-legacy' and add 'grade-kotlin' that matches errors and > > warnings outputted by non-legacy Kotlin/Gradle. > > --- > > etc/compilation.txt | 13 +++++++++++-- > > lisp/progmodes/compile.el | 20 +++++++++++++++++--- > > 2 files changed, 28 insertions(+), 5 deletions(-) > > Thanks, but: > > . applying this fails compile-tests in the test suite, so I guess > some adjustment there is also needed; > . you removed the comment with the pointer to kotlin sources, which > might be still useful for the legacy format (unless the URL is no > longer valid), so please restore that if the pointer can still be > useful > > Thanks. > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors 2024-05-25 7:46 ` Eli Zaretskii @ 2024-06-08 11:44 ` Eli Zaretskii 2024-06-09 21:40 ` Rudolf Adamkovič 0 siblings, 1 reply; 7+ messages in thread From: Eli Zaretskii @ 2024-06-08 11:44 UTC (permalink / raw) To: rudolf; +Cc: 70797 Ping! Ping! Can we please resolve this issue? > Cc: 70797@debbugs.gnu.org > Date: Sat, 25 May 2024 10:46:53 +0300 > From: Eli Zaretskii <eliz@gnu.org> > > Ping! Can we please make progress with resolving this issue? > > > Cc: 70797@debbugs.gnu.org > > Date: Sat, 11 May 2024 11:56:02 +0300 > > From: Eli Zaretskii <eliz@gnu.org> > > > > > From: Rudolf Adamkovič <rudolf@adamkovic.org> > > > Date: Mon, 06 May 2024 00:14:04 +0200 > > > > > > >From 8ff95a02a321d730e2c3171b18ddb55f3a554d20 Mon Sep 17 00:00:00 2001 > > > From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= <rudolf@adamkovic.org> > > > Date: Thu, 2 May 2024 19:06:11 +0200 > > > Subject: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle > > > errors > > > > > > The Compilation mode recognizes Kotlin/Gradle errors but only in the old > > > format. The new format, which has been in wide use for about a year, is > > > not supported. This patch adds support for the new format. > > > > > > * etc/compilation.txt: > > > (symbols): Add a non-legacy Kotlin/Gradle warning and error. > > > * lisp/progmodes/compile.el: > > > (compilation-error-regexp-alist-alist): Rename 'gradle-kotlin' to > > > 'gradle-kotlin-legacy' and add 'grade-kotlin' that matches errors and > > > warnings outputted by non-legacy Kotlin/Gradle. > > > --- > > > etc/compilation.txt | 13 +++++++++++-- > > > lisp/progmodes/compile.el | 20 +++++++++++++++++--- > > > 2 files changed, 28 insertions(+), 5 deletions(-) > > > > Thanks, but: > > > > . applying this fails compile-tests in the test suite, so I guess > > some adjustment there is also needed; > > . you removed the comment with the pointer to kotlin sources, which > > might be still useful for the legacy format (unless the URL is no > > longer valid), so please restore that if the pointer can still be > > useful > > > > Thanks. > > > > > > > > > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors 2024-06-08 11:44 ` Eli Zaretskii @ 2024-06-09 21:40 ` Rudolf Adamkovič 0 siblings, 0 replies; 7+ messages in thread From: Rudolf Adamkovič @ 2024-06-09 21:40 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 70797 Eli Zaretskii <eliz@gnu.org> writes: > Ping! Ping! Can we please resolve this issue? My apologies, I got swamped with life. I plan to get back to working on FLOSS soon. Rudy -- "I love deadlines. I love the whooshing noise they make as they go by." --- Douglas Adams, The Salmon of Doubt, 2002 Rudolf Adamkovič <rudolf@adamkovic.org> [he/him] http://adamkovic.org ^ permalink raw reply [flat|nested] 7+ messages in thread
* bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors 2024-05-11 8:56 ` Eli Zaretskii 2024-05-25 7:46 ` Eli Zaretskii @ 2024-06-13 14:44 ` Rudolf Adamkovic 2024-06-22 8:34 ` Eli Zaretskii 1 sibling, 1 reply; 7+ messages in thread From: Rudolf Adamkovic @ 2024-06-13 14:44 UTC (permalink / raw) To: Eli Zaretskii; +Cc: 70797 [-- Attachment #1: Type: text/plain, Size: 992 bytes --] Eli Zaretskii <eliz@gnu.org> writes: > . applying this fails compile-tests in the test suite, so I guess > some adjustment there is also needed; Oops! In the new patch, attached below, I - adjust the existing legacy Gradle/Kotlin tests and - add new tests for the non-legacy Gradle/Kotlin warnings/errors. I also improved the commit message a bit. > . you removed the comment with the pointer to kotlin sources, which > might be still useful for the legacy format (unless the URL is no > longer valid), so please restore that if the pointer can still be > useful Smart! All right, I did a bit of research, and documented - the first and last Kotlin version that emits the current format, - the last Kotlin version that used the legacy format, - the official Git commit that removed the legacy format, - the public release date of the current format, and - the Kotlin class where the current format is defined. All of it is packed into two short comments. Rudy [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-Make-the-Compilation-mode-recognize-non-legacy-Kotli.patch --] [-- Type: text/x-patch, Size: 5692 bytes --] From d9ab03624d868ee5f6a40390e321544c941cb9d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= <rudolf@adamkovic.org> Date: Thu, 2 May 2024 19:06:11 +0200 Subject: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors The Compilation mode recognizes Kotlin/Gradle errors but only in the now legacy format. The current format, which has been in wide use for about a year, is not supported. This patch adds support for the current format. * etc/compilation.txt: (symbols): Add examples of non-legacy Kotlin/Gradle warnings and errors. * lisp/progmodes/compile.el: (compilation-error-regexp-alist-alist): Rename 'gradle-kotlin' to 'gradle-kotlin-legacy' and add 'grade-kotlin' that matches the errors and warnings outputted by the current (non-legacy) Kotlin/Gradle. * test/lisp/progmodes/compile-tests.el (compile-tests--test-regexps-data): Rename 'gradle-kotlin' to 'gradle-kotlin-legacy' and add two test cases for the newly added, non-legacy Kotlin/Gradle warnings and errors. --- etc/compilation.txt | 13 +++++++++++-- lisp/progmodes/compile.el | 24 +++++++++++++++++++++--- test/lisp/progmodes/compile-tests.el | 20 ++++++++++++-------- 3 files changed, 44 insertions(+), 13 deletions(-) diff --git a/etc/compilation.txt b/etc/compilation.txt index 05f0829864c..e4e361ecfc7 100644 --- a/etc/compilation.txt +++ b/etc/compilation.txt @@ -186,13 +186,22 @@ Warning near line 10 file arrayclash.f: Module contains no executable Nonportable usage near line 31 col 9 file assign.f: mixed default and explicit -* Gradle with kotlin-gradle-plugin +* Gradle with Kotlin plugin -symbol: gradle-kotlin +symbol: grade-kotlin + +e: file:///src/Test.kt:267:5 foo: bar +w: file:///src/Test.kt:267:5 foo: bar + + +* Gradle with Kotlin plugin (legacy) + +symbol: gradle-kotlin-legacy e: /src/Test.kt: (34, 15): foo: bar w: /src/Test.kt: (34, 15): foo: bar + * Gradle Android resource linking symbol: gradle-android diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index e31af774bd0..4d43a715fef 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -263,10 +263,28 @@ compilation-error-regexp-alist-alist "\\(^Warning .*\\)? line[ \n]\\([0-9]+\\)[ \n]\\(?:col \\([0-9]+\\)[ \n]\\)?file \\([^ :;\n]+\\)" 4 2 3 (1)) - ;; Gradle with kotlin-gradle-plugin (see - ;; GradleStyleMessagerRenderer.kt in kotlin sources, see - ;; https://youtrack.jetbrains.com/issue/KT-34683). + ;; Introduced in Kotlin 1.8 and current as of Kotlin 2.0. + ;; Emitted by `GradleStyleMessagerRenderer' in Kotlin sources. (gradle-kotlin + ,(rx bol + (| (group "w") ; 1: warning + (group (in "iv")) ; 2: info + "e") ; error + ": " + "file://" + (group ; 3: file + (? (in "A-Za-z") ":") + (+ (not (in "\n:")))) + ":" + (group (+ digit)) ; 4: line + ":" + (group (+ digit)) ; 5: column + " ") + 3 4 5 (1 . 2)) + + ;; Obsoleted in Kotlin 1.8 Beta, released on Nov 15, 2022. + ;; See commit `93a0cdbf973' in Kotlin Git repository. + (gradle-kotlin-legacy ,(rx bol (| (group "w") ; 1: warning (group (in "iv")) ; 2: info diff --git a/test/lisp/progmodes/compile-tests.el b/test/lisp/progmodes/compile-tests.el index 20beed955d2..b1187426ccf 100644 --- a/test/lisp/progmodes/compile-tests.el +++ b/test/lisp/progmodes/compile-tests.el @@ -270,20 +270,24 @@ compile-tests--test-regexps-data 1 nil 27041 "{standard input}") (gnu "boost/container/detail/flat_tree.hpp:589:25: [ skipping 5 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]" 1 25 589 "boost/container/detail/flat_tree.hpp" 0) - ;; gradle-kotlin + ;; Gradle/Kotlin (gradle-kotlin - "e: /src/Test.kt: (34, 15): foo: bar" 4 15 34 "/src/Test.kt" 2) + "e: file:///src/Test.kt:267:5 foo: bar" 4 5 267 "/src/Test.kt" 2) (gradle-kotlin + "w: file:///src/Test.kt:267:5 foo: bar" 4 5 267 "/src/Test.kt" 1) + (gradle-kotlin-legacy + "e: /src/Test.kt: (34, 15): foo: bar" 4 15 34 "/src/Test.kt" 2) + (gradle-kotlin-legacy "w: /src/Test.kt: (11, 98): foo: bar" 4 98 11 "/src/Test.kt" 1) - (gradle-kotlin + (gradle-kotlin-legacy "e: e:/cygwin/src/Test.kt: (34, 15): foo: bar" 4 15 34 "e:/cygwin/src/Test.kt" 2) - (gradle-kotlin + (gradle-kotlin-legacy "w: e:/cygwin/src/Test.kt: (11, 98): foo: bar" 4 98 11 "e:/cygwin/src/Test.kt" 1) - (gradle-kotlin + (gradle-kotlin-legacy "e: e:\\src\\Test.kt: (34, 15): foo: bar" 4 15 34 "e:\\src\\Test.kt" 2) - (gradle-kotlin + (gradle-kotlin-legacy "w: e:\\src\\Test.kt: (11, 98): foo: bar" 4 98 11 "e:\\src\\Test.kt" 1) (gradle-android " ERROR:/Users/salutis/src/AndroidSchemeExperiment/app/build/intermediates/incremental/debug/mergeDebugResources/stripped.dir/layout/item.xml:3: AAPT: error: '16dpw' is incompatible with attribute padding (attr) dimension." @@ -534,8 +538,8 @@ compile-test-error-regexps 1 15 5 "alpha.c"))) (compile--test-error-line test)) - (should (eq compilation-num-errors-found 106)) - (should (eq compilation-num-warnings-found 35)) + (should (eq compilation-num-errors-found 107)) + (should (eq compilation-num-warnings-found 36)) (should (eq compilation-num-infos-found 35))))) (ert-deftest compile-test-grep-regexps () -- 2.39.3 (Apple Git-146) [-- Attachment #3: Type: text/plain, Size: 282 bytes --] -- "Mathematics takes us still further from what is human into the region of absolute necessity, to which not only the actual world, but every possible world, must conform." --- Bertrand Russell, 1902 Rudolf Adamkovič <rudolf@adamkovic.org> [he/him] http://adamkovic.org ^ permalink raw reply related [flat|nested] 7+ messages in thread
* bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors 2024-06-13 14:44 ` Rudolf Adamkovic @ 2024-06-22 8:34 ` Eli Zaretskii 0 siblings, 0 replies; 7+ messages in thread From: Eli Zaretskii @ 2024-06-22 8:34 UTC (permalink / raw) To: Rudolf Adamkovic; +Cc: 70797-done > From: Rudolf (Rudy) Adamkovic <rudolf@adamkovic.org> > Cc: 70797@debbugs.gnu.org > Date: Thu, 13 Jun 2024 16:44:04 +0200 > > Eli Zaretskii <eliz@gnu.org> writes: > > > . applying this fails compile-tests in the test suite, so I guess > > some adjustment there is also needed; > > Oops! In the new patch, attached below, I > > - adjust the existing legacy Gradle/Kotlin tests and > - add new tests for the non-legacy Gradle/Kotlin warnings/errors. > > I also improved the commit message a bit. > > > . you removed the comment with the pointer to kotlin sources, which > > might be still useful for the legacy format (unless the URL is no > > longer valid), so please restore that if the pointer can still be > > useful > > Smart! All right, I did a bit of research, and documented > > - the first and last Kotlin version that emits the current format, > - the last Kotlin version that used the legacy format, > - the official Git commit that removed the legacy format, > - the public release date of the current format, and > - the Kotlin class where the current format is defined. > > All of it is packed into two short comments. Thanks, installed on the master branch, and closing the bug. P.S. Please in the future mention the bug number in the commit log messages, when you know the number. In the initial submission of a patch, the number is usually not known, but if you resubmit, it usually is known already. (I added the bug number when installing the changes.) ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-06-22 8:34 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-05-05 22:14 bug#70797: [PATCH] Make the Compilation mode recognize non-legacy Kotlin/Gradle errors Rudolf Adamkovič 2024-05-11 8:56 ` Eli Zaretskii 2024-05-25 7:46 ` Eli Zaretskii 2024-06-08 11:44 ` Eli Zaretskii 2024-06-09 21:40 ` Rudolf Adamkovič 2024-06-13 14:44 ` Rudolf Adamkovic 2024-06-22 8:34 ` Eli Zaretskii
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).