Skip to content

Commit

Permalink
Update emscripten env vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhonnyg committed Sep 13, 2023
1 parent ec029c8 commit a2f51a4
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions server/docker-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ RUN \
ENV EMCC_SKIP_SANITY_CHECK 1

## Emscripten 2.0.11 (from version 1.2.178)
## Emscripten 3.1.45 (from version 2.0.11)

# Ubuntu still seem to use python3 3.8 as default version
RUN \
Expand All @@ -98,25 +99,25 @@ RUN \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2 && \
python3 --version

ENV EMSCRIPTEN_SDK_2_0_11 ${PLATFORMSDK_DIR}/emsdk-2.0.11
ENV EMSCRIPTEN_HOME_2_0_11 ${EMSCRIPTEN_SDK_2_0_11}
ENV EMSCRIPTEN_CONFIG_2_0_11 ${EMSCRIPTEN_HOME_2_0_11}/.emscripten
ENV EMSCRIPTEN_BIN_2_0_11 ${EMSCRIPTEN_HOME_2_0_11}/upstream/emscripten
ENV EMSCRIPTEN_CACHE_2_0_11 /var/extender/emcache_2_0_11
ENV EMSCRIPTEN_PYTHON_2_0_11 /usr/bin/python3.9
# Setup a special env variable that will be prefixed to PATH if requested version is 2.0.11
ENV EMSCRIPTEN_PATH_2_0_11 ${EMSCRIPTEN_HOME_2_0_11}:${EMSCRIPTEN_HOME_2_0_11}/upstream/bin:${EMSCRIPTEN_HOME_2_0_11}/node/12.9.1_64bit/bin:${EMSCRIPTEN_BIN_2_0_11}
ENV EMSCRIPTEN_SDK_3_1_45 ${PLATFORMSDK_DIR}/emsdk-3.1.45
ENV EMSCRIPTEN_HOME_3_1_45 ${EMSCRIPTEN_SDK_3_1_45}
ENV EMSCRIPTEN_CONFIG_3_1_45 ${EMSCRIPTEN_HOME_3_1_45}/.emscripten
ENV EMSCRIPTEN_BIN_3_1_45 ${EMSCRIPTEN_HOME_3_1_45}/upstream/emscripten
ENV EMSCRIPTEN_CACHE_3_1_45 /var/extender/emcache_3_1_45
ENV EMSCRIPTEN_PYTHON_3_1_45 /usr/bin/python3.9
# Setup a special env variable that will be prefixed to PATH if requested version is 3.1.45
ENV EMSCRIPTEN_PATH_3_1_45 ${EMSCRIPTEN_HOME_3_1_45}:${EMSCRIPTEN_HOME_3_1_45}/upstream/bin:${EMSCRIPTEN_HOME_3_1_45}/node/12.9.1_64bit/bin:${EMSCRIPTEN_BIN_3_1_45}

RUN \
mkdir ${EMSCRIPTEN_SDK_2_0_11} && \
wget -q -O - ${DM_PACKAGES_URL}/emsdk-2.0.11-linux.tar.gz | tar xz -C ${EMSCRIPTEN_SDK_2_0_11} --strip-components=1
mkdir ${EMSCRIPTEN_SDK_3_1_45} && \
wget -q -O - ${DM_PACKAGES_URL}/emsdk-2.0.11-linux.tar.gz | tar xz -C ${EMSCRIPTEN_SDK_3_1_45} --strip-components=1

RUN \
${EMSCRIPTEN_HOME_2_0_11}/emsdk activate sdk-2.0.11-64bit --embedded && \
EM_CONFIG=$EMSCRIPTEN_CONFIG_2_0_11 EM_CACHE=${EMSCRIPTEN_CACHE_2_0_11} python3 ${EMSCRIPTEN_BIN_2_0_11}/embuilder.py build SYSTEM MINIMAL && \
chmod -R 755 ${EMSCRIPTEN_HOME_2_0_11} && \
chown -R extender: ${EMSCRIPTEN_CACHE_2_0_11} && \
chown -R extender: ${EMSCRIPTEN_CACHE_2_0_11}/wasm/cache.lock
${EMSCRIPTEN_HOME_3_1_45}/emsdk activate sdk-2.0.11-64bit --embedded && \
EM_CONFIG=$EMSCRIPTEN_CONFIG_3_1_45 EM_CACHE=${EMSCRIPTEN_CACHE_3_1_45} python3 ${EMSCRIPTEN_BIN_3_1_45}/embuilder.py build SYSTEM MINIMAL && \
chmod -R 755 ${EMSCRIPTEN_HOME_3_1_45} && \
chown -R extender: ${EMSCRIPTEN_CACHE_3_1_45} && \
chown -R extender: ${EMSCRIPTEN_CACHE_3_1_45}/wasm/cache.lock


# We use the same temp directory for both versions.
Expand All @@ -125,8 +126,9 @@ RUN mkdir -p ${EMSCRIPTEN_TEMP_DIR}
RUN chmod -R 755 ${EMSCRIPTEN_TEMP_DIR} && chown extender: ${EMSCRIPTEN_TEMP_DIR}
# The "sed" command below removes the /TEMP_DIR line from the generated configs
# We replace it with a folder of our own
RUN sed '/TEMP_DIR =/d' ${EMSCRIPTEN_CONFIG_2_0_11} && \
echo TEMP_DIR = \'${EMSCRIPTEN_TEMP_DIR}\' >> ${EMSCRIPTEN_CONFIG_2_0_11}
RUN sed '/TEMP_DIR =/d' ${EMSCRIPTEN_CONFIG_3_1_45} && \
echo TEMP_DIR = \'${EMSCRIPTEN_TEMP_DIR}\' >> ${EMSCRIPTEN_CONFIG_3_1_45}
#echo TEMP_DIR = \'${EMSCRIPTEN_TEMP_DIR}\' >> ${EMSCRIPTEN_CONFIG_2_0_11}
# && \
# sed '/TEMP_DIR =/d' ${EMSCRIPTEN_CONFIG_1_39_16} && \
# echo TEMP_DIR = \'${EMSCRIPTEN_TEMP_DIR}\' >> ${EMSCRIPTEN_CONFIG_1_39_16}
Expand Down

0 comments on commit a2f51a4

Please sign in to comment.