Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update emsdk #3

Open
wants to merge 68 commits into
base: main
Choose a base branch
from

Conversation

spanferov-figma
Copy link

@spanferov-figma spanferov-figma commented Jul 19, 2024

This PR contains patches ported to the never version of the EMSDK with some additional fixes to support older versions

sbc100 and others added 30 commits July 25, 2023 07:50
…m. (emscripten-core#1262)

* wasm_cc_binary: Specify a default OS. Allow users to override platform.

Problem: proxy-wasm/proxy-wasm-cpp-sdk#157 (comment)

This is solving the problem in two different ways. Please let me know
your thoughts about both approaches, as either will work.

Signed-off-by: Martijn Stevenson <[email protected]>

* Rework platform selection to trigger os:wasi off standalone attr

Signed-off-by: Martijn Stevenson <[email protected]>

---------

Signed-off-by: Martijn Stevenson <[email protected]>
Mark the build files as using the starlark language so they have the correct syntax highlighting.
Also update emscripten include dir to v18, and change 17 to wildcard in emscripten deps
…from the py2 linter (emscripten-core#1272)

Flake8's INI config file format requires commas after each line. Because our file didn't have them, the exclude list
wasn't set up correctly, and the --extend-exclude flag wasn't working. This PR fixes the .flake8 file.

Also, update flake8 to the latest version available (because version 3.8 is required to get the --extend-exclude flag)
and use the flag to exclude the files in the scripts/ directory from the python2 linter (since the scripts are python3).
…re#1271)

This script is (IMO) more readable, but the real reason for this change is that
it raises an error message when the binary package fails to download. (The shell
script silently generated a bogus hash instead, because the shell's `set -e`
builtin does not affect commands executing inside a $() context.
It seemed just as easy to rewrite the script in Python as to fix that.

This change also updates some outdated filename references.
Fixes emscripten-core#1273. This was broken by emscripten-core#1045 with the comment "* all_files not needed?" They were needed.
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 emscripten-core#1235
Having an :all target is the most future-proof way here.

Closes emscripten-core#1294.
…ed (emscripten-core#1231)

Add job to conditionally build arm64 images when emscripten-releases-tags.json updated
sbc100 and others added 30 commits April 10, 2024 10:11
* fixes issues on windows when dealing with many dependencies causing a
  'command line too long' error
Usage would be something like:
```
filegroup(
    name = "hello-world-tarball",
    srcs = [":hello-world-wasm"],
    output_group = "_wasm_tar",
)
```
# Why
On one hand Ubuntu18's free LTS cycle is ended, and on the other hand Ubuntu18 does not support nodejs greater than v18.
# What's changed.
1. update the Linux Docker image to buildpack-deps:focal
2. some compatibility changes
3. use the new recommended way to install Docker ([see here](https://docs.docker.com/engine/install/ubuntu/))

See emscripten-core#1173
Node v18 is that current LTS release of node and v18.20.3 is the latest
release of v18.

This change means that emsdk is no longer installable on Ubuntu/Bionic
18.04, and we now require Ubuntu/Focal 20.04.

See: emscripten-core#1183
Fixes: emscripten-core#1173
…-core#1404)

* Allows generation of audio worklet bootstrap js file

In order to allow users to generate the file, the allowed extension list in `link_wrapper.py` has been updated accordingly.

* adds audio worklet js to wasm_cc_binary too

---------

Co-authored-by: William Izzo <[email protected]>
This removes `-Werror` set by default, thus conforming with default
bazel cc toolchain.

Co-authored-by: William Izzo <[email protected]>
Also switch bazel-mac to the arm64 config.
The CircleCI Intel mac config will be turned down soon.
Also move some code outside of the `using` block.
…ripten-core#1419)

On a Linux distro that doesn't have the `which` program installed we're
getting the following error:

    $ ./emsdk install latest
    ./emsdk: line 39: exec: python: not found

It's failing to detect the installed `python3` and falls back to using
`python`, but this distro doesn't provide a python -> python3 symlink so
we fail.

Fix this by using `command -v` instead which is a POSIX standard.
The same change went into emscripten a couple years ago:
emscripten-core/emscripten#15071
This is a working solution for generating a separate Emscripten cache.
Note that this requires an additional entry in the workspace as follows:
```starlark
load("@emsdk//:emscripten_cache.bzl", emsdk_emscripten_cache = "emscripten_cache")
emsdk_emscripten_cache()
```
When used like this, the default Emscripten cache will be used. However,
if the entry is as follows:
```starlark
load("@emsdk//:emscripten_cache.bzl", emsdk_emscripten_cache = "emscripten_cache")
emsdk_emscripten_cache(flags = ["--lto"])
```
Then embuilder will be called to build all system libraries and ports
(i.e., the `ALL` option to embuilder) with the LTO option enabled. This
can take awhile, so I have also made possible to specify which libraries
you want to build explicitly:
```starlark
load("@emsdk//:emscripten_cache.bzl", emsdk_emscripten_cache = "emscripten_cache")
emsdk_emscripten_cache(
    flags = ["--lto"],
    libraries = [
        "crtbegin",
        "libprintf_long_double-debug",
        "libstubs-debug",
        "libnoexit",
        "libc-debug",
        "libdlmalloc",
        "libcompiler_rt",
        "libc++-noexcept",
        "libc++abi-debug-noexcept",
        "libsockets"
    ]
)
```

Resolves emscripten-core#807, resolves emscripten-core#971, resolves emscripten-core#1099, resolves emscripten-core#1362, resolves
emscripten-core#1401
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.