Skip to content

Commit e8172d9

Browse files
authored
docs: describe potential build issues (#716)
* chore: describe potential build issues * chore: add more info & formatting * fix: cmake problematic version
1 parent 8a6916a commit e8172d9

2 files changed

Lines changed: 143 additions & 3 deletions

File tree

BUILD.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Build Issues and Solutions
2+
3+
## Prerequisites
4+
5+
Check that you have **DashSync** repo next to the wallet repo.
6+
7+
Make sure you're on the **master** branch for both DashSync and DashWallet.
8+
9+
### Clang Version Check
10+
11+
Check clang version:
12+
13+
```bash
14+
clang++ --version
15+
```
16+
17+
If you see homebrew version, this might cause issues with building. You need to switch to system version.
18+
19+
```
20+
❌ InstalledDir: /opt/homebrew/opt/llvm/bin
21+
✅ InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
22+
```
23+
24+
To unplug homebrew version, comment out the following in `~/.zshrc` or `~/.zsh_profile` (or `~/.bashrc` if you're using bash):
25+
26+
```bash
27+
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
28+
```
29+
30+
## Required Dependencies
31+
32+
Install the following dependencies:
33+
34+
- **cmake** (version 3.28.3 recommended)
35+
- **cbindgen**
36+
- **rust**
37+
38+
> **Note:** cmake 4.0.0 or higher might cause issues with building. Version 3.28.3 is tested and works.
39+
>
40+
> Download from: https://github.com/Kitware/CMake/releases/download/v3.28.3/cmake-3.28.3-macos-universal.dmg
41+
42+
### Installation Commands
43+
44+
```bash
45+
# Install CMake
46+
sudo "/Applications/CMake.app/Contents/bin/cmake-gui" --install
47+
48+
# Install cbindgen
49+
brew install cbindgen
50+
51+
# Install Rust
52+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
53+
```
54+
55+
### Xcode Setup
56+
57+
```bash
58+
xcode-select --install
59+
sudo xcodebuild -license accept
60+
```
61+
62+
### Pod Installation
63+
64+
Run from the wallet directory:
65+
66+
```bash
67+
pod install --verbose
68+
```
69+
70+
## Potential Issues and Solutions
71+
72+
### Issue 1: CBind Generation Error
73+
74+
**Error:**
75+
```
76+
Compiling rs-merk-verify-c-binding v0.1.3 (https://github.com/dashpay/rs-merk-verify-c-binding?branch=for-use-in-main-crate#930aeb2a)
77+
error: failed to run custom build command for `dash-spv-coinjoin v0.1.0 (/Users/username/Development/dash-shared-core/dash-spv-coinjoin)`
78+
```
79+
80+
**Solution:** Install cbindgen if not already installed:
81+
82+
```bash
83+
brew install cbindgen
84+
```
85+
86+
---
87+
88+
### Issue 2: Git Repository Error with DAPI-GRPC
89+
90+
**Error:**
91+
```
92+
Installing DAPI-GRPC (0.22.0-dev.8)
93+
> Git download
94+
$ /usr/bin/git clone https://github.com/dashevo/dashsync-iOS.git
95+
...
96+
fatal: not a git repository (or any of the parent directories): .git
97+
```
98+
99+
**Solution:** Downgrade CocoaPods to version 1.15.2. This might require upgrading Ruby to version 3.3.0 or higher:
100+
101+
```bash
102+
# Install Ruby
103+
brew install ruby
104+
105+
# Install specific CocoaPods version
106+
sudo gem install cocoapods -v 1.15.2
107+
```
108+
109+
**Alternative installation:**
110+
```bash
111+
sudo /opt/homebrew/opt/ruby/bin/gem install -n /usr/local/bin cocoapods -v 1.15.2
112+
```
113+
114+
---
115+
116+
### Issue 3: 'dash_shared_core.h' file not found
117+
118+
**Problem:** dash-shared-core was not compiled properly due to various potential reasons.
119+
120+
**Solution:** Check the build log for more details. Usually caused by missing dependencies (see above).
121+
122+
## dash-shared-core Development
123+
124+
If you want to make modifications to dash-shared-core, follow these steps:
125+
126+
### Setup Steps
127+
128+
1. **Place dash-shared-core in the correct location:**
129+
Put dash-shared-core in the same directory as the wallet repo.
130+
131+
2. **Remove DashSharedCore from DashSync.podspec:**
132+
```ruby
133+
# s.dependency 'DashSharedCore', '0.5.1'
134+
```
135+
136+
3. **Add local dash-shared-core to Podfile:**
137+
In the wallet or DashSync example Podfile, add:
138+
```ruby
139+
pod 'DashSharedCore', :path => '../dash-shared-core/'
140+
```

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,18 @@ Open `DashWallet.xcworkspace` in Xcode and run the project.
3636
## Requirements
3737

3838
- Xcode 11
39-
- Dependency manager [CocoaPods](https://cocoapods.org). Install via `gem install cocoapods`
39+
- Dependency manager [CocoaPods](https://cocoapods.org). Install via `gem install cocoapods -v 1.15.2`
4040

4141
### DashPay Requirements
4242

4343
Currently, DashPay wallet is under active development so it requires a few additional steps to make it work.
4444

4545
1. Clone [DashSync](https://github.com/dashevo/dashsync-iOS) and [dapi-grpc](https://github.com/dashevo/dapi-grpc) repositories:
4646
`git clone https://github.com/dashevo/dashsync-iOS.git DashSync`
47-
`git clone https://github.com/dashevo/dapi-grpc.git dapi-grpc`
4847

4948
To simplify developing process we use local podspec dependencies and it's important to preserve the following folder structure:
5049
```
5150
../DashSync/
52-
../dapi-grpc/
5351
../dashwallet-ios/
5452
```
5553

@@ -64,6 +62,8 @@ To simplify developing process we use local podspec dependencies and it's import
6462

6563
5. Run `pod install` in the wallet directory.
6664

65+
See [BUILD.md](BUILD.md) for more details.
66+
6767
### Optional Requirements
6868

6969
#### Objective-C Related

0 commit comments

Comments
 (0)