Skip to content

Commit c07d899

Browse files
authored
Install pak into the system library in the webR development Docker image (#422)
* Add Docker build test step to test.yml * Install pak into system library * Docker build arg for supporting libraries target
1 parent 28077f5 commit c07d899

File tree

3 files changed

+30
-3
lines changed

3 files changed

+30
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ jobs:
182182
push: true
183183
build-args: |
184184
WEBRCI_SHA=${{ steps.short.outputs.sha }}
185+
MAKE_LIBS_TARGET=all
185186
tags: ${{ steps.meta.outputs.tags }}
186187
labels: ${{ steps.meta.outputs.labels }}
187188
build-nix:

.github/workflows/test.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
build-docker:
10+
build-webr:
1111
runs-on: ubuntu-latest
1212
container: ghcr.io/r-wasm/flang-wasm:main
1313
steps:
@@ -40,6 +40,28 @@ jobs:
4040
fail_ci_if_error: true
4141
verbose: true
4242
token: ${{ secrets.CC_TOKEN }}
43+
build-docker:
44+
runs-on: ubuntu-latest
45+
permissions:
46+
contents: read
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v4
50+
- name: Short commit SHA
51+
id: short
52+
run: |
53+
SHA="${{github.event.pull_request.head.sha}}${{ github.sha }}"
54+
SHORT_SHA=${SHA:0:7}
55+
echo "sha: $SHORT_SHA"
56+
echo "sha=$SHORT_SHA" >> $GITHUB_OUTPUT
57+
- name: Build Docker image
58+
uses: docker/build-push-action@v5
59+
with:
60+
context: .
61+
push: false
62+
build-args: |
63+
WEBRCI_SHA=${{ steps.short.outputs.sha }}
64+
MAKE_LIBS_TARGET=default
4365
build-nix:
4466
runs-on: ubuntu-latest
4567
steps:

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ RUN curl -L https://rig.r-pkg.org/deb/rig.gpg -o /etc/apt/trusted.gpg.d/rig.gpg
6666

6767
# Because $HOME gets masked by GHA with the host $HOME
6868
ENV R_LIBS_USER=/opt/R/current/lib/R/site-library
69-
RUN rig add 4.4.0
69+
# Don't install pak. Rig installs it into the user lib, but we want it in the system lib
70+
RUN rig add 4.4.0 --without-pak
71+
# Install pak into the system lib
72+
RUN /opt/R/current/bin/R -q -e 'install.packages("pak", lib = .Library)'
7073

7174
# Download webR and configure for LLVM flang
7275
RUN git clone https://github.com/r-wasm/webr.git /opt/webr
@@ -79,7 +82,8 @@ RUN ./configure
7982
RUN R CMD INSTALL packages/webr
8083

8184
# Build webR with supporting Wasm libs
82-
RUN cd libs && make all
85+
ARG MAKE_LIBS_TARGET="all"
86+
RUN cd libs && make ${MAKE_LIBS_TARGET}
8387
RUN make
8488

8589
# Cleanup

0 commit comments

Comments
 (0)