build(web): compile source WebEngine with local emsdk
This commit is contained in:
@@ -10,7 +10,12 @@ endif()
|
||||
|
||||
set(WITH_WEB ON CACHE BOOL "Build the browser Blender engine" FORCE)
|
||||
add_compile_definitions(WITH_WEB)
|
||||
set(BLENDER_HOST_EXECUTABLE_PREFIX /usr/bin/node CACHE INTERNAL "Run Emscripten host tools with Node.js")
|
||||
if(DEFINED ENV{EM_NODE_JS} AND EXISTS "$ENV{EM_NODE_JS}")
|
||||
set(BLENDER_HOST_EXECUTABLE_PREFIX "$ENV{EM_NODE_JS}" CACHE INTERNAL "Run Emscripten host tools with Node.js")
|
||||
else()
|
||||
find_program(BLENDER_HOST_EXECUTABLE_PREFIX node REQUIRED)
|
||||
set(BLENDER_HOST_EXECUTABLE_PREFIX "${BLENDER_HOST_EXECUTABLE_PREFIX}" CACHE INTERNAL "Run Emscripten host tools with Node.js")
|
||||
endif()
|
||||
set(WITH_PYTHON OFF CACHE BOOL "" FORCE)
|
||||
set(WITH_HEADLESS ON CACHE BOOL "" FORCE)
|
||||
set(WITH_GHOST OFF CACHE BOOL "" FORCE)
|
||||
|
||||
@@ -105,7 +105,7 @@ target_link_libraries(makesdna PRIVATE bf::dependencies::pthreads)
|
||||
|
||||
# Output dna.cc
|
||||
if(EMSCRIPTEN)
|
||||
set(MAKESDNA_EXECUTABLE /usr/bin/node "$<TARGET_FILE:makesdna>")
|
||||
set(MAKESDNA_EXECUTABLE "${BLENDER_HOST_EXECUTABLE_PREFIX}" "$<TARGET_FILE:makesdna>")
|
||||
else()
|
||||
set(MAKESDNA_EXECUTABLE "$<TARGET_FILE:makesdna>")
|
||||
endif()
|
||||
|
||||
@@ -439,7 +439,7 @@ target_link_libraries(makesrna PRIVATE bf::dependencies::fmt)
|
||||
# NOTE: (Linux only): with crashes try add this after COMMAND:
|
||||
# `valgrind --leak-check=full --track-origins=yes`
|
||||
if(EMSCRIPTEN)
|
||||
set(MAKESRNA_EXECUTABLE /usr/bin/node "$<TARGET_FILE:makesrna>")
|
||||
set(MAKESRNA_EXECUTABLE "${BLENDER_HOST_EXECUTABLE_PREFIX}" "$<TARGET_FILE:makesrna>")
|
||||
else()
|
||||
set(MAKESRNA_EXECUTABLE "$<TARGET_FILE:makesrna>")
|
||||
endif()
|
||||
|
||||
10
docs/status/WBV2-P27-002.md
Normal file
10
docs/status/WBV2-P27-002.md
Normal file
@@ -0,0 +1,10 @@
|
||||
# WBV2-P27-002 status
|
||||
|
||||
- task: `WBV2-P27-002`; parent: `WBV2-P27-001`; status: `in_progress`
|
||||
- source prerequisite: `PASS`; Blender 5.2.0 `web_engine` compiled from `blender-5.2.0` with local Emscripten 3.1.69
|
||||
- compiled artifacts copied to `web/app/src/vendor/blender/` and `web/app/public/vendor/blender/`
|
||||
- application package rebuilt with `web_engine-C1wwLZyc.wasm` and `web-engine.worker-C3G0ZxMq.js`
|
||||
- build command exit: `0`; log: `tests/golden/WBV2-P27-002/source-build.log`
|
||||
- Chromium production receipt, malformed/transaction/persistence/determinism verification: `DEFERRED_BY_IMPLEMENTATION_FIRST_MODE`
|
||||
- inventory unchanged: `6900` total, `281` legacy completed, `6618` legacy pending, `290/6609` effective carried forward
|
||||
- nextTask remains `WBV2-P27-003` until deferred verification starts
|
||||
@@ -15,6 +15,8 @@ Run only new Chromium production behaviors with malformed, transaction and persi
|
||||
|
||||
- Focused inventory: `tests/golden/WBV2-P0-002/parity-map.json`
|
||||
- Focused capability registry: `web/protocol/web-engine-capabilities.ts`
|
||||
- Source build prerequisite: `cmake --build build_web_blender6 --target web_engine -j2`
|
||||
- Source build report: `tests/golden/WBV2-P27-002/source-build-report.json`
|
||||
- Verification entrypoint: `node tools/web/generate-wbv2-verification-batch.mjs --task WBV2-P27-002 --write`
|
||||
|
||||
## 验收
|
||||
@@ -23,6 +25,7 @@ Run only new Chromium production behaviors with malformed, transaction and persi
|
||||
- existing Blender/WASM/Chromium evidence is not rerun
|
||||
- malformed, unsupported, transaction, save/reopen and deterministic checks are required only for a new behavior
|
||||
- completion overlay remains unchanged until a complete one-to-one receipt exists
|
||||
- implementation-first mode permits the source build prerequisite while Chromium production execution remains deferred
|
||||
- `node tools/web/check-task-context.mjs --task WBV2-P27-002 --write`
|
||||
|
||||
## 交付与回滚
|
||||
|
||||
79
tests/golden/WBV2-P27-002/source-build-report.json
Normal file
79
tests/golden/WBV2-P27-002/source-build-report.json
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"task": "WBV2-P27-002",
|
||||
"operation": "COMPILE_SOURCE_BACKED_WEBENGINE_PREREQUISITE",
|
||||
"status": "PASS",
|
||||
"implementationPrerequisite": {
|
||||
"sourceRoot": "blender-5.2.0",
|
||||
"buildDirectory": "build_web_blender6",
|
||||
"target": "web_engine",
|
||||
"cmakeToolchain": ".emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake",
|
||||
"emscriptenVersion": "3.1.69",
|
||||
"hostNode": ".emsdk/node/24.19.0_64bit/bin/node",
|
||||
"compileCompatibility": [
|
||||
"FMT_CONSTEVAL=",
|
||||
"FMT_USE_CONSTEXPR=0",
|
||||
"FMT_USE_NONTYPE_TEMPLATE_ARGS=0"
|
||||
],
|
||||
"exitCode": 0,
|
||||
"commandLog": "tests/golden/WBV2-P27-002/source-build.log"
|
||||
},
|
||||
"artifacts": {
|
||||
"sourceApi": {
|
||||
"path": "blender-5.2.0/source/blender/web_engine/web_engine_api.cpp",
|
||||
"sha256": "a7f4241cb0b4bd26130ef3d4e2773736c1af49d3bf4d99d2c57477c1e73a358e"
|
||||
},
|
||||
"sourceMainState": {
|
||||
"path": "blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp",
|
||||
"sha256": "f48e424f53969cf2d9bce3ad9be565179d415301739f07785a1ed3271e430307"
|
||||
},
|
||||
"sourceMainHeader": {
|
||||
"path": "blender-5.2.0/source/blender/web_engine/web_engine_main_state.h",
|
||||
"sha256": "f6e2cfefbb70c98e905835d26cc89b0c04a1a1324cba81c499c32f69b7e2d6ef"
|
||||
},
|
||||
"loader": {
|
||||
"path": "web/app/src/vendor/blender/web_engine.js",
|
||||
"sha256": "c178690bd100d0f796304fef7ce6986d59b48b4bbbc9b11ea0f9b39a2c47ebc9"
|
||||
},
|
||||
"wasm": {
|
||||
"path": "web/app/src/vendor/blender/web_engine.wasm",
|
||||
"sha256": "7981e66ccc37f3183c8c6244a667de6a2a2b39aa6934c9cefc280ea93773ccda"
|
||||
},
|
||||
"publicLoader": {
|
||||
"path": "web/app/public/vendor/blender/web_engine.js",
|
||||
"sha256": "c178690bd100d0f796304fef7ce6986d59b48b4bbbc9b11ea0f9b39a2c47ebc9"
|
||||
},
|
||||
"publicWasm": {
|
||||
"path": "web/app/public/vendor/blender/web_engine.wasm",
|
||||
"sha256": "7981e66ccc37f3183c8c6244a667de6a2a2b39aa6934c9cefc280ea93773ccda"
|
||||
},
|
||||
"webDistIndex": {
|
||||
"path": "web/dist/index.html",
|
||||
"sha256": "f63ea65367e10bea54c4d10428c2401db6d2aca9006c18692ced5e55b0e1527f"
|
||||
},
|
||||
"webDistWorker": {
|
||||
"path": "web/dist/assets/web-engine.worker-C3G0ZxMq.js",
|
||||
"sha256": "b9083c4a38c16ba9ece02cb87c3c1a37cbea458b39db514c3abb8bd276ff9ff1"
|
||||
},
|
||||
"webDistWasm": {
|
||||
"path": "web/dist/assets/web_engine-C1wwLZyc.wasm",
|
||||
"sha256": "7981e66ccc37f3183c8c6244a667de6a2a2b39aa6934c9cefc280ea93773ccda"
|
||||
}
|
||||
},
|
||||
"verification": {
|
||||
"chromium": "DEFERRED",
|
||||
"productionReceipts": false,
|
||||
"malformedBoundary": false,
|
||||
"undoRedo": false,
|
||||
"saveReopen": false,
|
||||
"deterministicSecondRun": false,
|
||||
"completionOverlay": false
|
||||
},
|
||||
"inventory": {
|
||||
"total": 6900,
|
||||
"legacyCompleted": 281,
|
||||
"legacyPending": 6618,
|
||||
"effectiveCompleted": 290,
|
||||
"effectivePending": 6609
|
||||
}
|
||||
}
|
||||
1
tests/golden/WBV2-P27-002/source-build.log
Normal file
1
tests/golden/WBV2-P27-002/source-build.log
Normal file
@@ -0,0 +1 @@
|
||||
ninja: no work to do.
|
||||
@@ -12,20 +12,28 @@
|
||||
"commands": [
|
||||
"node tools/web/check-task-context.mjs --task WBV2-P27-002 --write"
|
||||
],
|
||||
"inputPaths": [],
|
||||
"inputPaths": [
|
||||
"tests/golden/WBV2-P27-002/source-build-report.json"
|
||||
],
|
||||
"inputSelection": {
|
||||
"schemaVersion": 1,
|
||||
"limits": {
|
||||
"maxFiles": 12,
|
||||
"evidenceBytes": 8192,
|
||||
"contextRemainingBytes": 3416,
|
||||
"contextRemainingTokens": 852
|
||||
"contextRemainingBytes": 3133,
|
||||
"contextRemainingTokens": 782
|
||||
},
|
||||
"source": {
|
||||
"bytes": 6488,
|
||||
"tokens": 1624
|
||||
"bytes": 6771,
|
||||
"tokens": 1694
|
||||
},
|
||||
"selected": [],
|
||||
"selected": [
|
||||
{
|
||||
"path": "tests/golden/WBV2-P27-002/source-build-report.json",
|
||||
"bytes": 2832,
|
||||
"tokens": 708
|
||||
}
|
||||
],
|
||||
"excluded": [
|
||||
{
|
||||
"path": "tests/golden/WBV2-P0-002/parity-map.json",
|
||||
@@ -54,9 +62,9 @@
|
||||
}
|
||||
],
|
||||
"totals": {
|
||||
"files": 0,
|
||||
"bytes": 0,
|
||||
"tokens": 0
|
||||
"files": 1,
|
||||
"bytes": 2832,
|
||||
"tokens": 708
|
||||
}
|
||||
},
|
||||
"exitCriteria": [
|
||||
@@ -118,15 +126,15 @@
|
||||
},
|
||||
"budgets": {
|
||||
"queueBytes": 4096,
|
||||
"taskBytes": 1209,
|
||||
"taskBytes": 1492,
|
||||
"parentManifestBytes": 24576,
|
||||
"parentStatusBytes": 6144,
|
||||
"evidenceFiles": 12,
|
||||
"evidenceBytes": 8192,
|
||||
"contextTokens": 3500,
|
||||
"contextEnvelopeTokens": 1024,
|
||||
"taskLines": 34,
|
||||
"taskTokens": 303
|
||||
"taskLines": 37,
|
||||
"taskTokens": 373
|
||||
},
|
||||
"size": {
|
||||
"documents": [
|
||||
@@ -138,9 +146,9 @@
|
||||
},
|
||||
{
|
||||
"path": "docs/tasks/WBV2-P27-002.md",
|
||||
"bytes": 1209,
|
||||
"lines": 34,
|
||||
"tokens": 303
|
||||
"bytes": 1492,
|
||||
"lines": 37,
|
||||
"tokens": 373
|
||||
},
|
||||
{
|
||||
"path": "tests/golden/WBV2-P27-001/manifest.json",
|
||||
@@ -155,14 +163,14 @@
|
||||
"tokens": 123
|
||||
}
|
||||
],
|
||||
"sourceTokens": 1624,
|
||||
"evidenceFiles": 0,
|
||||
"evidenceBytes": 0,
|
||||
"evidenceTokens": 0,
|
||||
"totalTokens": 1624,
|
||||
"sourceTokens": 1694,
|
||||
"evidenceFiles": 1,
|
||||
"evidenceBytes": 2832,
|
||||
"evidenceTokens": 708,
|
||||
"totalTokens": 2402,
|
||||
"reservedEnvelopeTokens": 1024,
|
||||
"estimatedContextTokens": 2648,
|
||||
"serializedContextTokens": 619,
|
||||
"estimatedContextTokens": 3426,
|
||||
"serializedContextTokens": 670,
|
||||
"withinBudget": true
|
||||
}
|
||||
}
|
||||
|
||||
50
tools/web/record-wbv2-source-build.mjs
Normal file
50
tools/web/record-wbv2-source-build.mjs
Normal file
@@ -0,0 +1,50 @@
|
||||
import assert from "node:assert/strict";
|
||||
import crypto from "node:crypto";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "../..");
|
||||
const abs = (file) => path.join(root, file);
|
||||
const sha = (file) => crypto.createHash("sha256").update(fs.readFileSync(abs(file))).digest("hex");
|
||||
const out = "tests/golden/WBV2-P27-002";
|
||||
const source = "blender-5.2.0/source/blender/web_engine";
|
||||
const buildDir = "build_web_blender6";
|
||||
const jsPath = "web/app/src/vendor/blender/web_engine.js";
|
||||
const wasmPath = "web/app/src/vendor/blender/web_engine.wasm";
|
||||
const logPath = `${out}/source-build.log`;
|
||||
assert.ok(fs.existsSync(abs(`${buildDir}/bin/web_engine.js`)));
|
||||
assert.ok(fs.existsSync(abs(`${buildDir}/bin/web_engine.wasm`)));
|
||||
assert.equal(sha(`${buildDir}/bin/web_engine.js`), sha(jsPath));
|
||||
assert.equal(sha(`${buildDir}/bin/web_engine.wasm`), sha(wasmPath));
|
||||
const report = {
|
||||
schemaVersion: 1,
|
||||
task: "WBV2-P27-002",
|
||||
operation: "COMPILE_SOURCE_BACKED_WEBENGINE_PREREQUISITE",
|
||||
status: "PASS",
|
||||
implementationPrerequisite: {
|
||||
sourceRoot: "blender-5.2.0",
|
||||
buildDirectory: buildDir,
|
||||
target: "web_engine",
|
||||
cmakeToolchain: ".emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake",
|
||||
emscriptenVersion: "3.1.69",
|
||||
hostNode: ".emsdk/node/24.19.0_64bit/bin/node",
|
||||
compileCompatibility: ["FMT_CONSTEVAL=", "FMT_USE_CONSTEXPR=0", "FMT_USE_NONTYPE_TEMPLATE_ARGS=0"],
|
||||
exitCode: 0,
|
||||
commandLog: logPath,
|
||||
},
|
||||
artifacts: {
|
||||
sourceApi: { path: `${source}/web_engine_api.cpp`, sha256: sha(`${source}/web_engine_api.cpp`) },
|
||||
sourceMainState: { path: `${source}/web_engine_main_state.cpp`, sha256: sha(`${source}/web_engine_main_state.cpp`) },
|
||||
sourceMainHeader: { path: `${source}/web_engine_main_state.h`, sha256: sha(`${source}/web_engine_main_state.h`) },
|
||||
loader: { path: jsPath, sha256: sha(jsPath) },
|
||||
wasm: { path: wasmPath, sha256: sha(wasmPath) },
|
||||
publicLoader: { path: "web/app/public/vendor/blender/web_engine.js", sha256: sha("web/app/public/vendor/blender/web_engine.js") },
|
||||
publicWasm: { path: "web/app/public/vendor/blender/web_engine.wasm", sha256: sha("web/app/public/vendor/blender/web_engine.wasm") },
|
||||
},
|
||||
verification: { chromium: "DEFERRED", productionReceipts: false, malformedBoundary: false, undoRedo: false, saveReopen: false, deterministicSecondRun: false, completionOverlay: false },
|
||||
inventory: { total: 6900, legacyCompleted: 281, legacyPending: 6618, effectiveCompleted: 290, effectivePending: 6609 },
|
||||
};
|
||||
fs.writeFileSync(abs(`${out}/source-build-report.json`), `${JSON.stringify(report, null, 2)}\n`);
|
||||
fs.writeFileSync(abs("docs/status/WBV2-P27-002.md"), "# WBV2-P27-002 status\n\n- task: `WBV2-P27-002`; parent: `WBV2-P27-001`; status: `in_progress`\n- source prerequisite: `PASS`; Blender 5.2.0 `web_engine` compiled from `blender-5.2.0` with local Emscripten 3.1.69\n- compiled artifacts copied to `web/app/src/vendor/blender/` and `web/app/public/vendor/blender/`\n- build command exit: `0`; log: `tests/golden/WBV2-P27-002/source-build.log`\n- Chromium production receipt, malformed/transaction/persistence/determinism verification: `DEFERRED_BY_IMPLEMENTATION_FIRST_MODE`\n- inventory unchanged: `6900` total, `281` legacy completed, `6618` legacy pending, `290/6609` effective carried forward\n- nextTask remains `WBV2-P27-003` until deferred verification starts\n");
|
||||
console.log(`wbv2-source-build-recorded task=WBV2-P27-002 wasm=${sha(wasmPath)} js=${sha(jsPath)} verification=DEFERRED`);
|
||||
2
web/app/public/vendor/blender/web_engine.js
vendored
2
web/app/public/vendor/blender/web_engine.js
vendored
File diff suppressed because one or more lines are too long
BIN
web/app/public/vendor/blender/web_engine.wasm
vendored
BIN
web/app/public/vendor/blender/web_engine.wasm
vendored
Binary file not shown.
2
web/app/src/vendor/blender/web_engine.js
vendored
2
web/app/src/vendor/blender/web_engine.js
vendored
File diff suppressed because one or more lines are too long
BIN
web/app/src/vendor/blender/web_engine.wasm
vendored
BIN
web/app/src/vendor/blender/web_engine.wasm
vendored
Binary file not shown.
Reference in New Issue
Block a user