Commit Graph

196 Commits

Author SHA1 Message Date
juj
378d768942 Firefox support (#1606)
This PR adds downloadable firefox packages into emsdk.

The downloading of firefox will be done via the `mozdownload` pip
package, which simplifies the installation a lot.

Installing and activating a Firefox package will set up the
`EMTEST_BROWSER` variable, so running browser tests will then
automatically use the activated browser.

The oldest supported Firefox version by Emscripten is 65. So add that
version, and all ESR versions from 65 upwards, and the moving channels.
This allows people to go back and forth testing different versions of
interest.
2025-10-08 00:09:14 +03:00
juj
b71731aa1a Pin Apple ARM64 Node Nightly (#1596)
Node.js Apple ARM64 nightly downloads are currently out of order, so pin
to recent version that does still exist.
https://github.com/nodejs/node/issues/59654
2025-08-27 21:17:04 +00:00
juj
5899439ff2 Add support for a new command 'emsdk deactivate' (#1593)
Add support for a new command 'emsdk deactivate' that can be used to
remove a tool from the active list.

Since the big endian cross compile Node.js is added to `NODE_JS_TEST`
instead of `NODE_JS`, there needs to be a way to deactivate it for
regular runs.

This PR adds a `emsdk deactivate` command to enable doing that.
2025-08-27 11:41:47 -07:00
juj
0674b46e36 Fix node nightly check when no node.js versions are installed (#1594)
This line failed when there are no Node.js's installed at all.
2025-08-27 19:57:16 +03:00
juj
efd71e9a2e Nightly Node.js and Big Endian cross compilation Node.js (#1590)
This PR adds support for

`./emsdk install node-nightly-64bit`

which finds the latest nightly node.js version and installs that. It is
a moving target, so the next day when a new nightly is produced,
reissuing `./emsdk install node-nightly-64bit` will install the newer
published version.

Also, this PR adds a fixed 22.18.0 version for the cross compilation
s390x Node.js target as well. On an x64 Linux system, this allows
running

`./emsdk install node-big-endian-crosscompile-22.16.0-64bit`

to install the big endian Node.js. This greatly simplifies the steps at
https://github.com/emscripten-core/emscripten/compare/main...juj:emscripten:bigendian_test_suite#diff-c36b90121be240017fa490a1c00e63e47fa3235f5c1be0593e2b7502d017c778R9985-R10000
and enables a trivial way to switch between LE and BE Node.js versions
for testing.

CC @slavek-kucera
2025-08-27 16:24:20 +03:00
juj
0c45297475 Allow switching between overrides (#1588)
Previously, if one used e.g. command

```
emsdk install --override-repository emscripten-main-64bit@https://github.com/juj/emscripten/tree/my_own_emscripten_branch emscripten-main-64bit
```

then the overridden installation would create a git clone from
`juj/emscripten`, and that clone would be located under the default
remote name `origin`.

This would prevent being able to switch between overrides on subsequent
`emsdk install` commands. I.e. it would then not be possible to later do
a default

```
emsdk install emscripten-main-64bit
```

command without an override, since the remote name `origin` would point
to `juj/emscripten` instead of `emscripten-core/emscripten`.

This PR changes the naming scheme of `git clone`s when
`--override-repository` is used, to name the clones with remote names
from the override, so in the above case, the clone would appear under
remote name `juj` and not `origin`.

This enables flipping between multiple `emsdk install` commands in the
same checkout, without needing to nuke the installed directory in
between.

This enables me to run experiments like
github.com/emscripten-core/emscripten/pull/25025 locally on my CI,
without needing to merge them upstream to become available.
2025-08-27 14:59:01 +03:00
juj
d07c793415 Update Python to 3.13.3 and add support to Windows on ARM64. (#1477)
Update Python to 3.13.0 and add support to Windows on AMD64. Rewrite
packaging of pywin32 because it is no longer shipped via separate binary
installers, but has migrated to use pip.
2025-05-28 23:20:03 +03:00
Sam Clegg
2e1e02e648 Don't build binaryen tests (#1551)
These seems to be some issue with building gtest on ubuntu/focal. Looks
like maybe the libstdc++ is too old for it.
2025-04-15 14:36:32 -07:00
Sam Clegg
7c8f0a2a3d Remove closure compile hack when running npm ci (#1541)
See
https://chromium.googlesource.com/emscripten-releases/+/2ee2f60605a7774b4e194c235e372c29973038ab
2025-03-25 12:39:52 -07:00
Christian Clauss
095c488961 Python lint: Use flake8 --extend-ignore instead of --ignore (#1498) 2024-12-06 15:20:31 -08:00
Christian Clauss
ac2adfeac4 Fix typos discovered by codespell (#1496)
# https://pypi.org/project/codespell
% `codespell`
```
./emsdk.py:1459: thier ==> their
./test/test.bat:1: equivilent ==> equivalent
./test/test.py:198: Specificlly ==> Specifically
./scripts/update_bazel_workspace.py:2: revisons ==> revisions
./scripts/update_node.py:11: direcotry ==> directory
./bazel/emscripten_toolchain/BUILD.bazel:57: implictly ==> implicitly
./docker/Dockerfile:87: terninal ==> terminal
```
2024-12-06 09:26:36 -08:00
juj
dc6e0d42c4 Remove temp zip after uncompressing in update_python.py (#1470)
Remove temp zip after uncompressing in update_python.py to avoid
confusing it with the output artifact zip. Adjust comments.
2024-10-18 23:03:08 +03:00
juj
a3fb5e8198 Fix 'emsdk install sdk-main-64bit' to produce a functioning installation. (#1444) 2024-09-03 18:02:32 +00:00
Sam Clegg
476dc4e01f Add missing comma from #1429 (#1433)
Turns out this is what was causing the OOM when building binaryen since
we were clobbering the EMSDK_NUM_CORES environment variable by mistake.

See #1429
2024-07-31 18:59:43 -07:00
mtb
fad40cf1f4 fix: improve Fish shell support (and Cshell) (#1429)
I faced the same issue mentioned in #1299, this PR fixes the issue by
taking in account specific `set` and `unset` syntax for Fish shell.

The post install instruction (i.e : `./emsdk activate latest`) provides
wrong instructions in Fish shell and Cshell cases.
This should be fixed by this PR too, although the code is a bit
redundant and it could be more cleaner.
2024-07-31 17:41:32 -07:00
Sam Clegg
8caaa25afb Add some logging after download is finished. NFC (#1413)
Also move some code outside of the `using` block.
2024-06-25 13:04:03 -07:00
Sam Clegg
a6db8d2872 Add logging of sys.executable on startup. NFC (#1412) 2024-06-25 13:03:25 -07:00
Sam Clegg
176dec4875 arm64-linux binaries are now available for all releases (#1369) 2024-04-10 16:32:54 -07:00
Sam Clegg
ccd111fb1f Prefer curl for downloading files over urllib (#1355)
This is especially important on macOS where `urllib` can fail to
verify certificates.

See https://stackoverflow.com/questions/40684543/how-to-make-python-use-ca-certificates-from-mac-os-truststore

Fixes: #1207, #85, #1356, #1357, #1358
2024-03-14 13:19:45 -07:00
Sam Clegg
5726cccef5 Remove JS_ENGINES and COMPILER_ENGINE from config file (#1354)
`COMPILER_ENGINE` was completely removed from emscripten in
https://github.com/emscripten-core/emscripten/pull/9469.

`JS_ENGINES` is only used/needed for testing and is no longer needed
as of https://github.com/emscripten-core/emscripten/pull/9542.
2024-03-13 17:54:26 -07:00
Sam Clegg
f2baa2f56a Only pass -DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON when building llvm. NFC (#1334) 2024-01-24 12:09:59 -08:00
Sam Clegg
8822664a14 Remove logic build building native asm.js optimizer. NFC (#1325)
We no longer support building fastcomp-based SDKs
2023-12-18 11:40:24 -08:00
Sam Clegg
cc1b3efbd3 Error on unknown arguments passed to --activate (#1313)
See #1312
2023-12-08 10:30:37 -08:00
Sam Clegg
ef77dcc2c0 Add suggestion to install using --permanent or --system on windows. NFC (#1308)
Fixes: #1307
2023-12-04 09:26:53 -08:00
Sam Clegg
8e82384f27 Update file extension used by create_release script (#1285)
This should have been part of #1235
2023-10-09 18:54:56 -07:00
Sam Clegg
d42c740aa5 Switch to .xz by default for SDK downloads (#1281)
This is a bit of a hack but I can't think of another way to do it.
Basically when downloading SDKs, we first try the new `.xz` extension.
If that fails, we fall back to the old `.tbz2`.  Both these first two
download attempts we run in "silent" mode.  If both of them fail we
re-run the original request in non-silent mode so that the error message
will always contain the original `.xz` extension.

See #1235
2023-09-21 15:16:34 -07:00
Sam Clegg
4f2db9682c Rename zipfile to archive or download as appropriate. NFC (#1257) 2023-07-10 14:04:24 -07:00
Alon Zakai
3bde060365 Fix a typo (#1251) 2023-06-27 16:51:34 -07:00
Sam Clegg
c88612d6d3 Fix activated_path_skip on repeated running of emsdk_env.sh (#1250)
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
2023-06-27 16:37:22 -07:00
Sam Clegg
098a3ffa2c Add a warning when trying to install linux-arm64 binaries (#1249)
See #547
2023-06-27 15:38:09 -07:00
Sam Clegg
1d59cd22bd Prefer arm64 over aarch64 internally. NFC (#1246)
This seems like more commonly known/used name for the architecture
these days.
2023-06-27 13:46:33 -07:00
Sam Clegg
c04b1bbb3a Only add node/bin to user's PATH if one is not already found (#1189)
If the user already has a version of node in their PATH don't clobber
it.  This doesn't effect emscripten since the version of node we use
there is controlled via the config file, not via PATH.

Part of fix for #705.
2023-03-03 07:37:33 -08:00
Radek Bartoň
90b4a16f05 Remove unused build_target_platform parameter from make_build (#1187) 2023-02-16 09:49:40 -08:00
Radek Bartoň
7bcf1449c0 Add Windows Arm64 support for compiling from source (#1186) 2023-02-15 13:10:41 -08:00
Sam Clegg
6305e91dee Improve ordering in emsdk list (#1180)
We have an existing `version_key` helper function for sorting versions.

It also does a better job, producing output like:

```
All recent (non-legacy) installable versions are:
         3.1.31
         3.1.31-asserts
         3.1.30
         3.1.30-asserts
         3.1.29
         3.1.29-asserts
```

Rather than:

```
All recent (non-legacy) installable versions are:
         3.1.31
         3.1.30
         3.1.29
         3.1.28
         3.1.27
```

(with -assert versions listed after 3.1.0)
2023-01-30 15:46:18 -08:00
juj
c678733d9e Remove support for building with Visual Studio 2017. Since Jan 29, 2022, upstream LLVM has required VS2019 or VS2022 to build. So it has not been possible to build emsdk from source with VS2017 for a year. 058c5dfc78 (#1178) 2023-01-30 17:46:04 +02:00
juj
592b7b74e4 Fix args ordering in LLVM build from previous commit (#1179) 2023-01-28 15:58:49 +02:00
juj
fa5f5f374f Add support for Visual Studio 2022 (#1177)
* Add support for Visual Studio 2022 and migrate to using cmake --build when building on Windows. Leverage the VS2019 MSBuild 'Multi-ToolTask' feature CL_MPCount to saturate project builds properly to 100% CPU usage so building LLVM builds different cpp files in parallel. Clean up some code duplication around Visual Studio support.

* flake

* Work around Linux bot not having 'cmake --build . -j' flag.
2023-01-28 13:08:17 +02:00
Sam Clegg
ae2664b48f Remove uneeded str. NFC (#1170)
These function already returns a string.
2023-01-13 20:14:55 -08:00
Sam Clegg
1eaaa4c5b4 Remove -upstream component of SDK names (#1166)
This name existed to distinguish the SDK from fastcomp, but as of #1165,
we no longer support fastcomp.
2023-01-13 20:11:55 -08:00
Sam Clegg
f3bb209b86 Remove fastcomp SDK and fastcomp build rules. NFC (#1165)
Folks that want to work with fastcomp will now need to use an older
checkout of emsdk.
2023-01-09 04:53:13 -08:00
Sam Clegg
58904e9b74 Remove reference to fastcomp-latest. NFC (#1164)
fastcomp can only be install using explicit versions names so this name
doesn't work.
2023-01-05 09:17:17 -08:00
Sam Clegg
32fba7b7c4 Use constants for fixed paths. NFC (#1140) 2022-11-30 16:32:26 -08:00
Pierrick Bouvier
35358657b4 Use x64 version for Windows on Arm (#1115) 2022-10-08 17:17:19 -07:00
Sam Clegg
3d87d5ea81 Avoid exporting EM_CONFIG for modern SDK versions (#1110)
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
```
2022-10-06 14:13:13 -07:00
Sam Clegg
e456ebdd52 Add EMSDK_QUIET to make emsdk_env less chatting (#1091)
Without this the recommended way to silence emsdk_env was to pipe its
stderr to /dev/null.. but then you also loose potentially useful error
message.

Fixes: #946
2022-08-19 12:13:03 -07:00
Tim Ebbeke
5ad3ff05a7 Exclude msys from path fix function. (#1078)
Fixes: #911
2022-07-23 21:31:41 -07:00
Sam Clegg
b0a51b36ee Pin latest to a specific version for arm64-linux (#1065)
Fixes: #1040
2022-07-01 15:26:24 -07:00
juj
7978a62f2b Pass -DENABLE_WERROR=0 when building Binaryen (#1028)
* Pass -DENABLE_WERROR=0 when building Binaryen

We are experiencing an issue at our Unity CI with building Binaryen: https://github.com/WebAssembly/binaryen/issues/4588

It seems that for end users, disabling -Werror is a good general measure to enable wider chance of success to build. Emsdk installations are unlikely to be used by Binaryen developers to iterate on Binaryen development, so it is not necessary there?

* Flake
2022-04-13 19:48:00 +03:00
juj
c2147f3b87 Enable building LLVM with about-to-be deprecated toolchains (#1029)
* Enable building LLVM with about-to-be deprecated toolchains for best chance of succeeding with the build.

* Shorten line length

* Adjust to 80 columns
2022-04-13 19:44:14 +03:00