Skip to content

Upgrade to Emscripten 2.0.29 #477

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

Merged
merged 2 commits into from
Aug 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}
# Install EMSDK to /emsdk just like the EMSDK Dockerfile: https://github.com/emscripten-core/emsdk/blob/master/docker/Dockerfile
ENV EMSDK /emsdk
# We pin EMSDK to 2.0.15 rather than 'latest' so that everyone is using the same compiler version
ENV EMSCRIPTEN_VERSION 2.0.15
ENV EMSCRIPTEN_VERSION 2.0.29

RUN git clone https://github.com/emscripten-core/emsdk.git $EMSDK

@@ -36,7 +36,7 @@ RUN echo "## Install Emscripten" \
# Copied directly from https://github.com/emscripten-core/emsdk/blob/master/docker/Dockerfile
RUN cd ${EMSDK} \
&& echo "## Generate standard configuration" \
&& ./emsdk activate $EMSCRIPTEN_VERSION \
&& ./emsdk activate ${EMSCRIPTEN_VERSION} \
&& chmod 777 ${EMSDK}/upstream/emscripten \
&& chmod -R 777 ${EMSDK}/upstream/emscripten/cache \
&& echo "int main() { return 0; }" > hello.c \
@@ -47,6 +47,7 @@ RUN cd ${EMSDK} \
ENV PATH $EMSDK:$EMSDK/upstream/emscripten/:$PATH

# Cleanup Emscripten installation and strip some symbols
# Copied directly from https://github.com/emscripten-core/emsdk/blob/master/docker/Dockerfile
RUN echo "## Aggressive optimization: Remove debug symbols" \
&& cd ${EMSDK} && . ./emsdk_env.sh \
# Remove debugging symbols from embedded node (extra 7MB)
@@ -60,6 +61,12 @@ RUN echo "## Aggressive optimization: Remove debug symbols" \
&& echo "## Done"

RUN echo ". /emsdk/emsdk_env.sh" >> /etc/bash.bashrc
# We must set the EM_NODE_JS environment variable for a somewhat silly reason
# We run our build scripts with `npm run`, which sets the NODE environment variable as it runs.
# The EMSDK picks up on that environment variable and gives a deprecation warning: warning: honoring legacy environment variable `NODE`. Please switch to using `EM_NODE_JS` instead`
# So, we are going to put this environment variable here explicitly to avoid the deprecation warning.
RUN echo 'export EM_NODE_JS="$EMSDK_NODE"' >> /etc/bash.bashrc

# END EMSDK
# --------------------------------------------------------------------

4 changes: 3 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -18,7 +18,9 @@
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// We use `npm ci` instead of `npm install` because we want to respect the lockfile and ONLY the lockfile.
// That way, our devcontainer is more reproducible. --Taytay
"postCreateCommand": "npm ci",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "node"
}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ EMFLAGS = \
-s RESERVED_FUNCTION_POINTERS=64 \
-s ALLOW_TABLE_GROWTH=1 \
-s EXPORTED_FUNCTIONS=@src/exported_functions.json \
-s EXTRA_EXPORTED_RUNTIME_METHODS=@src/exported_runtime_methods.json \
-s EXPORTED_RUNTIME_METHODS=@src/exported_runtime_methods.json \
-s SINGLE_FILE=0 \
-s NODEJS_CATCH_EXIT=0 \
-s NODEJS_CATCH_REJECTION=0
@@ -154,7 +154,7 @@ out/sqlite3.bc: sqlite-src/$(SQLITE_AMALGAMATION)
out/extension-functions.bc: sqlite-src/$(SQLITE_AMALGAMATION)
mkdir -p out
# Generate llvm bitcode
$(EMCC) $(CFLAGS) -s LINKABLE=1 -c sqlite-src/$(SQLITE_AMALGAMATION)/extension-functions.c -o $@
$(EMCC) $(CFLAGS) -c sqlite-src/$(SQLITE_AMALGAMATION)/extension-functions.c -o $@

# TODO: This target appears to be unused. If we re-instatate it, we'll need to add more files inside of the JS folder
# module.tar.gz: test package.json AUTHORS README.md dist/sql-asm.js