Skip to content

Commit d0d9a24

Browse files
committed
Fix: Pin indexmap to 2.11.0 for Rust 1.81 compatibility
1 parent e62cb5f commit d0d9a24

11 files changed

Lines changed: 841 additions & 6 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Build Status and Issues
2+
3+
## Current Status: ⚠️ Build Blocked
4+
5+
### Issue 1: macOS Native Build
6+
- **Problem**: Apple's clang doesn't support WASM targets required by `blst` C library
7+
- **Status**: ❌ Cannot build natively on macOS
8+
9+
### Issue 2: Docker Build
10+
- **Problem**: Docker image `radixdlt/scrypto-builder:v1.3.0` has Cargo 1.81.0, but dependencies require newer Cargo with `edition2024` support
11+
- **Error**: `feature 'edition2024' is required` but not available in Cargo 1.81.0
12+
- **Status**: ❌ Docker build also fails
13+
14+
## Workarounds to Try
15+
16+
### Option 1: Try Newer Docker Image
17+
Check if there's a newer version of the builder:
18+
```bash
19+
# List available tags (if repository supports it)
20+
docker search radixdlt/scrypto-builder
21+
22+
# Try latest tag
23+
docker pull radixdlt/scrypto-builder:latest
24+
```
25+
26+
### Option 2: Use WASI SDK (Recommended Next Step)
27+
Since Docker has version issues, try the WASI SDK approach:
28+
See `MACOS_BUILD_WORKAROUNDS.md` for instructions
29+
30+
### Option 3: Build on Linux
31+
If you have access to a Linux machine, build there and copy the WASM file back.
32+
33+
### Option 4: Check Dependency Versions
34+
The issue might be that Scrypto 1.3.0 requires a newer builder. Check Radix documentation for the correct builder version match.
35+
36+
## Next Steps
37+
38+
1. Try WASI SDK installation (see `MACOS_BUILD_WORKAROUNDS.md`)
39+
2. Or check for newer Docker builder images
40+
3. Or use a Linux build environment
41+

Providers/Blockchain/NextGenSoftware.OASIS.API.Providers.RadixOASIS/contracts/Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Providers/Blockchain/NextGenSoftware.OASIS.API.Providers.RadixOASIS/contracts/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ name = "oasis_storage"
99

1010
[dependencies]
1111
scrypto = "1.3.0"
12-
# Pin base64ct to avoid edition2024 requirement (Rust 1.81 compatibility)
12+
# Pin dependencies to avoid Rust 1.82+ requirements (Rust 1.81 compatibility for Scrypto)
1313
base64ct = "<=1.7.3"
14+
indexmap = "<=2.11.0"
1415

