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

Rename upstream directory to simply prebuilt #1171

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 1 addition & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ ignore =
exclude =
./llvm
./gnu
./upstream
./fastcomp
./prebuilt
./fastcomp-clang
./releases
./clang
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ __pycache__
# File that get download/extracted by emsdk itself
/ccache
/gnu
/upstream
/fastcomp
/fastcomp-clang/
/prebuilt
/llvm
/ninja
/releases
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,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 +156,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 Down Expand Up @@ -198,11 +198,11 @@ 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: 8 additions & 8 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ RUN echo "## Install Emscripten" \
RUN cd ${EMSDK} \
&& echo "## Generate standard configuration" \
&& ./emsdk activate ${EMSCRIPTEN_VERSION} \
&& chmod 777 ${EMSDK}/upstream/emscripten \
&& chmod -R 777 ${EMSDK}/upstream/emscripten/cache \
&& chmod 777 ${EMSDK}/prebuilt/emscripten \
&& chmod -R 777 ${EMSDK}/prebuilt/emscripten/cache \
&& echo "int main() { return 0; }" > hello.c \
&& ${EMSDK}/upstream/emscripten/emcc -c hello.c \
&& cat ${EMSDK}/upstream/emscripten/cache/sanity.txt \
&& ${EMSDK}/prebuilt/emscripten/emcc -c hello.c \
&& cat ${EMSDK}/prebuilt/emscripten/cache/sanity.txt \
&& echo "## Done"

# Cleanup Emscripten installation and strip some symbols
Expand All @@ -45,11 +45,11 @@ RUN echo "## Aggressive optimization: Remove debug symbols" \
# Remove debugging symbols from embedded node (extra 7MB)
&& strip -s `which node` \
# Tests consume ~80MB disc space
&& rm -fr ${EMSDK}/upstream/emscripten/tests \
&& rm -fr ${EMSDK}/prebuilt/emscripten/tests \
# Fastcomp is not supported
&& rm -fr ${EMSDK}/upstream/fastcomp \
&& rm -fr ${EMSDK}/prebuilt/fastcomp \
# strip out symbols from clang (~extra 50MB disc space)
&& find ${EMSDK}/upstream/bin -type f -exec strip -s {} + || true \
&& find ${EMSDK}/prebuilt/bin -type f -exec strip -s {} + || true \
&& echo "## Done"

# ------------------------------------------------------------------------------
Expand All @@ -65,7 +65,7 @@ COPY --from=stage_build /emsdk /emsdk
# (sub-stages) or with custom / no entrypoint
ENV EMSDK=/emsdk \
EMSDK_NODE=/emsdk/node/14.18.2_64bit/bin/node \
PATH="/emsdk:/emsdk/upstream/emscripten:/emsdk/upstream/bin:/emsdk/node/14.18.2_64bit/bin:${PATH}"
PATH="/emsdk:/emsdk/prebuilt/emscripten:/emsdk/prebuilt/bin:/emsdk/node/14.18.2_64bit/bin:${PATH}"

# ------------------------------------------------------------------------------
# Create a 'standard` 1000:1000 user
Expand Down
8 changes: 4 additions & 4 deletions emsdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -1919,9 +1919,9 @@ def install_sdk(self):
return False

if getattr(self, 'custom_install_script', None) == 'emscripten_npm_install':
# upstream tools have hardcoded paths that are not stored in emsdk_manifest.json registry
install_path = 'upstream'
emscripten_dir = os.path.join(EMSDK_PATH, install_path, 'emscripten')
# prebuilt sdk tools have hardcoded paths that are not stored in
# emsdk_manifest.json registry
emscripten_dir = os.path.join(EMSDK_PATH, 'prebuilt', 'emscripten')
# Older versions of the sdk did not include the node_modules directory
# and require `npm ci` to be run post-install
if not os.path.exists(os.path.join(emscripten_dir, 'node_modules')):
Expand Down Expand Up @@ -2244,7 +2244,7 @@ def load_releases_info():


def get_installed_sdk_version():
version_file = sdk_path(os.path.join('upstream', '.emsdk_version'))
version_file = sdk_path(os.path.join('prebuilt', '.emsdk_version'))
if not os.path.exists(version_file):
return None
with open(version_file) as f:
Expand Down
4 changes: 2 additions & 2 deletions emsdk_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"macos_url": "https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/%releases-tag%/wasm-binaries.tbz2",
"windows_url": "https://storage.googleapis.com/webassembly/emscripten-releases-builds/win/%releases-tag%/wasm-binaries.zip",
"zipfile_prefix": "%releases-tag%-",
"install_path": "upstream",
"install_path": "prebuilt",
"activated_path": "%installation_dir%/emscripten",
"activated_cfg": "LLVM_ROOT='%installation_dir%/bin';BINARYEN_ROOT='%installation_dir%';EMSCRIPTEN_ROOT='%installation_dir%/emscripten'",
"emscripten_releases_hash": "%releases-tag%"
Expand All @@ -51,7 +51,7 @@
"macos_url": "https://storage.googleapis.com/webassembly/emscripten-releases-builds/mac/%releases-tag%/wasm-binaries-arm64.tbz2",
"linux_url": "https://storage.googleapis.com/webassembly/emscripten-releases-builds/linux/%releases-tag%/wasm-binaries-arm64.tbz2",
"zipfile_prefix": "%releases-tag%-",
"install_path": "upstream",
"install_path": "prebuilt",
"activated_path": "%installation_dir%/emscripten",
"activated_cfg": "LLVM_ROOT='%installation_dir%/bin';BINARYEN_ROOT='%installation_dir%';EMSCRIPTEN_ROOT='%installation_dir%/emscripten'",
"emscripten_releases_hash": "%releases-tag%"
Expand Down
4 changes: 2 additions & 2 deletions test/test_activation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ try {
throw "$repo_root\\node is not added to path."
}

$EMSDK_UPSTREAM_Path = $path_split | Where-Object { $_ -like "$repo_root\upstream\emscripten*" }
$EMSDK_UPSTREAM_Path = $path_split | Where-Object { $_ -like "$repo_root\prebuilt\emscripten*" }
if (!$EMSDK_UPSTREAM_Path) {
throw "$repo_root\\upstream\emscripten is not added to path."
throw "$repo_root\\prebuilt\emscripten is not added to path."
}


Expand Down
4 changes: 2 additions & 2 deletions test/test_path_preservation.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ try {
$EMSDK_NODE_Path = $path_arr | Where-Object { $_ -like "$repo_root\node*" }
$EMSDK_PYTHON_Path = $path_arr | Where-Object { $_ -like "$repo_root\python*" }
$EMSDK_JAVA_Path = $path_arr | Where-Object { $_ -like "$repo_root\java*" }
$EMSDK_UPSTREAM_Path = $path_arr | Where-Object { $_ -like "$repo_root\upstream\emscripten*" }
$EMSDK_UPSTREAM_Path = $path_arr | Where-Object { $_ -like "$repo_root\prebuilt\emscripten*" }

$number_of_items = $path_arr.count
[System.Collections.ArrayList]$rest_of_path = @()
Expand All @@ -52,7 +52,7 @@ try {
($item -like "$repo_root\node*") -or
($item -like "$repo_root\python*") -or
($item -like "$repo_root\java*") -or
($item -like "$repo_root\upstream\emscripten*")
($item -like "$repo_root\prebuilt\emscripten*")
) {
echo "$item is on the PATH"
}
Expand Down