Skip to content

Commit

Permalink
Merge branch 'intel:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
brucehuke authored Sep 26, 2023
2 parents 74b9a54 + 46795ea commit 94bc188
Show file tree
Hide file tree
Showing 4 changed files with 153 additions and 2 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/libdyntype_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# Copyright (C) 2023 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#

name: libdyntype CI

on:
push:
paths:
- "runtime-library/**"
pull_request:
paths:
- "runtime-library/**"
# allow to be triggered manually
workflow_dispatch:

jobs:
build_and_test:
name: 'Libdyntype Build and Test'
runs-on: ubuntu-latest
defaults:
run:
working-directory: runtime-library/libdyntype

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
submodules: true

- name: download dependencies
run: |
./download.sh
working-directory: runtime-library/deps

- name: Dyntype Build
run: |
git pull --recurse-submodules
git submodule update --remote --recursive
mkdir build && cd build
cmake .. && make
- name: Dyntype Test
run: |
cd test
mkdir build && cd build
cmake ..
make
make test
96 changes: 96 additions & 0 deletions .github/workflows/ts2wasm_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
#
# Copyright (C) 2023 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#

name: ts2wasm-compiler CI

on:
push:
paths-ignore:
- "doc/**"
- "README.md"
pull_request:
types:
- opened
- synchronize
paths-ignore:
- "doc/**"
- "README.md"
# allow to be triggered manually
workflow_dispatch:

# Cancel any in-flight jobs for the same PR/branch so there's only one active
# at a time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
install_dependencies:
runs-on: ubuntu-latest
strategy:
matrix:
# node-version: [10.x, 12.x, 14.x, 15.x, 16.x]
# Test the latest version of Node.js plus the last two LTS versions.
# node-version:
# - "*"
# - lts/*
# - lts/-1
node-version: [16.x]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5

- name: Use node version ${{ matrix.node-version }}
uses: actions/setup-node@v3
- run: npm install

- name: Linter
run: npx lint-staged

validate_compilation:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5
- run: npm install

- name: Test compilation
run:
npm run test

validate_execution:
needs:
[install_dependencies]
runs-on: ubuntu-latest
strategy:
matrix:
target: [
"X86_64", "X86_32"
]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 5

- name: download dependencies
run: |
./download.sh
sudo apt update && sudo apt install g++-multilib -y
working-directory: runtime-library/deps

- name: Build runtime
run: |
mkdir build && cd build
cmake .. -DWAMR_BUILD_TARGET=${{ matrix.target }} -DWAMR_GC_IN_EVERY_ALLOCATION=1 -DUSE_SANITIZER=1 && make -j$(nproc)
working-directory: runtime-library/

- name: Validate execution
run:
npm start
working-directory: tools/validate/wamr
1 change: 1 addition & 0 deletions ATTRIBUTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Wasmnizer-ts project reused some components from other open source project:
### AssemblyScript

[LICENSE](./src/backend/binaryen/glue/LICENSE) (Apache-2.0)

[NOTICE](./src/backend/binaryen/glue/NOTICE)

### TypeScript
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

## Overview

`Wasmnizer-ts` is a toolchain for compiling TypeScript source code directly into [WasmGC](https://github.com/WebAssembly/gc) bytecode. The strategy is to apply static compilation for those with sufficient type information, while supporting dynamic type (such as any) through host APIs. The `Wasmnizer-ts` now supports a strict subset of TypeScript and continuously strives to accommodate more semantics.
`Wasmnizer-ts` utilizes [WasmGC](https://github.com/WebAssembly/gc) to compile TypeScript source code into WebAssembly bytecode, and support dynamic type (such as any) through host APIs. The `Wasmnizer-ts` now supports a strict subset of TypeScript and continuously strives to accommodate more semantics.

There are three components in `Wasmnizer-ts`:
- `ts2wasm-compiler`: a compiler for compiling TypeScript source code into WasmGC bytecode.
Expand Down Expand Up @@ -46,7 +46,11 @@ The wasm module generated by `ts2wasm-compiler` is designed to be executed in a
- **[libstruct-indirect API](./doc/libstruct_indirect_api_spec.md) (required by `interface` type)**: APIs for accessing WasmGC struct fields through index calculated during runtime.
- **libstd API (required by standard libraries)**: APIs for providing standard libraries from host environment.

`Wasmnizer-ts` currently provides `libdyntype API`, `libstruct-indirect API` and `libstd API` based on [WebAssembly Micro Runtime (WAMR)](https://github.com/bytecodealliance/wasm-micro-runtime/tree/dev/gc_refactor), and provides part of `libdyntype API` for chrome browser. Please see [feature list](./doc/developer-guide/feature_list.md) for supporting status of each feature.
`Wasmnizer-ts` currently implemented host APIs on multiple environments:
- [WebAssembly Micro Runtime (WAMR)](https://github.com/bytecodealliance/wasm-micro-runtime/tree/dev/gc_refactor): `libdyntype API`, `libstruct-indirect API` and `libstd API`
- chrome browser and nodejs (20.6.1+): part of `libdyntype API` implemented with JavaScript

Please see [feature list](./doc/developer-guide/feature_list.md) for supporting status of each feature.

Please goto [Getting Started](./doc/getting_started.md) for how to use the project and [Introduction](./doc/developer-guide/index.md) for more details.

Expand Down

0 comments on commit 94bc188

Please sign in to comment.