package/openjdk: modify site from mirror to official repos
PATCH 1/1 package/openjdk: modify site from mirror to official repos
From: Tudor Holton <[email protected]>
Since Java 11 (and possibly earlier), OpenJDK now has its own official repository at hg.openjdk.java.net which is referenced in all OpenJDK documentation. This patch brings buildroot into line with that source and allows consistent patching both across projects and for patches specific to buildroot environments.
--- DEVELOPERS | 3 +++ package/openjdk/openjdk.hash | 2 +- package/openjdk/openjdk.mk | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-)
DEVELOPERS +3 -0
@@ -2365,6 +2365,9 @@ F: package/redis/ N: Trent Piepho <[email protected]> F: package/libp11/ +N: Tudor Holton <[email protected]> +F: package/openjdk/ + N: Tzu-Jung Lee <[email protected]> F: package/dropwatch/ F: package/tstools/
package/openjdk/openjdk.hash +1 -1
@@ -1,3 +1,3 @@ # Locally computed -sha256 5f73d86ed516173965b27754f1bb21374ccb1194a17c2d89d8018280ce5ffa78 openjdk-12.0.2+10.tar.gz +sha256 b2bcad35656b00928683416f3480ad00363b00993eb711c3e1886e4fe77eefeb jdk-12.0.2+10.tar.gz sha256 4b9abebc4338048a7c2dc184e9f800deb349366bdf28eb23c2677a77b4c87726 LICENSE
package/openjdk/openjdk.mk +4 -4
@@ -7,7 +7,10 @@ OPENJDK_VERSION_MAJOR = 12.0.2 OPENJDK_VERSION_MINOR = 10 OPENJDK_VERSION = $(OPENJDK_VERSION_MAJOR)+$(OPENJDK_VERSION_MINOR) -OPENJDK_SITE = $(call github,AdoptOpenJDK,openjdk-jdk12u,jdk-$(OPENJDK_VERSION)) +OPENJDK_PROJECT = jdk-updates +OPENJDK_RELEASE = jdk12u +OPENJDK_SOURCE = jdk-$(OPENJDK_VERSION).tar.gz +OPENJDK_SITE = https://hg.openjdk.java.net/$(OPENJDK_PROJECT)/$(OPENJDK_RELEASE)/archive OPENJDK_LICENSE = GPL-2.0+ with exception OPENJDK_LICENSE_FILES = LICENSE
@@ -83,9 +86,6 @@ OPENJDK_CONF_OPTS = \ --with-native-debug-symbols=none \ --without-version-pre \ --with-sysroot=$(STAGING_DIR) \ - --with-vendor-name="AdoptOpenJDK" \ - --with-vendor-url="https://adoptopenjdk.net/" \ - --with-vendor-version-string="AdoptOpenJDK" \ --with-version-build="$(OPENJDK_VERSION_MAJOR)" \ --with-version-string="$(OPENJDK_VERSION_MAJOR)"
Signature · 1 line
2.20.1
PATCH 1/1 package/openjdk: modify site from mirror to official repos
Quoted 6 lines · Tudor Holton
From: Tudor Holton <[email protected]>
Since Java 11 (and possibly earlier), OpenJDK now has its own official repository at hg.openjdk.java.net which is referenced in all OpenJDK documentation. This patch brings buildroot into line with that source and allows consistent patching both across projects and for patches specific to buildroot environments.
I guess by switching to a different source repository, we're also loosing some
modifications that were done by AdoptOpenJDK, right? So could you enumerate these changes (and possibly explain why they're not relevant/wanted for Buildroot)?
Quoted 36 lines
Signed-off-by Tudor Holton <[email protected]>--- DEVELOPERS | 3 +++ package/openjdk/openjdk.hash | 2 +- package/openjdk/openjdk.mk | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-)DEVELOPERS +3
-0@@ -2365,6 +2365,9 @@ F: package/redis/ N: Trent Piepho <[email protected]> F: package/libp11/ +N: Tudor Holton <[email protected]> +F: package/openjdk/ + N: Tzu-Jung Lee <[email protected]> F: package/dropwatch/ F: package/tstools/package/openjdk/openjdk.hash +1
-1@@ -1,3 +1,3 @@ # Locally computed -sha256 5f73d86ed516173965b27754f1bb21374ccb1194a17c2d89d8018280ce5ffa78 openjdk-12.0.2+10.tar.gz +sha256 b2bcad35656b00928683416f3480ad00363b00993eb711c3e1886e4fe77eefeb jdk-12.0.2+10.tar.gz sha256 4b9abebc4338048a7c2dc184e9f800deb349366bdf28eb23c2677a77b4c87726 LICENSEpackage/openjdk/openjdk.mk +0
-0
package/openjdk/openjdk.mk line 11
Quoted 6 lines
package/openjdk/openjdk.mk +2
-1@@ -7,7 +7,10 @@ OPENJDK_VERSION_MAJOR = 12.0.2 OPENJDK_VERSION_MINOR = 10 OPENJDK_VERSION = $(OPENJDK_VERSION_MAJOR)+$(OPENJDK_VERSION_MINOR) -OPENJDK_SITE = $(call github,AdoptOpenJDK,openjdk-jdk12u,jdk-$(OPENJDK_VERSION)) +OPENJDK_PROJECT = jdk-updates +OPENJDK_RELEASE = jdk12u
Is it relevant to create variables for these? Just use them directly in the_SITE, like we do for most other packages.
package/openjdk/openjdk.mk line 13
Quoted 2 lines
package/openjdk/openjdk.mk +2
-0+OPENJDK_SOURCE = jdk-$(OPENJDK_VERSION).tar.gz +OPENJDK_SITE = https://hg.openjdk.java.net/$(OPENJDK_PROJECT)/$(OPENJDK_RELEASE)/archive
I suspect this is an autogenerated archive, right? Do you know how reliable it
is w.r.t. changes in the hash? Long ago, we've had problems with github a couple of times, where suddenly the generated tarball would be slightly different and the existing hash would break.
I realize that it's hard to know for sure if the tarball is consistent. But at
least please check if there's nothing stupid like a download date embedded in it.
Regards,
Arnout
Quoted 14 lines
package/openjdk/openjdk.mk +0
-3OPENJDK_LICENSE = GPL-2.0+ with exception OPENJDK_LICENSE_FILES = LICENSE@@ -83,9 +86,6 @@ OPENJDK_CONF_OPTS = \ --with-native-debug-symbols=none \ --without-version-pre \ --with-sysroot=$(STAGING_DIR) \ - --with-vendor-name="AdoptOpenJDK" \ - --with-vendor-url="https://adoptopenjdk.net/" \ - --with-vendor-version-string="AdoptOpenJDK" \ --with-version-build="$(OPENJDK_VERSION_MAJOR)" \ --with-version-string="$(OPENJDK_VERSION_MAJOR)"
PATCH 1/1 package/openjdk: modify site from mirror to official repos
Quoted 12 lines · Arnout Vandecappelle
Quoted 10 lines · Tudor Holton
From: Tudor Holton <[email protected]>
Since Java 11 (and possibly earlier), OpenJDK now has its own official repository
at hg.openjdk.java.net which is referenced in all OpenJDK documentation.
This patch brings buildroot into line with that source and allows consistent
patching both across projects and for patches specific to buildroot environments.
Quoted 6 lines
I guess by switching to a different source repository, we're also
loosing some
modifications that were done by AdoptOpenJDK, right? So could you enumerate
these changes (and possibly explain why they're not relevant/wanted for Buildroot)?
Thanks for looking at this. :-)
Well, it depends on who you believe and how good your crystal ball is. The current AdoptOpenJDK repos says "Mirror of
http://hg.openjdk.java.net/jdk-updates/jdk12u/", but the hashes don't match. Although, that could be something to do with the filename being ever-so-slightly different which obviously depends on how the hash is calculated.
Either way, changing to the upstream source removes the potential for a code injection between the upstream source and buildroot which, in our case, is essential to some buildroot-specific integrations in the pipeline (namely new Java 9+ module management, removal of Xorg dependency, and uClibC integration) which would be painful to apply upstream, and could have the potential to break buildroot patches in the middle, leading to patch wars (speaking from experience).
Quoted 48 lines
Quoted 48 lines
Signed-off-by Tudor Holton <[email protected]>--- DEVELOPERS | 3 +++ package/openjdk/openjdk.hash | 2 +- package/openjdk/openjdk.mk | 8 ++++---- 3 files changed, 8 insertions(+), 5 deletions(-)DEVELOPERS +3
-0@@ -2365,6 +2365,9 @@ F: package/redis/ N: Trent Piepho <[email protected]> F: package/libp11/ +N: Tudor Holton <[email protected]> +F: package/openjdk/ + N: Tzu-Jung Lee <[email protected]> F: package/dropwatch/ F: package/tstools/package/openjdk/openjdk.hash +0
-1@@ -1,3 +1,3 @@ # Locally computed -sha256
5f73d86ed516173965b27754f1bb21374ccb1194a17c2d89d8018280ce5ffa78openjdk-12.0.2+10.tar.gz
+sha256b2bcad35656b00928683416f3480ad00363b00993eb711c3e1886e4fe77eefebjdk-12.0.2+10.tar.gz
sha2564b9abebc4338048a7c2dc184e9f800deb349366bdf28eb23c2677a77b4c87726LICENSEpackage/openjdk/openjdk.mk +0
-0@@ -7,7 +7,10 @@ OPENJDK_VERSION_MAJOR = 12.0.2 OPENJDK_VERSION_MINOR = 10 OPENJDK_VERSION = $(OPENJDK_VERSION_MAJOR)+$(OPENJDK_VERSION_MINOR)
Quoted 10 lines
package/openjdk/openjdk.mk line 11
Quoted 4 lines
package/openjdk/openjdk.mk +2
-1-OPENJDK_SITE = $(call github,AdoptOpenJDK,openjdk-jdk12u,jdk-$(OPENJDK_VERSION)) +OPENJDK_PROJECT = jdk-updates +OPENJDK_RELEASE = jdk12uIs it relevant to create variables for these? Just use them directly
in the_SITE, like we do for most other packages.
This was inspired by a few other buildroot openjdk packages that have been floating around the internet.
It's more a style choice, but also an understanding of the upstream repos layout:
Since OpenJDK has multiple streams this may become needed later on. Things like aarch32 aren't in jdk-updates (yet). Config.in may eventually be able to select the project and release, but I was trying to keep this all as close to the current version as possible. Don't forget, also, that OpenJDK now has LTS releases, which I think would be preferable, but there will always be a demand for newer releases also.
I can concur to a simpler form if you prefer.
Quoted 12 lines
Quoted 3 lines
package/openjdk/openjdk.mk +2
-0+OPENJDK_SOURCE = jdk-$(OPENJDK_VERSION).tar.gz +OPENJDK_SITE =https://hg.openjdk.java.net/$(OPENJDK_PROJECT)/$(OPENJDK_RELEASE)/archive
I suspect this is an autogenerated archive, right? Do you know how
reliable it
is w.r.t. changes in the hash? Long ago, we've had problems with github a couple
of times, where suddenly the generated tarball would be slightly different and
the existing hash would break.
Quoted 4 lines
I realize that it's hard to know for sure if the tarball is
consistent. But at
least please check if there's nothing stupid like a download date embedded in it.
I can say for sure that we have now been using these archives for just over a year internally, since OpenJDK 11, and we haven't seen an archive hash change in that entire time. This was a vast improvement on the previous Mercurial forest. /archive is exactly as is sounds. It's an archive that doesn't change, which is why it effectively negates the need for a "downstream" mirror.
Regards,
Tudor Holton
PATCH 1/1 package/openjdk: modify site from mirror to official repos
Quoted 16 lines · Tudor Holton
Quoted 10 lines · Arnout Vandecappelle
Quoted 8 lines · Tudor Holton
From: Tudor Holton <[email protected]>
Since Java 11 (and possibly earlier), OpenJDK now has its own official repository
at hg.openjdk.java.net which is referenced in all OpenJDK documentation. This patch brings buildroot into line with that source and allows consistent patching both across projects and for patches specific to buildroot environments.Quoted 4 lines
?I guess by switching to a different source repository, we're also loosing some modifications that were done by AdoptOpenJDK, right? So could you enumerate these changes (and possibly explain why they're not relevant/wanted for Buildroot)?
Quoted 7 lines
Thanks for looking at this. :-)
Well, it depends on who you believe and how good your crystal ball is.? The current AdoptOpenJDK repos says "Mirror of
http://hg.openjdk.java.net/jdk-updates/jdk12u/", but the hashes don't match.? Although, that could be something to do with the filename being ever-so-slightly different which obviously depends on how the hash is calculated.
In that case, can you do a 'diff -ru' between the two extracted tarballs and
report in the commit message that this shows no differences?
Quoted 2 lines
Either way, changing to the upstream source removes the potential for a code injection between the upstream source and buildroot
Absolutely, and this is the main reason to make this change IIUC.
Quoted 59 lines
which, in our case, is
essential to some buildroot-specific integrations in the pipeline (namely new Java 9+ module management, removal of Xorg dependency, and uClibC integration) which would be painful to apply upstream, and could have the potential to break buildroot patches in the middle, leading to patch wars (speaking from experience).Quoted 43 lines
Quoted 43 lines
Signed-off-by Tudor Holton <[email protected]>---
?DEVELOPERS?????????????????? | 3 +++ ?package/openjdk/openjdk.hash | 2 +- ?package/openjdk/openjdk.mk?? | 8 ++++----?3 files changed, 8 insertions(+), 5 deletions(-)
DEVELOPERS +0
-0@@ -2365,6 +2365,9 @@ F:??? package/redis/?N:??? Trent Piepho <[email protected]>
?F:??? package/libp11/DEVELOPERS +3
-0+N:??? Tudor Holton <[email protected]> +F:??? package/openjdk/ +?N:??? Tzu-Jung Lee <[email protected]>
?F:??? package/dropwatch/
?F:??? package/tstools/package/openjdk/openjdk.hash +0
-0@@ -1,3 +1,3 @@?# Locally computed
-sha2565f73d86ed516173965b27754f1bb21374ccb1194a17c2d89d8018280ce5ffa78? openjdk-12.0.2+10.tar.gz
+sha256b2bcad35656b00928683416f3480ad00363b00993eb711c3e1886e4fe77eefeb? jdk-12.0.2+10.tar.gz
?sha2564b9abebc4338048a7c2dc184e9f800deb349366bdf28eb23c2677a77b4c87726? LICENSEpackage/openjdk/openjdk.mk +0
-0@@ -7,7 +7,10 @@?OPENJDK_VERSION_MAJOR = 12.0.2
?OPENJDK_VERSION_MINOR = 10Quoted 10 lines
package/openjdk/openjdk.mk line 11
Quoted 5 lines
?OPENJDK_VERSION = $(OPENJDK_VERSION_MAJOR)+$(OPENJDK_VERSION_MINOR) -OPENJDK_SITE = $(call github,AdoptOpenJDK,openjdk-jdk12u,jdk-$(OPENJDK_VERSION))
package/openjdk/openjdk.mk +2
-0+OPENJDK_PROJECT = jdk-updates +OPENJDK_RELEASE = jdk12u?Is it relevant to create variables for these? Just use them directly in the
_SITE, like we do for most other packages.
Quoted 2 lines
This was inspired by a few other buildroot openjdk packages that have been floating around the internet.
Stuff floating around on the internet is generally not a good source of coding
style :-)
Quoted 9 lines
It's more a style choice, but also an understanding of the upstream repos layout:
Since OpenJDK has multiple streams this may become needed later on.? Things like aarch32 aren't in jdk-updates (yet).? Config.in may eventually be able to select the project and release, but I was trying to keep this all as close to the current version as possible.? Don't forget, also, that OpenJDK now has LTS releases, which I think would be preferable, but there will always be a demand for newer releases also.
We prefer not to introduce things that only exist for the sake of some
theoretical future feature.
Using the project and release strings directly in the _SITE URL makes it much
easier to understand what exactly is being downloaded. And even if there would be several different tarballs to download in the future, we'd probably prefer full _SITE strings even then.
Quoted 16 lines
I can concur to a simpler form if you prefer.
Quoted 9 lines
Quoted 3 lines
package/openjdk/openjdk.mk +2
-0+OPENJDK_SOURCE = jdk-$(OPENJDK_VERSION).tar.gz +OPENJDK_SITE =https://hg.openjdk.java.net/$(OPENJDK_PROJECT)/$(OPENJDK_RELEASE)/archive
?I suspect this is an autogenerated archive, right? Do you know how reliable it is w.r.t. changes in the hash? Long ago, we've had problems with github a couple of times, where suddenly the generated tarball would be slightly different and the existing hash would break.
Quoted 3 lines
?I realize that it's hard to know for sure if the tarball is consistent. But at least please check if there's nothing stupid like a download date embedded in it.
Quoted 5 lines
I can say for sure that we have now been using these archives for just over a year internally, since OpenJDK 11, and we haven't seen an archive hash change in that entire time.? This was a vast improvement on the previous Mercurial forest.? /archive is exactly as is sounds.? It's an archive that doesn't change, which is why it effectively negates the need for a "downstream" mirror.
Excellent. Can you add something like this to the commit message? In the
unlikely case that this does break in the future, it's good to know what our understanding was.
Regards,
Arnout
Quoted 3 lines
Regards,
Tudor Holton
PATCH 1/1 package/openjdk: modify site from mirror to official repos
In reply to Tudor HoltonTudor,
Quoted 3 lines · Tudor Holton
Quoted 1 line · Arnout Vandecappelle
On 27/11/2019 06:39, Tudor Holton wrote:
[snip]
Quoted 21 lines
Quoted 4 lines
Quoted 4 lines
package/openjdk/openjdk.mk +0
-0@@ -7,7 +7,10 @@ OPENJDK_VERSION_MAJOR = 12.0.2 OPENJDK_VERSION_MINOR = 10 OPENJDK_VERSION = $(OPENJDK_VERSION_MAJOR)+$(OPENJDK_VERSION_MINOR)Quoted 10 lines
package/openjdk/openjdk.mk line 11
Quoted 4 lines
package/openjdk/openjdk.mk +2
-1-OPENJDK_SITE = $(call github,AdoptOpenJDK,openjdk-jdk12u,jdk-$(OPENJDK_VERSION)) +OPENJDK_PROJECT = jdk-updates +OPENJDK_RELEASE = jdk12uIs it relevant to create variables for these? Just use them directly
in the_SITE, like we do for most other packages.This was inspired by a few other buildroot openjdk packages that have been floating around the internet.
It's more a style choice, but also an understanding of the upstream repos layout:
Quoted 6 lines
Since OpenJDK has multiple streams this may become needed later on. Things like aarch32 aren't in jdk-updates (yet). Config.in may eventually be able to select the project and release, but I was trying to keep this all as close to the current version as possible. Don't forget, also, that OpenJDK now has LTS releases, which I think would be preferable, but there will always be a demand for newer releases also.
If you could, please verify the openjdk run-tests test case still passes after this site change. From within your buildroot clone with this patchset applied, run the following.
./support/testing/run-tests -d ./dl/ -k -o test_dir tests.package.test_openjdk.TestOpenJdk
Regards,
Matt