-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_fixed.sh
More file actions
26 lines (23 loc) · 942 Bytes
/
build_fixed.sh
File metadata and controls
26 lines (23 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
echo "==================================================="
echo "🛠️ Building NEAR Contract (WSL: Ubuntu)"
echo "==================================================="
# Use 'Ubuntu' distro as identified, force interactive shell to load env vars
# and executing the build commands directly.
wsl -d Ubuntu bash -i -c "
echo 'Please enter sudo password if prompted...';
source ~/.cargo/env;
cd packages/near-wasm;
echo 'Checking tools...';
rustc --version;
cargo near --version || echo 'cargo-near not in PATH (will fallback)';
echo 'Building...';
# Try cargo-near first (standard)
if command -v cargo-near &> /dev/null; then
cargo near build --no-docker
else
# Fallback to standard cargo build
echo '⚠️ cargo-near not found, using cargo build...';
RUSTFLAGS='-C link-arg=-s' cargo build --target wasm32-unknown-unknown --release
fi
"