Skip to content

Commit

Permalink
Merge pull request #382 from r-wasm/rel-v0.3.0
Browse files Browse the repository at this point in the history
Release v0.3.0
  • Loading branch information
georgestagg committed Mar 22, 2024
2 parents 184e9b5 + d03314a commit 9e02552
Show file tree
Hide file tree
Showing 20 changed files with 514 additions and 717 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/deploy.yml
Expand Up @@ -147,11 +147,20 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
- name: Short commit SHA
id: short
run: |
SHA="${{github.event.pull_request.head.sha}}${{ github.sha }}"
SHORT_SHA=${SHA:0:7}
echo "sha: $SHORT_SHA"
echo "sha=$SHORT_SHA" >> $GITHUB_OUTPUT
- name: Build and publish Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
WEBRCI_SHA=${{ steps.short.outputs.sha }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-nix:
Expand Down
32 changes: 17 additions & 15 deletions Dockerfile
Expand Up @@ -15,13 +15,13 @@ ENV EMFC="/opt/flang/host/bin/flang-new"
FROM webr as deb_build
RUN mkdir /opt/fake_rust/ && \
apt-get update && \
apt-get install -y equivs lsb-release &&\
equivs-control fake_rust && \
sed -i 's/Package:.*/Package: rustc/' fake_rust && \
sed -i 's/# Version:.*/Version: 99.0/' fake_rust && \
equivs-build fake_rust && \
sed -i 's/Package:.*/Package: cargo/' fake_rust && \
equivs-build fake_rust && \
apt-get install -y equivs lsb-release &&\
equivs-control fake_rust && \
sed -i 's/Package:.*/Package: rustc/' fake_rust && \
sed -i 's/# Version:.*/Version: 99.0/' fake_rust && \
equivs-build fake_rust && \
sed -i 's/Package:.*/Package: cargo/' fake_rust && \
equivs-build fake_rust && \
mv rustc_99.0_all.deb cargo_99.0_all.deb /opt/fake_rust/

# Step 2: Do the necessary setups
Expand All @@ -31,7 +31,7 @@ RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | \
gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] \
https://deb.nodesource.com/node_18.x nodistro main" | \
https://deb.nodesource.com/node_18.x nodistro main" | \
tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && \
apt-get install nodejs -y
Expand All @@ -46,12 +46,12 @@ RUN set -eux; \
echo "0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
./rustup-init -y \
--no-modify-path \
--profile minimal \
--default-toolchain nightly \
--default-host x86_64-unknown-linux-gnu \
--target wasm32-unknown-emscripten \
--component rust-src; \
--no-modify-path \
--profile minimal \
--default-toolchain nightly \
--default-host x86_64-unknown-linux-gnu \
--target wasm32-unknown-emscripten \
--component rust-src; \
rm rustup-init; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
Expand All @@ -75,8 +75,10 @@ ENV R_LIBS_USER=/opt/R/current/lib/R/site-library
RUN rig add 4.3.2

# Download webR and configure for LLVM flang
RUN git clone --depth=1 https://github.com/r-wasm/webr.git /opt/webr
RUN git clone https://github.com/r-wasm/webr.git /opt/webr
WORKDIR /opt/webr
ARG WEBRCI_SHA=HEAD
RUN git checkout ${WEBRCI_SHA}
RUN ./configure

# Install r-wasm's webr package for native R
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
@@ -1,5 +1,7 @@
# webR (development version)

# webR 0.3.0

## New features

* Updated to R version 4.3.3.
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Expand Up @@ -26,7 +26,7 @@
# cd src; prefetch-npm-deps package-lock.json
srcNpmDeps = pkgs.fetchNpmDeps {
src = "${self}/src";
hash = "sha256-3lhRylOg3XGk+06gyYeABmapvJWeFHxOlN2qpC2I7pg=";
hash = "sha256-xCAcEegU6q4QWkfaI7xz2JZ6u4nsx4KOlaPQU1M7ZiQ=";
};

inherit system;
Expand Down
7 changes: 4 additions & 3 deletions libs/Makefile
Expand Up @@ -59,12 +59,13 @@ $(EM_PKG_CONFIG_PATH)/%.pc: recipes/**/%.pc
mkdir -p $(EM_PKG_CONFIG_PATH)
cp "$<" "$@"

$(HOST)/bin/%: $(WASM)/bin/%
$(DEFAULT_WASM_BINS_INST): $(DEFAULT_WASM_LIBS)
@mkdir -p $(HOST)/bin
@cp "$<" "$@"
cp "$(patsubst $(HOST)/bin/%,$(WASM)/bin/%,$@)" "$@"

$(DEFAULT_WASM_BINS_INST): $(DEFAULT_WASM_LIBS)
$(OPTIONAL_WASM_BINS_INST): $(OPTIONAL_WASM_LIBS)
@mkdir -p $(HOST)/bin
cp "$(patsubst $(HOST)/bin/%,$(WASM)/bin/%,$@)" "$@"

