diff options
author | Nicholas H.Tollervey <ntoll@ntoll.org> | 2022-08-19 14:58:58 +0100 |
---|---|---|
committer | Nicholas H.Tollervey <ntoll@ntoll.org> | 2022-08-22 12:03:39 +0100 |
commit | af54d2ce9f923eba06b19bddb784a1c9da228347 (patch) | |
tree | 2f546c12def404b89d86a59deb71e2d6967fc45b | |
parent | c616721b1afe176c8d760afc15a93621d411c1dc (diff) | |
download | micropython-af54d2ce9f923eba06b19bddb784a1c9da228347.tar.gz micropython-af54d2ce9f923eba06b19bddb784a1c9da228347.zip |
javascript: Rename this port to 'webassembly'.
-rw-r--r-- | .github/workflows/ports_webassembly.yml (renamed from .github/workflows/ports_javascript.yml) | 10 | ||||
-rw-r--r-- | ports/webassembly/Makefile (renamed from ports/javascript/Makefile) | 2 | ||||
-rw-r--r-- | ports/webassembly/README.md (renamed from ports/javascript/README.md) | 15 | ||||
-rw-r--r-- | ports/webassembly/library.h (renamed from ports/javascript/library.h) | 0 | ||||
-rw-r--r-- | ports/webassembly/library.js (renamed from ports/javascript/library.js) | 0 | ||||
-rw-r--r-- | ports/webassembly/main.c (renamed from ports/javascript/main.c) | 0 | ||||
-rw-r--r-- | ports/webassembly/modutime.c (renamed from ports/javascript/modutime.c) | 0 | ||||
-rw-r--r-- | ports/webassembly/mpconfigport.h (renamed from ports/javascript/mpconfigport.h) | 2 | ||||
-rw-r--r-- | ports/webassembly/mphalport.c (renamed from ports/javascript/mphalport.c) | 0 | ||||
-rw-r--r-- | ports/webassembly/mphalport.h (renamed from ports/javascript/mphalport.h) | 0 | ||||
-rwxr-xr-x | ports/webassembly/node_run.sh (renamed from ports/javascript/node_run.sh) | 0 | ||||
-rw-r--r-- | ports/webassembly/qstrdefsport.h (renamed from ports/javascript/qstrdefsport.h) | 0 | ||||
-rw-r--r-- | ports/webassembly/wrapper.js (renamed from ports/javascript/wrapper.js) | 0 | ||||
-rwxr-xr-x | tools/ci.sh | 12 |
14 files changed, 23 insertions, 18 deletions
diff --git a/.github/workflows/ports_javascript.yml b/.github/workflows/ports_webassembly.yml index 244dc966aa..861039c0fc 100644 --- a/.github/workflows/ports_javascript.yml +++ b/.github/workflows/ports_webassembly.yml @@ -1,4 +1,4 @@ -name: javascript port +name: webassembly port on: push: @@ -9,7 +9,7 @@ on: - 'py/**' - 'extmod/**' - 'lib/**' - - 'ports/javascript/**' + - 'ports/webassembly/**' jobs: build: @@ -17,8 +17,8 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install packages - run: source tools/ci.sh && ci_javascript_setup + run: source tools/ci.sh && ci_webassembly_setup - name: Build - run: source tools/ci.sh && ci_javascript_build + run: source tools/ci.sh && ci_webassembly_build - name: Run tests - run: source tools/ci.sh && ci_javascript_run_tests + run: source tools/ci.sh && ci_webassembly_run_tests diff --git a/ports/javascript/Makefile b/ports/webassembly/Makefile index 93c7b5609b..db3f36ad8e 100644 --- a/ports/javascript/Makefile +++ b/ports/webassembly/Makefile @@ -51,6 +51,6 @@ min: $(BUILD)/micropython.js test: $(BUILD)/micropython.js $(TOP)/tests/run-tests.py $(eval DIRNAME=ports/$(notdir $(CURDIR))) - cd $(TOP)/tests && MICROPY_MICROPYTHON=../ports/javascript/node_run.sh ./run-tests.py -j1 + cd $(TOP)/tests && MICROPY_MICROPYTHON=../ports/webassembly/node_run.sh ./run-tests.py -j1 include $(TOP)/py/mkrules.mk diff --git a/ports/javascript/README.md b/ports/webassembly/README.md index 39808943b1..3b577233ff 100644 --- a/ports/javascript/README.md +++ b/ports/webassembly/README.md @@ -1,13 +1,18 @@ -MicroPython.js -============== +MicroPython WebAssembly +======================= -MicroPython transmuted into Javascript by Emscripten. +MicroPython for [WebAssembly](https://webassembly.org/). Dependencies ------------ -Building micropython.js bears the same requirements as the standard MicroPython -ports with the addition of Emscripten (and uglify-js for the minified file). +Building webassembly port bears the same requirements as the standard +MicroPython ports with the addition of Emscripten (and uglify-js for the +minified file). + +The output includes `micropython.js` (a JavaScript wrapper for the +MicroPython runtime) and `firmware.wasm` (actual MicroPython compiled to +WASM). Build instructions ------------------ diff --git a/ports/javascript/library.h b/ports/webassembly/library.h index 47982e0640..47982e0640 100644 --- a/ports/javascript/library.h +++ b/ports/webassembly/library.h diff --git a/ports/javascript/library.js b/ports/webassembly/library.js index a8e54aaaca..a8e54aaaca 100644 --- a/ports/javascript/library.js +++ b/ports/webassembly/library.js diff --git a/ports/javascript/main.c b/ports/webassembly/main.c index 36ea9e98be..36ea9e98be 100644 --- a/ports/javascript/main.c +++ b/ports/webassembly/main.c diff --git a/ports/javascript/modutime.c b/ports/webassembly/modutime.c index 76fe8df374..76fe8df374 100644 --- a/ports/javascript/modutime.c +++ b/ports/webassembly/modutime.c diff --git a/ports/javascript/mpconfigport.h b/ports/webassembly/mpconfigport.h index 6c86d816bd..4fbd922e15 100644 --- a/ports/javascript/mpconfigport.h +++ b/ports/webassembly/mpconfigport.h @@ -105,7 +105,7 @@ #define MICROPY_PY_MICROPYTHON_MEM_INFO (1) #define MICROPY_PY_ARRAY_SLICE_ASSIGN (1) #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) -#define MICROPY_PY_SYS_PLATFORM "javascript" +#define MICROPY_PY_SYS_PLATFORM "webassembly" #define MICROPY_PY_UERRNO (1) #define MICROPY_PY_UCTYPES (1) #define MICROPY_PY_UZLIB (1) diff --git a/ports/javascript/mphalport.c b/ports/webassembly/mphalport.c index c938a63928..c938a63928 100644 --- a/ports/javascript/mphalport.c +++ b/ports/webassembly/mphalport.c diff --git a/ports/javascript/mphalport.h b/ports/webassembly/mphalport.h index 3e2c439f32..3e2c439f32 100644 --- a/ports/javascript/mphalport.h +++ b/ports/webassembly/mphalport.h diff --git a/ports/javascript/node_run.sh b/ports/webassembly/node_run.sh index 466ffe39e3..466ffe39e3 100755 --- a/ports/javascript/node_run.sh +++ b/ports/webassembly/node_run.sh diff --git a/ports/javascript/qstrdefsport.h b/ports/webassembly/qstrdefsport.h index 00d3e2ae3c..00d3e2ae3c 100644 --- a/ports/javascript/qstrdefsport.h +++ b/ports/webassembly/qstrdefsport.h diff --git a/ports/javascript/wrapper.js b/ports/webassembly/wrapper.js index ae0f24e7e4..ae0f24e7e4 100644 --- a/ports/javascript/wrapper.js +++ b/ports/webassembly/wrapper.js diff --git a/tools/ci.sh b/tools/ci.sh index e3203f8bfb..dc2ccf775b 100755 --- a/tools/ci.sh +++ b/tools/ci.sh @@ -172,21 +172,21 @@ function ci_esp8266_build { } ######################################################################################## -# ports/javascript +# ports/webassembly -function ci_javascript_setup { +function ci_webassembly_setup { git clone https://github.com/emscripten-core/emsdk.git (cd emsdk && ./emsdk install latest && ./emsdk activate latest) } -function ci_javascript_build { +function ci_webassembly_build { source emsdk/emsdk_env.sh - make ${MAKEOPTS} -C ports/javascript + make ${MAKEOPTS} -C ports/webassembly } -function ci_javascript_run_tests { +function ci_webassembly_run_tests { # This port is very slow at running, so only run a few of the tests. - (cd tests && MICROPY_MICROPYTHON=../ports/javascript/node_run.sh ./run-tests.py -j1 basics/builtin_*.py) + (cd tests && MICROPY_MICROPYTHON=../ports/webassembly/node_run.sh ./run-tests.py -j1 basics/builtin_*.py) } ######################################################################################## |