The first time around `node` was being correctly added to the PATH, but
the second time around this code was observing the emsdk copy of node
in the PATH and assuming it could be skipped.
Fixes: #1240
Newer versions of emscipten, starting all the way back in 1.39.13, can
automatically locate the `.emscripten` config file that emsdk creates so
there is no need for the explicit EM_CONFIG environment variable. Its
redundant and adds unnessary noisce/complexity.
Really, adding emcc to the PATH is all the is needed these days.
One nice thing about this change is that it allows folks to run
whichever emcc they want to and have it just work, even if they have
configured emsdk. Without this change, if I activate emsdk and I run
`some/other/emcc` then emsdk's `EM_CONFIG` will still be present and
override the configuration embedded in `some/other/emcc`.
e.g. in the same shell, with emsdk activated, I can run both these
commands and have them both just work as expected.
```
$ emcc --version
$ /path/to/my/emcc --version
```
The newer versions of eslint require 14.17.0 or above. This
updates our node version to the latest in the 14.XX series.
I don't expect any user-visible changes.
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.
* Makes provided bazel rules look up @emsdk workspace instead of local workspace
* Uses system-specific emscripten binaries instead of defaulting to linux
* Provides macros for loading emsdk dependencies (nodejs and emscripten binaries)
* Unhardcodes paths in bazel rules and .sh wrappers
* `update_bazel_workspace.sh` now updates `revisions.bzl`
* `emscripten_deps()` can be fed with specific emscripten version
* Adds external usage test
Addresses #650 and #696
Previously this had to be
emsdk install sdk-releases-upstream-HASH
The only thing preventing using just the hash was that there was no
default for the backend, so defaulting to upstream fixes this. And then
we can do
emsdk install HASH