Skip to content

Commit

Permalink
Handle renamed R wasm binary and script
Browse files Browse the repository at this point in the history
  • Loading branch information
georgestagg committed Nov 12, 2024
1 parent 881c05b commit 3727749
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ jobs:
- name: Upload files to S3 bucket
run: |
aws s3 sync . s3://${{ secrets.AWS_S3_BUCKET }}/_webr/${{ github.ref_name }}/
gzip -k R.bin.wasm
gzip -k R.wasm
aws s3 cp --content-encoding="gzip" --content-type="application/wasm" \
--metadata-directive="REPLACE" R.bin.wasm.gz \
s3://${{ secrets.AWS_S3_BUCKET }}/_webr/${{ github.ref_name }}/R.bin.wasm
--metadata-directive="REPLACE" R.wasm.gz \
s3://${{ secrets.AWS_S3_BUCKET }}/_webr/${{ github.ref_name }}/R.wasm
aws s3 cp --exclude "*" --include "*.js.metadata" --recursive \
--content-type="text/javascript" --metadata-directive="REPLACE" \
s3://${{ secrets.AWS_S3_BUCKET }}/_webr/${{ github.ref_name }}/ \
Expand Down
6 changes: 3 additions & 3 deletions R/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,10 @@ install:
@mkdir -p $(DIST)
$(MAKE) vfs
@cp "$(R_SOURCE)/build/src/main/R.wasm" "$(DIST)/R.wasm"
@cat $(R_WASM)/pre.js $(R_SOURCE)/build/src/main/R.bin > $(DIST)/R.bin.js
@cat $(R_WASM)/pre.js $(R_SOURCE)/build/src/main/R.bin > $(DIST)/R.js
# Patch Emscripten library to redirect a warning message to console.warn()
@sed -i.bak 's/out("LazyFiles/console.warn("LazyFiles/' $(DIST)/R.bin.js
@rm $(DIST)/R.bin.js.bak
@sed -i.bak 's/out("LazyFiles/console.warn("LazyFiles/' $(DIST)/R.js
@rm $(DIST)/R.js.bak

# Build lazy virtual filesystem, backed by XHR when loaded in browsers
WASM_LAZY_VFS := $(WASM_LAZY_VFS)
Expand Down
2 changes: 1 addition & 1 deletion src/webR/webr-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ function init(config: Required<WebROptions>) {

// At the next tick, launch the REPL. This never returns.
setTimeout(() => {
const scriptSrc = `${_config.baseUrl}R.bin.js`;
const scriptSrc = `${_config.baseUrl}R.js`;
void loadScript(scriptSrc);
});
}

0 comments on commit 3727749

Please sign in to comment.