Apparently 10.11 is no longer good enough to run the latest version of
binaryen. Specifically since binaryen switched to using std::variant it
now fails to build with this set to 10.11.
This is also the version used on the emscripten-releases CI which builds
the emsdk binaries:
https://chromium.googlesource.com/emscripten-releases/+/refs/heads/main/src/build.py#673
In the past the instructions were to copy `emscripten_toolchain` into the project dir, now it downloads emsdk as a package so the `bazelrc` part has to refer to `@emsdk`.
When linking with `-o filename` (such as in various CMake build checks), the parameter passed to the linker is a temporary file, and it is passed as a bare filename (i.e. relative path without a `'/'`). In such cases, `outdir` would have been the empty string, and the final `tar` command would fail (actually the call to `subprocess.check_call(…)` is what fails).
Previously if a tool (any part of an SDK) was not installed
we would issue a warning and continue to active without returning
non-zero.
This meant doing `emsdk install 2.0.0 && emsdk activate latest`
would appear to be work aside from the warning messages about
latest not being installed.
This is especially annoying since we dropped support for side
by side SDK installations. The following sequence is no longer
valid and we want to make that clear by erroring out:
```
$ emsdk install 2.0.1
$ emsdk install 2.0.2
$ emsdk activate 2.0.1
```
Since 2.0.2 replaces 2.0.1 on the filesystem the active here
could fail hard rather than just warning.
Also, improve reporting of version resolution. e.g.:
```
$ ./emsdk install sdk-latest
Resolving SDK alias 'latest' to '2.0.23'
Resolving SDK version '2.0.23' to 'sdk-releases-upstream-77b065ace39e6ab21446e13f92897f956c80476a-64bit'
Installing SDK 'sdk-releases-upstream-77b065ace39e6ab21446e13f92897f956c80476a-64bit'..
...
```
When we deactivate a tool we also want to remove its environment
variables. One driver for this is that modern sdks don't set
`EM_CACHE` whereas old ones did and we want to make sure that
`EM_CACHE` gets unset when folks upgrade (and then re-set if
they downgrade). See #797.