Skip to content

Commit fcbbb9d

Browse files
authored
feat!(r-apt): support arm64 platform (#261)
1 parent a9941fc commit fcbbb9d

File tree

3 files changed

+26
-31
lines changed

3 files changed

+26
-31
lines changed

src/r-apt/devcontainer-feature.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "R (via apt)",
33
"id": "r-apt",
4-
"version": "0.4.2",
4+
"version": "0.5.0",
55
"description": "Installs the latest R, some R packages, and needed dependencies. Note: May require source code compilation for some R packages.",
66
"documentationURL": "https://github.com/rocker-org/devcontainer-features/tree/main/src/r-apt",
77
"options": {

src/r-apt/install.sh

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,6 @@ if [ "${architecture}" != "amd64" ] && [ "${architecture}" != "arm64" ]; then
3838
exit 1
3939
fi
4040

41-
# Only debian testing supports arm64
42-
# shellcheck source=/dev/null
43-
source /etc/os-release
44-
if [ "${ID}" = "ubuntu" ] && [ "${architecture}" != "amd64" ]; then
45-
echo "(!) Ubuntu $architecture unsupported"
46-
exit 1
47-
fi
48-
if [ "${ID}" = "debian" ] && [ "${architecture}" != "amd64" ] && [ "${USE_TESTING}" != "true" ]; then
49-
echo "(!) To use Debian $architecture, please set useTesting option to true"
50-
exit 1
51-
fi
52-
5341
# Determine the appropriate non-root user
5442
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
5543
USERNAME=""
@@ -144,13 +132,15 @@ usermod -a -G staff "${USERNAME}"
144132

145133
check_packages curl ca-certificates
146134

135+
# shellcheck source=/dev/null
136+
source /etc/os-release
147137
if [ "${ID}" = "ubuntu" ]; then
148138
echo "Set up for Ubuntu..."
149139
curl -fsSL https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc >/dev/null
150-
echo "deb [arch=amd64] https://cloud.r-project.org/bin/linux/ubuntu ${UBUNTU_CODENAME}-cran40/" >/etc/apt/sources.list.d/cran-ubuntu.list
140+
echo "deb https://cloud.r-project.org/bin/linux/ubuntu ${UBUNTU_CODENAME}-cran40/" >/etc/apt/sources.list.d/cran-ubuntu.list
151141
echo "Set up r2u..."
152142
curl -fsSL https://eddelbuettel.github.io/r2u/assets/dirk_eddelbuettel_key.asc | tee -a /etc/apt/trusted.gpg.d/cranapt_key.asc >/dev/null
153-
echo "deb [arch=amd64] https://r2u.stat.illinois.edu/ubuntu ${UBUNTU_CODENAME} main" >/etc/apt/sources.list.d/cranapt.list
143+
echo "deb https://r2u.stat.illinois.edu/ubuntu ${UBUNTU_CODENAME} main" >/etc/apt/sources.list.d/cranapt.list
154144
# Pinning
155145
cat <<EOF >"/etc/apt/preferences.d/99cranapt"
156146
Package: *
@@ -167,7 +157,7 @@ elif [ "${ID}" = "debian" ]; then
167157
else
168158
echo "Set up for Debian ${VERSION_CODENAME}..."
169159
curl -fsSL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x95c0faf38db3ccad0c080a7bdc78b2ddeabc47b7" | tee -a /etc/apt/trusted.gpg.d/cran_debian_key.asc >/dev/null
170-
echo "deb [arch=amd64] http://cloud.r-project.org/bin/linux/debian ${VERSION_CODENAME}-cran40/" >/etc/apt/sources.list.d/cran-debian.list
160+
echo "deb http://cloud.r-project.org/bin/linux/debian ${VERSION_CODENAME}-cran40/" >/etc/apt/sources.list.d/cran-debian.list
171161
fi
172162
# On Debian, renv, languageserver and httpgd are not available via apt
173163
# shellcheck disable=SC2206
@@ -176,6 +166,10 @@ elif [ "${ID}" = "debian" ]; then
176166
APT_PACKAGES=(${APT_PACKAGES[@]/r-cran-languageserver})
177167
# shellcheck disable=SC2206
178168
APT_PACKAGES=(${APT_PACKAGES[@]/r-cran-httpgd})
169+
else
170+
echo "(!) Unsupported distribution: ${ID}"
171+
echo " This script is designed only for Debian and Ubuntu."
172+
exit 1
179173
fi
180174

181175
apt-get update -y

test/r-apt/scenarios.json

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,22 @@
4141
}
4242
}
4343
},
44-
"all-on-not-testing": {
45-
"image": "debian:stable-slim",
46-
"features": {
47-
"r-apt": {
48-
"useTesting": false,
49-
"vscodeRSupport": "full",
50-
"installDevTools": true,
51-
"installREnv": true,
52-
"installRMarkdown": true,
53-
"installVscDebugger": true,
54-
"installJupyterlab": true,
55-
"installRadian": true
56-
}
57-
}
58-
},
44+
// TODO: some packages are not available on stable for now
45+
// "all-on-not-testing": {
46+
// "image": "debian:stable-slim",
47+
// "features": {
48+
// "r-apt": {
49+
// "useTesting": false,
50+
// "vscodeRSupport": "full",
51+
// "installDevTools": true,
52+
// "installREnv": true,
53+
// "installRMarkdown": true,
54+
// "installVscDebugger": true,
55+
// "installJupyterlab": true,
56+
// "installRadian": true
57+
// }
58+
// }
59+
// },
5960
// TODO: enable tesing on debian
6061
// "bspm-debian": {
6162
// "image": "mcr.microsoft.com/devcontainers/base:debian",

0 commit comments

Comments
 (0)