Skip to content

Commit 3ad50b2

Browse files
authored
Merge pull request #18 from kwonoj/pin-emscripten
build(emscripten): pin version via env variable
2 parents e599480 + a9d15ee commit 3ad50b2

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ services:
77
env:
88
global:
99
- DOCKER_REPO='ojkwon/arch-emscripten'
10+
- EMSCRIPTEN_VERSION=1.37.28
11+
- PROTOBUF_VERSION=3.5.1.1
1012
matrix:
1113
- BUILD_TARGET='base'
1214
- BUILD_TARGET='protobuf'
@@ -20,7 +22,7 @@ script:
2022
# set docker tag based on last commit short sha.
2123
- DOCKER_TAG=$DOCKER_REPO:${COMMIT}-$BUILD_TARGET
2224
- tput setaf 2; echo building docker image tagged as $DOCKER_TAG
23-
- sudo docker build --tag $DOCKER_TAG --build-arg BUILD_TARGET=$BUILD_TARGET --build-arg PROTOBUF_VERSION=3.5.1.1 .
25+
- sudo docker build --tag $DOCKER_TAG --build-arg BUILD_TARGET=$BUILD_TARGET --build-arg PROTOBUF_VERSION=$PROTOBUF_VERSION --build-arg EMSCRIPTEN_VERSION=$EMSCRIPTEN_VERSION .
2426
- |
2527
if [[ ! -z "${TRAVIS_TAG}" ]]; then
2628
tput setaf 2; echo this build is tagged versioned build, pushing into registry

Dockerfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ MAINTAINER OJ Kwon <[email protected]>
44
# Build time args
55
ARG BUILD_TARGET=""
66
ARG PROTOBUF_VERSION=""
7+
ARG EMSCRIPTEN_VERSION=""
78

89
# Upgrade system
910
RUN pacman --noconfirm -Syyu
@@ -14,14 +15,19 @@ RUN pacman --noconfirm -S \
1415
python \
1516
python-setuptools \
1617
python2-setuptools \
17-
jre8-openjdk \
18-
emscripten
18+
jre8-openjdk
1919

2020
# Change subsequent execution shell to bash
2121
SHELL ["/bin/bash", "-l", "-c"]
2222

2323
USER builder
2424

25+
# Install emcc
26+
RUN cd $TMPDIR && \
27+
curl https://archive.archlinux.org/packages/e/emscripten/emscripten-$EMSCRIPTEN_VERSION-1-x86_64.pkg.tar.xz > ./emscripten-$EMSCRIPTEN_VERSION-1-x86_64.pkg.tar.xz && \
28+
curl https://archive.archlinux.org/packages/e/emscripten/emscripten-$EMSCRIPTEN_VERSION-1-x86_64.pkg.tar.xz.sig > ./emscripten-$EMSCRIPTEN_VERSION-1-x86_64.pkg.tar.xz.sig && \
29+
sudo pacman --noconfirm -U emscripten-$EMSCRIPTEN_VERSION-1-x86_64.pkg.tar.xz
30+
2531
# Initialize emcc
2632
RUN emcc && emcc --version
2733

@@ -38,9 +44,9 @@ RUN if [[ "${BUILD_TARGET}" == "protobuf" ]]; then \
3844
cd $TMPDIR/protobuf-wasm && git checkout v$PROTOBUF_VERSION && cp *.patch $TMPDIR/protobuf && \
3945
cd $TMPDIR/protobuf && git apply *.patch && \
4046
git status && \
41-
sh autogen.sh && emconfigure ./configure && emmake make && \
47+
sh autogen.sh && emconfigure ./configure CXXFLAGS="-O2" && emmake make && \
4248
cp -r ./src/.libs $TMPDIR/ && \
43-
ls $TMPDIR/.libs; \
49+
ls -al $TMPDIR/.libs; \
4450
fi
4551

4652
# trigger dummy build to cache corresponding binaryen port for wasm

0 commit comments

Comments
 (0)