Docker: avoid sourcing emsdk_env.sh in interactive shells#1220
Docker: avoid sourcing emsdk_env.sh in interactive shells#1220kleisauke wants to merge 3 commits into
emsdk_env.sh in interactive shells#1220Conversation
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? |
| # (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.
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.
Also, EMSDK it only used locally within this file.. is there some way to declare it as local?
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
0000So, 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
PATHenvironment variable.This would ensure that a custom cache directory via
EM_CACHEis honored rather than being ignored.Current behavior:
New behavior:
Context: kleisauke/wasm-vips#49.