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

Add embedded jdk support for s390x #11965

Conversation

ruixin-bao
Copy link
Contributor

This patch follows a similar approach used in PR
#11436 to add support
for embedding OpenJDK in bazel on s390x.

Similar to ppc, the openjdk used will be downloadded from adoptopenjdk website.

/cc @philwo

This patch follows a similar approach used in PR
bazelbuild#11436 to add support
for embedding OpenJDK in bazel on s390x.

Similar to ppc, the openjdk used will be downloadded from adoptopenjdk website.
@philwo
Copy link
Member

philwo commented Aug 21, 2020

Thank you! Merging this.

@philwo
Copy link
Member

philwo commented Aug 21, 2020

@ruixin-bao Just super curious - can you confirm that with this change, Bazel can be built out of the box on s390x and works fine? 😀

@bazel-io bazel-io closed this in e14a6f2 Aug 21, 2020
@ruixin-bao
Copy link
Contributor Author

ruixin-bao commented Aug 21, 2020

Hi @philwo, thank you for the review :D.

One thing I noticed is that there is a mirror copy created with adoptopenjdk in #11436. For instance, "https://mirror.bazel.build/openjdk/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.7%2B10/OpenJDK11U-jdk_ppc64le_linux_hotspot_11.0.7_10.tar.gz". Wondering should this PR also do that too? The link I posted should be reliable too , I got the link at https://adoptopenjdk.net/archive.html. Asking just in case.

nvm about the first half : ), see this being included in e14a6f2. Thanks for doing that.

can you confirm that with this change, Bazel can be built out of the box on s390x and works fine

Sure, for bazel master, last time I checked, it can be built. I will be testing again on s390x with bazel that contains this commit and reply back in this PR once I have the results. This patch allows embedded jdk to be built on s390x and this helps us running bazel tests a bit easier.

@ruixin-bao
Copy link
Contributor Author

ruixin-bao commented Aug 25, 2020

Hi @philwo, I have got the results. Bazel can be built out of the box on s390x and works fine : ). I haven't run the bazel test suite yet though. Also, I am a bit curious about the binary release steps for bazel with another architecture (s390x), wondering if you mind giving some pointers to look at? I have seen #8833 and wondering if s390x can do a similar thing. Let me know and happy to help on that. Thanks.

Bootstrap 3.4.1 Bazel

$ uname -a
Linux spondee1.fyre.ibm.com 4.15.0-52-generic #56-Ubuntu SMP Tue Jun 4 22:52:27 UTC 2019 s390x s390x s390x GNU/Linux
$ cat /etc/lsb-release | grep Ubuntu
DISTRIB_ID=Ubuntu
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"

$ sudo apt-get update && sudo apt-get install wget curl openjdk-11-jdk unzip patch build-essential zip python3 git -y
$ sudo ln -sf /usr/bin/python3 /usr/bin/python 

$ mkdir bazel-bootstrap && cd bazel-bootstrap
$ wget https://github.com/bazelbuild/bazel/releases/download/3.4.1/bazel-3.4.1-dist.zip
$ unzip bazel-3.4.1-dist.zip 
$ chmod -R +w .
$ env EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk" bash ./compile.sh
🍃  Building Bazel from scratch......
🍃  Building Bazel with Bazel.
Build successful! Binary is here: /home/peterbao/bazel-bootstrap/output/bazel
$ /home/peterbao/bazel-bootstrap/output/bazel --version
bazel 3.4.1- (@non-git)

Build bazel with this commit

$ cd 
$ git clone https://github.com/bazelbuild/bazel.git
$ cd bazel
$ git checkout e14a6f2f770439c52d7154b495342c2e14ea2073 (the embedded jdk commit)
$ export PATH=$PATH:/home/peterbao/bazel-bootstrap/output
$ bazel build --host_javabase=@local_jdk//:jdk //:bazel-distfile
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Target //:bazel-distfile up-to-date:
  bazel-bin/bazel-distfile.zip
[...]

$ cd && mkdir bazel-s390x && cd bazel-s390x
$ unzip /home/peterbao/bazel/bazel-bin/bazel-distfile.zip
$ bash ./compile.sh 
🍃  Building Bazel from scratch..
🍃  Building Bazel with Bazel.
[...]
Build successful! Binary is here: /home/peterbao/bazel-s390x/output/bazel

I can then use this bazel to build bazel master successfully following the similar steps (without --host_javabase=@local_jdk//:jdk anymore) as above

@ruixin-bao
Copy link
Contributor Author

@philwo friendly ping on the previous message, quoting here just in case.

Also, I am a bit curious about adding the binary release steps for bazel with another architecture (s390x), wondering if you mind giving some pointers to look at? I have seen #8833 and wondering if s390x can do a similar thing (to have Bazel binary).

Do let me know if I can provide any help. I am more than happy to help with any PRs, testing etc. that is required.

Thanks!

@philwo
Copy link
Member

philwo commented Sep 21, 2020

@ruixin-bao As we currently cannot cross-compile Bazel releases, we would need an s390x machine (or a way to emulate one) so that we can build Bazel releases directly on that platform. 😊

@ruixin-bao
Copy link
Contributor Author

@philwo Thank you for your reply! Yes, we are able to provide VM access, wondering if you mind providing an email, then I can send you the relevant information regarding VM access? : )

@philwo
Copy link
Member

philwo commented Sep 22, 2020

@ruixin-bao Thank you, that sounds interesting! Please contact me at philwo@google.com.

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

Successfully merging this pull request may close these issues.

3 participants