Revert docker image, implement workarounds for arm64 machines and java #4377
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a workaround for #4369
When introducing
jlink
in #4322 we broke arm64 related builds that are produced on github actions. This is becausejlink
builds ajre
that is OS and architecture specific to the host machine.As documented in #4369,
jlink
expects anx86
linker to be available when attempting to runjava
. Since this is not available onarm64
platforms, java fails to start.This PR implements a work around by modifying the
bitcoin-s-server
andbitcoin-s-oracle-server
bash startup scripts.If we detect the user is running on
arm64
oraarch64
, we define a new bash function calledget_java_no_jlink
. This function is equivalent to the bash script that sbt native packager generates with one exception, it removes thejlink
check.This is the function that is generated by sbt native packagers startup script by default:
My PR removes these two lines in the new
get_java_no_jlink
functionAs a by product, this PR also reverts #4367 and reverts our base docker image to be
openjdk:17-slim
. This way our docker containers can just work ™️ out of the box. This is because the docker container provides java, so we don't need to rely on ourjre
built byjlink
.The only thing that still isn't working on this PR is users that have an m1 mac and do not have a pre-existing java installed on their system. They will fail to run servers. The best we can do at this time is to ask them to install java out of band. As discussed with @rorp , in this case i think the only thing we can do is install an arm64 java manually on CI and package with our
bitcoin-s-server-mac
zips that we ship. We would need to now make abitcoin-s-server-mac-x86
build andbitcoin-s-server-mac-arm64
build and equivalents for thebitcoin-s-oracle-server
.