Skip to content

Commit 428f67f

Browse files
authored
Merge pull request #1902 from GoogleContainerTools/rework_build_2
rework java build
2 parents bfe1b69 + f12e3f8 commit 428f67f

File tree

13 files changed

+1038
-1229
lines changed

13 files changed

+1038
-1229
lines changed

MODULE.bazel.lock

Lines changed: 5 additions & 257 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java/BUILD

Lines changed: 47 additions & 420 deletions
Large diffs are not rendered by default.

java/java.bzl

Lines changed: 537 additions & 0 deletions
Large diffs are not rendered by default.

java/jre_ver.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ def jre_ver(version):
44
Debian packages versions are of the form:
55
openjdk-11-jre*: 11.0.1+13-2~bpo9+1
66
"""
7-
if version.startswith("11.") or version.startswith("17."):
8-
return version.split("+")[0]
7+
if version.startswith("11.") or version.startswith("17.") or version.startswith("21.") or version.startswith("25."):
8+
v = version.split("+")[0].split(".")
9+
return v[0] + "." + v[1] + "." + v[2]
910

1011
fail("unrecognized openjdk package version: " + version)

java/testdata/java25_debian13.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
schemaVersion: "2.0.0"
22
commandTests:
33
- name: java
4-
command: "/usr/lib/jvm/temurin25_jre_amd64/bin/java"
4+
command: "/usr/lib/jvm/temurin-25-jre-amd64/bin/java"
55
args: ["-version"]
6-
expectedError: ['openjdk version "25"']
6+
expectedError: ['openjdk version "25.0.1"']
77
- name: java-symlink
88
command: "/usr/bin/java"
99
args: ["-version"]
10-
expectedError: ['openjdk version "25"']
10+
expectedError: ['openjdk version "25.0.1"']
1111
fileExistenceTests:
1212
- name: certs
1313
path: "/etc/ssl/certs/java/cacerts"
1414
shouldExist: true
1515
- name: certs
16-
path: "/usr/lib/jvm/temurin25_jre_amd64/lib/security/cacerts"
16+
path: "/etc/ssl/certs/adoptium/cacerts"
17+
permissions: 'Lrwxrwxrwx'
18+
shouldExist: true
19+
- name: certs
20+
path: "/usr/lib/jvm/temurin-25-jre-amd64/lib/security/cacerts"
1721
permissions: 'Lrwxrwxrwx'
1822
shouldExist: true
1923
- name: no-busybox
@@ -23,17 +27,17 @@ fileExistenceTests:
2327
path: "/bin/sh"
2428
shouldExist: false
2529
- name: no-javac
26-
path: "/usr/lib/jvm/temurin25_jre_amd64/bin/javac"
30+
path: "/usr/lib/jvm/temurin-25-jre-amd64/bin/javac"
2731
shouldExist: false
2832
- name: jexec-executable
29-
path: "/usr/lib/jvm/temurin25_jre_amd64/lib/jexec"
33+
path: "/usr/lib/jvm/temurin-25-jre-amd64/lib/jexec"
3034
shouldExist: true
3135
isExecutableBy: "any"
3236
- name: jspawnhelper-executable
33-
path: "/usr/lib/jvm/temurin25_jre_amd64/lib/jspawnhelper"
37+
path: "/usr/lib/jvm/temurin-25-jre-amd64/lib/jspawnhelper"
3438
shouldExist: true
3539
isExecutableBy: "any"
3640
metadataTest:
3741
envVars:
3842
- key: 'JAVA_VERSION'
39-
value: '25'
43+
value: '25.0.1'
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
schemaVersion: "2.0.0"
22
commandTests:
33
- name: java
4-
command: "/usr/lib/jvm/temurin25_jdk_amd64/bin/java"
4+
command: "/usr/lib/jvm/temurin-25-jdk-amd64/bin/java"
55
args: ["-version"]
6-
expectedError: ['openjdk version "25"']
6+
expectedError: ['openjdk version "25.0.1"']
77
- name: java-symlink
88
command: "/usr/bin/java"
99
args: ["-version"]
10-
expectedError: ['openjdk version "25"']
10+
expectedError: ['openjdk version "25.0.1"']
1111
- name: javac
12-
command: "/usr/lib/jvm/temurin25_jdk_amd64/bin/javac"
12+
command: "/usr/lib/jvm/temurin-25-jdk-amd64/bin/javac"
1313
args: ["-version"]
1414
expectedOutput: ['javac 25']
1515
fileExistenceTests:
1616
- name: certs
1717
path: "/etc/ssl/certs/java/cacerts"
1818
shouldExist: true
1919
- name: certs
20-
path: "/usr/lib/jvm/temurin25_jdk_amd64/lib/security/cacerts"
20+
path: "/etc/ssl/certs/adoptium/cacerts"
21+
permissions: 'Lrwxrwxrwx'
22+
shouldExist: true
23+
- name: certs
24+
path: "/usr/lib/jvm/temurin-25-jdk-amd64/lib/security/cacerts"
2125
permissions: 'Lrwxrwxrwx'
2226
shouldExist: true
2327
- name: busybox
@@ -29,4 +33,4 @@ fileExistenceTests:
2933
metadataTest:
3034
envVars:
3135
- key: 'JAVA_VERSION'
32-
value: '25'
36+
value: '25.0.1'

knife

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function cmd_lock() {
2828
# temporarily hardcode right now (query doesn't work after bzl mod)
2929
local repos=$(cat <<EOL
3030
trixie
31+
trixie_java
3132
bookworm
3233
bookworm_java
3334
bookworm_python
@@ -135,15 +136,13 @@ function cmd_lint () {
135136
buildifier -mode=fix $(find . -name 'BUILD*' -o -name 'WORKSPACE*' -o -name '*.bzl' -type f)
136137
}
137138

139+
# deprecate with debian12
138140
function cmd_update_java_archives () {
139141
source knife.d/update_java_archives.sh
140142
old_version=$(get_java_version 21)
141143
generate_java_archives 21 > private/repos/java_temurin/java_21.MODULE.bazel
142144
new_version=$(get_java_version 21)
143145
update_test_versions_java21 $old_version $new_version
144-
145-
# java 17 set up
146-
generate_java_archives 17 > private/repos/java_temurin/java_17.MODULE.bazel
147146
}
148147

149148
function cmd_update_node_archives () {

0 commit comments

Comments
 (0)