Open hturner opened 2 months ago
Notes from RSECon24 added to https://github.com/r-devel/r-dev-env/issues/112. t
To summarise: The dockerfile uses the Ubuntu r-project repo to install r-base-core when building the container, but this doesn't have a recent arm build (most recent when we tried was 4.1.2). There may be a more recent arm build in the debian r-project repo, so that may be a potential solution.
A few findings from looking into this issue.
FROM mcr.microsoft.com/devcontainers/cpp:dev-debian-12
and suitable deb reference changes)apt -y build-dep r-base-dev
, you just don't have any version of R installed to initially test with, and don't have the language server R packages installed yet. But once a build has completed within the container, you can continue - this avoids the missing r-base-dev
dependency on ARM completely.binfmt
on x86_64
(reference: https://github.com/docker/buildx?tab=readme-ov-file#building-multi-platform-images). apt-src
can be used to build r-base-dev
instead of installing it, but this was extremely slow on non-ARM hardware although may complete if given ~24 hours (about 15 times the build time). apt-src
in combination with xx
to cross compile the r-base-dev
Debian package source have not succeeded (dpkg-buildpackage
fails with missing dependencies, because we used the x86 package source, or "No such file or directory", "clang: error: no input files" if we ignore missing dependencies)xx
to build the source binary, and buildx
to create an ARM container (copying in the stable build), may provide a fully functional dev container.Current status:
Thanks @sjimellor-jr for digging into this! Your (off GitHub) comment about "why there isn't an ARM build of the Debian/Ubuntu package in the first place" got me wondering and after some searching around I found from the rocker/r-ubuntu Dockerfile that they use "ppa:marutter/rrutter4.0"
as the repository vs "https://cloud.r-project.org/bin/linux/ubuntu jammy-cran40/"
. I tried building from the R Dev Container Dockerfile with Michael Rutter's base R PPA as the R repository and the build was successful on my ARM machine!
I think we will now be able to get this working with buildx. I'll leave this issue open for the moment and hopefully update it when we've got that working!
The R Dev Container was primarily built for use with GitHub Codespaces (now extended to Gitpod Workspaces), so the underlying Docker container is built for linux/amd64 architecture. This means that it doesn't work well on M+ macOS or Windows as discussed in issue 112 of the R Dev Container repo.
@StarTrooper08 has attempted to use buildx to build a linux/amd64 image but got stuck.
If anyone with experience in this area can help us make progress on this issue it would be appreciated!