Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move buildCyclonedxLib to Build the CycloneDX Java library and app used for SBoM generation from build.sh to sbom.sh #3209

Closed
wants to merge 10 commits into from

Conversation

julian55455
Copy link
Contributor

@julian55455 julian55455 commented Jan 10, 2023

move buildCyclonedxLib to Build the CycloneDX Java library and app used for SBoM generation from build.sh to sbom.sh

Ref: #3158

…ed for SBoM generation from build.sh to sbom.sh
@github-actions
Copy link

Thank you for creating a pull request!
If you have not done so already, please familiarise yourself with our Contributing Guidelines and FAQ, even if you have contributed to the Adoptium project before. GitHub actions will now run a set of jobs against your PR that will lint and unit test your changes. Keep an eye out for the results from these on the latest commit you submitted. For more information, please see our testing documentation.

@karianna
Copy link
Contributor

@julian55455 you'll need to sign the Eclipse CLA?

@karianna
Copy link
Contributor

@julian55455 - Also linter and tests fail

@zdtsw zdtsw marked this pull request as draft January 16, 2023 13:43
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A block has been put on this Pull Request as this repository is temporarily under a code freeze due to an ongoing release cycle.

If this pull request needs to be merged during the release cycle then please comment /merge and a PMC member will be able to remove the block.

If the code freeze is over you can remove this block by commenting /thaw.

@zdtsw zdtsw marked this pull request as ready for review January 25, 2023 10:07
@zdtsw
Copy link
Contributor

zdtsw commented Jan 25, 2023

you might need to do a rebase first

@zdtsw
Copy link
Contributor

zdtsw commented Jan 25, 2023

will merge it once code frozen is uplifted

@zdtsw
Copy link
Contributor

zdtsw commented Jan 26, 2023

@julian55455 need to resolve conflicts first ^

@zdtsw
Copy link
Contributor

zdtsw commented Jan 26, 2023

/thaw

@github-actions github-actions bot dismissed their stale review January 26, 2023 16:59

Pull Request unblocked - code freeze is over.

@julian55455
Copy link
Contributor Author

@zdtsw are these build failures related to the changes made in this PR?

@zdtsw
Copy link
Contributor

zdtsw commented Feb 1, 2023

@zdtsw are these build failures related to the changes made in this PR?

dont think so, but since both mac failed, i will run one of them and see if it was glitch or not

@andrew-m-leonard
Copy link
Contributor

andrew-m-leonard commented Feb 1, 2023

Ah of course the github action does not use --create-sbom...
must be a glitch ?

sbin/build.sh Outdated
@@ -968,17 +946,17 @@ cleanAndMoveArchiveFiles() {

echo "Currently at '${PWD}'"

local jdkPath=$(ls -d ${BUILD_CONFIG[JDK_PATH]})
local jdkPath=$(ls -d "${BUILD_CONFIG[JDK_PATH]}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line needs the quotes removing as it relies on glob expansion.
Please can you undo the other " changes above as well

@zdtsw
Copy link
Contributor

zdtsw commented Feb 1, 2023

lets try get this pass test first and merge it, leave the "linter" to issue adoptium/ci-jenkins-pipelines#428 to fix

@zdtsw
Copy link
Contributor

zdtsw commented Feb 1, 2023

Ah of course the github action does not use --create-sbom... must be a glitch ?

think the reason is, we wanna only enable sbom related part from ci-jenkins-pipeline, and decouple from temurin-build.
so the others fork the repo wont need to do anything with sbom.

if we want sbom be in the GH check here, we later will also need to add more logic for the signing keys, can be a bit complicated.

@andrew-m-leonard
Copy link
Contributor

@julian55455 For the linter error:

Error: File:[/github/workspace/sbin/build.sh] is not executable
Error: File:[/github/workspace/sbin/common/sbom.sh] is not executable

Try doing a new commit with:
chmod +x sbin/build.sh
chmod +x sbin/common/sbom.sh

You may need to do an arbitrary change in each file to make a commit.

# Check if JDK-17 is available, download it if it isn't
if [ ! -d "${javaHome}" ]; then
# Download JDK-17
apiUrlTemplate="https://api.adoptium.net/v3/binary/latest/\${JDK_BOOT_VERSION}/\${releaseType}/linux/\${downloadArch}/jdk/hotspot/normal/\${vendor}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need these 2 lines:
apiUrlTemplate=...
apiURL=$(eval echo ${apiUrlTemplate})

# Download JDK-17
apiUrlTemplate="https://api.adoptium.net/v3/binary/latest/\${JDK_BOOT_VERSION}/\${releaseType}/linux/\${downloadArch}/jdk/hotspot/normal/\${vendor}"
apiURL=$(eval echo ${apiUrlTemplate})
JDK_BOOT_VERSION="17"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make all these "local" variables

buildCyclonedxLib() {
local javaHome="${1}"

# Check if JDK-17 is available, download it if it isn't
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move this boot jdk logic to

setupAntEnv() {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, i was about to say the logic should be in setupAntEnv()

downloadArch="x64"
vendor="adoptium"
apiURL="https://api.adoptium.net/v3/binary/latest/${JDK_BOOT_VERSION}/${releaseType}/linux/${downloadArch}/jdk/hotspot/normal/${vendor}"
echo "Downloading GA release of boot JDK version ${JDK_BOOT_VERSION} from ${apiURL}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are missing the actual download..

curl -L "${apiURL}" | tar xpzf - --strip-components=1 -C "$jdkDir"

Set jdkDir variable to be "${CYCLONEDB_DIR}/jdk"
Also add that folder to https://github.com/adoptium/temurin-build/blob/master/.gitignore

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then set javaHome in setupAntEnv()

@@ -2,6 +2,9 @@
# Build the CycloneDX Java library and app used for SBoM generation
buildCyclonedxLib() {
local javaHome="${1}"
# Download jdk-19 if JAVA_HOME is not set or is older than jdk-19
if [[ -z "${JAVA_HOME}" ]] || [[ "$(${JAVA_HOME}/bin/java -version 2>&1 | awk -F '"' '/version/ {print $2}')" < "1.9" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

an empty block?

buildCyclonedxLib() {
local javaHome="${1}"

# Check if JDK-17 is available, download it if it isn't
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, i was about to say the logic should be in setupAntEnv()

@julian55455
Copy link
Contributor Author

fixed in this pr #3243

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants