Skip to content

Commit 6ebf78e

Browse files
fix(ci/windows): generate deno snapshot on Linux, download on Windows
Windows cannot build generate_snapshot.exe — irreconcilable CRT conflict: - surrealdb-librocksdb-sys mt_static compiles RocksDB with /MT - V8/deno deps link against /MD C++ runtime (msvcprt.lib) - MSVC linker refuses to mix MT/MD (LNK1319), even with /FORCE The V8 heap snapshot (CUSTOM_DENO_SNAPSHOT.bin) is architecture-specific (x86_64) but OS-independent — the same serialized heap state works on Linux, macOS, and Windows. New approach: 1. 'generate-deno-snapshot' job runs on Linux CI image (~10 min) 2. Uploads CUSTOM_DENO_SNAPSHOT.bin as artifact 3. Windows job downloads artifact before cargo build 4. No more generate_snapshot.exe compilation on Windows
1 parent 15cf990 commit 6ebf78e

1 file changed

Lines changed: 46 additions & 10 deletions

File tree

.github/workflows/publish_staging.yml

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,46 @@ jobs:
5252
prerelease: true
5353

5454
# ============================================================================
55+
# Generate V8 Deno Snapshot — runs on Linux, artifact shared to Windows
56+
# Windows cannot build generate_snapshot.exe due to irreconcilable CRT
57+
# mismatch (surrealdb-librocksdb-sys mt_static /MT vs V8/deno /MD).
58+
# The snapshot is architecture-specific (x86_64) but OS-independent.
59+
# ============================================================================
60+
generate-deno-snapshot:
61+
runs-on: ubuntu-latest
62+
container:
63+
image: coasys/ad4m-ci-linux:latest@sha256:a0ab4b6358b7314a2ad49e232ba6c53b28a56e7f02641f226b2ed05544cc66d8
64+
65+
needs:
66+
- create-release
67+
68+
steps:
69+
- name: Fetch source code
70+
uses: actions/checkout@v3
71+
72+
- name: Use Node.js 24.x
73+
uses: actions/setup-node@v3
74+
with:
75+
node-version: 24.x
76+
77+
- uses: pnpm/action-setup@v4
78+
79+
- name: pnpm Install
80+
run: pnpm install --no-frozen-lockfile
81+
82+
- name: Generate deno snapshot
83+
env:
84+
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
85+
run: |
86+
cd rust-executor && pnpm run build-deno-snapshot && cd ..
87+
88+
- name: Upload snapshot artifact
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: deno-snapshot
92+
path: rust-executor/CUSTOM_DENO_SNAPSHOT.bin
93+
retention-days: 1
94+
5595
# Linux Binary Build - Uses Docker container (all deps pre-installed)
5696
# ============================================================================
5797
build-launcher-binary-linux:
@@ -426,6 +466,7 @@ jobs:
426466

427467
needs:
428468
- create-release
469+
- generate-deno-snapshot
429470

430471
steps:
431472
- name: Fetch source code
@@ -521,16 +562,11 @@ jobs:
521562
cd connect && pnpm run build && cd ..
522563
cd dapp && pnpm run build && cd ..
523564
524-
- name: Generate deno snapshot
525-
env:
526-
RUSTY_V8_MIRROR: https://github.com/coasys/rusty_v8/releases/download
527-
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
528-
# generate_snapshot.exe has irreconcilable CRT conflicts:
529-
# surrealdb-librocksdb-sys mt_static → /MT, V8/deno deps → /MD.
530-
# /FORCE overrides ALL fatal linker errors (LNK1169 duplicates +
531-
# LNK1319 mismatches). Safe because generate_snapshot is a build tool.
532-
RUSTFLAGS: -C target-feature=+crt-static -C link-arg=/FORCE
533-
run: cd rust-executor && pnpm run build-deno-snapshot && cd ..
565+
- name: Download deno snapshot from Linux build
566+
uses: actions/download-artifact@v4
567+
with:
568+
name: deno-snapshot
569+
path: rust-executor/
534570

535571
- name: Build AD4M-CLI
536572
env:

0 commit comments

Comments
 (0)