From b31447b54c60c401c3791e0e100b5d49ee682922 Mon Sep 17 00:00:00 2001 From: dscanteianu Date: Wed, 29 Jan 2025 18:38:53 +0000 Subject: [PATCH 1/7] add wsl option --- configureBuild.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/configureBuild.sh b/configureBuild.sh index 8606be3ec..89dba0542 100755 --- a/configureBuild.sh +++ b/configureBuild.sh @@ -163,6 +163,11 @@ setVariablesForConfigure() { BUILD_CONFIG[TEST_IMAGE_PATH]=$openjdk_test_image_path BUILD_CONFIG[DEBUG_IMAGE_PATH]=$openjdk_debug_image_path BUILD_CONFIG[STATIC_LIBS_IMAGE_PATH]=$static_libs_path + echo "wsl val:" $WSL + if ! [[ -z ${WSL+x} ]]; then + echo "building in wsl mode" + BUILD_CONFIG[USER_SUPPLIED_CONFIGURE_ARGS]="--build=x86_64-unknown-linux-gnu --openjdk-target=x86_64-unknown-linux-gnu" + fi } # Set the repository to build from, defaults to adoptium if not set by the user From 77e592d45290255ece1bccebbcd6346832e567a1 Mon Sep 17 00:00:00 2001 From: dscanteianu Date: Wed, 29 Jan 2025 18:42:22 +0000 Subject: [PATCH 2/7] unnecessary echo --- configureBuild.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/configureBuild.sh b/configureBuild.sh index 89dba0542..8e5a66446 100755 --- a/configureBuild.sh +++ b/configureBuild.sh @@ -163,7 +163,6 @@ setVariablesForConfigure() { BUILD_CONFIG[TEST_IMAGE_PATH]=$openjdk_test_image_path BUILD_CONFIG[DEBUG_IMAGE_PATH]=$openjdk_debug_image_path BUILD_CONFIG[STATIC_LIBS_IMAGE_PATH]=$static_libs_path - echo "wsl val:" $WSL if ! [[ -z ${WSL+x} ]]; then echo "building in wsl mode" BUILD_CONFIG[USER_SUPPLIED_CONFIGURE_ARGS]="--build=x86_64-unknown-linux-gnu --openjdk-target=x86_64-unknown-linux-gnu" From 2b2e3904c686bd80eac3d2c6625c684a33a5f9d3 Mon Sep 17 00:00:00 2001 From: dscanteianu Date: Thu, 30 Jan 2025 12:28:13 +0000 Subject: [PATCH 3/7] breaking, but just Andrew's change --- sbin/build.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sbin/build.sh b/sbin/build.sh index 59e7e8269..293b99e54 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -105,7 +105,7 @@ configureDevKitConfigureParameter() { addConfigureArg "--with-devkit=" "${BUILD_CONFIG[ADOPTIUM_DEVKIT_LOCATION]}" fi fi -} +} # Configure the boot JDK configureBootJDKConfigureParameter() { @@ -1121,6 +1121,8 @@ generateSBoM() { addSBOMComponentPropertyFromFile "${javaHome}" "${classpath}" "${sbomJson}" "${componentName}" "makejdk_any_platform_args" "${BUILD_CONFIG[WORKSPACE_DIR]}/config/makejdk-any-platform.args" # Add make_command_args JDK Component Property addSBOMComponentPropertyFromFile "${javaHome}" "${classpath}" "${sbomJson}" "${componentName}" "make_command_args" "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[TARGET_DIR]}/metadata/makeCommandArg.txt" + # Add CONFIGURE_ARGS property + # addSBOMComponentProperty "${javaHome}" "${classpath}" "${sbomJson}" "${componentName}" "Configure Args" "${CONFIGURE_ARGS}" done @@ -1137,7 +1139,7 @@ generateSBoM() { local openjdkSrcDir="${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}" # strace analysis needs to know the bootJDK and optional local DevKit/Toolchain, as these versions will - # be present in the analysis and not necessarily installed as packages + # be present in the analysis and not necessarily installed as packages local devkit_path=$(getConfigureArgPath "--with-devkit") local cc_path=$(getCCFromSpecGmk) if [[ -n "${cc_path}" ]]; then From f7c453dba3058563987bbb186d11fbca7ac0ed0f Mon Sep 17 00:00:00 2001 From: dscanteianu Date: Thu, 30 Jan 2025 17:27:22 +0000 Subject: [PATCH 4/7] move to --wsl option --- configureBuild.sh | 4 ---- sbin/common/config_init.sh | 15 +++++++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/configureBuild.sh b/configureBuild.sh index 8e5a66446..8606be3ec 100755 --- a/configureBuild.sh +++ b/configureBuild.sh @@ -163,10 +163,6 @@ setVariablesForConfigure() { BUILD_CONFIG[TEST_IMAGE_PATH]=$openjdk_test_image_path BUILD_CONFIG[DEBUG_IMAGE_PATH]=$openjdk_debug_image_path BUILD_CONFIG[STATIC_LIBS_IMAGE_PATH]=$static_libs_path - if ! [[ -z ${WSL+x} ]]; then - echo "building in wsl mode" - BUILD_CONFIG[USER_SUPPLIED_CONFIGURE_ARGS]="--build=x86_64-unknown-linux-gnu --openjdk-target=x86_64-unknown-linux-gnu" - fi } # Set the repository to build from, defaults to adoptium if not set by the user diff --git a/sbin/common/config_init.sh b/sbin/common/config_init.sh index 1a649a805..e3d298bd5 100755 --- a/sbin/common/config_init.sh +++ b/sbin/common/config_init.sh @@ -282,12 +282,12 @@ function parseConfigurationArguments() { "--docker" ) BUILD_CONFIG[CONTAINER_COMMAND]="docker"; - if setCustomImage "${1-}"; then shift ; fi + if setCustomImage "${1-}"; then shift ; fi ;; "--podman" ) BUILD_CONFIG[CONTAINER_COMMAND]="podman"; - if setCustomImage "${1-}"; then shift ; fi + if setCustomImage "${1-}"; then shift ; fi ;; "--debug-docker" ) @@ -407,6 +407,9 @@ function parseConfigurationArguments() { "--jvm-variant" | "-V" ) BUILD_CONFIG[JVM_VARIANT]="$1"; shift;; + "--wsl" ) + BUILD_CONFIG[USER_SUPPLIED_CONFIGURE_ARGS]+="--build=x86_64-unknown-linux-gnu --openjdk-target=x86_64-unknown-linux-gnu ";; + *) echo >&2 "Invalid build.sh option: ${opt}"; exit 1;; esac done @@ -434,22 +437,22 @@ function setCustomImage() { local imageCandidate="${1}" # is next param empty? if [[ -z ${imageCandidate} ]] ; then - echo "default image will be used: ${BUILD_CONFIG[CONTAINER_IMAGE]}" + echo "default image will be used: ${BUILD_CONFIG[CONTAINER_IMAGE]}" return 1 fi # is the next parameter a switch? if [[ ${imageCandidate} == -* ]] ; then - echo "default image will be used: ${BUILD_CONFIG[CONTAINER_IMAGE]}" + echo "default image will be used: ${BUILD_CONFIG[CONTAINER_IMAGE]}" return 1 fi # is the next param a main arg? if checkOpenJdkVersion "${imageCandidate}" ; then - echo "default image will be used: ${BUILD_CONFIG[CONTAINER_IMAGE]}" + echo "default image will be used: ${BUILD_CONFIG[CONTAINER_IMAGE]}" return 1 fi # not empty, not switch, not main arg - therefore it must be an image, use it BUILD_CONFIG[CONTAINER_IMAGE]="${imageCandidate}" - echo "base image will be set to: ${BUILD_CONFIG[CONTAINER_IMAGE]}" + echo "base image will be set to: ${BUILD_CONFIG[CONTAINER_IMAGE]}" return 0 } From d392e32729ae4054110c53cc473b2eac20d6a3fe Mon Sep 17 00:00:00 2001 From: dscanteianu Date: Thu, 30 Jan 2025 17:29:27 +0000 Subject: [PATCH 5/7] add message to readme --- README.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index e628bb60e..9bc4dc59e 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,8 @@ the "boot JDK" which should generally be one major version prior to the one you are building (although one of the same major version will also work). Note that the build variant defaults to HotSpot if omitted which builds from the same repositories as Temurin. +If you're using wsl, use the `--wsl` flag (ie: `./makejdk-any-platform.sh -J /usr/lib/jvm/java-21-openjdk-amd64 --wsl --create-sbom jdk21`). + ```bash ./makejdk-any-platform.sh (-J /usr/lib/jvm/jdk-xx) (--build-variant ) ``` @@ -124,7 +126,7 @@ removes the existing docker container and persistent volume before starting a new docker based build. -C, --configure-args -specify any custom user configuration arguments, using +specify any custom user configuration arguments, using temporary_speech_mark_placeholder in the place of any speech marks. --clean-git-repo @@ -196,7 +198,7 @@ Unix: /usr/local/dependency_cache creates an exploded image (useful for codesigning jmods). Use --assemble-exploded-image once you have signed the jmods to complete the packaging steps. --custom-cacerts -If true (default), a custom cacerts file will be generated based on the Mozilla list of CA certificates (see folder security/). If false, the file shipped by OpenJDK will be used. +If true (default), a custom cacerts file will be generated based on the Mozilla list of CA certificates (see folder security/). If false, the file shipped by OpenJDK will be used. -n, --no-colour disable colour output. @@ -400,7 +402,7 @@ Example values: [`0`, `1`] Example values: [`22`, `23`, `24`] - `security:` -Example values: [`0`, `1`] +Example values: [`0`, `1`] - `tags:` Example values: [`m1`, `m2`] @@ -423,7 +425,7 @@ Example Values: [`0`, `9`, `252` `272`] Example values: [`null`] - `adopt_build_number:` -Example values: [`0`] +Example values: [`0`] If the `ADOPT_BUILD_NUMBER` parameter is used to build te JDK that value will appear here, otherwise a default value of 0 appears. - `major:` @@ -433,11 +435,11 @@ Example values: [`8`, `11`, `15`, `16`] Example values: [`1.8.0_272-202010111709-b09`, `11.0.9+10-202010122348`, `14.0.2+11-202007272039`, `16+19-202010120348`] - `semver:` -Example values: [`8.0.202+8.0.202008210941`, `11.0.9+10.0.202010122348`, `14.0.2+11.0.202007272039`, `16.0.0+19.0.202010120339`] +Example values: [`8.0.202+8.0.202008210941`, `11.0.9+10.0.202010122348`, `14.0.2+11.0.202007272039`, `16.0.0+19.0.202010120339`] Formed from the major, minor, security, and build number by the [formSemver()](https://github.com/adoptium/temurin-build/blob/805e76acbb8a994abc1fb4b7d582486d48117ee8/pipelines/library/src/common/VersionInfo.groovy#L123) function. - `build:` -Example values: [`6`, `9`, `18`] +Example values: [`6`, `9`, `18`] The OpenJDK build number for the JDK being built. - `opt:` @@ -446,7 +448,7 @@ Example values: [`202008210941`, `202010120348`, `202007272039`] ---- - `scmRef:` -Example values: [`dragonwell-8.4.4_jdk8u262-b10`, `jdk-16+19_adopt-61198-g59e3baa94ac`, `jdk-11.0.9+10_adopt-197-g11f44f68c5`, `23f997ca1`] +Example values: [`dragonwell-8.4.4_jdk8u262-b10`, `jdk-16+19_adopt-61198-g59e3baa94ac`, `jdk-11.0.9+10_adopt-197-g11f44f68c5`, `23f997ca1`] A reference the the base JDK repository being build, usually including a GitHub commit reference, i.e. `jdk-16+19_adopt-61198-g59e3baa94ac` links to `https://github.com/adoptium/openjdk-jdk/commit/59e3baa94ac` via the commit SHA **59e3baa94ac**. @@ -455,7 +457,7 @@ Values that only contain a commit reference such as `23f997ca1` are OpenJ9 commi ---- - `buildRef:` -Example values: [`openjdk-build/fe0f2dba`, `openjdk-build/f412a523`] +Example values: [`openjdk-build/fe0f2dba`, `openjdk-build/f412a523`] A reference to the build tools repository used to create the JDK, uses the format **repository-name**/**commit-SHA**. ---- @@ -471,7 +473,7 @@ Example values: [`jdk`, `jre`, `debugimage`, `testimage`] ---- - `sha256:` -Example values: [`20278aa9459e7636f6237e85fcd68deec1f42fa90c6c541a2dfa127f4156d3e2`, `2f9700bd75a807614d6d525fbd8d016c609a9ea71bf1ffd5d4839f3c1c8e4b8e`] +Example values: [`20278aa9459e7636f6237e85fcd68deec1f42fa90c6c541a2dfa127f4156d3e2`, `2f9700bd75a807614d6d525fbd8d016c609a9ea71bf1ffd5d4839f3c1c8e4b8e`] A SHA to verify the contents of the JDK. ---- From aef0b64b1896722e73051b0a9c891453150fa080 Mon Sep 17 00:00:00 2001 From: dscanteianu Date: Thu, 30 Jan 2025 17:32:11 +0000 Subject: [PATCH 6/7] add to man page --- makejdk-any-platform.1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/makejdk-any-platform.1 b/makejdk-any-platform.1 index 6251c26b1..c4436215a 100755 --- a/makejdk-any-platform.1 +++ b/makejdk-any-platform.1 @@ -201,7 +201,7 @@ Use certs defined in JEP319 in Java 8/9. Deprecated, has no effect. .BR \-\-custom-cacerts " " \fI\fR If true (default), a custom cacerts file will be generated based on Mozilla's list of CA certificates (see folder security/). If false, the file shipped by -OpenJDK will be used. +OpenJDK will be used. .TP .BR \-\-vendor " " \fI\fR specify the vendor name @@ -222,6 +222,9 @@ to tell the build that you are effectively building a jdk8u binary. .TP .BR \-V ", " \-\-jvm-variant " " \fI\fR specify the JVM variant (server or client), defaults to server. +.TP +.BR \-\-wsl +configure the build to run natively on WSL (Windows Subsystem for Linux) .SH EXAMPLE USAGE From e7a492aa445d332038b121fb860b02c5265bba33 Mon Sep 17 00:00:00 2001 From: dscanteianu Date: Thu, 30 Jan 2025 19:05:31 +0000 Subject: [PATCH 7/7] add configure.txt --- sbin/build.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/build.sh b/sbin/build.sh index 293b99e54..93be9e69f 100755 --- a/sbin/build.sh +++ b/sbin/build.sh @@ -1122,7 +1122,10 @@ generateSBoM() { # Add make_command_args JDK Component Property addSBOMComponentPropertyFromFile "${javaHome}" "${classpath}" "${sbomJson}" "${componentName}" "make_command_args" "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[TARGET_DIR]}/metadata/makeCommandArg.txt" # Add CONFIGURE_ARGS property - # addSBOMComponentProperty "${javaHome}" "${classpath}" "${sbomJson}" "${componentName}" "Configure Args" "${CONFIGURE_ARGS}" + addSBOMComponentProperty "${javaHome}" "${classpath}" "${sbomJson}" "${componentName}" "Configure Args" "${CONFIGURE_ARGS}" + # Add configure.txt JDK Component Property + addSBOMComponentPropertyFromFile "${javaHome}" "${classpath}" "${sbomJson}" "${componentName}" "configure.txt" "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[TARGET_DIR]}/metadata/configure.txt" + done