Skip to content

Commit

Permalink
chore: update loader and container
Browse files Browse the repository at this point in the history
  • Loading branch information
twilson63 committed Jun 9, 2024
1 parent 1e7503c commit d2abd37
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 59 deletions.
4 changes: 2 additions & 2 deletions dev-cli/src/versions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable */
export const VERSION = {
"CLI": "0.0.57",
"IMAGE": "0.0.37"
"CLI": "0.0.58",
"IMAGE": "0.0.38"
}
4 changes: 2 additions & 2 deletions loader/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion loader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@permaweb/ao-loader",
"version": "0.0.33",
"version": "0.0.34",
"repository": {
"type": "git",
"url": "https://github.com/permaweb/ao.git",
Expand Down
117 changes: 63 additions & 54 deletions loader/src/formats/wasm64-emscripten.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -630,60 +630,66 @@ var Module = (() => {

missingGlobal("asm", "Please use wasmExports instead");

function missingLibrarySymbol(sym) {
if (typeof globalThis != "undefined" && !Object.getOwnPropertyDescriptor(globalThis, sym)) {
Object.defineProperty(globalThis, sym, {
configurable: true,
get() {
var msg = `\`${sym}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`;
var librarySymbol = sym;
if (!librarySymbol.startsWith("_")) {
librarySymbol = "$" + sym;
}
msg += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${librarySymbol}')`;
if (isExportedByForceFilesystem(sym)) {
msg += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you";
}
warnOnce(msg);
return undefined;
}
});
}
unexportedRuntimeSymbol(sym);
}

function unexportedRuntimeSymbol(sym) {
if (!Object.getOwnPropertyDescriptor(Module, sym)) {
Object.defineProperty(Module, sym, {
configurable: true,
get() {
var msg = `'${sym}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;
if (isExportedByForceFilesystem(sym)) {
msg += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you";
}
abort(msg);
}
});
}
}

function __asyncjs__weavedrive_open(c_filename, mode) {
return Asyncify.handleAsync(async () => {
const filename = UTF8ToString(Number(c_filename));
if (!Module.WeaveDrive) {
return Promise.resolve(null);
}
const drive = Module.WeaveDrive(Module, FS);
return await drive.open(filename);
});
}

function __asyncjs__weavedrive_read(fd, dst_ptr, length) {
return Asyncify.handleAsync(async () => {
const drive = Module.WeaveDrive(Module, FS);
return Promise.resolve(await drive.read(fd, dst_ptr, length));
});
}
function missingLibrarySymbol(sym) {
if (typeof globalThis != "undefined" && !Object.getOwnPropertyDescriptor(globalThis, sym)) {
Object.defineProperty(globalThis, sym, {
configurable: true,
get() {
var msg = `\`${sym}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`;
var librarySymbol = sym;
if (!librarySymbol.startsWith("_")) {
librarySymbol = "$" + sym;
}
msg += ` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${librarySymbol}')`;
if (isExportedByForceFilesystem(sym)) {
msg += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you";
}
warnOnce(msg);
return undefined;
}
});
}
unexportedRuntimeSymbol(sym);
}

function unexportedRuntimeSymbol(sym) {
if (!Object.getOwnPropertyDescriptor(Module, sym)) {
Object.defineProperty(Module, sym, {
configurable: true,
get() {
var msg = `'${sym}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;
if (isExportedByForceFilesystem(sym)) {
msg += ". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you";
}
abort(msg);
}
});
}
}

function __asyncjs__weavedrive_open(c_filename, mode) {
return Asyncify.handleAsync(async () => {
const filename = UTF8ToString(Number(c_filename));
if (!Module.WeaveDrive) {
return Promise.resolve(null);
}
const drive = Module.WeaveDrive(Module, FS);
return await drive.open(filename);
});
}

function __asyncjs__weavedrive_read(fd, dst_ptr, length) {
return Asyncify.handleAsync(async () => {
const drive = Module.WeaveDrive(Module, FS);
return Promise.resolve(await drive.read(fd, dst_ptr, length));
});
}
function __asyncjs__weavedrive_close(fd) {
return Asyncify.handleAsync(async () => {
const drive = Module.WeaveDrive(Module, FS);
return drive.close(fd);
});
}

/** @constructor */ function ExitStatus(status) {
this.name = "ExitStatus";
Expand Down Expand Up @@ -4949,6 +4955,9 @@ var Module = (() => {

var wasmImports = {
/** @export */ __assert_fail: ___assert_fail,
/** @export */ __asyncjs__weavedrive_close: __asyncjs__weavedrive_close,


/** @export */ __asyncjs__weavedrive_open: __asyncjs__weavedrive_open,
/** @export */ __asyncjs__weavedrive_read: __asyncjs__weavedrive_read,
/** @export */ __cxa_throw: ___cxa_throw,
Expand Down

0 comments on commit d2abd37

Please sign in to comment.