1516
[package.metadata.scrypto]
1617
target = "wasm32-unknown-unknown"
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
# macOS Build Workarounds for Scrypto
2+
3+
## Problem
4+
5+
The build fails because `blst` (a cryptographic library) requires a C compiler that can target WebAssembly, but Apple's clang doesn't support WASM targets by default.
6+
7+
## Solution Options (Ranked by Reliability)
8+
9+
### Option 1: Use Docker Scrypto Builder (RECOMMENDED) ✅
10+
11+
This is the **official recommended approach** by Radix for consistent builds.
12+
13+
#### Prerequisites
14+
- Docker installed and running
15+
16+
#### Steps
17+
18+
1. **Pull the Scrypto Builder Docker image** (version should match your Scrypto version 1.3.0):
19+
```bash
20+
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker pull radixdlt/scrypto-builder:v1.3.0
21+
```
22+
23+
2. **Build using Docker**:
24+
```bash
25+
cd /Volumes/Storage/OASIS_CLEAN/Providers/Blockchain/NextGenSoftware.OASIS.API.Providers.RadixOASIS/contracts
26+
27+
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run \
28+
-v "$(pwd):/src" \
29+
-w /src \
30+
radixdlt/scrypto-builder:v1.3.0 \
31+
scrypto build
32+
```
33+
34+
3. **Find the WASM file**:
35+
The WASM file will be created at: `target/wasm32-unknown-unknown/release/oasis_storage.wasm`
36+
37+
**Pros**: Official method, consistent builds, no macOS-specific issues
38+
**Cons**: Requires Docker
39+
40+
---
41+
42+
### Option 2: Install WASI SDK (Good Alternative) ⚠️
43+
44+
Provides a WASM-compatible C compiler toolchain.
45+
46+
#### Steps
47+
48+
1. **Download and Install WASI SDK**:
49+
```bash
50+
# Download WASI SDK
51+
cd ~/Downloads
52+
curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-20/wasi-sdk-20.0-macos.tar.gz
53+
54+
# Extract
55+
tar -xvf wasi-sdk-20.0-macos.tar.gz
56+
57+
# Move to a permanent location (requires sudo)
58+
sudo mv wasi-sdk-20.0 /opt/wasi-sdk
59+
```
60+
61+
2. **Set Environment Variables** (add to `~/.zshrc` or `~/.bash_profile`):
62+
```bash
63+
export WASI_SDK_PATH="/opt/wasi-sdk"
64+
export CC="$WASI_SDK_PATH/bin/clang"
65+
export CXX="$WASI_SDK_PATH/bin/clang++"
66+
export AR="$WASI_SDK_PATH/bin/llvm-ar"
67+
export CFLAGS="--sysroot=$WASI_SDK_PATH/share/wasi-sysroot"
68+
export CXXFLAGS="--sysroot=$WASI_SDK_PATH/share/wasi-sysroot"
69+
```
70+
71+
3. **Apply changes**:
72+
```bash
73+
source ~/.zshrc # or source ~/.bash_profile
74+
```
75+
76+
4. **Try building again**:
77+
```bash
78+
cd contracts
79+
scrypto build
80+
```
81+
82+
**Pros**: Local build, no Docker needed
83+
**Cons**: More setup, may still have compatibility issues
84+
85+
---
86+
87+
### Option 3: Use Emscripten (Alternative) ⚠️
88+
89+
Another WASM compiler option.
90+
91+
#### Steps
92+
93+
1. **Install Emscripten**:
94+
```bash
95+
# Clone emsdk
96+
git clone https://github.com/emscripten-core/emsdk.git ~/emsdk
97+
cd ~/emsdk
98+
99+
# Install latest SDK
100+
./emsdk install latest
101+
./emsdk activate latest
102+
103+
# Activate in current shell
104+
source ./emsdk_env.sh
105+
```
106+
107+
2. **Configure build to use Emscripten**:
108+
```bash
109+
export CC=emcc
110+
export CXX=em++
111+
```
112+
113+
3. **Try building**:
114+
```bash
115+
cd contracts
116+
scrypto build
117+
```
118+
119+
**Pros**: Full WASM toolchain
120+
**Cons**: Large installation, may be overkill
121+
122+
---
123+
124+
### Option 4: Build on Linux (If Available)
125+
126+
If you have access to a Linux machine (physical, VM, or cloud instance):
127+
128+
```bash
129+
# On Linux machine
130+
cd contracts
131+
scrypto build
132+
```
133+
134+
Then copy the WASM file back to macOS.
135+
136+
**Pros**: Native build, no workarounds needed
137+
**Cons**: Requires Linux environment
138+
139+
---
140+
141+
## Quick Test: Try Docker First
142+
143+
The Docker approach is the most reliable. Let's try it:
144+
145+
```bash
146+
# Check if Docker is installed
147+
docker --version
148+
149+
# If Docker is available, try:
150+
cd /Volumes/Storage/OASIS_CLEAN/Providers/Blockchain/NextGenSoftware.OASIS.API.Providers.RadixOASIS/contracts
151+
152+
# Pull the builder (check version - might be v1.3.0 or different)
153+
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker pull radixdlt/scrypto-builder:v1.3.0
154+
155+
# Build
156+
DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run \
157+
-v "$(pwd):/src" \
158+
-w /src \
159+
radixdlt/scrypto-builder:v1.3.0 \
160+
scrypto build
161+
```
162+
163+
---
164+
165+
## Verifying the Build
166+
167+
After successful build, verify the WASM file exists:
168+
169+
```bash
170+
ls -lh target/wasm32-unknown-unknown/release/oasis_storage.wasm
171+
```
172+
173+
The file should be several MB in size.
174+
175+
---
176+
177+
## Next Steps After Successful Build
178+
179+
Once you have the WASM file:
180+
181+
1. **Deploy via Radix Wallet Developer Console**:
182+
- Go to: https://console.radixdlt.com/deploy-package
183+
- Connect your wallet
184+
- Upload the WASM file
185+
- Get package address
186+
187+
2. **Instantiate Component**:
188+
- Use package address to instantiate `OasisStorage` component
189+
- Get component address
190+
191+
3. **Update Configuration**:
192+
- Update `OASIS_DNA.json` with component address
193+
194+
See `STEP_BY_STEP_WALLET_DEPLOYMENT.md` for full deployment instructions.
195+
196+
---
197+
198+
## References
199+
200+
- Scrypto Builder: https://docs.radixdlt.com/docs/productionize-your-code
201+
- WASI SDK: https://github.com/WebAssembly/wasi-sdk
202+
- Emscripten: https://emscripten.org/docs/getting_started/downloads.html
203+

0 commit comments

Comments
 (0)