[PATCH 1/7] gnu: java-openjfx-build: Add helpful patch.

  • Done
  • quality assurance status badge
Details
3 participants
  • Björn Höfling
  • Leo Famulari
  • Alexey Abramov
Owner
unassigned
Submitted by
Alexey Abramov
Severity
normal
Merged with

Debbugs page

Alexey Abramov wrote 5 years ago
(address . guix-patches@gnu.org)
20200222201755.50425-1-levenson@mmer.org
* gnu/packages/java.scm: Add patch
* gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch: New
file. Allows you to run gradlew to run properly. Useful for debugging.
---
gnu/packages/java.scm | 3 ++-
.../java-openjfx-build-get_guix_jdk_version.patch | 14 ++++++++++++++
2 files changed, 16 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch

Toggle diff (36 lines)
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 9371901e1f..01541ee419 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -2355,7 +2355,8 @@ new Date();"))
(file-name (string-append name "-" version "-checkout"))
(sha256
(base32
- "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))))
+ "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
+ (patches (search-patches "java-openjfx-build-get_guix_jdk_version.patch"))))
(build-system ant-build-system)
(arguments
`(#:jar-name "java-openjfx.jar"
diff --git a/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch b/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
new file mode 100644
index 0000000000..214ef9949c
--- /dev/null
+++ b/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
@@ -0,0 +1,14 @@
+--- a/build.gradle
++++ b/build.gradle
+@@ -742,9 +742,9 @@
+ if (inStream.readLine() != null) {
+ String v = inStream.readLine();
+ if (v != null) {
+- int ib = v.indexOf(" (build ");
++ int ib = v.indexOf(" (guix build ");
+ if (ib != -1) {
+- String ver = v.substring(ib + 8, v.size() - 1);
++ String ver = v.substring(ib + 13, v.size() - 1);
+
+ defineProperty("jdkRuntimeVersion", ver)
+ defineProperty("jdkVersion", jdkRuntimeVersion.split("-")[0])
--
2.24.1
levenson wrote 5 years ago
(address . guix-devel@gnu.org)(address . 39742@debbugs.gnu.org)
84k1412vip.fsf@delta.i-did-not-set--mail-host-address--so-tickle-me
Hi

I packaged openjfx and would like to get some review. Can someone take a look?

Alexey Abramov <levenson@mmer.org> writes:

Toggle quote (44 lines)
> * gnu/packages/java.scm: Add patch
> * gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch: New
> file. Allows you to run gradlew to run properly. Useful for debugging.
> ---
> gnu/packages/java.scm | 3 ++-
> .../java-openjfx-build-get_guix_jdk_version.patch | 14 ++++++++++++++
> 2 files changed, 16 insertions(+), 1 deletion(-)
> create mode 100644 gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
>
> diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
> index 9371901e1f..01541ee419 100644
> --- a/gnu/packages/java.scm
> +++ b/gnu/packages/java.scm
> @@ -2355,7 +2355,8 @@ new Date();"))
> (file-name (string-append name "-" version "-checkout"))
> (sha256
> (base32
> - "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))))
> + "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
> + (patches (search-patches "java-openjfx-build-get_guix_jdk_version.patch"))))
> (build-system ant-build-system)
> (arguments
> `(#:jar-name "java-openjfx.jar"
> diff --git a/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch b/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
> new file mode 100644
> index 0000000000..214ef9949c
> --- /dev/null
> +++ b/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
> @@ -0,0 +1,14 @@
> +--- a/build.gradle
> ++++ b/build.gradle
> +@@ -742,9 +742,9 @@
> + if (inStream.readLine() != null) {
> + String v = inStream.readLine();
> + if (v != null) {
> +- int ib = v.indexOf(" (build ");
> ++ int ib = v.indexOf(" (guix build ");
> + if (ib != -1) {
> +- String ver = v.substring(ib + 8, v.size() - 1);
> ++ String ver = v.substring(ib + 13, v.size() - 1);
> +
> + defineProperty("jdkRuntimeVersion", ver)
> + defineProperty("jdkVersion", jdkRuntimeVersion.split("-")[0])

--
Alexey
Leo Famulari wrote 5 years ago
(name . Alexey Abramov)(address . levenson@mmer.org)(address . 39742@debbugs.gnu.org)
20200304025607.GA1199@jasmine.lan
Hi,

Thanks for these patches and sorry for the delay in review! There are a
lot of patches and it takes a while to get through them.

On Sat, Feb 22, 2020 at 09:17:49PM +0100, Alexey Abramov wrote:
Toggle quote (4 lines)
> * gnu/packages/java.scm: Add patch
> * gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch: New
> file. Allows you to run gradlew to run properly. Useful for debugging.

The commit message needs a couple changes, to something like this:

------
* gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/java.scm (java-openjfx-build)[source]: Use it.
------

We don't need to describe the patch in the commit message. Instead, we
explain it in a comment at the beginning of the patch file itself. This
is easier for the people that will read the patch later. The comment
should explain what the patch does and where it came from, including
links to bug reports and external patch sources, if they exist.

We need to register the new patch file in 'gnu/local.mk', so that it
gets distributed in the Guix release process.

And finally, we need to name the package variable (java-openjfx-build)
that the patch is being used by.

Here is an example from an older commit:

Leo Famulari wrote 5 years ago
(no subject)
(address . control@debbugs.gnu.org)
20200304031442.GA2347@jasmine.lan
merge 39741 39742 39743 39744 39745 39746 39747
Björn Höfling wrote 5 years ago
Re: [bug#39742] [PATCH 1/7] gnu: java-openjfx-build: Add helpful patch.
(name . Alexey Abramov)(address . levenson@mmer.org)(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 39742@debbugs.gnu.org)(name . Leo Famulari)(address . leo@famulari.name)
20200305200925.31b637d4@alma-ubu
Hi Alexey,

On Sat, 22 Feb 2020 21:17:49 +0100
Alexey Abramov <levenson@mmer.org> wrote:

Toggle quote (5 lines)
> * gnu/packages/java.scm: Add patch
> * gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch:
> New file. Allows you to run gradlew to run properly. Useful for
> debugging. ---

This sentence sounds suspicious :-)

In Guix, we build everything from source. If we need a compiler,
library, or build-tool, we build that also from source.

Here, the problem is that:

gradle/wrapper/gradle-wrapper.jar

is a binary JAR-file included in the sources, which is used by the
'gradlew' script. This jar-file should not be part of the original
sources used to to compile this package.

Whenever sources contain unwanted binaries, we use 'snippets' to remove
them before doing any further steps. You will find them in many places
in the java.scm file, just search for 'snippet', for example in the
package java-cisd-jhdf5.

For using gradle, we need to compile gradle from sources, but this is
very hard, there are some bootstrapping problems involed in this.

So, first we should first snipp away the jar-files from the original
java-openjfx-build package by Julien.

And second, I hope you don't rely on the gradle build in any way
here :-)

Björn

Toggle quote (43 lines)
> gnu/packages/java.scm | 3 ++-
> .../java-openjfx-build-get_guix_jdk_version.patch | 14
> ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-)
> create mode 100644
> gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
>
> diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
> index 9371901e1f..01541ee419 100644
> --- a/gnu/packages/java.scm
> +++ b/gnu/packages/java.scm
> @@ -2355,7 +2355,8 @@ new Date();"))
> (file-name (string-append name "-" version
> "-checkout")) (sha256
> (base32
> -
> "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))))
> +
> "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
> + (patches (search-patches
> "java-openjfx-build-get_guix_jdk_version.patch")))) (build-system
> ant-build-system) (arguments
> `(#:jar-name "java-openjfx.jar"
> diff --git
> a/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
> b/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
> new file mode 100644 index 0000000000..214ef9949c --- /dev/null
> +++
> b/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
> @@ -0,0 +1,14 @@ +--- a/build.gradle
> ++++ b/build.gradle
> +@@ -742,9 +742,9 @@
> + if (inStream.readLine() != null) {
> + String v = inStream.readLine();
> + if (v != null) {
> +- int ib = v.indexOf(" (build ");
> ++ int ib = v.indexOf(" (guix build ");
> + if (ib != -1) {
> +- String ver = v.substring(ib + 8, v.size() - 1);
> ++ String ver = v.substring(ib + 13, v.size() - 1);
> +
> + defineProperty("jdkRuntimeVersion", ver)
> + defineProperty("jdkVersion",
> jdkRuntimeVersion.split("-")[0])
-----BEGIN PGP SIGNATURE-----

iF0EARECAB0WIQQiGUP0np8nb5SZM4K/KGy2WT5f/QUCXmFOZQAKCRC/KGy2WT5f
/a3MAKCQxe6l7eHCU+NO/79BawGXy4bWcwCgq5T0h6c6U5ft0iVehGG0H7jMLoc=
=TSEv
-----END PGP SIGNATURE-----


Alexey Abramov wrote 5 years ago
(name . Björn Höfling)(address . bjoern.hoefling@bjoernhoefling.de)(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 39742@debbugs.gnu.org)(name . Leo Famulari)(address . leo@famulari.name)
170ac51b5a8.281d.da5dc967fe079fb386b94d5b80162893@mmer.org
Hi,

I have been trying to compile it so many times, so I patched the file for
easy debugging )

I traced some confusing parts of a build.gradle using gradlew ...
--verbose to translate it in Scheme.


Alexey

On March 5, 2020 19:38:40 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
wrote:

Toggle quote (82 lines)
> Hi Alexey,
>
> On Sat, 22 Feb 2020 21:17:49 +0100
> Alexey Abramov <levenson@mmer.org> wrote:
>
>> * gnu/packages/java.scm: Add patch
>> * gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch:
>> New file. Allows you to run gradlew to run properly. Useful for
>> debugging. ---
>
> This sentence sounds suspicious :-)
>
> In Guix, we build everything from source. If we need a compiler,
> library, or build-tool, we build that also from source.
>
> Here, the problem is that:
>
> gradle/wrapper/gradle-wrapper.jar
>
> is a binary JAR-file included in the sources, which is used by the
> 'gradlew' script. This jar-file should not be part of the original
> sources used to to compile this package.
>
> Whenever sources contain unwanted binaries, we use 'snippets' to remove
> them before doing any further steps. You will find them in many places
> in the java.scm file, just search for 'snippet', for example in the
> package java-cisd-jhdf5.
>
> For using gradle, we need to compile gradle from sources, but this is
> very hard, there are some bootstrapping problems involed in this.
>
> So, first we should first snipp away the jar-files from the original
> java-openjfx-build package by Julien.
>
> And second, I hope you don't rely on the gradle build in any way
> here :-)
>
> Björn
>
>> gnu/packages/java.scm | 3 ++-
>> .../java-openjfx-build-get_guix_jdk_version.patch | 14
>> ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-)
>> create mode 100644
>> gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
>>
>> diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
>> index 9371901e1f..01541ee419 100644
>> --- a/gnu/packages/java.scm
>> +++ b/gnu/packages/java.scm
>> @@ -2355,7 +2355,8 @@ new Date();"))
>> (file-name (string-append name "-" version
>> "-checkout")) (sha256
>> (base32
>> -
>> "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))))
>> +
>> "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
>> + (patches (search-patches
>> "java-openjfx-build-get_guix_jdk_version.patch")))) (build-system
>> ant-build-system) (arguments
>> `(#:jar-name "java-openjfx.jar"
>> diff --git
>> a/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
>> b/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
>> new file mode 100644 index 0000000000..214ef9949c --- /dev/null
>> +++
>> b/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
>> @@ -0,0 +1,14 @@ +--- a/build.gradle
>> ++++ b/build.gradle
>> +@@ -742,9 +742,9 @@
>> + if (inStream.readLine() != null) {
>> + String v = inStream.readLine();
>> + if (v != null) {
>> +- int ib = v.indexOf(" (build ");
>> ++ int ib = v.indexOf(" (guix build ");
>> + if (ib != -1) {
>> +- String ver = v.substring(ib + 8, v.size() - 1);
>> ++ String ver = v.substring(ib + 13, v.size() - 1);
>> +
>> + defineProperty("jdkRuntimeVersion", ver)
>> + defineProperty("jdkVersion",
>> jdkRuntimeVersion.split("-")[0])
Alexey Abramov wrote 5 years ago
(name . Leo Famulari)(address . leo@famulari.name)(address . 39742@debbugs.gnu.org)
170ac6f01a8.281d.da5dc967fe079fb386b94d5b80162893@mmer.org
Many thanks! I will fix these in the next patches.

Alexey

On March 4, 2020 03:25:36 Leo Famulari <leo@famulari.name> wrote:

Toggle quote (33 lines)
> Hi,
>
> Thanks for these patches and sorry for the delay in review! There are a
> lot of patches and it takes a while to get through them.
>
> On Sat, Feb 22, 2020 at 09:17:49PM +0100, Alexey Abramov wrote:
>> * gnu/packages/java.scm: Add patch
>> * gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch: New
>> file. Allows you to run gradlew to run properly. Useful for debugging.
>
> The commit message needs a couple changes, to something like this:
>
> ------
> * gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch: New file.
> * gnu/local.mk (dist_patch_DATA): Add it.
> * gnu/packages/java.scm (java-openjfx-build)[source]: Use it.
> ------
>
> We don't need to describe the patch in the commit message. Instead, we
> explain it in a comment at the beginning of the patch file itself. This
> is easier for the people that will read the patch later. The comment
> should explain what the patch does and where it came from, including
> links to bug reports and external patch sources, if they exist.
>
> We need to register the new patch file in 'gnu/local.mk', so that it
> gets distributed in the Guix release process.
>
> And finally, we need to name the package variable (java-openjfx-build)
> that the patch is being used by.
>
> Here is an example from an older commit:
>
> https://git.savannah.gnu.org/cgit/guix.git/commit/?id=ca5e404f9a1ff81a38a32578c9c3a6c866482a9a
Björn Höfling wrote 5 years ago
(name . Alexey Abramov)(address . levenson@mmer.org)(name . Julien Lepiller)(address . julien@lepiller.eu)(address . 39742@debbugs.gnu.org)(name . Leo Famulari)(address . leo@famulari.name)
20200305223531.723bb732@alma-ubu
On Thu, 5 Mar 2020 20:09:25 +0100
Björn Höfling <bjoern.hoefling@bjoernhoefling.de> wrote:

Toggle quote (4 lines)
> Here, the problem is that:
>
> gradle/wrapper/gradle-wrapper.jar

[..]

Toggle quote (3 lines)
> So, first we should first snipp away the jar-files from the original
> java-openjfx-build package by Julien.

I fixed that in the java-openjfx-build package under commit:

2c2b1ef85448681d858f447ac6fed6679a95209f

Björn
-----BEGIN PGP SIGNATURE-----

iF0EARECAB0WIQQiGUP0np8nb5SZM4K/KGy2WT5f/QUCXmFwowAKCRC/KGy2WT5f
/QtcAJ97lYGlVUtrurm8QgwCyoleYyl3sQCdHtf12RqxBp9FT2km9SabIjkViCQ=
=tUcC
-----END PGP SIGNATURE-----


Alexey Abramov wrote 5 years ago
[v2] gnu: java-openjfx-build: Add helpful patch.
(address . 39742@debbugs.gnu.org)(name . Alexey Abramov)(address . levenson@mmer.org)
20200308194000.16724-1-levenson@mmer.org
* gnu/packages/java.scm (java-openjfx-build)[source]: Use it.
* gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
---
gnu/local.mk | 1 +
gnu/packages/java.scm | 3 +-
...a-openjfx-build-get_guix_jdk_version.patch | 37 +++++++++++++++++++
3 files changed, 40 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch

Toggle diff (71 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index f6c56ceb28..0bcbde7301 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1033,6 +1033,7 @@ dist_patch_DATA = \
%D%/packages/patches/java-apache-ivy-port-to-latest-bouncycastle.patch \
%D%/packages/patches/java-commons-collections-fix-java8.patch \
%D%/packages/patches/java-jeromq-fix-tests.patch \
+ %D%/packages/patches/java-openjfx-build-get_guix_jdk_version.patch \
%D%/packages/patches/java-powermock-fix-java-files.patch \
%D%/packages/patches/java-simple-xml-fix-tests.patch \
%D%/packages/patches/java-svg-salamander-Fix-non-det.patch \
diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm
index 5229eeda06..a46d4013d8 100644
--- a/gnu/packages/java.scm
+++ b/gnu/packages/java.scm
@@ -2361,7 +2361,8 @@ new Date();"))
#t))
(sha256
(base32
- "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))))
+ "0yg38mwpivswccv9n96k06x3iv82i4px1a9xg9l8dswzwmfj259f"))
+ (patches (search-patches "java-openjfx-build-get_guix_jdk_version.patch"))))
(build-system ant-build-system)
(arguments
`(#:jar-name "java-openjfx.jar"
diff --git a/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch b/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
new file mode 100644
index 0000000000..4ebdadc671
--- /dev/null
+++ b/gnu/packages/patches/java-openjfx-build-get_guix_jdk_version.patch
@@ -0,0 +1,37 @@
+From d156313340d3edcd78751ea8ed5e66c7668275c3 Mon Sep 17 00:00:00 2001
+From: Alexey Abramov <levenson@mmer.org>
+Date: Sun, 8 Mar 2020 20:07:22 +0100
+Subject: [PATCH] openjfx: Determine the version of Java in JDK_HOME
+
+Icedtea contains guix in its version, so build.gradle failes to run. Openjfx
+packaging is not trivial, so you will probably need to try build it with
+gradlew.
+
+---
+ build.gradle | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/build.gradle b/build.gradle
+index df82f63..2c626cd 100644
+--- a/build.gradle
++++ b/build.gradle
+@@ -742,9 +742,9 @@ try {
+ if (inStream.readLine() != null) {
+ String v = inStream.readLine();
+ if (v != null) {
+- int ib = v.indexOf(" (build ");
++ int ib = v.indexOf(" (guix build ");
+ if (ib != -1) {
+- String ver = v.substring(ib + 8, v.size() - 1);
++ String ver = v.substring(ib + 13, v.size() - 1);
+
+ defineProperty("jdkRuntimeVersion", ver)
+ defineProperty("jdkVersion", jdkRuntimeVersion.split("-")[0])
+@@ -3540,4 +3540,3 @@ compileTargets { t ->
+ }
+ )
+ }
+-
+--
+2.24.1
+
--
2.24.1
Leo Famulari wrote 5 years ago
(name . Alexey Abramov)(address . levenson@mmer.org)(address . 39742-done@debbugs.gnu.org)
20200315181953.GA5561@jasmine.lan
I'm closing this bug ticket because Alexey is still working on some of
the patches and it's confusing to have the patches spread over multiple
tickets, even though we merged them. Alexey will open a new ticket soon.
Closed
Björn Höfling wrote 5 years ago
Re: bug#39742: [v2] gnu: java-openjfx-build: Add helpful patch.
(name . Leo Famulari)(address . leo@famulari.name)(address . 39742-done@debbugs.gnu.org)(name . Alexey Abramov)(address . levenson@mmer.org)
20200317221241.4e8805e1@alma-ubu
On Sun, 15 Mar 2020 14:19:53 -0400
Leo Famulari <leo@famulari.name> wrote:

Toggle quote (5 lines)
> I'm closing this bug ticket because Alexey is still working on some of
> the patches and it's confusing to have the patches spread over
> multiple tickets, even though we merged them. Alexey will open a new
> ticket soon.

Thanks for the information. I'm happy to review the patches, but was
very confused about the different mails and patches.

Alexey, if you need some help, don't hesitate to ask.

Björn
-----BEGIN PGP SIGNATURE-----

iF0EARECAB0WIQQiGUP0np8nb5SZM4K/KGy2WT5f/QUCXnE9SQAKCRC/KGy2WT5f
/ZdnAKCZVPXk91w2iQMaYHS7MpyJY6Vc7gCghbyVUAIvRi7UzoQoDROjUj3Tc5I=
=rw6T
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 39742
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help