Where to pass EMSDK_QUIET=1

1k Views Asked by At

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?

3

There are 3 best solutions below

0
On BEST ANSWER

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.

0
On

According to official documentation of recommended installing Emscripten using emsdk (Emscripten SDK), the last move in the procedure is:
#Activate PATH and other environment variables in the current terminal
source ./emsdk_env.sh"
So this script is at the core of generating said message, exposed at the beginning of every new shell session. Logic dictates that the suppressor of this event (EMSDK_QUIET=1) should be placed in it, because emsdk_env.sh is defined as source, right?
One possible location of "export EMSDK_QUIET=1" could be at the bottom section of the script (# Force emsdk to use bash syntax...) before the line "eval EMSDK_BASH=1 "$DIR/emsdk" construct_env".

0
On

in my case at the bottom of emsdk_env.sh file (or whatever your env file)

eval `EMSDK_BASH=1 EMSDK_QUIET=1 "$DIR/emsdk" construct_env`