Skip to content

Commit

Permalink
Merge branch 'master' into macAarch
Browse files Browse the repository at this point in the history
  • Loading branch information
sophia-guo authored Oct 9, 2024
2 parents 129a2d6 + 16cf218 commit bdb8991
Show file tree
Hide file tree
Showing 11 changed files with 795 additions and 130 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ jobs:
steps:
- name: Restore cygwin packages from cache
id: cygwin
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
with:
path: C:\cygwin64
key: cygwin-packages-${{ runner.os }}-v1
Expand Down Expand Up @@ -279,15 +279,15 @@ jobs:
- name: Restore Visual Studio 2017 from cache
id: vs2017
if: matrix.version == 'jdk8u'
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
with:
path: ~/vs2017.exe
key: vs2017

- name: Restore Visual Studio 2019 from cache
id: vs2019
if: matrix.version == 'jdk11u' || matrix.version == 'jdk17u'
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@2cdf405574d6ef1f33a1d12acccd3ae82f47b3f2 # v4.1.0
with:
path: ~/vs2019.exe
key: vs2019
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ca-cert-updater.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
working-directory: ./security
run: "./mk-ca-bundle.pl"

- uses: gr2m/create-or-update-pull-request-action@86ec1766034c8173518f61d2075cc2a173fb8c97 # v1.9.4
- uses: gr2m/create-or-update-pull-request-action@488876a65a2ca38b7eb05e9086166337087f5323 # v1.10.0
env:
GITHUB_TOKEN: ${{ secrets.ADOPTIUM_TEMURIN_BOT_TOKEN }}
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
uses: github/codeql-action/init@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -68,7 +68,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
uses: github/codeql-action/autobuild@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
Expand All @@ -81,6 +81,6 @@ jobs:
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v3.26.10
uses: github/codeql-action/analyze@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v3.26.12
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/ossf-scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ jobs:
name: SARIF file
path: results.sarif
retention-days: 5
- uses: github/codeql-action/upload-sarif@e2b3eafc8d227b0241d48be5f425d47c2d750a13 # v2.13.4
- uses: github/codeql-action/upload-sarif@c36620d31ac7c881962c3d9dd939c40ec9434f2b # v2.13.4
with:
sarif_file: results.sarif
4 changes: 2 additions & 2 deletions cyclonedx-lib/getDependencies
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

LABEL=params.LABEL ? params.LABEL : 'ci.role.test&&hw.arch.x86&&sw.os.linux'

TEMURIN_BUILD_REPO="https://github.com/adamfarley/temurin-build"
TEMURIN_BUILD_BRANCH="add_versions_and_shas_to_build_getdependencies"
TEMURIN_BUILD_REPO="https://github.com/adoptium/temurin-build"
TEMURIN_BUILD_BRANCH="master"

