Skip to content

Commit cffcd70

Browse files
authoredDec 6, 2019
Update wasi usage to latest version: wasi_snapshot_preview1 (#9956)
The primary different here is that the main header file was renamed from core.h to api.h. Update wasmer version to the latest version that includees support this api version.
1 parent 40e3737 commit cffcd70

28 files changed

+2698
-869
lines changed
 

‎.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ jobs:
388388
- run:
389389
name: get wasmer
390390
command: |
391-
wget https://github.com/wasmerio/wasmer/releases/download/0.9.0/wasmer-linux-amd64.tar.gz
391+
wget https://github.com/wasmerio/wasmer/releases/download/0.11.0/wasmer-linux-amd64.tar.gz
392392
tar -xf wasmer-linux-amd64.tar.gz
393393
mkdir ~/vms
394394
cp bin/wasmer ~/vms

‎ChangeLog.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ Current Trunk
2222
disabled. There is no "Module.canvas" object, no magic "null" default handling,
2323
and DOM element 'target' parameters are taken to refer to CSS selectors, instead
2424
of referring to DOM IDs. For more information see:
25-
https://groups.google.com/forum/#!msg/emscripten-discuss/xScZ_LRIByk/_gEy67utDgAJ
25+
<https://groups.google.com/forum/#!msg/emscripten-discuss/xScZ_LRIByk/_gEy67utDgAJ>
26+
- WASI API updated to from `wasi_unstable` to `wasi_snapshot_preview1` this
27+
is mostly an implementation detail but if you use `WASI_STANDALONE` it means
28+
that the output of emscripten now requires a runtime with
29+
`wasi_snapshot_preview1` support.
2630

2731
v1.39.4: 12/03/2019
2832
-------------------

‎src/library_syscall.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1852,7 +1852,7 @@ var WASI_SYSCALLS = set([
18521852
'fd_sync',
18531853
]);
18541854

1855-
// Fallback for cases where the wasi_unstable.name prefixing fails,
1855+
// Fallback for cases where the wasi_interface_version.name prefixing fails,
18561856
// and we have the full name from C. This happens in fastcomp which
18571857
// lacks the attribute to set the import module and base names.
18581858
if (!WASM_BACKEND) {

‎src/library_wasi.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ var WasiLibrary = {
9191
},
9292
};
9393

94-
// Fallback for cases where the wasi_unstable.name prefixing fails,
94+
// Fallback for cases where the wasi_interface_version.name prefixing fails,
9595
// and we have the full name from C. This happens in fastcomp which
9696
// lacks the attribute to set the import module and base names.
9797
if (!WASM_BACKEND) {

‎src/preamble.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -933,7 +933,7 @@ function createWasm() {
933933
// prepare imports
934934
var info = {
935935
'env': asmLibraryArg,
936-
'wasi_unstable': asmLibraryArg
936+
'{{{ WASI_MODULE_NAME }}}': asmLibraryArg
937937
#if WASM_BACKEND == 0
938938
,
939939
'global': {

‎src/settings.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ var ASYNCIFY_IMPORTS = [
593593
'emscripten_idb_store', 'emscripten_idb_delete', 'emscripten_idb_exists',
594594
'emscripten_idb_load_blob', 'emscripten_idb_store_blob', 'SDL_Delay',
595595
'emscripten_scan_registers', 'emscripten_lazy_load_code',
596-
'wasi_unstable.fd_sync', '__wasi_fd_sync',
596+
'wasi_snapshot_preview1.fd_sync', '__wasi_fd_sync',
597597
];
598598

599599
// Whether indirect calls can be on the stack during an unwind/rewind.

‎src/settings_internal.js

+2
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,5 @@ var IMPLEMENTED_FUNCTIONS = [];
8181

8282
// Name of the file containing the Fetch *.fetch.js, if relevant
8383
var FETCH_WORKER_FILE = '';
84+
85+
var WASI_MODULE_NAME = "wasi_snapshot_preview1";

‎src/struct_info.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,7 @@
15761576
]
15771577
},
15781578
{
1579-
"file": "wasi/wasi.h",
1579+
"file": "wasi/api.h",
15801580
"structs": {
15811581
"__wasi_fdstat_t": [
15821582
"fs_filetype",

‎src/support.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ function loadWebAssemblyModule(binary, flags) {
534534
},
535535
'global.Math': Math,
536536
env: proxy,
537-
wasi_unstable: proxy,
537+
{{{ WASI_MODULE_NAME }}}: proxy,
538538
'asm2wasm': asm2wasmImports
539539
};
540540
#if ASSERTIONS

‎system/include/libc/fcntl.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define _FCNTL_H
33

44
#ifdef __EMSCRIPTEN__
5-
#include <wasi/wasi.h>
5+
#include <wasi/api.h>
66
#endif
77

88
#ifdef __cplusplus

‎system/include/libc/stdio.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define _STDIO_H
33

44
#ifdef __EMSCRIPTEN__
5-
#include <wasi/wasi.h>
5+
#include <wasi/api.h>
66
#endif
77

88
#ifdef __cplusplus

‎system/include/libc/unistd.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define _UNISTD_H
33

44
#ifdef __EMSCRIPTEN__
5-
#include <wasi/wasi.h>
5+
#include <wasi/api.h>
66
#endif
77

88
#ifdef __cplusplus

0 commit comments

Comments
 (0)