Skip to content

Commit 80163a3

Browse files
committed
Copy files to r-devel repository
0 parents  commit 80163a3

3 files changed

Lines changed: 79 additions & 0 deletions

File tree

.github/workflows/test.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
on:
2+
push:
3+
schedule:
4+
- cron: "0 2 * * *"
5+
6+
name: Test on Ubuntu 24.04
7+
8+
jobs:
9+
R-CMD-check:
10+
runs-on: ubuntu-24.04${{matrix.arch=='arm64' && '-arm' || ''}}
11+
12+
name: Ubuntu 24.04 ${{ matrix.arch }}
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
arch: ['x86_64', 'arm64' ]
18+
19+
steps:
20+
- name: checkout
21+
uses: actions/checkout@v6
22+
23+
- name: build
24+
run: docker build . --no-cache --progress=plain

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# TODO: switch to release container when R-4.6 is out
2+
FROM ghcr.io/r-devel/ubuntu-devel
3+
4+
RUN echo "R_PLATFORM_PKGTYPE=linux.binary.noble-$(arch)" >> "$HOME/.Renviron"
5+
6+
# Should reflect envvar set above
7+
RUN R -e "print(.Platform$pkgType)"
8+
9+
# Install tidyverse + deps
10+
RUN R -e "install.packages('tidyverse', repos = 'https://cran.r-universe.dev')"
11+
12+
# Assert that package can be loaded
13+
RUN R -e "library(tidyverse)"

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Binary packages for Linux [![badge](https://github.com/r-devel/linux-binary-packages/actions/workflows/test.yml/badge.svg)](https://github.com/r-devel/linux-binary-packages/actions/workflows/test.yml)
2+
3+
R-4.6 has finally standardized the format for serving binary packages on platforms beyond Windows and MacOS, notably Linux. Here we run some demos and tests to further improve this.
4+
5+
R news item: https://developer.r-project.org/blosxom.cgi/R-devel/NEWS/2026/02/03
6+
7+
## How it works
8+
9+
This is not enabled by default. Users (or distro-maintainers) opt-in via environment variable `R_PLATFORM_PKGTYPE` which specifies the path where R will look for binaries on package repositories. This variable is usually set in any of the `Renviron` files that gets loaded when R starts.
10+
11+
The format of this variable must be `{os}.binary.{flavor}` for example if we use:
12+
13+
14+
```env
15+
R_PLATFORM_PKGTYPE=linux.binary.noble-x86_64
16+
```
17+
18+
Then the server binaries need to be hosted on:
19+
20+
```
21+
https://{server}/bin/linux/noble-x86_64/contrib/{r-version}/PACKAGES
22+
```
23+
24+
Where `linux` and `noble-x86_64` are taken from `R_PLATFORM_PKGTYPE` and `{r-version}` is the usual `major.minor` R version (without the patch part) e.g. `4.6`.
25+
26+
R will show a warning and fall back on building packages from source as usual for packages or repositories where the requested binaries are not available.
27+
28+
29+
## Testing with R-universe
30+
31+
Currently R-universe already hosts such binaries for Ubuntu "noble" 24.04 for both arm64 and x86_64:
32+
33+
- https://cran.r-universe.dev/bin/linux/noble-x86_64/contrib/4.6/PACKAGES.gz
34+
- https://cran.r-universe.dev/bin/linux/noble-arm64/contrib/4.6/PACKAGES.gz
35+
36+
We can use the attached [Dockerfile](Dockerfile) to test that this works as intended by installing the tidyverse and its dependencies. The output logs show that installation is quick and no packages get built from source.
37+
38+
```sh
39+
docker build . --no-cache --progress=plain
40+
```
41+
42+
Output from nightly runs of this Dockerfile on GitHub actions is here: https://github.com/r-devel/linux-binary-packages/actions/workflows/test.yml

0 commit comments

Comments
 (0)