@@ -6,34 +6,51 @@ yarn ubrn:clean
66echo " ==> Step 2: Checking out..."
77yarn ubrn:checkout
88
9- echo " ==> Step 3: Fetching full git history for patch application..."
9+ echo " ==> Step 3: Resetting any modifications after checkout..."
10+ git -C rust_modules/matrix-rust-sdk reset --hard HEAD
11+ echo " ✓ Repository clean"
12+
13+ echo " ==> Step 4: Fetching full git history for patch application..."
1014git -C rust_modules/matrix-rust-sdk fetch --unshallow
1115
12- echo " ==> Step 4: Applying patches..."
13- cd rust_modules/matrix-rust-sdk && git apply ../../patches/0001-Fix-uniffi-and-wasm-build.patch && git apply ../../patches/0001-Fix-wasm-default-features.patch && cd ../..
14- echo " ✓ Patches applied successfully"
16+ echo " ==> Step 5: Applying uniffi downgrade patch..."
17+ if git -C rust_modules/matrix-rust-sdk apply ../../patches/0001-Downgrade-uniffi-to-0.29.4.patch; then
18+ echo " ✓ Patch applied (uniffi downgrade to 0.29.4)"
19+ else
20+ echo " ✗ Patch failed!"
21+ exit 1
22+ fi
1523
16- echo " ==> Step 5: Removing bindings/wasm from Cargo.toml..."
24+ echo " ==> Step 6: Removing bindings/wasm from workspace..."
25+ # Remove the non-existent bindings/wasm from workspace members
1726sed -i.bak ' /bindings\/wasm/d' rust_modules/matrix-rust-sdk/Cargo.toml
27+ echo " ✓ Removed from workspace"
1828
19- echo " ==> Step 6 : Building web (first pass, expected to fail )..."
20- yarn ubrn:web:build:release || true
29+ echo " ==> Step 7 : Building web (first pass to generate wasm bindings )..."
30+ yarn ubrn:web:build:release || echo " (First pass may have warnings) "
2131
22- echo " ==> Step 7: Adding bindings/wasm back to Cargo.toml..."
23- sed -i.bak ' /uniffi-bindgen/a\
32+ echo " ==> Step 8: Adding bindings/wasm back to workspace..."
33+ # Add bindings/wasm back to workspace members now that it exists
34+ sed -i.bak ' /"xtask",/a\
2435 "bindings/wasm",
2536' rust_modules/matrix-rust-sdk/Cargo.toml
37+ echo " ✓ Added back to workspace"
2638
27- echo " ==> Step 8 : Building web (second pass, should succeed )..."
39+ echo " ==> Step 9 : Building web (second pass with complete workspace )..."
2840set -e
2941yarn ubrn:web:build:release
3042
31- echo " ==> Step 9: Fixing index.web.ts import..."
32- INDEX_FILE=" /Users/davidlangley/dev/aurora/src/index.web.ts"
33- sed -i.bak -E " s/index_bg\\ .wasm/index_bg.wasm?url/" " $INDEX_FILE "
43+ echo " ==> Step 10: Fixing index.web.ts import..."
44+ INDEX_FILE=" src/index.web.ts"
45+ if [ -f " $INDEX_FILE " ]; then
46+ sed -i.bak -E " s/index_bg\\ .wasm/index_bg.wasm?url/" " $INDEX_FILE "
47+ echo " ✓ Import fixed"
48+ else
49+ echo " ⚠ $INDEX_FILE not found, skipping import fix"
50+ fi
3451
35- echo " ==> Step 10 : Optimizing wasm binary with wasm-opt..."
36- WASM_FILE=" /Users/davidlangley/dev/aurora/ src/generated/wasm-bindgen/index_bg.wasm"
52+ echo " ==> Step 11 : Optimizing wasm binary with wasm-opt..."
53+ WASM_FILE=" src/generated/wasm-bindgen/index_bg.wasm"
3754if [ -f " $WASM_FILE " ]; then
3855 echo " Optimizing $WASM_FILE (this may take a few minutes)..."
3956 wasm-opt -Oz " $WASM_FILE " -o " ${WASM_FILE} .tmp" && mv " ${WASM_FILE} .tmp" " $WASM_FILE "
0 commit comments