Skip to content

Commit

Permalink
Update emscripten requirements and WASM CI job (#1036)
Browse files Browse the repository at this point in the history
* Bump emsdk version to 3.1.47
  Produces module importable in Node v18
  With older (emsdk 3.0.0) version, generated `libthemis.js` that should
  load `libthemis.wasm` fails due to some internal autogenerated code
  working differently on v16 and v18

* Add link flag for WASM builds
  Needed to make new emscripten produce working module

* Update Node testing versions
  Add v18 that should now work, also add v20 that is in active development
  as of now, but if tests are green then why not?

* Switched integration tests to use v16

* Removed testing of quite old and deprecated v10

* Updated version of BoringSSL submodule to a newer one (not the latest though)
  • Loading branch information
iamnotacake committed Nov 21, 2023
1 parent 05cac26 commit 6111766
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ jobs:
with:
toolchain: stable
profile: minimal
- name: Install Node.js 10.x
- name: Install Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: 10.x
node-version: 16.x
- name: Install Emscripten
run: |
version=$(cat src/wrappers/themis/wasm/emscripten/VERSION)
Expand Down
17 changes: 10 additions & 7 deletions .github/workflows/test-wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ jobs:
strategy:
matrix:
node-version:
- 10.x # legacy
- 12.x # old LTS
- 14.x # current LTS
- 16.x # current stable
- 12.x # legacy
- 14.x # legacy
- 16.x # legacy
- 18.x # current LTS
- 20.x # current active
fail-fast: false
steps:
- name: Install Node.js ${{ matrix.node-version }}
Expand Down Expand Up @@ -110,9 +111,11 @@ jobs:
strategy:
matrix:
node-version:
- 12.x # old LTS
- 14.x # current LTS
- 16.x # current stable
- 12.x # legacy
- 14.x # legacy
- 16.x # legacy
- 18.x # current LTS
- 20.x # current active
fail-fast: false
env:
# WasmThemis uses promises to handle asynchronous WebAssmebly compilation.
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ _Code:_

- Minimum supported Rust version is now 1.58 ([#977](https://github.com/cossacklabs/themis/pull/977), [#984](https://github.com/cossacklabs/themis/pull/984)).

- **WasmThemis**

- Updated required `emsdk` version to 3.1.47 ([#1036](https://github.com/cossacklabs/themis/pull/1036)).
- WasmThemis now works with Node v18 and v20 ([#1036](https://github.com/cossacklabs/themis/pull/1036)).

- **WebAssembly**

- Node.js v8 is no longer supported ([#901](https://github.com/cossacklabs/themis/pull/901)).
Expand Down
2 changes: 1 addition & 1 deletion src/wrappers/themis/wasm/emscripten/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0
3.1.47
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
["_malloc", "_free"]
6 changes: 4 additions & 2 deletions src/wrappers/themis/wasm/wasmthemis.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ WASM_PATH = src/wrappers/themis/wasm
WASM_SRC += $(WASM_PATH)/package.json
WASM_SRC += $(wildcard $(WASM_PATH)/src/*.js)

WASM_RUNTIME = $(abspath $(WASM_PATH)/emscripten/runtime_exports.json)
WASM_PRE_JS = $(abspath $(WASM_PATH)/emscripten/pre.js)
WASM_RUNTIME = $(abspath $(WASM_PATH)/emscripten/runtime_exports.json)
WASM_PRE_JS = $(abspath $(WASM_PATH)/emscripten/pre.js)
WASM_EXPORTED_FUNCTIONS = $(abspath $(WASM_PATH)/emscripten/exported_functions.json)

WASM_PACKAGE = $(BIN_PATH)/wasm-themis.tgz

$(BIN_PATH)/libthemis.js: LDFLAGS += -s EXPORTED_RUNTIME_METHODS=@$(WASM_RUNTIME)
$(BIN_PATH)/libthemis.js: LDFLAGS += -s ALLOW_TABLE_GROWTH
$(BIN_PATH)/libthemis.js: LDFLAGS += -s MODULARIZE=1
$(BIN_PATH)/libthemis.js: LDFLAGS += -s ALLOW_MEMORY_GROWTH=1
$(BIN_PATH)/libthemis.js: LDFLAGS += -s EXPORTED_FUNCTIONS=@$(WASM_EXPORTED_FUNCTIONS)
# FIXME(ilammy, 2020-11-29): rely in EMSCRIPTEN_KEEPALIVE instead of LINKABLE
# For some reason existing EMSCRIPTEN_KEEPALIVE macros do not work and without
# LINKABLE flag wasm-ld ends up stripping *all* Themis functions from "*.wasm"
Expand Down
2 changes: 1 addition & 1 deletion tests/soter/soter_sym_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ static void test_invalid_params(void)
}
}

void run_soter_sym_test()
void run_soter_sym_test(void)
{
testsuite_enter_suite("soter sym");
// testsuite_run_test(soter_sym_test);
Expand Down
2 changes: 1 addition & 1 deletion third_party/boringssl/src
Submodule src updated from 897a2c to a43c76

0 comments on commit 6111766

Please sign in to comment.