-
-
Notifications
You must be signed in to change notification settings - Fork 256
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
enabled build from source dir/tarball via to --openjdk-source-location/-l #3737
Conversation
Yet again the label is wrong.... @andrew-m-leonard wdyt about this version? |
sbin/prepareWorkspace.sh
Outdated
copyFromDir() { | ||
echo "Copyng existing ${BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]} to `pwd`/${BUILD_CONFIG[OPENJDK_SOURCE_DIR]} to be built" | ||
# we really do not want to use .git for dirs, as we expect user have them set up, ignoring them | ||
local files=$(find ${BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]} -maxdepth 1 -mindepth 1 | grep -v -e "/workspace$" -e "/build$" -e "/.git" -e -"/build/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the ignores for workspace, build, .git, ...., this list could grow or become wrong...
I think we should assume the source tarball is exactly that, if someone puts something in their that is "wrong" then we are not really judging if it is right or wrong....?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I Agree it may be ragile, however it have its reasons.
- .git is useless, we want to build it as it is.Actually its presence may be disturbing
- in addition, .git is quite big,and by nature of its content very slow to copy.
- build is important, it is big, and it would need to be deleted anyway
- in addition it is default of jdk build system for ages.
As for workspace, it is tricky. In temurin build, can workspace dir be renamed/relocated?
It have to be excluded- otherwise, when;
cd ~/git/myJdkClone
sh ~/git/temurin-build/makejdk-any-platform.sh -o . jdk21u
Then the worskapce will copy itself.
I had not found the renaming switch/setup. I had overlooked most liekly, so I hardcoded it.
I was not thinking what is wrong or not. Excluding of workspace is a must. Excluding of a .git is just good. And the build needs to go away anyway in worksapce.... If there will be more excludes on time, just good. Maybe I it should have been made customizable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Teh source tarball is most likely ok. But in case of local directory? That will always contain at least .git. And in many cases also the workspace and build:(
Thanx a lot for reading it out. I had fixed all what coudl be fixed without asking. Two topic remained above. |
@judovana Some linter issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial comments - I might come back and add more as I haven't followed all of the logic through yet. Ref the tar comments - these scripts are designed to be used on non-GNU environments like AIX and Solaris which may not have gnu tar installed, or not have them as the default tar
implementation.
Having said that, it won't affect the Temurin pipelines in jenkins since they won't be using this option ;-)
Then I will keep the flag and value separaed. If @andrew-m-leonard will insist, I will go with value only (wihtout any additional talking).
The main target actually is local directory, and when I was doing this for |
redundant if [ "${BUILD_CONFIG[OPENJDK_FOREST_DIR]}" == "true" ] from getFirstTagFromOpenJDKGitRepo renamed setLocalDir to setOpenjdkSourceDir wrong parent of removed build dir after unpack bounch of typos: does not exists Copying OpenJDK source from Extracting OpenJDK source tarbal contains, does not contain
thanx shell lint
Co-authored-by: Martijn Verburg <[email protected]>
Co-authored-by: Martijn Verburg <[email protected]>
Co-authored-by: Martijn Verburg <[email protected]>
Co-authored-by: Martijn Verburg <[email protected]>
Co-authored-by: Martijn Verburg <[email protected]>
Co-authored-by: Martijn Verburg <[email protected]>
sbin/common/config_init.sh
Outdated
@@ -81,6 +81,8 @@ OPENJDK_BUILD_NUMBER | |||
OPENJDK_CORE_VERSION | |||
OPENJDK_FEATURE_NUMBER | |||
OPENJDK_FOREST_NAME | |||
OPENJDK_FOREST_SOURCE_ARCHIVE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Archive to me usually means .zip or .tar etc. Is OPENJDK_FOREST_SOURCE or something OPENJDK_LOCAL_SOURCE a better name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be archive archive. You can build local directory and tarball (both with sources) in same way.
As i replied to @sxa #3737 (comment) the proepr name aka OPENJDK_LOCAL_SOURCE_DIR_OR_ARCHIVE
is terrible, but why not.
sh makejdk-any-platform.sh -o ~/git/java-21-openjdk-portable/openjdk-21.0.2+13.tar.xz jdk21u
and
sh makejdk-any-platform.sh -o ~/git/jdk21u/ jdk21u
both do same job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, OPENJDK_LOCAL_SOURCE
and OPENJDK_LOCAL_SOURCE_ABSPATH
are generic enough. @sxa , I will use that.
…RCHIVE Tus resulting for both usages: -OPENJDK_FOREST_SOURCE_ARCHIVE -OPENJDK_FOREST_SOURCE_ARCHIVE_ABSPATH +OPENJDK_LOCAL_SOURCE_ARCHIVE +OPENJDK_LOCAL_SOURCE_ARCHIVE_ABSPATH
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Broadly LGTM - over to @sxa
TY! |
/thaw |
Pull Request unblocked - code freeze is over.
macOS jdk11u CI failure unrelated, and already fixed in master |
Maybe we don't need the reset counter in this case but that's a minor point :-) Running some tests just now and will look through the code while I'm doing that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
/thaw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments/suggestions/discussion points before approving but overall this LGTM and I have no major objections.
I'd normally be more strict on it but if you want to leave the GNU-isms in place I'd be ok in this situation since it's not functionality that the temurin pipelines will use, and the platforms that will be affected are, how should I put it, "niche" ;-)
tar --strip-components 0 -xf "${BUILD_CONFIG[OPENJDK_FOREST_DIR_ABSPATH]}" | ||
fi | ||
rm -rf "build" | ||
popd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not seen that before, but I'm ok with it :-)
@@ -79,6 +122,8 @@ checkoutAndCloneOpenJDKGitRepo() { | |||
echo "If this is inside a docker you can purge the existing source by passing --clean-docker-build" | |||
exit 1 | |||
fi | |||
elif [ "${BUILD_CONFIG[OPENJDK_LOCAL_SOURCE_ARCHIVE]}" == "true" ]; then | |||
copyFromDirOrUnpackFromArchive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels a little odd to be calling this from within checkoutAndCloneOpenJDKGitRepo
- perhaps we could invoke it from the higher level configureWorkspace` instead as an alternative. I guess it depends how much of the extra logic in this function we'd need to duplicate or abstract out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. let me try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see. There is
cd "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}"
# Check that we have a git repo, we assume that it is a repo that contains openjdk source
if [ -d "${BUILD_CONFIG[OPENJDK_SOURCE_DIR]}/.git" ] && [ "${BUILD_CONFIG[OPENJDK_LOCAL_SOURCE_ARCHIVE]}" == "false" ]; then
So the change of control dir, which is pretty important for any future steps would need to be handled.
And the main if is still using the [ "${BUILD_CONFIG[OPENJDK_LOCAL_SOURCE_ARCHIVE]}" == "false" ]
becasue of the change of the dir, I would rather not chnage the location of the call, unless yo really insists.
In that case it will go :
function configureWorkspace() {
if [[ "${BUILD_CONFIG[ASSEMBLE_EXPLODED_IMAGE]}" != "true" ]]; then
createWorkspace
downloadingRequiredDependencies
downloadDevkit
relocateToTmpIfNeeded
+if [ "${BUILD_CONFIG[OPENJDK_LOCAL_SOURCE_ARCHIVE]}" == "true" ]; then
+ copyFromDirOrUnpackFromArchiveWrapper
+else
checkoutAndCloneOpenJDKGitRepo
+fi
applyPatches
if [ "${BUILD_CONFIG[CUSTOM_CACERTS]}" = "true" ] ; then
prepareMozillaCacerts
fi
fi
writeDockerImageSHA
}
where the wrapper:
function copyFromDirOrUnpackFromArchiveWrapper() {
cd "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}"
copyFromDirOrUnpackFromArchive
cd "${BUILD_CONFIG[WORKSPACE_DIR]}"
}
IN addition the method of checkoutAndCloneOpenJDKGitRepo
is doing a bit more before cd "${BUILD_CONFIG[WORKSPACE_DIR]}"
Although it seems those lines looks oook to omit (temurin exit, update openj9 and createSourceTagFile ) I'm not sure If I feel safe to omit them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah agree that the safest option is to leave it as-is although putting it in the configureWorkspace
function as per your example does look a lot nicer. But I won't insist on it :-)
Co-authored-by: Stewart X Addison <[email protected]>
Co-authored-by: Martijn Verburg <[email protected]>
Co-authored-by: Stewart X Addison <[email protected]>
Co-authored-by: Stewart X Addison <[email protected]>
Co-authored-by: Stewart X Addison <[email protected]>
usabel also for zips if needed Added fogooten quotes
@sxa I had elaborated on all your comments I had found. Please let me know if you need anything more. Thanx a lto for suggestions! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the basis that all of my comments have been addressed I'll approve this.
I'll let you make the decision on whether to do the extra change to move things into configureWorkspace - I suggest we hold of merging this until Monday (Putting something like this on a Friday always seems like a bad idea!)
sure. TY! |
Surpassing #3724
--tag
but warning if it is not present. Reusing default tag if not set (which works pretty well)Wdyt?