[patch] maven: fix build with java-slf4j-simple-source expanded

DoneSubmitted by Dr. Arne Babenhauserheide.
Details
3 participants
  • Dr. Arne Babenhauserheide
  • Julien Lepiller
  • Rostislav Svoboda
Owner
unassigned
Severity
normal
D
D
Dr. Arne Babenhauserheide wrote on 12 Sep 14:33 +0200
(address . bug-guix@gnu.org)
87sfkw3h4i.fsf@web.de
Hi,

Maven failed to build for me, because java-slf4j-simple-source is no
longer a tarball, but an expanded directory of files.

Copying the files from Scheme makes it build. A patch is attached.
From f9ca747f6ecf63d46a41e813c6c4e7b7190e9081 Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide <arne_bab@web.de>
Date: Mon, 12 Sep 2022 14:31:42 +0200
Subject: [PATCH] gnu: maven: fix build with java-slf4j-simple-source expanded

* gnu/packages/maven.scm (maven): copy files from source.
---
gnu/packages/maven.scm | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

Toggle diff (33 lines)
diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm
index 28ec4eb9a8..a7d984fef2 100644
--- a/gnu/packages/maven.scm
+++ b/gnu/packages/maven.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2019 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2022 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+;;; Copyright © 2022 Arne Babenhauserheide <arne_bab@web.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1787,7 +1788,17 @@ (define-public maven-slf4j-provider
            (lambda* (#:key inputs #:allow-other-keys)
              (mkdir-p "generated-sources")
              (with-directory-excursion "generated-sources"
-               (invoke "tar" "xf" (assoc-ref inputs "java-slf4j-simple-source"))
+               (let ((input-folder (assoc-ref inputs "java-slf4j-simple-source")))
+                 ;; copy all files
+                 (for-each (lambda (filename)
+                             (let ((target (string-drop
+                                            filename ;; remove one more than length: the slash
+                                            (1+ (string-length input-folder)))))
+                               (when (not (file-exists? (dirname target)))
+                                 (mkdir-p (dirname target)))
+                               (copy-file filename target)))
+                           (find-files (assoc-ref inputs "java-slf4j-simple-source"))))
+
                (for-each delete-file (find-files "." "StaticLoggerBinder.java")))
              (for-each
                (lambda (simple)
-- 
2.37.3
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de
-----BEGIN PGP SIGNATURE-----

iQJEBAEBCAAuFiEE801qEjXQSQPNItXAE++NRSQDw+sFAmMfJ44QHGFybmVfYmFi
QHdlYi5kZQAKCRAT741FJAPD610OD/9gZfUHAxvzaWWdRzhNln/MyEaq5tQueKWR
CNWQU657MyiRyRI3cDNmdPB4tP9TfhGutiic9NUSMwnUrGwOjWYPuEQVDrEf1aPW
Msq/VI/aak9lZuow0u8PjV+/LQGE3ge5518f8FRyUtLAfYLe3+qzdN2GJWBQ4kWE
NdKk8SLOzK/MCiCdAiqDCTh95esM6VtWKSsCRqVEbOpb7jI0WKeqxvS3Aaknspj0
fHnJmZCz3HEFkF5Mom2sxOktaNBt0IgzOu5ayxUjnGF6uJiQueEBzyuKB/BS2oeO
5Vwv4Bd8ETHcf326I90NlpppmLIlVTho8F42KwJEHzik/cUn0L6m6OrIoEmDMSMK
1jwXF55DgaNv2SmmkzXiC68L5DcNBjGart6cIbxgdwSxJGeGGPgY2+aKwYsbwzrf
o6FX0L8wuHkENINLqHcpxRI3SLW/oeEwKZ182BPc8cL5WleMLWH0qoEbubsDrbVz
1yYTRUvuwtXCh7QmSB6eJky+t2FRNluTyXOmmG53YhZccCnTaqaH87jQwL+QkXrp
GKAAQvcicRTU+9GmOHgPx779EUnbdphvH/CIeMITG6D2kWSJg9qmy7C8Iq15uuSB
ny2QKMvZ78Q5y9zZPViOt4jMFZG2YMZa/0t4JdBINL86HTNRylU3PYbG16QuX2xD
QHTKrcgkKYjEBAEBCAAuFiEE3Si95tmHXKvOSosd3M8NswvBBUgFAmMfJ44QHGFy
bmVfYmFiQHdlYi5kZQAKCRDczw2zC8EFSBzvA/9rHbfVtfVJsUp0NEjM6k4IrwVM
Z6aQv9XQYrUCcSTWwkbLOJ56fAWRl+RLmlXzI9X8/xZndls1sRfwZBrdDRbaRHOo
vA4ZZBmayl5Ouehl7A0gTqv/+Q0CBFsHHvv1VV1IXKJ2vI5Fgl5h1uFsU0xkEjpD
jU/w5zJT/ELpiuAr8w==
=GDvL
-----END PGP SIGNATURE-----

J
J
Julien Lepiller wrote on 12 Sep 16:13 +0200
Re: bug#57749: [patch] maven: fix build with java-slf4j-simple-source expanded
B0390C3D-549E-418D-AFFC-731DE91D6106@lepiller.eu
I don't think checking for file-exists before mkdir-p makes much sense. Doesn't mkdir-p make the same checks already?

I thought find-files required two arguments? Also the first argument could be simplified to input-folder

Otherwise LGTM, but I can't push myself currently. Thanks!

Le 12 septembre 2022 14:33:04 GMT+02:00, "Dr. Arne Babenhauserheide" <arne_bab@web.de> a écrit :
Toggle quote (8 lines)
>Hi,
>
>Maven failed to build for me, because java-slf4j-simple-source is no
>longer a tarball, but an expanded directory of files.
>
>Copying the files from Scheme makes it build. A patch is attached.
>
>
Attachment: file
D
D
Dr. Arne Babenhauserheide wrote on 12 Sep 17:45 +0200
Re: bug#57749: [patch] maven: fix build with java-slf4j-simple-source expanded
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 57749@debbugs.gnu.org)
87o7vk37uv.fsf@web.de
Julien Lepiller <julien@lepiller.eu> writes:

Toggle quote (3 lines)
> I don't think checking for file-exists before mkdir-p makes much sense. Doesn't mkdir-p make the same
> checks already?

You’re right — thank you!

Toggle quote (3 lines)
> I thought find-files required two arguments? Also the first argument
> could be simplified to input-folder

The second argument is #:optional. But yes, it should be input-folder —
that was the whole point of the first let.

Thank you!

Toggle quote (2 lines)
> Otherwise LGTM, but I can't push myself currently. Thanks!

Here’s the updated patch:
From 12164a5b46ad0a5c27c42b426ad94df8f9910b48 Mon Sep 17 00:00:00 2001
From: Arne Babenhauserheide <arne_bab@web.de>
Date: Mon, 12 Sep 2022 14:31:42 +0200
Subject: [PATCH] gnu: maven: fix build with java-slf4j-simple-source expanded

* gnu/packages/maven.scm (maven): copy files from source.
---
gnu/packages/maven.scm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

Toggle diff (32 lines)
diff --git a/gnu/packages/maven.scm b/gnu/packages/maven.scm
index 28ec4eb9a8..f198c2a475 100644
--- a/gnu/packages/maven.scm
+++ b/gnu/packages/maven.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2019 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2022 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+;;; Copyright © 2022 Arne Babenhauserheide <arne_bab@web.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1787,7 +1788,16 @@ (define-public maven-slf4j-provider
            (lambda* (#:key inputs #:allow-other-keys)
              (mkdir-p "generated-sources")
              (with-directory-excursion "generated-sources"
-               (invoke "tar" "xf" (assoc-ref inputs "java-slf4j-simple-source"))
+               (let ((input-folder (assoc-ref inputs "java-slf4j-simple-source")))
+                 ;; copy all files
+                 (for-each (lambda (filename)
+                             (let ((target ;; remove folder prefix plus slash
+                                    (string-drop
+                                     filename
+                                     (1+ (string-length input-folder)))))
+                               (mkdir-p (dirname target))
+                               (copy-file filename target)))
+                           (find-files input-folder)))
                (for-each delete-file (find-files "." "StaticLoggerBinder.java")))
              (for-each
                (lambda (simple)
-- 
2.37.3
Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de
-----BEGIN PGP SIGNATURE-----

iQJEBAEBCAAuFiEE801qEjXQSQPNItXAE++NRSQDw+sFAmMfVnkQHGFybmVfYmFi
QHdlYi5kZQAKCRAT741FJAPD68OHEAC0pLcYfyXQMPTRQ+FQ2ssmMNsaiUwyac8Z
cxUAmR33pYRUp1CPbWQEwR6PjizAEMBLXPsqxmq8+jse6e3u25TzmR1NiKoqjU+y
fTzYlaMJ8UnPjClng2NF6C7DJ8oKX0WnUXgLhKNdJ6u9He/uB+cUcd095vlZJCkY
VH99grSpA8U+Tum7F7b1x39OfWFMEe6OXHirfM7y86XmIxvYjNBMXv0LL8J1D5mi
DTCT2gJaRcHsV0nKWQVY7zqdt5Tag5kOfYJ3CqghYCFrY2W/q4mIbRB9hWpWNMij
NZ9zMmULKQxrMI85qtmfBXWehGM9ZGw+VajKuC+GomVTWgWmpLUZ8DVi5dAabuxE
hJSlx4C+6oNxMhrQoeCF+pvKBY20WMpVMMeoQmoC0bgbFh4sHDjRQx94RCT82TcK
oSTua8B6u0haFr51RH5NEUFgt8C3hXxLlpzpTgROs2OEuwktR6reNWDoGq3voxyp
xqyyyrjjOhwc2wPJH86p1jcWcIGCpAWuhBhEhyXw3ZIxfMEIuMEgimCDGW2PZtPh
odoJUCmfS7bvp6HLhF5WQTmZdgt/BXGj9KimXqsWrrjLoJYptmgjUMciFpLeY4OG
/H/Av2L+wOKo+wNTxZ+wGZXNT+q5WExvooHSXw0DpOxqniWhIXfZHKZm9cPDSUc8
SWvkL74lmojEBAEBCAAuFiEE3Si95tmHXKvOSosd3M8NswvBBUgFAmMfVnkQHGFy
bmVfYmFiQHdlYi5kZQAKCRDczw2zC8EFSOQzA/9XiFDPmOBcSeH5eHoyYxmoHl+j
tfX+klFgm68CKPiX9gDnq2oCepp4+O62UDMgf3PU7iNYAApWBmM3Lq1pRj7pqNxa
1rY653CH5EW9BlJxq0xa+DT7yAEp9haUpm4LK12nlfDg0+7tH7mMtmgdTxcHYmZj
nMNI+bGKWz5+pUXUsQ==
=LcLc
-----END PGP SIGNATURE-----

D
D
Dr. Arne Babenhauserheide wrote on 21 Sep 23:42 +0200
(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 57749@debbugs.gnu.org)
87illgs8ru.fsf@web.de
"Dr. Arne Babenhauserheide" <arne_bab@web.de> writes:
Toggle quote (5 lines)
> Julien Lepiller <julien@lepiller.eu> writes:
>> Otherwise LGTM, but I can't push myself currently. Thanks!
>
> Here’s the updated patch:

Can you push again?
(sorry to come back, I just don’t want this to get lost)

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de
-----BEGIN PGP SIGNATURE-----

iQJEBAEBCAAuFiEE801qEjXQSQPNItXAE++NRSQDw+sFAmMrhZcQHGFybmVfYmFi
QHdlYi5kZQAKCRAT741FJAPD61I0D/9uJtOzSJTd7lGj3DPQ309D5UUpGK6Je6rQ
PMtD9pQ1ifACbx9ABSfsut9vDXD7kVBRWzXDrlmdwA21i7UWF9lbQVtZGqZmM5DZ
Swyh844TGUSGzsM+nrJaDBPWdx+y8oip6n/FaK114EGpYbiRhK9GoRFJ41odj6eu
ffarR6TKkSmzyTFZ+plxrmn9Mj8+FZnqGgfqabYCcRbcRvQwQd3f7DmguoSEWyjQ
r58KzHfS+PMYi07gOd4BzGtKunHChzGFgmfors5HmYT8+VIdByrsnn1eKJWo0PH5
+Y/8dwozAtGmcIzsP4VMYxARwa/hn50gXCq7dWFGD9jdXo1bwI9rJxOXsIDD8bE1
DQ7FuyFBR3ZwMx7Epkb8d3i593ZEtoVyuQkwWxyOpq8AP3vG9UK2FWmmvOJpWbDp
jvyOatzCBoRN5AJr4EoNi+oayk0qTUL+2nfrZHOr/DFvrP/ikkLCwPfK41MPH0i2
+cQ702uEtpaX6Ku3xMv//t4hDdqWNoa83kZ9Zd8PBsMVLqDhG7eXnMlCd0/+Z5dn
2+Dt6ULK1HCSbFC/DvR8ySNWIAhYQ2H54YZB7azZDM+dlfheP/W+yyTWcvBXtXo3
CP/FJEr8p1oXNEmLkaNMgMQTM/CBsS58GnSQEkccjYrZjTaW369LhAOxkiEqdWOm
ryHW4oHgwojEBAEBCAAuFiEE3Si95tmHXKvOSosd3M8NswvBBUgFAmMrhZoQHGFy
bmVfYmFiQHdlYi5kZQAKCRDczw2zC8EFSP2+BACNa+L7fFPByPXcyCBzLAb1WGBI
KXrgJoCCLmVueutCdAgsBsOSLtfFAl2GfdeFHQWFxHuM1dXGbolXayj355tTM7El
/bd5Z73icVoYiaEdI9SYZWmGQVvyPm7kr1de6FuF1/c+ng3sKXxTTb0cj8bxEDpP
jMiwdIHhuIiua9iWSA==
=YPLh
-----END PGP SIGNATURE-----

R
R
Rostislav Svoboda wrote on 22 Sep 10:19 +0200
(address . 57749@debbugs.gnu.org)
CAEtmmew1W0dTa1LBD0Uurp6yVeDQTquw9c+wxOPj3soHRaTZQg@mail.gmail.com
It seems like this issue has been resolved by the
79897a37012a9bfbcb460cfe0aaaf32aab79dbe5 if so then please close this
issue.

Thanks
J
J
Julien Lepiller wrote on 22 Sep 21:50 +0200
(name . Rostislav Svoboda)(address . rostislav.svoboda@gmail.com)(address . 57749-close@debbugs.gnu.org)
20220922215026.0d69975a@sybil.lepiller.eu
Le Thu, 22 Sep 2022 10:19:16 +0200,
Rostislav Svoboda <rostislav.svoboda@gmail.com> a écrit :

Toggle quote (9 lines)
> It seems like this issue has been resolved by the
> 79897a37012a9bfbcb460cfe0aaaf32aab79dbe5 if so then please close this
> issue.
>
> Thanks
>
>
>

Ah indeed, a similar patch was sent independently and pushed before
this. I was hoping another commiter would have pushed this patch, but
in the end maven-slf4j-provider was fixed :)

Closing this since it's no longer relevant. Thanks again!
?
Your comment

This issue is archived.

To comment on this conversation send email to 57749@debbugs.gnu.org