Skip to content

Commit d0fa549

Browse files
xrvivclaude
andcommitted
fix(docs): correct Flutter version, add Rust 1.71.0, fix Ubuntu 24.04 meson install, add rsync
- Flutter: 3.38.5 → 3.38.1 (all platforms; confirmed by libflutter.so identity match during reproducible build verification) - Rust: add 1.71.0 to all rustup install lines; required by crypto_plugins/frostdart/scripts/linux/build_all.sh which hardcodes cargo +1.71.0 - Ubuntu 24.04 meson: replace pipx with python3-venv approach; pipx cannot install library-only packages (markupsafe, jinja2, etc.) and will fail; setuptools added because Python 3.12 removed distutils which meson needs for GObject introspection - Linux desktop deps: add rsync; required by crypto_plugins/flutter_libmwc/scripts/linux/build_all.sh Fixes found during WalletScrutiny reproducible build verification (issue #1399). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent edc19aa commit d0fa549

1 file changed

Lines changed: 67 additions & 34 deletions

File tree

docs/building.md

Lines changed: 67 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Here you will find instructions on how to install the necessary tools for buildi
1414
The following instructions are for building and running on a Linux host. Alternatively, see the [Mac](#mac-host) and/or [Windows](#windows-host) section. This entire section (except for the Android Studio section) needs to be completed in WSL if building on a Windows host.
1515

1616
### Flutter
17-
Install Flutter 3.38.5 by [following their guide](https://docs.flutter.dev/get-started/install/linux/desktop?tab=download#install-the-flutter-sdk). Run `flutter doctor` in a terminal to confirm its installation.
17+
Install Flutter 3.38.1 by [following their guide](https://docs.flutter.dev/get-started/install/linux/desktop?tab=download#install-the-flutter-sdk). Run `flutter doctor` in a terminal to confirm its installation.
1818

1919
### Android Studio
2020
Install Android Studio. Follow instructions here [https://developer.android.com/studio/install#linux](https://developer.android.com/studio/install#linux) or install via snap:
@@ -43,26 +43,17 @@ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-
4343
### Build dependencies
4444
Install basic dependencies
4545
```
46-
sudo apt-get install libssl-dev curl unzip automake build-essential file pkg-config git python3 libtool libtinfo6 cmake libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm g++ gcc gperf libopencv-dev python3-typogrify xsltproc valac gobject-introspection meson
47-
```
48-
49-
For Ubuntu 20.04,
50-
```
51-
sudo apt-get install valac python3-pip
52-
pip3 install --upgrade meson==0.64.1 markdown==3.4.1 markupsafe==2.1.1 jinja2==3.1.2 pygments==2.13.0 toml==0.10.2 typogrify==2.0.7 tomli==2.0.1
53-
```
54-
55-
For Ubuntu 24.04,
56-
```
57-
sudo apt install pipx libgcrypt20-dev libglib2.0-dev libsecret-1-dev
58-
pipx install meson==0.64.1 markdown==3.4.1 markupsafe==2.1.1 jinja2==3.1.2 pygments==2.13.0 toml==0.10.2 typogrify==2.0.7 tomli==2.0.1
46+
sudo apt-get install libssl-dev curl unzip automake build-essential file pkg-config git python3 libtool libtinfo6 cmake libgit2-dev clang libncurses5-dev libncursesw5-dev zlib1g-dev llvm lld g++ gcc gperf libopencv-dev python3-typogrify xsltproc valac gobject-introspection meson python3-pip python3-venv libgcrypt20-dev libglib2.0-dev libsecret-1-dev
47+
python3 -m venv ~/.build-tools
48+
~/.build-tools/bin/pip install meson==0.64.1 markdown==3.4.1 markupsafe==2.1.1 jinja2==3.1.2 pygments==2.13.0 toml==0.10.2 typogrify==2.0.7 tomli==2.0.1 setuptools
49+
echo 'export PATH="$HOME/.build-tools/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
5950
```
6051

6152
Install [Rust](https://www.rust-lang.org/tools/install) via [rustup.rs](https://rustup.rs), the required Rust toolchains, and `cargo-ndk` with command:
6253
```
6354
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
6455
source ~/.bashrc
65-
rustup install 1.89.0 1.85.1 1.81.0
56+
rustup install 1.89.0 1.85.1 1.81.0 1.71.0
6657
rustup default 1.89.0
6758
cargo install cargo-ndk
6859
```
@@ -75,12 +66,11 @@ rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-andro
7566

7667
Linux desktop specific dependencies:
7768
```
78-
sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev meson python3-pip libgirepository1.0-dev valac xsltproc docbook-xsl
79-
pip3 install --upgrade meson==0.64.1 markdown==3.4.1 markupsafe==2.1.1 jinja2==3.1.2 pygments==2.13.0 toml==0.10.2 typogrify==2.0.7 tomli==2.0.1
69+
sudo apt-get install clang cmake lld ninja-build pkg-config libgtk-3-dev liblzma-dev meson python3-pip libgirepository1.0-dev valac xsltproc docbook-xsl rsync
8070
```
8171

8272
### Flutter
83-
Install Flutter 3.38.5 by [following their guide](https://docs.flutter.dev/install/manual).
73+
Install Flutter 3.38.1 by [following their guide](https://docs.flutter.dev/install/manual).
8474

8575
Run `flutter doctor` in a terminal to confirm its installation.
8676

@@ -89,7 +79,7 @@ After installing the prerequisites listed above, download the code and init the
8979
```
9080
git clone https://github.com/cypherstack/stack_wallet.git
9181
cd stack_wallet
92-
git submodule update --init --recursive
82+
git submodule foreach 'git fetch --tags' && git submodule update --init --recursive
9383
```
9484

9585
Build the secure storage dependencies in order to target Linux (not needed for Windows or other platforms):
@@ -160,13 +150,21 @@ cd scripts/windows
160150
./deps.sh
161151
```
162152

163-
install go in WSL [https://go.dev/doc/install](https://go.dev/doc/install) (follow linux instructions) and ensure you have `x86_64-w64-mingw32-gcc`
153+
Upgrade the version of cmake >= 3.31.6, the default version of ubuntu 24.04 (3.28.1) will be too low to build libepiccash.
154+
You can use pip to install a specific version
155+
```
156+
sudo apt remove cmake
157+
pip install cmake==3.31.6
158+
```
159+
160+
install go in WSL [https://go.dev/doc/install](https://go.dev/doc/install) (follow linux instructions) and ensure you have `mingw-w64` package installed to get the `x86_64-w64-mingw32-gcc` compiler.
161+
164162
go version should be at least 1.24
165163

166-
and use `scripts/build_app.sh` to build plugins:
164+
and use `scripts/build_app.sh` to build plugins: (see the [Build script section](#build-script-build_appsh) to understand the arguments)
167165
```
168166
cd ..
169-
./build_app.sh -a stack_wallet -p windows -v 2.1.0 -b 210
167+
./build_app.sh -a stack_wallet -p windows -v 2.4.4 -b 301
170168
```
171169

172170
### Running
@@ -213,7 +211,7 @@ Download and install [Rust](https://www.rust-lang.org/tools/install). [Rustup](
213211
```
214212
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
215213
source ~/.bashrc
216-
rustup install 1.89.0 1.85.1 1.81.0
214+
rustup install 1.89.0 1.85.1 1.81.0 1.71.0
217215
rustup default 1.89.0
218216
cargo install cargo-ndk
219217
cargo install cbindgen cargo-lipo
@@ -223,7 +221,7 @@ rustup target add aarch64-apple-ios aarch64-apple-darwin
223221
Optionally download [Android Studio](https://developer.android.com/studio) as an IDE and activate its Dart and Flutter plugins. VS Code may work as an alternative, but this is not recommended.
224222

225223
### Flutter
226-
Install 3.38.5 on your Mac host by [following their guide](https://docs.flutter.dev/install/manual). Run `flutter doctor` in a terminal to confirm its installation.
224+
Install Flutter 3.38.1 on your Mac host by [following their guide](https://docs.flutter.dev/install/manual). Run `flutter doctor` in a terminal to confirm its installation.
227225

228226
### Build plugins and configure
229227
#### Building plugins for iOS
@@ -266,17 +264,33 @@ flutter run macos
266264
## Windows host
267265

268266
### Visual Studio
269-
Visual Studio is required for Windows development with the Flutter SDK. Download it at https://visualstudio.microsoft.com/downloads/ and install the "Desktop development with C++", "Linux development with C++", and "Visual C++ build tools" workloads. You may also need the Windows 10, 11, and/or Universal SDK workloads depending on your Windows version.
267+
Visual Studio 2022 is required for Windows development with the Flutter SDK. Download it at https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history and install the "Desktop development with C++", "Linux development with C++", and "Visual C++ build tools" workloads. You may also need the Windows 10, 11, and/or Universal SDK workloads depending on your Windows version.
270268

271269
### Build plugins in WSL2
272270
Set up Ubuntu 24.04 in WSL2. Follow the entire Linux host section in the WSL2 Ubuntu 24.04 host to get set up to build. The Android Studio section may be skipped in WSL (it's only needed on the Windows host).
273271

274272
Install the following libraries:
275273
```
276-
sudo apt-get install libgtk2.0-dev
274+
sudo apt-get install libgtk2.0-dev nasm mingw-w64
275+
```
276+
277+
The WSL2 host may optionally be navigated to the `stack_wallet` repository on the Windows host in order to build the plugins in-place and skip the next section in which you copy the `dll`s from WSL2 to Windows.
278+
279+
In this case, you need to enable "metadata" in your wsl setup to be able to modify files on your Windows filesystem.
280+
Add this content to your /etc/wsl.conf in WSL.
281+
```
282+
[automount]
283+
options = "metadata"
284+
```
285+
Then restart the wsl from Windows
277286
```
287+
wsl --shutdown
288+
wsl
289+
```
290+
291+
https://stackoverflow.com/questions/46610256/chmod-wsl-bash-doesnt-work/50856772#50856772
278292

279-
The WSL2 host may optionally be navigated to the `stack_wallet` repository on the Windows host in order to build the plugins in-place and skip the next section in which you copy the `dll`s from WSL2 to Windows. Then build windows `dll` libraries by running the following script on the WSL2 Ubuntu 20.04 host:
293+
Then build windows `dll` libraries by running the following script on the WSL2 Ubuntu 24.04 host:
280294

281295
- `stack_wallet/scripts/windows/build_all.sh`
282296

@@ -289,12 +303,12 @@ If the DLLs were built on the WSL filesystem instead of on Windows, copy the res
289303
Frostdart will be built by the Windows host later.
290304

291305
### Install Flutter on Windows host
292-
Install Flutter 3.38.5 on your Windows host (not in WSL2) by [following their guide](https://docs.flutter.dev/install/manual). Run `flutter doctor` in PowerShell to confirm its installation.
306+
Install Flutter 3.38.1 on your Windows host (not in WSL2) by [following their guide](https://docs.flutter.dev/install/manual). Run `flutter doctor` in PowerShell to confirm its installation.
293307

294308
### Rust
295309
Install [Rust](https://www.rust-lang.org/tools/install) on the Windows host (not in WSL2). Download the installer from [rustup.rs](https://rustup.rs), make sure it works on the commandline (you may need to open a new terminal), and install the following versions:
296310
```
297-
rustup install 1.89.0 1.85.1 1.81.0
311+
rustup install 1.89.0 1.85.1 1.81.0 1.71.0
298312
rustup default 1.89.0
299313
cargo install cargo-ndk
300314
```
@@ -307,11 +321,27 @@ Enable Developer Mode for symlink support,
307321
start ms-settings:developers
308322
```
309323

310-
You may need to install NuGet and CppWinRT / C++/WinRT SDKs version `2.0.210806.1`:
324+
Or enable it automatically from powershell:
325+
```
326+
PS C:\WINDOWS\system32> reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" /t REG_DWORD /f /v "AllowDevelopmentWithoutDevLicense" /d "1"
327+
```
328+
329+
330+
Install NuGet:
311331
```
312-
winget install 9WZDNCRDMDM3 # NuGet, can also use Microsoft.NuGet
313-
winget install Microsoft.Windows.CppWinRT -Version 2.0.210806.1
332+
winget install 9WZDNCRDMDM3 --accept-package-agreements # NuGet, can also use Microsoft.NuGet
333+
```
334+
335+
Then restart your terminal and add a source to nuget:
314336
```
337+
nuget sources add -Name "nuget.org" -Source "https://api.nuget.org/v3/index.json"
338+
```
339+
340+
Install and CppWinRT / C++/WinRT SDKs version `2.0.210806.1` with the help of nuget:
341+
```
342+
nuget install Microsoft.Windows.CppWinRT --Version 2.0.210806.1
343+
```
344+
315345
or [download the package](https://www.nuget.org/packages/Microsoft.Windows.CppWinRT/2.0.210806.1) and [manually install it](https://github.com/Baseflow/flutter-permission-handler/issues/1025#issuecomment-1518576722) by placing it in `flutter/bin` with [nuget.exe](https://dist.nuget.org/win-x86-commandline/latest/nuget.exe) and installing by running `nuget install Microsoft.Windows.CppWinRT -Version 2.0.210806.1` in the root `stack_wallet` folder.
316346
<!-- TODO: script this NuGet and WinCppRT installation -->
317347

@@ -320,16 +350,18 @@ or [download the package](https://www.nuget.org/packages/Microsoft.Windows.CppWi
320350
Certain test wallet parameter and API key template files must be created in order to run Stack Wallet on Windows. These can be created by script using PowerShell on the Windows host as in
321351
```
322352
cd scripts
323-
./prebuild.ps1
353+
powershell -ExecutionPolicy Bypass -File prebuild.ps1
324354
cd .. // When finished go back to the root directory.
325355
```
356+
357+
326358
or manually by creating the files referenced in that script with the specified content.
327359

328360
### Build frostdart
329361

330362
In PowerShell on the Windows host, navigate to the `stack_wallet` folder:
331363
```
332-
cd crypto_plugins/frostdart
364+
cd crypto_plugins/frostdart/scripts/windows
333365
./build_all.bat
334366
cd .. // When finished go back to the root directory.
335367
```
@@ -339,6 +371,7 @@ cd .. // When finished go back to the root directory.
339371
Run the following commands:
340372
```
341373
flutter pub get
374+
dart run coinlib:build_windows
342375
flutter run -d windows
343376
```
344377

0 commit comments

Comments
 (0)