-
Notifications
You must be signed in to change notification settings - Fork 753
Docker: avoid sourcing emsdk_env.sh
in interactive shells
#1220
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
Docker: avoid sourcing emsdk_env.sh
in interactive shells
#1220
Conversation
Instead, rely on the already set `PATH` environment variable.
Do we want to support this though? That point of emsdk_env is that it sets up the current env to point to emsdk tools (and emsdk cache). If we want to change this behaviour maybe we should change emsdk_env instead? |
# Fallback in case Emscripten isn't activated. | ||
# This will let use tools offered by this image inside other Docker images | ||
# (sub-stages) or with custom / no entrypoint | ||
# Set up emsdk environment | ||
ENV EMSDK=/emsdk \ | ||
EMSDK_NODE=/emsdk/node/15.14.0_64bit/bin/node \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing this now I think we should remove EMSDK_NODE
here.. its not used for anything that I know of.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, EMSDK it only used locally within this file.. is there some way to declare it as local?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c4ab401
to
1a3dc75
Compare
The $ docker run -it --rm -v $(pwd):/src emscripten/emsdk:3.1.39 bash -c 'umask'
0022
$ docker run -it --rm -v $(pwd):/src emscripten/emsdk:3.1.39
Setting up EMSDK environment (suppress these messages with EMSDK_QUIET=1)
Setting environment variables:
PATH = /emsdk:/emsdk/upstream/emscripten:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root@8e8d456cdb1e:/src# umask
0000 So, it's therefore better to align the behavior of interactive and non-interactive shells (with the latter being much more common, I think). |
1a3dc75
to
7822b41
Compare
The ideas is that emsdk_env is in charge to setting everything up.. but I guess we don't need that give that we are manually constructing that PATH. However, emsdk_env is the official recommended way to setup the PATH so I guess I would prefer to have emsdk_env run in all cases.. and not manually inject |
Can you split out the removal of fastcomp and EMSDK_NODE into its own separate PR? |
7822b41
to
b3dc670
Compare
I see. Unfortunately, you cannot set those Another option would be to avoid the need for these environment variables altogether by installing the pre-built binaries in systems locations such as
|
Can't we just add Then we can remove the PATH additions above? |
Closing in favor of #1227. My only concern is that it would break compatibility for users that set the |
Instead, rely on the already set
PATH
environment variable.This would ensure that a custom cache directory via
EM_CACHE
is honored rather than being ignored.Current behavior:
New behavior:
Context: kleisauke/wasm-vips#49.