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
c55fe9af
1ffda5be
1/1
deploy.yaml
success
14m 35s
+57
-2
1 changed file
expand all
collapse all
unified
split
.tangled
workflows
deploy.yaml
+57
-2
.tangled/workflows/deploy.yaml
reviewed
···
7
7
nixpkgs:
8
8
- nodejs
9
9
- bash
10
10
+
- git
11
11
+
- cacert
12
12
+
- cargo
13
13
+
- rustc
14
14
+
- wasm-pack
15
15
+
- clang # Compiler
16
16
+
- llvm # Provides llvm-ar and other tools often needed by burn
10
17
11
18
steps:
12
19
- name: install dependencies
13
20
command: npm install
14
21
22
22
+
- name: build external wasm models
23
23
+
environment:
24
24
+
MODEL_REPOS: >-
25
25
+
https://tangled.org/akshitgaur2005.tngl.sh/depth_anything_v3_burn|depth
26
26
+
command: |
27
27
+
# --- FIX START ---
28
28
+
# 1. Completely clear Nix wrapper flags
29
29
+
# These variables are what force the compiler to look at Linux headers
30
30
+
unset NIX_CFLAGS_COMPILE
31
31
+
unset NIX_LDFLAGS
32
32
+
unset C_INCLUDE_PATH
33
33
+
unset CPATH
34
34
+
unset LIBRARY_PATH
35
35
+
36
36
+
# 2. Configure Clang for WASM
37
37
+
export CC_wasm32_unknown_unknown=clang
38
38
+
39
39
+
# 3. Force "No Standard Includes" (-nostdinc)
40
40
+
# This stops Clang from looking at /nix/store/.../glibc/include
41
41
+
# But we must manually add back Clang's internal headers (stddef.h, limits.h, etc.)
42
42
+
CLANG_RES_DIR=$(clang -print-resource-dir)/include
43
43
+
export CFLAGS_wasm32_unknown_unknown="-nostdinc -I${CLANG_RES_DIR} -Wno-macro-redefined"
44
44
+
# --- FIX END ---
45
45
+
46
46
+
mkdir -p public/wasm
47
47
+
mkdir -p temp_build
48
48
+
cd temp_build
49
49
+
50
50
+
for entry in $MODEL_REPOS; do
51
51
+
url="${entry%%|*}"
52
52
+
name="${entry##*|}"
53
53
+
54
54
+
echo "--- Processing: $name from $url ---"
55
55
+
git clone "$url" "$name"
56
56
+
57
57
+
cd "$name"
58
58
+
echo "Checking out 'web' branch..."
59
59
+
git checkout web
60
60
+
61
61
+
echo "Building WASM..."
62
62
+
wasm-pack build --target web --out-dir ../../public/wasm/$name --no-typescript --release
63
63
+
64
64
+
rm -f ../../public/wasm/$name/.gitignore
65
65
+
cd ..
66
66
+
done
67
67
+
68
68
+
cd ..
69
69
+
rm -rf temp_build
70
70
+
15
71
- name: build site
16
16
-
# Use 'npm run build' which runs 'astro build'
17
72
command: npm run build
18
73
19
74
- name: deploy
20
75
command: |
21
21
-
npx --yes wrangler pages deploy dist --project-name himwant --branch main
76
76
+
npx --yes wrangler pages deploy dist --project-name himwant --branch main