.PHONY: clean-bins
clean-bins:
Expand Down
2 changes: 1 addition & 1 deletion packages/webr/DESCRIPTION
@@ -1,7 +1,7 @@
Type: Package
Package: webr
Title: WebR Support Package
Version: 0.2.2.9000
Version: 0.3.0
Authors@R: c(
person("George", "Stagg", , "george.stagg@posit.co", role = c("aut", "cre")),
person("Lionel", "Henry", , "lionel@posit.co", role = "aut"),
Expand Down
13 changes: 13 additions & 0 deletions patches/R-4.3.3/emscripten-r-home-stderr.diff
@@ -0,0 +1,13 @@
Index: R-4.3.3/src/scripts/R.sh.in
===================================================================
--- R-4.3.3.orig/src/scripts/R.sh.in
+++ R-4.3.3/src/scripts/R.sh.in
@@ -28,7 +28,7 @@ if test -n "${R_HOME}" && \

if test -n "${R_HOME}" && \
test "${R_HOME}" != "${R_HOME_DIR}"; then
- echo "WARNING: ignoring environment value of R_HOME"
+ echo "WARNING: ignoring environment value of R_HOME" >&2
fi
R_HOME="${R_HOME_DIR}"
export R_HOME
1 change: 1 addition & 0 deletions patches/R-4.3.3/series
Expand Up @@ -12,6 +12,7 @@ emscripten-xhr-download.diff
emscripten-disable-bcEval.diff
emscripten-fix-blas-dlsym-search.diff
emscripten-avoid-testing-issues.diff
emscripten-r-home-stderr.diff
fix-signrank-wilcox.diff
fix-devUp.diff
flang-avoid-maxloc.diff
Expand Down
2 changes: 1 addition & 1 deletion src/docs/_quarto.yml
Expand Up @@ -15,7 +15,7 @@ website:
favicon: images/webR.png
page-navigation: true
sidebar:
title: "WebR 0.2.3-dev Documentation"
title: "WebR 0.3.0 Documentation"
logo: images/webR.png
contents:
- index.qmd
Expand Down
2 changes: 1 addition & 1 deletion src/docs/convert-r-to-js.qmd
Expand Up @@ -254,7 +254,7 @@ await mtcars.toObject();
carb: [4, 4, 1, ..., 2],
cyl: [6, 6, 4, ..., 4]
...,
wt: (32) [2.62, 2.875, 2.32, ..., 2.78],
wt: [2.62, 2.875, 2.32, ..., 2.78],
}

R `data.frame` objects may also be converted into a [D3](https://d3js.org)-style data array format using the [`toD3()`](api/js/classes/RWorker.RDouble.md#tod3) method. This method is only available for R objects of class `data.frame`.
Expand Down
2 changes: 1 addition & 1 deletion src/docs/examples.qmd
Expand Up @@ -388,7 +388,7 @@ After loading, the resulting web page should present an interactive R console si
</div>
</div>
<script type="module">
import { Console } from 'https://webr.r-wasm.org/v0.2.2/webr.mjs';
import { Console } from 'https://webr.r-wasm.org/v0.3.0/webr.mjs';
const webRConsole = new Console({
stdout: line => document.getElementById('out').append(line + '\n'),
stderr: line => document.getElementById('out').append(line + '\n'),
Expand Down
2 changes: 1 addition & 1 deletion src/docs/index.qmd
Expand Up @@ -39,7 +39,7 @@ summary(fit)</div>
editor.setOptions({ fontSize: "11pt", maxLines: Infinity });
editor.session.setMode("ace/mode/r");
import { WebR } from 'https://webr.r-wasm.org/v0.2.2/webr.mjs';
import { WebR } from 'https://webr.r-wasm.org/v0.3.0/webr.mjs';
const webR = new WebR();
await webR.init();
await webR.evalRVoid('options(device=webr::canvas)');
Expand Down
4 changes: 2 additions & 2 deletions src/docs/plotting.qmd
Expand Up @@ -82,7 +82,7 @@ text(4, -4, "זה כתוב בעברית")</div>
editor.setOptions({ fontSize: "11pt", maxLines: Infinity });
editor.session.setMode("ace/mode/r");
import { WebR } from 'https://webr.r-wasm.org/v0.2.2/webr.mjs';
import { WebR } from 'https://webr.r-wasm.org/v0.3.0/webr.mjs';
const webR = new WebR();
await webR.init();
await webR.evalRVoid('options(device=function(...){webr::canvas(width=500, height=300)})');
Expand Down Expand Up @@ -207,7 +207,7 @@ Click the button below to see the output of this demo,
<button id="plot-button" class="btn btn-success btn-sm" disabled="true">Run graphics demo</button>
<div style="text-align: center" id="plot-container"></div>
<script type="module">
import { WebR } from 'https://webr.r-wasm.org/v0.2.2/webr.mjs';
import { WebR } from 'https://webr.r-wasm.org/v0.3.0/webr.mjs';
const webR = new WebR();
let canvas = null;
let container = document.getElementById('plot-container');
Expand Down
2 changes: 1 addition & 1 deletion src/docs/webr-serviceworker.js
@@ -1 +1 @@
importScripts('https://webr.r-wasm.org/v0.2.2/webr-serviceworker.js');
importScripts('https://webr.r-wasm.org/v0.3.0/webr-serviceworker.js');
2 changes: 1 addition & 1 deletion src/docs/webr-worker.js
@@ -1 +1 @@
importScripts('https://webr.r-wasm.org/v0.2.2/webr-worker.js');
importScripts('https://webr.r-wasm.org/v0.3.0/webr-worker.js');

0 comments on commit 9e02552

Please sign in to comment.