Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check Emscripten toolchain version for WasmThemis #879

Merged
merged 5 commits into from
Nov 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
python3 python3-setuptools \
ruby ruby-dev \
pkg-config clang
- name: Check out code
uses: actions/checkout@v2
with:
submodules: true
- name: Install RVM
run: |
sudo apt install --yes software-properties-common
Expand All @@ -70,13 +74,14 @@ jobs:
node-version: 10.x
- name: Install Emscripten
run: |
version=$(cat src/wrappers/themis/wasm/emscripten/VERSION)
# Install Emscripten toolchain as described in documentation:
# https://emscripten.org/docs/getting_started/downloads.html
cd $HOME
git clone https://github.com/emscripten-core/emsdk.git
cd $HOME/emsdk
./emsdk install 2.0.13
./emsdk activate 2.0.13
./emsdk install "$version"
./emsdk activate "$version"
- name: Install PHP from PPA
run: |
sudo apt install --yes software-properties-common
Expand All @@ -87,10 +92,6 @@ jobs:
sudo update-alternatives --set php /usr/bin/php7.2
sudo update-alternatives --set php-config /usr/bin/php-config7.2
sudo update-alternatives --set phpize /usr/bin/phpize7.2
- name: Check out code
uses: actions/checkout@v2
with:
submodules: true
- name: Install Themis Core
run: |
make
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/test-wasm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,20 @@ jobs:
sudo sh -c 'echo "DEBIAN_FRONTEND=noninteractive" >> /etc/environment'
sudo apt update
sudo apt install --yes gcc make libssl-dev ninja-build
- name: Check out code
uses: actions/checkout@v2
with:
submodules: true
- name: Install Emscripten
run: |
version=$(cat src/wrappers/themis/wasm/emscripten/VERSION)
# Install Emscripten toolchain as described in documentation:
# https://emscripten.org/docs/getting_started/downloads.html
cd $HOME
git clone https://github.com/emscripten-core/emsdk.git
cd $HOME/emsdk
./emsdk install 2.0.13
./emsdk activate 2.0.13
- name: Check out code
uses: actions/checkout@v2
with:
submodules: true
./emsdk install "$version"
./emsdk activate "$version"
- name: Build WasmThemis
run: |
source "$HOME/emsdk/emsdk_env.sh"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ _Code:_
```
- New initialization API: `initialize()`, allowing to specify custom URL for `libthemis.wasm` ([#792](https://github.com/cossacklabs/themis/pull/792), [#854](https://github.com/cossacklabs/themis/pull/854), [#857](https://github.com/cossacklabs/themis/pull/857)).
- Updated embedded BoringSSL to the latest version ([#812](https://github.com/cossacklabs/themis/pull/812)).
- `make wasmthemis` now fails with unsupported Emscripten toolchains ([#879](https://github.com/cossacklabs/themis/pull/879)).

_Infrastructure:_

Expand Down
1 change: 1 addition & 0 deletions src/wrappers/themis/wasm/emscripten/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.0.13
10 changes: 10 additions & 0 deletions src/wrappers/themis/wasm/wasmthemis.mk
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,16 @@ ifndef IS_EMSCRIPTEN
fi
@exit 1
endif
# Typical version string:
# emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 2.0.13 (681cdf3e7edeef79855adc2f2a04a1a2a44ec24f)
@actual="$$(emcc --version | head -1 | sed -E 's/^emcc \([^()]*\) (.*) \([0-9a-f]*\)$$/\1/')"; \
expected="$$(cat $(WASM_PATH)/emscripten/VERSION)"; \
if [[ "$$actual" != "$$expected" ]]; then \
echo "Current Emscripten environment is not supported!" ; \
echo " actual: $$actual" ; \
echo " expected: $$expected" ; \
exit 1 ; \
fi

wasmthemis_install: CMD = npm install $(abspath $(WASM_PACKAGE))
wasmthemis_install:
Expand Down