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

--skip-npm flag to Skip putting emsdk's npm on PATH #1141

Open
wants to merge 67 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
156dccb
skip-npm
shlomif May 18, 2022
9cc8ed7
cleanup
shlomif May 18, 2022
787da0b
Refactoring / code cleanup.
shlomif May 19, 2022
e6d333b
Rename to skip_node and cleanup.
shlomif Dec 2, 2022
bac1329
refactor
shlomif Dec 23, 2022
65bc87d
Add standalone_wasm feature to bazel emscripten_toolchain (#1145)
robbertvanginkel Dec 6, 2022
7d76e9e
3.1.28 (#1149)
sbc100 Dec 9, 2022
0d1238e
Upgrade to rules_nodejs 5.8.0 (#1150)
jfirebaugh Dec 20, 2022
f999f4d
3.1.29 (#1160)
sbc100 Jan 3, 2023
f3bc9f2
Pin Windows CI to Bazel 5.4.0 (#1163)
jfirebaugh Jan 4, 2023
346e233
Remove reference to fastcomp-latest. NFC (#1164)
sbc100 Jan 5, 2023
c299f67
Remove fastcomp SDK and fastcomp build rules. NFC (#1165)
sbc100 Jan 9, 2023
c25efd6
3.1.30 (#1167)
dschuff Jan 12, 2023
5991457
Remove `-upstream` component of SDK names (#1166)
sbc100 Jan 14, 2023
8c09461
Remove uneeded str. NFC (#1170)
sbc100 Jan 14, 2023
ba3a3c8
Update README.md after #1166. NFC (#1172)
sbc100 Jan 17, 2023
3009923
3.1.31 (#1176)
sbc100 Jan 27, 2023
0a03e63
Add support for Visual Studio 2022 (#1177)
juj Jan 28, 2023
22f2521
Fix args ordering in LLVM build from previous commit (#1179)
juj Jan 28, 2023
f90d188
Remove support for building with Visual Studio 2017. Since Jan 29, 20…
juj Jan 30, 2023
72bca9f
Improve ordering in `emsdk list` (#1180)
sbc100 Jan 30, 2023
c98ba98
Add Windows Arm64 support for compiling from source (#1186)
Blackhex Feb 15, 2023
7c66ba7
Remove unused build_target_platform parameter from make_build (#1187)
Blackhex Feb 16, 2023
31c28db
3.1.32 (#1188)
sbc100 Feb 18, 2023
09992a5
Update some stale information in README.md (#1190)
sbc100 Feb 24, 2023
7a71a71
Add missing binaries for bazel (#1082)
kon72 Feb 25, 2023
ee175ad
Only add node/bin to user's PATH if one is not already found (#1189)
sbc100 Mar 3, 2023
adc2846
3.1.33 (#1200)
tlively Mar 9, 2023
6b248a3
v3.1.34 (#1203)
sbc100 Mar 15, 2023
97ffba1
Update arm64 linux release (#1204)
sbc100 Mar 15, 2023
acd8abd
Add linux/arm64 support to bazel rules (#1156)
robbertvanginkel Mar 30, 2023
1507c59
3.1.35 (#1208)
dschuff Apr 4, 2023
1f284ad
Add `activated_path_skip` to node v14.18.2 packages (#1209)
sbc100 Apr 10, 2023
1cadcc8
Update node version 14.15.5 -> 15.14.0 (#829)
sbc100 Apr 11, 2023
1147c9d
3.1.36 (#1210)
sbc100 Apr 17, 2023
1355cd7
3.1.37 (#1212)
sbc100 Apr 26, 2023
19c2dd7
3.1.38 (#1215)
sbc100 May 10, 2023
7500b15
3.1.39 (#1217)
dschuff May 19, 2023
bda6e3d
3.1.40 (#1221)
dschuff May 31, 2023
b5fb454
Update mac builders to use Circle's gen2 mac runner (#1222)
dschuff May 31, 2023
d59bea6
Add security policy (#1224)
pnacht May 31, 2023
41a6db6
Docker: remove remnant of fastcomp (#1226)
kleisauke Jun 1, 2023
e2f87da
Docker: remove redundant `EMSDK_NODE` env (#1225)
kleisauke Jun 1, 2023
fcbbb5c
3.1.41 (#1230)
sbc100 Jun 6, 2023
d094326
Update node, 15.14.0 -> 16.20.0 (#1232)
dschuff Jun 20, 2023
5690fde
3.1.42 (#1238)
sbc100 Jun 23, 2023
6fb20c4
Prefer `arm64` over `aarch64` internally. NFC (#1246)
sbc100 Jun 27, 2023
6dbcaff
Add some basic testing of arm64 linux (#1247)
sbc100 Jun 27, 2023
ab10d25
Add a warning when trying to install linux-arm64 binaries (#1249)
sbc100 Jun 27, 2023
dbaed53
Fix `activated_path_skip` on repeated running of `emsdk_env.sh` (#1250)
sbc100 Jun 27, 2023
2933da6
Fix a typo (#1251)
kripken Jun 27, 2023
42b482c
Docker: use a entrypoint script (#1227)
kleisauke Jul 6, 2023
a971fe4
3.1.43 (#1254)
sbc100 Jul 10, 2023
a2ca455
Have create_release.py push the new branch automatically (#1255)
sbc100 Jul 10, 2023
c3870d4
Update linux arm64 to 3.1.41 (#1256)
sbc100 Jul 10, 2023
8c1d600
Rename `zipfile` to `archive` or `download` as appropriate. NFC (#1257)
sbc100 Jul 10, 2023
a760086
Update linux arm64 to 3.1.43 (#1258)
sbc100 Jul 11, 2023
b25d87e
3.1.44 (#1260)
sbc100 Jul 25, 2023
c5e02fa
wasm_cc_binary: Specify a default OS. Allow users to override platfor…
martijneken Jul 28, 2023
d27c69b
Add starlark highlighting to Bazel readme (#1264)
mattsoulanille Aug 8, 2023
d021b3d
3.1.45 (#1269)
dschuff Aug 23, 2023
dd94117
Update linux arm64 build. NFC (#1270)
sbc100 Aug 23, 2023
b3b0121
Fix the format of the .flake8 file, and exclude the script directory …
dschuff Aug 24, 2023
16d3178
Replace update_bazel_workspace.sh with a python script (#1271)
dschuff Aug 24, 2023
0b10952
[bazel] populate all_files (#1274)
walkingeyerobot Aug 29, 2023
f9f0ba3
3.1.46 (#1279)
sbc100 Sep 15, 2023
1285434
Switch to .xz by default for SDK downloads (#1281)
sbc100 Sep 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 66 additions & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,46 @@ executors:
bionic:
docker:
- image: buildpack-deps:bionic
mac:
environment:
EMSDK_NOTTY: "1"
# Without this, any `brew install` command will result in self-update of
# brew itself which takes more than 4 minutes.
HOMEBREW_NO_AUTO_UPDATE: "1"
macos:
xcode: "12.5.1"
resource_class: macos.x86.medium.gen2
mac_arm64:
environment:
EMSDK_NOTTY: "1"
# Without this, any `brew install` command will result in self-update of
# brew itself which takes more than 4 minutes.
HOMEBREW_NO_AUTO_UPDATE: "1"
macos:
xcode: "13.4.1"
resource_class: macos.m1.medium.gen1
linux_arm64:
machine:
image: ubuntu-2004:202101-01
resource_class: arm.medium

commands:
setup-macos:
steps:
- checkout
- run:
name: Install CMake
command: brew install cmake
test-macos:
steps:
- run:
name: test.sh
command: test/test.sh
- run:
name: test.py
command: |
source emsdk_env.sh
test/test.py

jobs:
flake8:
Expand All @@ -20,9 +60,9 @@ jobs:
apt-get install -q -y python-pip python3-pip
- run: python2 -m pip install --upgrade pip
- run: python3 -m pip install --upgrade pip
- run: python2 -m pip install flake8==3.7.8
- run: python3 -m pip install flake8==3.7.8
- run: python2 -m flake8 --show-source --statistics
- run: python2 -m pip install flake8==3.9.2
- run: python3 -m pip install flake8==3.9.2
- run: python2 -m flake8 --show-source --statistics --extend-exclude=./scripts
- run: python3 -m flake8 --show-source --statistics
test-linux:
executor: bionic
Expand All @@ -40,32 +80,32 @@ jobs:
- run:
name: Install debian packages
command: apt-get update -q && apt-get install -q -y cmake build-essential openjdk-8-jre-headless ksh zsh
- run: test/test_node_path.sh
- run: test/test.sh
- run: test/test_source_env.sh
- run:
name: test.py
command: |
source emsdk_env.sh
test/test.py
test-mac:
macos:
xcode: "12.5.1"
environment:
EMSDK_NOTTY: "1"
# Without this, any `brew installl` command will result in self-update of
# brew itself which takes more than 4 minutes.
HOMEBREW_NO_AUTO_UPDATE: "1"
test-linux-arm64:
executor: linux_arm64
steps:
- checkout
- run:
name: Install cmake
command: brew install cmake
name: Install debian packages
command: sudo apt-get update -q && sudo apt-get install -q cmake build-essential openjdk-8-jre-headless
- run: test/test.sh
- run:
name: test.py
command: |
source emsdk_env.sh
test/test.py
test-mac:
executor: mac
steps:
- setup-macos
- test-macos
test-mac-arm64:
executor: mac_arm64
steps:
- setup-macos
- test-macos
test-windows:
executor:
name: win/vs2019
Expand Down Expand Up @@ -190,11 +230,7 @@ jobs:
- run: test/test_bazel.sh

test-bazel-mac:
macos:
xcode: "12.5.1"
environment:
EMSDK_NOTTY: "1"
HOMEBREW_NO_AUTO_UPDATE: "1"
executor: mac
steps:
- checkout
- run: brew install grep
Expand All @@ -211,6 +247,7 @@ jobs:
environment:
PYTHONUNBUFFERED: "1"
EMSDK_NOTTY: "1"
USE_BAZEL_VERSION: "5.4.0"
steps:
- checkout
- run:
Expand All @@ -233,9 +270,15 @@ workflows:
test-linux:
jobs:
- test-linux
test-linux-arm64:
jobs:
- test-linux-arm64
test-mac:
jobs:
- test-mac
test-mac-arm64:
jobs:
- test-mac-arm64
test-windows:
jobs:
- test-windows
Expand Down
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Ignore everything
*

# Allow to run the test script inside the Docker container
# Allow the entrypoint/test script inside the Docker container
!/docker/entrypoint.sh
!/docker/test_dockerimage.sh

# Allow license file
Expand Down
31 changes: 16 additions & 15 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@ ignore =
E501, # Line too long
E121, # Continuation line under-indented for hanging indent
E722 # bare excepts
E741, # Variable names such as 'l', 'O', or 'I'
exclude =
./llvm
./gnu
./upstream
./fastcomp
./fastcomp-clang
./releases
./clang
./emscripten
./binaryen
./git
./node
./python
./temp
./zips
./crunch
./llvm,
./gnu,
./upstream,
./fastcomp,
./fastcomp-clang,
./releases,
./clang,
./emscripten,
./binaryen,
./git,
./node,
./python,
./temp,
./downloads,
./crunch,
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ __pycache__
/node
/python
/temp
/zips
/downloads
/crunch
/java
/mingw
Expand Down
42 changes: 14 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,14 @@ important concepts to help understanding the internals of the SDK:
* **SDK**: A set of tools. For example, 'sdk-1.5.6-32bit' is an SDK consisting
of the tools `clang-3.2-32bit`, `node-0.10.17-32bit`, `python-2.7.5.1-32bit`
and `emscripten-1.5.6`.
* **Active Tool/SDK**: Emscripten stores compiler configuration in a
user-specific file **~/.emscripten**. This file points to paths for
Emscripten, Python, Clang and so on. If the file ~/.emscripten is configured
to point to a Tool in a specific directory, then that tool is denoted as being
**active**. The Emscripten Command Prompt always gives access to the currently
active Tools. This mechanism allows switching between different installed SDK
versions easily.
* **Active Tool/SDK**: Emscripten SDK stores compiler configuration in a file
called `.emscripten` within the emsdk directory. This file points to paths
for Emscripten, Python, Clang and so on. If the configuration file points to a
Tool in a specific directory, then that tool is denoted as being
**active**. This mechanism allows switching between different installed
tools and SDKs.
* **emsdk**: This is the name of the manager script that Emscripten SDK is
accessed through. Most operations are of the form `emsdk command`. To access
the emsdk script, launch the Emscripten Command Prompt.
accessed through. Most operations are of the form `emsdk <command>`.

## System Requirements

Expand Down Expand Up @@ -136,11 +134,11 @@ using git, and compile the package on demand.
When you run `emsdk list`, it will group the Tools and SDKs under these two
categories.

To obtain and build latest upstream wasm SDK from source, run
To obtain and build latest wasm SDK from source, run

```
emsdk install sdk-upstream-main-64bit
emsdk activate sdk-upstream-main-64bit
emsdk install sdk-main-64bit
emsdk activate sdk-main-64bit
```

You can use this target for example to bootstrap developing patches to LLVM,
Expand All @@ -156,7 +154,7 @@ https://emscripten.org/docs/contributing/developers_guide.html?highlight=develop
### When working on git branches compiled from source, how do I update to a newer compiler version?

Unlike tags and precompiled versions, a few of the SDK packages are based on
"moving" git branches and compiled from source (e.g. sdk-upstream-main,
"moving" git branches and compiled from source (e.g. sdk-main,
sdk-main, emscripten-main, binaryen-main). Because of that, the
compiled versions will eventually go out of date as new commits are introduced
to the development branches. To update an old compiled installation of one of
Expand All @@ -179,30 +177,18 @@ activate <tool/sdk name>`. Activating a tool will set up `~/.emscripten` to
point to that particular tool. On Windows, you can pass the option `--permanent` to
the `activate` command to register the environment permanently for the current user. Use `--system` to do this for all users.

### How do I build multiple projects with different SDK versions in parallel?

By default, Emscripten locates all configuration files in the home directory of
the user. This may be a problem if you need to simultaneously build with
multiple Emscripten compiler versions, since the user home directory can only be
configured to point to one compiler at a time. This can be overcome by
specifying the '--embedded' option as a parameter to 'emsdk activate', which
will signal emsdk to generate the compiler configuration files inside the emsdk
root directory instead of the user home directory. Use this option also when it
is desirable to run emsdk in a fully portable mode that does not touch any files
outside the emsdk directory.

### How do I track the latest Emscripten development with the SDK?

A common and supported use case of the Emscripten SDK is to enable the workflow
where you directly interact with the github repositories. This allows you to
obtain new features and latest fixes immediately as they are pushed to the
github repository, without having to wait for release to be tagged. You do not
need a github account or a fork of Emscripten to do this. To switch to using the
latest upstream git development branch `main`, run the following:
latest git development branch `main`, run the following:

emsdk install git-1.9.4 # Install git. Skip if the system already has it.
emsdk install sdk-upstream-main-64bit # Clone+pull the latest emscripten-core/emscripten/main.
emsdk activate sdk-upstream-main-64bit # Set the main SDK as the currently active one.
emsdk install sdk-main-64bit # Clone+pull the latest emscripten-core/emscripten/main.
emsdk activate sdk-main-64bit # Set the main SDK as the currently active one.

### How do I use my own Emscripten github fork with the SDK?

Expand Down
16 changes: 16 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Security Policy

If you have discovered a security vulnerability in this project, please report it
privately. **Do not disclose it as a public issue.** This gives us time to work with you
to fix the issue before public exposure, reducing the chance that the exploit will be
used before a patch is released.

Please submit the report as a [security bug on the Chromium tracker](https://bugs.chromium.org/p/chromium/issues/entry?template=Security%20Bug).

Please provide the following information in your report:

- A description of the vulnerability and its impact
- How to reproduce the issue
- Make it clear that it's an Emscripten SDK bug.

We ask that you give us 90 days to work on a fix before public exposure.
19 changes: 19 additions & 0 deletions bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ config_setting(
],
)

config_setting(
name = "linux_arm64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:arm64",
],
)

config_setting(
name = "macos",
constraint_values = [
Expand Down Expand Up @@ -38,6 +46,7 @@ alias(
name = "compiler_files",
actual = select({
":linux": "@emscripten_bin_linux//:compiler_files",
":linux_arm64": "@emscripten_bin_linux_arm64//:compiler_files",
":macos": "@emscripten_bin_mac//:compiler_files",
":macos_arm64": "@emscripten_bin_mac_arm64//:compiler_files",
":windows": "@emscripten_bin_win//:compiler_files",
Expand All @@ -49,6 +58,7 @@ alias(
name = "linker_files",
actual = select({
":linux": "@emscripten_bin_linux//:linker_files",
":linux_arm64": "@emscripten_bin_linux_arm64//:linker_files",
":macos": "@emscripten_bin_mac//:linker_files",
":macos_arm64": "@emscripten_bin_mac_arm64//:linker_files",
":windows": "@emscripten_bin_win//:linker_files",
Expand All @@ -60,6 +70,7 @@ alias(
name = "ar_files",
actual = select({
":linux": "@emscripten_bin_linux//:ar_files",
":linux_arm64": "@emscripten_bin_linux_arm64//:ar_files",
":macos": "@emscripten_bin_mac//:ar_files",
":macos_arm64": "@emscripten_bin_mac_arm64//:ar_files",
":windows": "@emscripten_bin_win//:ar_files",
Expand All @@ -73,3 +84,11 @@ platform(
"@platforms//cpu:wasm32",
],
)

platform(
name = "platform_wasi",
constraint_values = [
"@platforms//cpu:wasm32",
"@platforms//os:wasi",
],
)
4 changes: 2 additions & 2 deletions bazel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Setup Instructions

In `WORKSPACE` file, put:
```
```starlark
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "emsdk",
Expand Down Expand Up @@ -37,7 +37,7 @@ build --incompatible_enable_cc_toolchain_resolution

Then write a new rule wrapping your `cc_binary`.

```
```starlark
load("@rules_cc//cc:defs.bzl", "cc_binary")
load("@emsdk//emscripten_toolchain:wasm_rules.bzl", "wasm_cc_binary")

Expand Down
Loading