tangled
alpha
login
or
join now
akshitgaur2005.tngl.sh
/
himwant
0
fork
atom
Musings from the mountains
himwant.org
0
fork
atom
overview
issues
pulls
pipelines
Add Depth Anything v3 Burn WASM
akshitgaur2005.tngl.sh
2 months ago
b4bcfc18
1ffda5be
1/1
deploy.yaml
success
13m 45s
+52
-2
1 changed file
expand all
collapse all
unified
split
.tangled
workflows
deploy.yaml
+52
-2
.tangled/workflows/deploy.yaml
···
7
7
nixpkgs:
8
8
- nodejs
9
9
- bash
10
10
-
10
10
+
- git
11
11
+
- cacert
12
12
+
- cargo
13
13
+
- rustc
14
14
+
- wasm-pack
15
15
+
- gcc
16
16
+
- clang
11
17
steps:
12
18
- name: install dependencies
13
19
command: npm install
14
20
21
21
+
- name: build external wasm models
22
22
+
environment:
23
23
+
MODEL_REPOS: >-
24
24
+
https://tangled.org/akshitgaur2005.tngl.sh/depth_anything_v3_burn|depth
25
25
+
command: |
26
26
+
# --- FIX START ---
27
27
+
# 1. Force using clang for cross-compilation
28
28
+
export CC_wasm32_unknown_unknown=clang
29
29
+
export CFLAGS_wasm32_unknown_unknown="-Wno-macro-redefined"
30
30
+
31
31
+
# 2. STRIP NIX WRAPPERS:
32
32
+
# Nix injects flags for x86_64 Linux (like -I/nix/store/.../include).
33
33
+
# We must remove them so the compiler doesn't pull in Linux headers for WASM.
34
34
+
unset NIX_CFLAGS_COMPILE
35
35
+
unset NIX_LDFLAGS
36
36
+
unset C_INCLUDE_PATH
37
37
+
unset LD_LIBRARY_PATH
38
38
+
# --- FIX END ---
39
39
+
40
40
+
mkdir -p public/wasm
41
41
+
mkdir -p temp_build
42
42
+
cd temp_build
43
43
+
44
44
+
for entry in $MODEL_REPOS; do
45
45
+
url="${entry%%|*}"
46
46
+
name="${entry##*|}"
47
47
+
48
48
+
echo "--- Processing: $name from $url ---"
49
49
+
git clone "$url" "$name"
50
50
+
51
51
+
cd "$name"
52
52
+
echo "Checking out 'web' branch..."
53
53
+
git checkout web
54
54
+
55
55
+
echo "Building WASM..."
56
56
+
wasm-pack build --target web --out-dir ../../public/wasm/$name --no-typescript --release
57
57
+
58
58
+
rm -f ../../public/wasm/$name/.gitignore
59
59
+
cd ..
60
60
+
done
61
61
+
62
62
+
cd ..
63
63
+
rm -rf temp_build
64
64
+
15
65
- name: build site
16
66
# Use 'npm run build' which runs 'astro build'
17
67
command: npm run build
18
68
19
69
- name: deploy
20
70
command: |
21
21
-
npx --yes wrangler pages deploy dist --project-name himwant --branch main
71
71
+
npx --yes wrangler pages deploy dist --project-name himwant --branch main