Skip to content

Add binary support for s390x#12127

Closed
ruixin-bao wants to merge 1 commit intobazelbuild:masterfrom
linux-on-ibm-z:binary_support_s390x
Closed

Add binary support for s390x#12127
ruixin-bao wants to merge 1 commit intobazelbuild:masterfrom
linux-on-ibm-z:binary_support_s390x

Conversation

@ruixin-bao
Copy link
Contributor

This patch changes the script in scripts/kokoro/release/build_linux.sh
to allow building bazel binary on a s390x machine. I've also executed this script on x86 to ensure no regressions.

To execute this script, the following command works on a s390x machine with this PR:

export RELEASE_NAME=3.5.0 
./scripts/kokoro/release/build_linux.sh 

Lastly, this patch hopes to achieve a similar thing as #8833 to add Bazel binary for s390x architecture. Though I wasn't able to find too many relevant information on how this was done for arm architecture, so any pointers or guidance will be super helpful. Hardware/VM access can also be provided if needed. Happy to discuss and make changes. Thanks!

This commit changes the script in scripts/kokoro/release/build_linux.sh
to allow building bazel binary on a s390x machine.

To execute this script, the following command should work on a s390x machine:

export RELEASE_NAME=3.5.0
./scripts/kokoro/release/build_linux.sh
@oquenchil oquenchil added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Oct 5, 2020
@laurentlb
Copy link
Contributor

ping @philwo?

@ruixin-bao
Copy link
Contributor Author

Hi @laurentlb, thank you for the comment. I originally raised this PR hoping to get some advice. A few days later after this PR, Phillip replied in #11965 and give me some suggestions on the relevant information, and currently we are in discussion about s390x VM/hardware access.

Best.

@philwo
Copy link
Member

philwo commented Oct 21, 2020

@ruixin-bao FYI, I'm still working through internal matters regarding the ToS you sent me. I made some progress yesterday, will follow up soon.

@ruixin-bao
Copy link
Contributor Author

gentle ping @philwo, any updates? Thanks : ).

1 similar comment
@ruixin-bao
Copy link
Contributor Author

gentle ping @philwo, any updates? Thanks : ).

@philwo
Copy link
Member

philwo commented Apr 22, 2021

Hi,

sorry for the late reply. This is not the right script to modify to add s390x or other architecture support - scripts/kokoro/release/build_linux.sh is a currently unused script that we added as preparation to move building our official Bazel releases to an internal system called "Kokoro" for increased security.

I don't think we currently have an existing script for the purpose of building a release binary from a source tree, although I agree it would be nice to have. Personally I would recommend to move these steps into a blog post or community maintained s390x repo of some sort for now, as it's more likely that it will be found there by someone explicitly searching for how to build Bazel on s390x than this script.

FYI, I also don't think scripts like this should ever make persistent modifications to the system, like running sudo apt-get to install packages. For once, this is very surprising and probably unwanted by the user and in other environments it might simply not work (for example we don't run Bazel CI's actions as root or with sudo rights). It's fine to check the presence of packages and print a helpful error message how to install missing dependencies though. :)

Let me know if you have any questions. By the way, I haven't forgotten about your kind offer to grant us access to the s390x VM, unfortunately it's currently not possible for me to follow this or similar architecture support side-projects (e.g. better FreeBSD support or Windows-on-ARM support or ...) due to priorities :( I promise to get back to it when we have some breathing room though!

Cheers,
Philipp

@philwo
Copy link
Member

philwo commented Apr 22, 2021

As an example, I just found this repo for Bazel on Raspberry Pi: https://github.com/koenvervloesem/bazel-on-arm. I think this is a great example of a community maintained repository like I mentioned above and an especially well written README.

@ruixin-bao
Copy link
Contributor Author

Hi,

sorry for the late reply.

No worries : ).

This is not the right script to modify to add s390x or other architecture support - scripts/kokoro/release/build_linux.sh is a currently unused script that we added as preparation to move building our official Bazel releases to an internal system called "Kokoro" for increased security.
I don't think we currently have an existing script for the purpose of building a release binary from a source tree, although I agree it would be nice to have.

I see, thanks for the info.

Personally I would recommend to move these steps into a blog post or community maintained s390x repo of some sort for now, as it's more likely that it will be found there by someone explicitly searching for how to build Bazel on s390x than this script.

Thanks for the suggestion, my colleague and I actually have something like that. We have drafted a build instruction for building bazel on s390x at https://github.com/linux-on-ibm-z/docs/wiki/Building-Bazel

FYI, I also don't think scripts like this should ever make persistent modifications to the system, like running sudo apt-get to install packages. For once, this is very surprising and probably unwanted by the user and in other environments it might simply not work (for example we don't run Bazel CI's actions as root or with sudo rights). It's fine to check the presence of packages and print a helpful error message how to install missing dependencies though. :)

Yeah I agree --- I was not sure if the implementation in this PR makes sense at the point of writing it.

Let me know if you have any questions. By the way, I haven't forgotten about your kind offer to grant us access to the s390x VM, unfortunately it's currently not possible for me to follow this or similar architecture support side-projects (e.g. better FreeBSD support or Windows-on-ARM support or ...) due to priorities :( I promise to get back to it when we have some breathing room though!

Thank you for your kind words. No worries, take your time. Let me know if I can provide any help when you get back to this side project : ).

Cheers,
Philipp

Best,
Ruixin

@aiuto
Copy link

aiuto commented Oct 7, 2021

@ruixin-bao It looks like https://github.com/linux-on-ibm-z/docs/wiki/Building-Bazel replaces the need for this PR.
I'm closing it for now.

@aiuto aiuto closed this Oct 7, 2021
@ruixin-bao
Copy link
Contributor Author

Hi @aiuto, thanks for commenting. The intention for this PR was to add / propose adding s390x binaries to the official binaries, similar to that of arm64. The provided official binaries will allow potential s390x users to easily access the built s390x binaries instead of building from scratch each time. https://github.com/linux-on-ibm-z/docs/wiki/Building-Bazel only provides the build instruction for building baze on s390xl. The build instruction is beneficial if people want to build from scratch, but could be time consuming. Thus, I think adding binary support for s390x to the official releases would still be beneficial, so I'm wondering if we should reopen this PR? (I don't think I have right to reopen this, unfortunately) Thanks.

@aiuto
Copy link

aiuto commented Oct 27, 2021

I think reopening this is @philwo's choice. He gave a very detailed opinion of the PR back on April 22.

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

Labels

cla: yes team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants