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

8255240: Mobile builds need to exclude some modules #20

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

johanvos
Copy link
Collaborator

@johanvos johanvos commented Mar 23, 2024

This PR enables to build the static libs for ios/android for the native code in most of the modules.
It also adds GA scripts to build those libs on Android and iOS.
Note that building hotspot is disabled by this PR.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8255240: Mobile builds need to exclude some modules (Task - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/mobile.git pull/20/head:pull/20
$ git checkout pull/20

Update a local copy of the PR:
$ git checkout pull/20
$ git pull https://git.openjdk.org/mobile.git pull/20/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20

View PR using the GUI difftool:
$ git pr show -t 20

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/mobile/pull/20.diff

Webrev

Link to Webrev Comment

johanvos and others added 6 commits February 14, 2024 16:53
Add sample configure script for ios
* Add android build

* fix env variable use

* fix condition

* update conf and build for android

* add config name

* remove build jdk

* update id

* fix command

* add ls to debug

* fix build command

* update conf name

* update directory name

* remove ${{ }} to fix condition

* do not remove bundle for android

* add debug

* add debug

* do not build debug

* s/x64/aarch64

* add debug logs

* fix condition

* create only release

* build on push

* add ios build

* fix platform name

* download cups from source

* fix command

* skip running make for product-bundles and test-bundles

* update upload to support ios static
Fix conflict related to major changes in NativeCompilation.gmk
@bridgekeeper
Copy link

bridgekeeper bot commented Mar 23, 2024

👋 Welcome back jvos! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Mar 23, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@johanvos johanvos changed the title Static libs 8255240: Mobile builds need to exclude some modules Mar 25, 2024
@johanvos
Copy link
Collaborator Author

changed description to match the JBS issue that should get fixed with this PR.

@openjdk openjdk bot added the rfr label Mar 25, 2024
@johanvos
Copy link
Collaborator Author

/reviewers 0

@openjdk
Copy link

openjdk bot commented Mar 25, 2024

@johanvos
The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 1 (with at least 1 Reviewer).

@mlbridge
Copy link

mlbridge bot commented Mar 25, 2024

Webrevs

@@ -70,7 +70,9 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \

$(BUILD_LIBJDWP): $(call FindLib, java.base, java)

TARGETS += $(BUILD_LIBJDWP)
Copy link
Member

Choose a reason for hiding this comment

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

While this work, this is not normally how we do things in the build.

If you ever want to have this upstreamed, you need to put the entire SetupJdkLibrary inside the ifeq block.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only the $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP block or also the

$(BUILD_LIBJDWP): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBJDWP)

?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, everything needed for the compilation. Have a look at how other libraries that are only built on specific platforms are defined (e.g. in CoreLibraries.gmk, if you struggle to find examples.)

@@ -77,4 +77,7 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBSAPROC, \
LIBS_windows := dbgeng.lib, \
))

TARGETS += $(BUILD_LIBSAPROC)
ifeq ($(call isTargetOs, android ios), false)
TARGETS += $(BUILD_LIBSA)
Copy link
Member

Choose a reason for hiding this comment

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

The same goes here. Also note that this is actually broken for non-android or ios builds, BUILD_LIBSA should be BUILD_LIBSAPROC...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks for noticing, this is embarrassing!
I'll change that in the same way as I'll fix the above -- once I know if only the call to SetupJdkLibrary should be inside the test.

@@ -63,4 +63,8 @@ else
endif
$(BUILD_LIBINSTRUMENT): $(call FindLib, java.base, java)

TARGETS += $(BUILD_LIBINSTRUMENT)
ifeq ($(call isTargetOs, android ios), false)
Copy link
Member

Choose a reason for hiding this comment

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

And here as well...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

thanks, will fix that too.

@@ -32,7 +32,7 @@ ifeq ($(call isTargetOs, windows), false)
include gensrc/GensrcIcons.gmk
endif

ifeq ($(call isTargetOs, linux aix), true)
ifeq ($(call isTargetOs, linux aix android ios), true)
Copy link
Member

Choose a reason for hiding this comment

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

Should ios really have X11Wrappers?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

no. Will fix.

@@ -314,6 +317,9 @@ Java_com_sun_management_internal_OperatingSystemImpl_getOpenFileDescriptorCount0
free(fds);

return nfiles;
#else
return (100);
Copy link
Member

Choose a reason for hiding this comment

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

This seem like a hack?

Also, why the parenthesis?

@magicus
Copy link
Member

magicus commented Mar 27, 2024

The GHA scripts are interesting. I did not realize it could be possible to cross-compile to ios and android on GHA.

I have tried to review them, but I did not go into too much detail. If they are ever to be upstreamed, I think they will need some cleanup and be made to fit better into the existing structure, but for a separate port I assume they are okay.

@magicus
Copy link
Member

magicus commented Mar 27, 2024

And why are you disabling the hotspot build? How can anything good come out of a JDK build without hotspot?

@openjdk
Copy link

openjdk bot commented Mar 27, 2024

@johanvos this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:

git checkout staticlibs
git fetch https://git.openjdk.org/mobile.git master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push

@openjdk openjdk bot added merge-conflict and removed rfr labels Mar 27, 2024
@openjdk openjdk bot added the rfr label Mar 27, 2024
Copy link
Member

@magicus magicus left a comment

Choose a reason for hiding this comment

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

I guess this looks good enough now, but the PR/JBS issue title does not seem to correlate at all to what the code does...

@openjdk openjdk bot removed the merge-conflict label Apr 14, 2024
@@ -88,7 +90,7 @@ jobs:
echo 'false'
return
else
input='${{ secrets.JDK_SUBMIT_PLATFORMS }}'
input='android-linux-aarch64, ios-macos-aarch64'
Copy link
Member

Choose a reason for hiding this comment

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

Actually, this should be reverted, otherwise you can never run a user-specified set of platforms on GHA.

@@ -0,0 +1,10 @@
# sample configure command for ios
Copy link
Member

Choose a reason for hiding this comment

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

I also don't think this belongs in the repo. A command example like this can be documented on the wiki or the JDK project web page.

@@ -41,6 +41,10 @@ runs:
id: bundles
run: |
# Rename bundles to consistent names
echo "build/${{ inputs.platform }} contents..."
Copy link
Member

Choose a reason for hiding this comment

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

This (and more below) looks like debug code that could/should be removed once you have made sure the builds are working.

id: build
uses: ./.github/actions/do-build
with:
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
make-target: '${{ inputs.make-target }} ${{ inputs.make-arguments }}'
make-target: 'static-libs-image ${{ inputs.make-arguments }}'

Then you will not need the change in do-build/action.yml

@@ -39,12 +39,21 @@ inputs:
runs:
using: composite
steps:
- name: 'Build Android or iOS'
id: build-android-ios
run: |
Copy link
Member

Choose a reason for hiding this comment

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

This is a hack, put in the wrong place. See below for a better solution.

@bridgekeeper
Copy link

bridgekeeper bot commented May 16, 2024

@johanvos This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants