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

Ensure any old openjdk build directory is removed before building #1030

Merged
merged 2 commits into from
May 15, 2024

Conversation

andrew-m-leonard
Copy link
Contributor

The openjdk build output directory may exist from a previous build if it was aborted or purposely kept.
It must always be deleted prior to a new build.

@andrew-m-leonard andrew-m-leonard self-assigned this May 10, 2024
Copy link

Thank you for creating a pull request!

Please check out the information below if you have not made a pull request here before (or if you need a reminder how things work).

Code Quality and Contributing Guidelines

If you have not done so already, please familiarise yourself with our Contributing Guidelines and Code Of Conduct, even if you have contributed before.

Tests

Github actions will 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.

In order to run the advanced pipeline tests (executing a set of mock pipelines), it requires an admin to post run tests on this PR.
If you are not an admin, please ask for one's attention in #infrastructure on Slack or ping one here.
To run full set of tests, use "run tests"; a subset of tests on specific jdk version, use "run tests quick 11,21"

@andrew-m-leonard
Copy link
Contributor Author

run tests

Copy link
Contributor

@steelhead31 steelhead31 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@sophia-guo sophia-guo left a comment

Choose a reason for hiding this comment

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

@eclipse-temurin-bot
Copy link
Collaborator

 PR TESTER RESULT 

❎ Some pipelines failed or the job was aborted! ❎
See the pipeline-build-check below for more information...

@sophia-guo
Copy link
Contributor

Wondered if this should be done in temurin-build?

@andrew-m-leonard
Copy link
Contributor Author

Does the code https://github.com/adoptium/ci-jenkins-pipelines/blob/master/pipelines/build/common/openjdk_build_pipeline.groovy#L1792-L1817 do the clean?

yes, this line:
context.sh(script: 'rm -rf ' + context.WORKSPACE + '/*')
openjdk_build dir is under WORKSPACE

@andrew-m-leonard
Copy link
Contributor Author

Wondered if this should be done in temurin-build?

So no, because a user may have specified a user openjdk build folder that maybe by accident is some location they don't want to delete like /home !

@andrew-m-leonard
Copy link
Contributor Author

run tests

@andrew-m-leonard
Copy link
Contributor Author

Aborted Windows build jobs are always going to be an issue, as kill -9 on Windows processes can cause "locked" files, so I warn against aborting Windows jobs if possible

@eclipse-temurin-bot
Copy link
Collaborator

 PR TESTER RESULT 

❎ Some pipelines failed or the job was aborted! ❎
See the pipeline-build-check below for more information...

@sophia-guo
Copy link
Contributor

If cleanWorkspace=true context.WORKSPACE will be cleaned up include openjdk_build_dir(under WORKSPACE). Otherwise openjdk_build_dir will not be cleaned up.

This pr will cleanup openjdk_build_dir(under WORKSPACE) even if cleanWorkspace=false. However any other files or directory under the WORKSPACE will not be cleaned up if cleanWorkspace=false.

Just curious any reason we don't do the cleanWorkspace by default CLEAN_WORKSPACE": false?

@andrew-m-leonard
Copy link
Contributor Author

If cleanWorkspace=true context.WORKSPACE will be cleaned up include openjdk_build_dir(under WORKSPACE). Otherwise openjdk_build_dir will not be cleaned up.

This pr will cleanup openjdk_build_dir(under WORKSPACE) even if cleanWorkspace=false. However any other files or directory under the WORKSPACE will not be cleaned up if cleanWorkspace=false.

Just curious any reason we don't do the cleanWorkspace by default CLEAN_WORKSPACE": false?

We have always not cleaned the WORKSPACE before a build by default for nightly/weekly builds, the reason is to save time in having to re-clone the openjdk src repository(~2Gb) each time.
Release builds do clean WORKSPACE before a build.

@karianna karianna merged commit 31b6c33 into adoptium:master May 15, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants