Skip to content

Commit

Permalink
Merge branch 'main' into inline-test
Browse files Browse the repository at this point in the history
  • Loading branch information
hedwigz committed Dec 21, 2024
2 parents 97dff88 + dc2b1c2 commit 26cbc57
Show file tree
Hide file tree
Showing 438 changed files with 3,914 additions and 3,732 deletions.
8 changes: 5 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -419,12 +419,14 @@ jobs:
- run: make -C site text
- run: tools/maint/check_emcc_help_text.py
- run: make -C site html
flake8:
ruff:
executor: bionic
steps:
- checkout
- pip-install
- run: python3 -m flake8 --show-source --statistics
- run: ruff check
# TODO (cclauss): When ruff supports rule E303 without --preview, remove following line
- run: ruff check --preview --select=E303
mypy:
executor: bionic
steps:
Expand Down Expand Up @@ -970,7 +972,7 @@ jobs:
workflows:
build-test:
jobs:
- flake8
- ruff
- mypy
- eslint
- build-docs
Expand Down
7 changes: 0 additions & 7 deletions .coveragerc

This file was deleted.

19 changes: 0 additions & 19 deletions .flake8

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/archive.yml

This file was deleted.

86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI

on:
create:
tags:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
archive:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: make dist
run: |
make dist
version=`cat emscripten-version.txt | sed s/\"//g`
echo "VERSION=$version" >> $GITHUB_ENV
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: emscripten-${{ env.VERSION }}
path: emscripten-${{ env.VERSION }}.tar.bz2

check-expectations:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # We want access to other branches, specifically `main`
- name: pip install
run: |
which python3
python3 --version
python3 -m pip install -r requirements-dev.txt
- name: Install emsdk
run: |
EM_CONFIG=$HOME/emsdk/.emscripten
echo $EM_CONFIG
echo "EM_CONFIG=$EM_CONFIG" >> $GITHUB_ENV
curl -# -L -o ~/emsdk-main.tar.gz https://github.com/emscripten-core/emsdk/archive/main.tar.gz
tar -C ~ -xf ~/emsdk-main.tar.gz
mv ~/emsdk-main ~/emsdk
cd ~/emsdk
./emsdk install tot
./emsdk activate tot
echo "JS_ENGINES = [NODE_JS]" >> $EM_CONFIG
echo "final config:"
cat $EM_CONFIG
- name: Check test expectations on target branch
run: |
echo "Checking out ${{ github.base_ref }}"
git checkout ${{ github.base_ref }}
git rev-parse HEAD
# Hack to honor changes to rebaseline_tests.py in the current PR
git checkout - ./tools/maint/rebaseline_tests.py
./bootstrap
if ! ./tools/maint/rebaseline_tests.py --check-only; then
echo "Test expectations are out-of-date on the target branch."
echo "You can run './tools/maint/rebaseline_tests.py --new-branch'"
echo "and use it to create a seperate PR."
echo "-- This failure is only a warning and can be ignored"
exit 1
fi
- name: Check test expectations on PR branch
run: |
echo "Checking out ${{ github.ref }} (${{ github.sha }})"
# For some reason we cannot pass ${{ github.ref }} direclty to git
# since it doesn't recognise it.
git checkout ${{ github.sha }}
git rev-parse HEAD
./bootstrap
if ! ./tools/maint/rebaseline_tests.py --check-only --clear-cache; then
echo "Test expectations are out-of-date on the PR branch."
echo "You can run './tools/maint/rebaseline_tests.py' to"
echo "create a commit updating the expectations."
echo "Be sure to have `emsdk install tot` first."
echo "-- This failure is only a warning and can be ignored"
exit 1
fi
80 changes: 41 additions & 39 deletions .github/workflows/tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,44 @@ on:
type: string

jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
# Updates changelog and writes the release version into the environment
- name: Update Changelog
run: python3 tools/maint/create_release.py --action
- name: Create Changelog PR
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.EMSCRIPTEN_BOT_TOKEN }}
title: Mark ${{ env.RELEASE_VERSION }} as released
team-reviewers: release-reviewers
delete-branch: true
- name: Enable auto-merge
run: gh pr merge --squash --auto "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.EMSCRIPTEN_BOT_TOKEN }}
- name: Tag release sha
uses: actions/github-script@v7
with:
github-token: ${{ secrets.EMSCRIPTEN_BOT_TOKEN }}
script: |
const tag_sha = '${{ inputs.release-sha }}';
const release_version = '${{ env.RELEASE_VERSION }}';
console.log(`Version ${release_version} at SHA ${tag_sha}`);
const regex = /^[0-9]+.[0-9]+.[0-9]+$/;
const match = release_version.match(regex);
if (!match) {
throw new Error('Malformed release version');
}
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${release_version}`,
sha: tag_sha
});
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
# Updates changelog and writes the release version into the environment
- name: Update Changelog
run: python3 tools/maint/create_release.py --action
- name: Create Changelog PR
id: cpr
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.EMSCRIPTEN_BOT_TOKEN }}
title: Mark ${{ env.RELEASE_VERSION }} as released
body: Update changelog and emscripten-version.txt [ci skip]
team-reviewers: release-reviewers
delete-branch: true
- name: Enable auto-merge
run: gh pr merge --squash --auto "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.EMSCRIPTEN_BOT_TOKEN }}
- name: Tag release sha
uses: actions/github-script@v7
with:
github-token: ${{ secrets.EMSCRIPTEN_BOT_TOKEN }}
script: |
const tag_sha = '${{ inputs.release-sha }}';
const release_version = '${{ env.RELEASE_VERSION }}';
console.log(`Version ${release_version} at SHA ${tag_sha}`);
const regex = /^[0-9]+.[0-9]+.[0-9]+$/;
const match = release_version.match(regex);
if (!match) {
throw new Error('Malformed release version');
}
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/tags/${release_version}`,
sha: tag_sha
});
16 changes: 0 additions & 16 deletions .mypy.ini

This file was deleted.

52 changes: 49 additions & 3 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Note that version numbers do not necessarily reflect the amount of changes
between versions. A version number reflects a release that is known to pass all
tests, and versions may be tagged more or less frequently at different times.

Note that there is *no* ABI compatibility guarantee between versions - the ABI
nNote that there is *no* ABI compatibility guarantee between versions - the ABI
may change, so that we can keep improving and optimizing it. The compiler will
automatically invalidate system caches when the version number updates, so that
libc etc. are rebuilt for you. You should also rebuild object files and
Expand All @@ -18,12 +18,58 @@ to browse the changes between the tags.

See docs/process.md for more on how version tagging works.

3.1.74 (in development)
3.1.75 (in development)
-----------------------
- compiler-rt was updated to LLVM 19.1.4. (#22937)
- The Wasm nontrapping-fptoint feature has been enabled by default. clang will
generate nontrapping (saturating) float-to-int conversion instructions for
C typecasts. This should have no effect on programs that do not have
undefined behavior but if the casted floating-point value is outside the range
of the target integer type, the result will be a number of the max or min value
instead of a trap. This also results in a small code size improvement because
of details of the LLVM IR semantics. This feature can be disabled in clang with
the -mno-nontrapping-fptoint flag. (#23007)
- The `WASM_BIGINT` feature has been enabled by default. This has the effect that
Wasm i64 values are passed and returned between Wasm and JS as BigInt values
rather than being split by Binaryen into pairs of Numbers. (#22993)
- When using `-sMODULARIZE` we now assert if the factory function is called with
the JS `new` keyword. e.g. `a = new Module()` rather than `b = Module()`.
This paves the way for marking the function as `async` which does not allow
`new` to be used. This usage of `new` here was never documented and is
considered and antipattern. (#23210)
- `PATH.basename()` no longer calls `PATH.normalize()`, so that
`PATH.basename("a/.")` returns `"."` instead of `"a"` and
`PATH.basename("a/b/..")` returns `".."` instead of `"a"`. This is in line with
the behaviour of both node and coreutils, and is already the case when using
NODERAWFS". (#23180)
- The factory function exposed in `-sMODULARIZE` mode is now marked as `async`
when `WASM_ASYNC_COMPILATION` is enabled (the default). This allows us to use
`await` during module creation. One side effect of this is that code in
`--post-js` files will now be delayed until after module creation and after
`main` runs. This matches the existing behaviour when using sync instantation
(`-sWASM_ASYNC_COMPILATION=0`) but is an observable difference. (#23157)

3.1.74 - 12/14/24
-----------------
- The file system was updated to independently track atime, mtime and ctime
instead of using the same time for all three. (#22998)
- Emscripten-generated code will now use async/await internally when loading
the Wasm module. This will be lowered away by babel when targeting older
browsers. (#23068)
- Due to the discontinued support for invalid specializations of
`std::basic_string` (https://github.com/llvm/llvm-project/pull/72694), the
support for `std::basic_string<unsigned char>` was removed from embind.
(#23070)
- The minimum supported versions of browser engines that we support were updated
to versions that support Promise, Fetch and Object.asign APIs, allowing the
polyfills for these to be removed. Chrome 32 -> 45, Firefox 34 -> 40, Safari
9.0 -> 10.1. These browser engines version are all over 8 years old now.
(#23077, #23118)

3.1.73 - 11/28/24
-----------------
- libunwind was updated to LLVM 19.1.4. (#22394)
- libunwind was updated to LLVM 19.1.4. (#22934)
- mimalloc was updated to 2.1.7. (#21548)

3.1.72 - 11/19/24
-----------------
Expand Down
5 changes: 1 addition & 4 deletions docs/emcc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Options that are modified or new in *emcc* are listed below:
"--closure 0|1|2"
[link] Runs the *Closure Compiler*. Possible values are:

* "0": No closure compiler (default in "-O2" and below).
* "0": No closure compiler (default).

* "1": Run closure compiler. This greatly reduces the size of
the support JavaScript code (everything but the WebAssembly or
Expand All @@ -277,9 +277,6 @@ Options that are modified or new in *emcc* are listed below:
before the closure-compiled code runs, because then it will
reuse that variable.

* Closure is only run if JavaScript opts are being done ("-O2" or
above).

"--closure-args=<args>"
[link] Pass arguments to the *Closure compiler*. This is an
alternative to "EMCC_CLOSURE_ARGS".
Expand Down
6 changes: 3 additions & 3 deletions docs/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ pre-processor. See [`.clang-format`][clang-format] for more details.
### Python Code

We generally follow the pep8 standard with the major exception that we use 2
spaces for indentation. `flake8` is run on all PRs to ensure that python code
conforms to this style. See [`.flake8`][flake8] for more details.
spaces for indentation. `ruff` is run on all PRs to ensure that Python code
conforms to this style. See [`pyproject.toml`][pyproject.toml] for more details.

#### Static Type Checking

Expand Down Expand Up @@ -304,7 +304,7 @@ To update our libraries to a newer musl release:
[emsdk_tags]: https://github.com/emscripten-core/emsdk/tags
[emscripten_tags]: https://github.com/emscripten-core/emscripten/tags
[clang-format]: https://github.com/emscripten-core/emscripten/blob/main/.clang-format
[flake8]: https://github.com/emscripten-core/emscripten/blob/main/.flake8
[pyproject.toml]: https://github.com/emscripten-core/emscripten/blob/main/pyproject.toml
[mypy]: https://github.com/emscripten-core/emscripten/blob/main/.mypy
[update_docs]: https://github.com/emscripten-core/emscripten/blob/main/tools/maint/update_docs.py
[llvm_repo]: https://github.com/llvm/llvm-project
Expand Down
2 changes: 1 addition & 1 deletion em-config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def main():
not re.match(r"^[\w\W_][\w\W_\d]*$", sys.argv[1]) or \
not hasattr(config, sys.argv[1]):
print('Usage: em-config VAR_NAME', file=sys.stderr)
exit(1)
sys.exit(1)

print(getattr(config, sys.argv[1]))
return 0
Expand Down
Loading

0 comments on commit 26cbc57

Please sign in to comment.