stage('Queue') {
node("$LABEL") {
Expand Down
2 changes: 1 addition & 1 deletion sbin/common/downloaders.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function downloadLinuxBootJDK() {
# the fallback mechanism, as downloading of the GA binary might fail.
set +e
curl -L -o bootjdk.tar.gz "${apiURL}"
apiSigURL=$(curl -v "${apiURL}" 2>&1 | tr -d \\r | awk '/^< Location:/{print $3 ".sig"}')
apiSigURL=$(curl -v "${apiURL}" 2>&1 | tr -d \\r | awk '/^< [Ll]ocation:/{print $3 ".sig"}')
if ! grep "No releases match the request" bootjdk.tar.gz; then
curl -L -o bootjdk.tar.gz.sig "${apiSigURL}"
gpg --keyserver keyserver.ubuntu.com --recv-keys 3B04D753C9050D9A5D343F39843C48A565F8F04B
Expand Down
762 changes: 760 additions & 2 deletions security/certdata.txt

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class VerifyCACertsTest {
private static final JdkVersion JDK_VERSION = new JdkVersion();

// Expect matching certs number
private static final int EXPECTED_COUNT = 148;
private static final int EXPECTED_COUNT = 152;

/* TODO: add up to 141 certs
private static final Map<String, String> EXPFP_MAP = new HashMap<>() {
Expand Down
3 changes: 2 additions & 1 deletion test/system/reproducibleCompare/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
</test>
<test>
<testCaseName>Rebuild_Same_JDK_Reproducibility_Test_win</testCaseName>
<command>$(TEST_ROOT)$(D)system$(D)reproducibleCompare$(D)windows_repro_build_compare.sh $(SBOM_FILE) $(JDK_FILE) $(REPORTDIR); \
<command>unset SPEC;\
$(TEST_ROOT)$(D)system$(D)reproducibleCompare$(D)windows_repro_build_compare.sh $(SBOM_FILE) $(JDK_FILE) $(REPORTDIR); \
$(TEST_STATUS)
</command>
<levels>
Expand Down
2 changes: 1 addition & 1 deletion tooling/reproducible/comparable_patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ fi

if [[ "$OS" =~ CYGWIN* ]] || [[ "$OS" =~ Darwin* ]]; then
# SystemModules$*.class's differ due to hash differences from Windows COMPANY_NAME and Signatures
removeSystemModulesHashBuilderParams
removeSystemModulesHashBuilderParams "${JDK_DIR}"
fi

if [[ "$OS" =~ CYGWIN* ]]; then
Expand Down
134 changes: 20 additions & 114 deletions tooling/reproducible/windows_repro_build_compare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ CPP_COMPILER_EXE="cl.exe"
WIN_URCT_BASE="C:/Program Files (x86)/Windows Kits/10/Redist"
SIGNTOOL_BASE="C:/Program Files (x86)/Windows Kits/10"

# Define What Are Configure Args & Redundant Args
# This MAY Need Updating If Additional Configure Args Are Passed
CONFIG_ARGS=("--disable-warnings-as-errors" "--disable-ccache" "--with-toolchain-version" "--with-ucrt-dll-dir" "--with-version-opt")
NOTUSE_ARGS=("--assemble-exploded-image" "--configure-args")

# Addiitonal Working Variables Defined For Use By This Script
SBOMLocalPath="$WORK_DIR/src_sbom.json"
DISTLocalPath="$WORK_DIR/src_jdk_dist.zip"
Expand All @@ -74,17 +69,6 @@ is_url() {
fi
}

# Function to check if a value is in the array
containsElement () {
local e
for e in "${@:2}"; do
if [ "$e" == "$1" ]; then
return 0 # Match found
fi
done
return 1 # No match found
}

Create_WorkDir() {
# Check if the folder exists & remove if it does
echo "Checking If Working Directory: $WORK_DIR Exists"
Expand Down Expand Up @@ -554,105 +538,27 @@ Clone_Build_Repo() {
Prepare_Env_For_Build() {
echo "Setting Variables"
export BOOTJDK_HOME=$WORK_DIR/jdk-${bootJDK}
echo "Parsing Make JDK Any Platform ARGS For Build"
# Split the string into an array of words
IFS=' ' read -ra words <<< "$buildArgs"

# Add The Build Time Stamp In Case It Wasnt In The SBOM ARGS
words+=("--build-reproducible-date")
words+=("\"$buildStamp\"")

# Initialize variables
param=""
value=""
params=()

# Loop through the words
for word in "${words[@]}"; do
# Check if the word starts with '--'
if [[ $word == --* ]] || [[ $word == -b* ]]; then
# If a parameter already exists, store it in the params array
if [[ -n $param ]]; then
params+=("$param=$value")
fi
# Reset variables for the new parameter
param="$word"
value=""
else
value+="$word "
fi
done

# Add the last parameter to the array
params+=("$param=$value")

# Read the separated parameters and values into a new array
export fixed_param=""
export fixed_value=""
export fixed_params=()
export new_params=""
CONFIG_ARRAY=()
BUILD_ARRAY=()
IGNORED_ARRAY=()

for p in "${params[@]}"; do
IFS='=' read -ra parts <<< "$p"
prefixed_param=${parts[0]}
fixed_param="${prefixed_param%%[[:space:]]}"
prepped_value=${parts[1]}
fixed_value=$(echo "$prepped_value" | awk '{$1=$1};1')
# Handle Special parameters
if [ "$fixed_param" == "--jdk-boot-dir" ]; then fixed_value="$BOOTJDK_HOME" ; fi
if [ "$fixed_param" == "--with-toolchain-version" ]; then fixed_value="$visualStudioVersion" ; fi
if [ "$fixed_param" == "--with-ucrt-dll-dir" ]; then fixed_value="temporary_speech_mark_placeholder${UCRT_PARAM_PATH}temporary_speech_mark_placeholder " ; fi
if [ "$fixed_param" == "--target-file-name" ]; then target_file="$fixed_value" ; fi
if [ "$fixed_param" == "--user-openjdk-build-root-directory" ]; then fixed_value="$WORK_DIR/temurin-build/workspace/build/openjdkbuild" ; fi

# Fix Build Variant Parameter To Strip JDK Version

if [ "$fixed_param" == "--build-variant" ] ; then
# Remove Leading White Space
trimmed_value=$(echo "$prepped_value" | awk '{$1=$1};1')
IFS=' ' read -r variant jdk <<< "$trimmed_value"
if [[ $jdk == jdk* ]]; then
variant="$variant "
else
temp="$variant "
variant="$jdk"
jdk="$temp"
fi
fixed_value=$variant
fi

# Check if fixed_param is in CONFIG_ARGS
if containsElement "$fixed_param" "${CONFIG_ARGS[@]}"; then
# Add Config Arg To New Array

# Handle Windows Param Names In Config Args (Replace Space with =)
if [ "$fixed_param" == "--with-toolchain-version" ] || [ "$fixed_param" == "--with-ucrt-dll-dir" ] || [ "$fixed_param" == "--with-version-opt" ] ; then
STRINGTOADD="$fixed_param=$fixed_value"
CONFIG_ARRAY+=("$STRINGTOADD")
else
STRINGTOADD="$fixed_param $fixed_value"
CONFIG_ARRAY+=("$STRINGTOADD")
fi
elif containsElement "$fixed_param" "${NOTUSE_ARGS[@]}"; then
# Strip Parameters To Be Ignored
STRINGTOADD="$fixed_param $fixed_value"
IGNORED_ARRAY+=("$STRINGTOADD")
else
# Not A Config Param Nor Should Be Ignored, So Add To Build Array
STRINGTOADD="$fixed_param $fixed_value"
BUILD_ARRAY+=("$STRINGTOADD")
fi
done

IFS=' ' build_string="${BUILD_ARRAY[*]}"
IFS=' ' config_string=$"${CONFIG_ARRAY[*]}"
final_params="$build_string --configure-args \"$config_string\" $jdk"
# set --build-reproducible-date if not yet
if [[ "${buildArgs}" != *"--build-reproducible-date"* ]]; then
buildArgs="--build-reproducible-date \"${buildStamp}\" ${buildArgs}"
fi
# reset --jdk-boot-dir
# shellcheck disable=SC2001
buildArgs="$(echo "$buildArgs" | sed -e "s|--jdk-boot-dir [^ ]*|--jdk-boot-dir ${BOOTJDK_HOME}|")"
# shellcheck disable=SC2001
buildArgs="$(echo "$buildArgs" | sed -e "s|--with-toolchain-version [^ ]*|with-toolchain-version ${visualStudioVersion}|")"
# shellcheck disable=SC2001
buildArgs="$(echo "$buildArgs" | sed -e "s|--with-ucrt-dll-dir=[^ ]*|--with-ucrt-dll-dir=temporary_speech_mark_placeholder${UCRT_PARAM_PATH}temporary_speech_mark_placeholder|")"
# shellcheck disable=SC2001
buildArgs="$(echo "$buildArgs" | sed -e "s|--user-openjdk-build-root-directory [^ ]*|--user-openjdk-build-root-directory ${WORK_DIR}/temurin-build/workspace/build/openjdkbuild/|")"
# remove ingored options
buildArgs=${buildArgs/--assemble-exploded-image /}
buildArgs=${buildArgs/--enable-sbom-strace /}

echo ""
echo "Make JDK Any Platform Argument List = "
echo "$final_params"
echo "$buildArgs"
echo ""
echo "Parameters Parsed Successfully"
}
Expand All @@ -662,9 +568,9 @@ Build_JDK() {

# Trigger Build
cd "$WORK_DIR"
echo "cd temurin-build && ./makejdk-any-platform.sh $final_params 2>&1 | tee build.$$.log" | sh
echo "cd temurin-build && ./makejdk-any-platform.sh $buildArgs 2>&1 | tee build.$$.log" | sh
# Copy The Built JDK To The Working Directory
cp "$WORK_DIR/temurin-build/workspace/target/$target_file" "$WORK_DIR/reproJDK.zip"
cp "${WORK_DIR}"/temurin-build/workspace/target/OpenJDK*-jdk_*.zip "$WORK_DIR/reproJDK.zip"
}

Compare_JDK() {
Expand Down

0 comments on commit bdb8991

Please sign in to comment.