@wasm-oj/server 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +4 -3
- package/dist/server-build-stage.mjs +4 -3
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -348,11 +348,12 @@ function instantiateClangCc1(template, placeholders, source, objectPath) {
|
|
|
348
348
|
function instantiateClangPch(template, placeholders, header, outputPath) {
|
|
349
349
|
return instantiateClangCc1(template.map((token) => token === "-emit-obj" ? "-emit-pch" : token === "c++" ? "c++-header" : token), placeholders, header, outputPath);
|
|
350
350
|
}
|
|
351
|
-
function instantiateClangLink(template, placeholders, objectPaths, outputPath) {
|
|
351
|
+
function instantiateClangLink(template, placeholders, objectPaths, outputPath, stackSizeBytes) {
|
|
352
352
|
const argv = [];
|
|
353
353
|
for (const token of template) if (token === placeholders.objects) argv.push(...objectPaths);
|
|
354
354
|
else if (token === placeholders.output) argv.push(outputPath);
|
|
355
355
|
else argv.push(token);
|
|
356
|
+
if (stackSizeBytes !== void 0) argv.push("--stack-first", "-z", `stack-size=${stackSizeBytes}`);
|
|
356
357
|
return argv;
|
|
357
358
|
}
|
|
358
359
|
//#endregion
|
|
@@ -1551,12 +1552,12 @@ async function buildClangWithSdkDirect(project, cacheKey, requestId, host) {
|
|
|
1551
1552
|
host.progress(requestId, "linking", "Linking SDK-direct Clang objects", .8);
|
|
1552
1553
|
host.trace(requestId, "link", "start");
|
|
1553
1554
|
const outputPath = "/project/build/app.wasm";
|
|
1554
|
-
const linkArguments = instantiateClangLink(config.link, pins.placeholders, objectPaths, outputPath);
|
|
1555
|
+
const linkArguments = instantiateClangLink(config.link, pins.placeholders, objectPaths, outputPath, project.config.stackSizeBytes);
|
|
1555
1556
|
const linkManifestKey = await sha256Hex(JSON.stringify({
|
|
1556
1557
|
pins: pins.sourceSha256,
|
|
1557
1558
|
package: CLANG_PACKAGE_SHA256,
|
|
1558
1559
|
target: project.config.target,
|
|
1559
|
-
arguments:
|
|
1560
|
+
arguments: linkArguments
|
|
1560
1561
|
}));
|
|
1561
1562
|
let bytes = await objectCache.lookupLink(linkManifestKey, objectInputs);
|
|
1562
1563
|
let linkedStdout = "";
|
|
@@ -55,11 +55,12 @@ function instantiateClangCc1(template, placeholders, source, objectPath) {
|
|
|
55
55
|
function instantiateClangPch(template, placeholders, header, outputPath) {
|
|
56
56
|
return instantiateClangCc1(template.map((token) => token === "-emit-obj" ? "-emit-pch" : token === "c++" ? "c++-header" : token), placeholders, header, outputPath);
|
|
57
57
|
}
|
|
58
|
-
function instantiateClangLink(template, placeholders, objectPaths, outputPath) {
|
|
58
|
+
function instantiateClangLink(template, placeholders, objectPaths, outputPath, stackSizeBytes) {
|
|
59
59
|
const argv = [];
|
|
60
60
|
for (const token of template) if (token === placeholders.objects) argv.push(...objectPaths);
|
|
61
61
|
else if (token === placeholders.output) argv.push(outputPath);
|
|
62
62
|
else argv.push(token);
|
|
63
|
+
if (stackSizeBytes !== void 0) argv.push("--stack-first", "-z", `stack-size=${stackSizeBytes}`);
|
|
63
64
|
return argv;
|
|
64
65
|
}
|
|
65
66
|
//#endregion
|
|
@@ -981,12 +982,12 @@ async function buildClangWithSdkDirect(project, cacheKey, requestId, host) {
|
|
|
981
982
|
host.progress(requestId, "linking", "Linking SDK-direct Clang objects", .8);
|
|
982
983
|
host.trace(requestId, "link", "start");
|
|
983
984
|
const outputPath = "/project/build/app.wasm";
|
|
984
|
-
const linkArguments = instantiateClangLink(config.link, pins.placeholders, objectPaths, outputPath);
|
|
985
|
+
const linkArguments = instantiateClangLink(config.link, pins.placeholders, objectPaths, outputPath, project.config.stackSizeBytes);
|
|
985
986
|
const linkManifestKey = await sha256Hex(JSON.stringify({
|
|
986
987
|
pins: pins.sourceSha256,
|
|
987
988
|
package: CLANG_PACKAGE_SHA256,
|
|
988
989
|
target: project.config.target,
|
|
989
|
-
arguments:
|
|
990
|
+
arguments: linkArguments
|
|
990
991
|
}));
|
|
991
992
|
let bytes = await objectCache.lookupLink(linkManifestKey, objectInputs);
|
|
992
993
|
let linkedStdout = "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wasm-oj/server",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Node.js compiler and runner host for the WASM-OJ SDK.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "JacobLinCool",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"node": ">=24.18.0 <25"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@wasm-oj/contracts": "0.2.
|
|
62
|
-
"@wasm-oj/core": "0.2.
|
|
61
|
+
"@wasm-oj/contracts": "0.2.6",
|
|
62
|
+
"@wasm-oj/core": "0.2.6",
|
|
63
63
|
"@wasmer/sdk": "0.10.0",
|
|
64
64
|
"fflate": "0.8.3"
|
|
65
65
|
},
|