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 riscv64 support #509

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

add riscv64 support #509

wants to merge 4 commits into from

Conversation

gdams
Copy link
Member

@gdams gdams commented Mar 13, 2024

Keeping in draft until I've had some people eyeball this one. Noting that Debian is the only official Linux image available right now. Apparently there are plans to add Ubuntu support at some point so we could switch once that's available

@gdams
Copy link
Member Author

gdams commented Mar 14, 2024

I cannot recreate the error locally when building like this:

docker buildx build --platform linux/riscv64 -t foo .
docker run  --platform linux/riscv64 foo java -version
openjdk version "21.0.2" 2024-01-16 LTS
OpenJDK Runtime Environment Temurin-21.0.2+13 (build 21.0.2+13-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode, sharing)

CC @tianon @yosifkit as they may have some extra insight here

> [2/5] RUN set -eux;     apt-get update;     DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends         wget         fontconfig         ca-certificates p11-kit         binutils         tzdata         locales     ;     echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen;     locale-gen en_US.UTF-8;     rm -rf /var/lib/apt/lists/*:
0.156 exec /bin/sh: exec format error
------
Dockerfile:28
--------------------
  27 |     
  28 | >>> RUN set -eux; \
  29 | >>>     apt-get update; \
  30 | >>>     DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
  31 | >>>         wget \
  32 | >>>         # java.lang.UnsatisfiedLinkError: libfontmanager.so: libfreetype.so.6: cannot open shared object file: No such file or directory
  33 | >>>         # java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager
  34 | >>>         # https://github.com/docker-library/openjdk/pull/235#issuecomment-4244[66](https://github.com/adoptium/containers/actions/runs/8278932317/job/22652358248?pr=509#step:5:67)077
  35 | >>>         fontconfig \
  36 | >>>         # utilities for keeping Ubuntu and OpenJDK CA certificates in sync
  37 | >>>         # https://github.com/adoptium/containers/issues/293
  38 | >>>         ca-certificates p11-kit \
  39 | >>>         # jlink --strip-debug on 13+ needs objcopy: https://github.com/docker-library/openjdk/issues/351
  40 | >>>         # Error: java.io.IOException: Cannot run program "objcopy": error=2, No such file or directory
  41 | >>>         binutils \
  42 | >>>         tzdata \
  43 | >>>         # locales ensures proper character encoding and locale-specific behaviors using en_US.UTF-8
  44 | >>>         locales \
  45 | >>>     ; \
  46 | >>>     echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \
  47 | >>>     locale-gen en_US.UTF-8; \
  48 | >>>     rm -rf /var/lib/apt/lists/*
  49 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c set -eux;     apt-get update;     DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends         wget         fontconfig         ca-certificates p11-kit         binutils         tzdata         locales     ;     echo \"en_US.UTF-8 UTF-8\" >> /etc/locale.gen;     locale-gen en_US.UTF-8;     rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 1
Error: Process completed with exit code 1.

@sxa
Copy link
Member

sxa commented Mar 14, 2024

I cannot recreate the error locally when building like this:

For what it's worth when I tried running on an Ubuntu 23.04 host (native riscv64) I had an issue with the repositories for sid:

$ docker run -it debian:sid-slim
root@a166693ac07f:/# apt-get -y update
Get:1 http://deb.debian.org/debian-ports sid InRelease [80.4 kB]
Get:2 http://deb.debian.org/debian-ports unreleased InRelease [54.1 kB]
Fetched 134 kB in 1s (122 kB/s)
Reading package lists... Done
N: Skipping acquire of configured file 'main/binary-riscv64/Packages' as repository 'http://deb.debian.org/debian-ports sid InRelease' doesn't support architecture 'riscv64'
N: Skipping acquire of configured file 'main/binary-riscv64/Packages' as repository 'http://deb.debian.org/debian-ports unreleased InRelease' doesn't support architecture 'riscv64'

@yosifkit
Copy link

0.156 exec /bin/sh: exec format error

I think this error is because GitHub actions runners aren't automatically setup with user-mode qemu like when using Docker Desktop.

As far as adding Debian Unstable based builds, we wouldn't do it in images we directly maintain since it is actually unstable (https://wiki.debian.org/DebianUnstable)

having images based on Debian Unstable leads to a lot of not-unexpected instability both in our own builds and in the downstream builds of our users
- docker-library/golang#435 (comment)

@gdams
Copy link
Member Author

gdams commented Mar 20, 2024

0.156 exec /bin/sh: exec format error

I think this error is because GitHub actions runners aren't automatically setup with user-mode qemu like when using Docker Desktop.

As far as adding Debian Unstable based builds, we wouldn't do it in images we directly maintain since it is actually unstable (https://wiki.debian.org/DebianUnstable)

having images based on Debian Unstable leads to a lot of not-unexpected instability both in our own builds and in the downstream builds of our users

Right okay, I'll see if I can implement some changes to set. the user-mode qemu when running non intel builds.

As for the base image, it sounds like we're stuck until Ubuntu add support to their official images again. Do you know who I can reach out to resolve this?

@gdams gdams force-pushed the riscv64 branch 2 times, most recently from 8658858 to 8965da6 Compare March 21, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants