|
| 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 | + ``` |
0 commit comments