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 a devcontainer on alpine #6710

Merged
merged 10 commits into from
Jan 7, 2025
22 changes: 22 additions & 0 deletions .devcontainer/r-devel-alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM docker.io/rhub/r-minimal:devel

RUN apk update \
&& apk add --no-cache \
gcc git musl-dev openmp pkgconf tzdata zlib-dev \
&& echo 'options("repos"="https://cloud.r-project.org")' >> /usr/local/lib/R/etc/Rprofile.site

ENV TZDIR=/usr/share/zoneinfo

COPY DESCRIPTION .

RUN Rscript -e ' \
read.dcf("DESCRIPTION", c("Imports", "Suggests")) |> \
tools:::.split_dependencies() |> \
names() |> \
setdiff(tools:::.get_standard_package_names()$base) |> \
install.packages(repos="https://cloud.r-project.org") \
'

# setup cc()
WORKDIR /root
COPY .devcontainer/.Rprofile .
9 changes: 9 additions & 0 deletions .devcontainer/r-devel-alpine/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"build": { "dockerfile": "Dockerfile", "context": "../.." },
"customizations": { "vscode": {
"extensions": [
"REditorSupport.r",
"ms-vscode.cpptools-extension-pack"
]
}}
}
12 changes: 4 additions & 8 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,11 @@ else
NOZLIB=0
lib=`pkg-config --libs zlib`
cflag=`pkg-config --cflags zlib`
expr -- "$lib" : ".*-lz$" >> config.log # -- for FreeBSD, #4652
echo "$lib" | grep -qE '[-]lz($| )' >> config.log
if [ $? -ne 0 ]; then
expr -- "$lib" : ".*-lz " >> config.log
# would use \b in one expr but MacOS does not support \b
if [ $? -ne 0 ]; then
echo "*** pkg-config is installed and 'pkg-config --exists zlib' succeeds but"
echo "*** 'pkg-config --libs zlib' returns '${lib}' which does not include the standard -lz."
msg=1
fi
echo "*** pkg-config is installed and 'pkg-config --exists zlib' succeeds but"
echo "*** 'pkg-config --libs zlib' returns '${lib}' which does not include the standard -lz."
msg=1
fi
fi
fi
Expand Down
8 changes: 3 additions & 5 deletions inst/tests/tests.Rraw
Original file line number Diff line number Diff line change
Expand Up @@ -8448,11 +8448,9 @@ baseR = base::order(c(x2,x1,x1,x2))
# are so relaxed now that they barely testing anything. It appears base R behaviour is undefined in this rare case of identical strings in different encodings.
test(1590.04, identical(baseR, INT(1,4,2,3)) || identical(baseR, INT(2,3,1,4)) || identical(baseR, 1:4))
Encoding(x2) = "unknown"
# TODO(#6350): Decide if this test should be adjusted for Alpine Linux, or just dropped.
if (!file.exists("/etc/alpine-release")) {
test(1590.05, x1!=x2)
test(1590.06, forderv( c(x2,x1,x1,x2)), INT(1,4,2,3)) # consistent with Windows-1252 result, tested further below
}
# test(1590.05, x1!=x2) # Skip this test of R's own behavior since R itself does not give platform-consistent results, #6350
# TODO(#6350): Restore this test. On Alpine, forder() finds this input to be sorted, but we want to be platform-independent.
if (!file.exists("/etc/alpine-release")) test(1590.06, forderv( c(x2,x1,x1,x2)), INT(1,4,2,3)) # consistent with Windows-1252 result, tested further below
baseR = base::order(c(x2,x1,x1,x2))
test(1590.07, identical(baseR, INT(1,4,2,3)) || identical(baseR, INT(2,3,1,4)) || identical(baseR, 1:4))
Sys.setlocale("LC_CTYPE", ctype)
Expand Down
Loading