Skip to content

Update emscripten installation and user #1573

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
17 changes: 2 additions & 15 deletions ci/emscripten.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,8 @@ exit 1

git clone https://github.com/emscripten-core/emsdk.git /emsdk-portable
cd /emsdk-portable
# TODO: switch to an upstream install once
# https://github.com/rust-lang/rust/pull/63649 lands
hide_output ./emsdk install 1.38.42
./emsdk activate 1.38.42

# Compile and cache libc
# shellcheck disable=SC1091
source ./emsdk_env.sh
echo "main(){}" > a.c
HOME=/emsdk-portable/ emcc a.c
rm -f a.*

# Make emsdk usable by any user
cp /root/.emscripten /emsdk-portable
chmod a+rxw -R /emsdk-portable
hide_output ./emsdk install 1.38.46-upstream
./emsdk activate 1.38.46-upstream

# node 8 is required to run wasm
cd /
Expand Down
10 changes: 9 additions & 1 deletion ci/run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,17 @@ run() {
kvm=""
fi

# Emscripten targets require that the user is the same for building and
# running the image
if echo "${1}" | grep emscripten > /dev/null; then
user="0"
else
user="$(id -u):$(id -g)"
fi

docker run \
--rm \
--user "$(id -u)":"$(id -g)" \
--user "$user" \
--env LIBC_CI \
--env CARGO_HOME=/cargo \
--env CARGO_TARGET_DIR=/checkout/target \
Expand Down