I've installed emsdk, following the steps described in the following document: https://emscripten.org/docs/getting_started/downloads.html#sdk-download-and-install
Now, when I launch a Terminal under macOS, I have these lines inserted at the beginning:
Setting up EMSDK environment (suppress these messages with EMSDK_QUIET=1)
Adding directories to PATH:
PATH = [private]/emscripten/emsdk
PATH = [private]/emscripten/emsdk/upstream/emscripten
PATH = [private]/emscripten/emsdk/node/14.18.2_64bit/bin
Setting environment variables:
PATH = [private]/emscripten/emsdk:[private]/emscripten/emsdk/upstream/emscripten:[private]/emscripten/emsdk/node/14.18.2_64bit/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Little Snitch.app/Contents/Components:/usr/local/share/dotnet:/opt/X11/bin:~/.dotnet/tools:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands
EMSDK = [private]/emscripten/emsdk
EM_CONFIG = [private]/emscripten/emsdk/.emscripten
EMSDK_NODE = [private]/emscripten/emsdk/node/14.18.2_64bit/bin/node
EMSDK_PYTHON = [private]/emscripten/emsdk/python/3.9.2_64bit/bin/python3
SSL_CERT_FILE = [private]/emscripten/emsdk/python/3.9.2_64bit/lib/python3.9/site-packages/certifi/cacert.pem
I can't find from where this is launched. emsdk
doesn't appear in .bash_profile
, nor in .profile
or .bashrc
.
Where do I have to set EMSDK_QUIET=1
to avoid these lines?
CodePudding user response:
A lot of times when you install a program that needs to alter the environment like compiler toolchains the install script will modify the file it expects to be sourced by your shell based on the default shell for the current user or sometimes by scanning $HOME. On MacOS you might see it add a line to (or create if it can't find):
- $HOME/.bashrc or $HOME/.bash_profile for bash
- $HOME/.zshrc or $HOME/.zprofile for zsh
- $HOME/.config/fish/config.fish for fish
Note that recent versions of MacOS have changed the default shell from bash to zsh. Due to licensing issues they have to ship an archaic version of bash (3.2 vs 5.x current) so it was probably a good move but it means you may need to check the zsh files instead of the usual bash ones.
When you need to set an envar for a toolchain like EMSDK_QUIET=1
just look for the line where the environment is sourced, and export that envar above it.