mirror of
https://github.com/logos-blockchain/lez-programs.git
synced 2026-07-17 04:19:35 +00:00
Skip compiled wallet packaging for generation-only outputs and normalize the relative shared-wallet lock entry. Document the supported macOS architecture accurately.
99 lines
2.9 KiB
Markdown
99 lines
2.9 KiB
Markdown
# AMM UI on macOS
|
|
|
|
The AMM UI supports Apple Silicon through the Nix flake. Intel Macs are not
|
|
supported because the pinned Nixpkgs release no longer supports
|
|
`x86_64-darwin`. The project packages its QML wallet and AMM client libraries
|
|
with relative macOS loader paths, so a normal `nix run .` does not need
|
|
`DYLD_LIBRARY_PATH`.
|
|
|
|
## One-time prerequisites
|
|
|
|
Install Nix in multi-user mode, make sure its daemon is running, and enable
|
|
flakes:
|
|
|
|
```sh
|
|
mkdir -p ~/.config/nix
|
|
printf '%s\n' 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf
|
|
nix --version
|
|
```
|
|
|
|
The build uses RISC Zero's Metal kernel build on Darwin. Apple Command Line
|
|
Tools alone do not provide the `metal` and `metallib` compilers. Install the
|
|
full Xcode application, select it, accept its licence, and install the Metal
|
|
Toolchain component when Xcode asks for it:
|
|
|
|
```sh
|
|
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
|
|
sudo xcodebuild -license accept
|
|
xcodebuild -downloadComponent MetalToolchain
|
|
xcrun --sdk macosx --find metal
|
|
xcrun --sdk macosx --find metallib
|
|
```
|
|
|
|
The last two commands must print paths. Do not use `RISC0_SKIP_BUILD_KERNELS=1`
|
|
as a replacement: the pinned RISC Zero version still invokes the Metal build
|
|
for this dependency graph.
|
|
|
|
Leave at least 40 GiB free before the first build. Qt, Rust and Nix closures
|
|
are large; later runs reuse the Nix store cache.
|
|
|
|
## Build and run
|
|
|
|
From this directory:
|
|
|
|
```sh
|
|
nix build .
|
|
nix run .
|
|
```
|
|
|
|
The first start opens the AMM UI without a wallet. Select **Connect** to create
|
|
or open the wallet stored under `~/.lee/wallet/`.
|
|
|
|
## Recovery
|
|
|
|
### `nix: command not found` or no `/nix` volume
|
|
|
|
Open a new terminal after installing Nix. If the Nix volume is not mounted or
|
|
the daemon is not available, repair the Nix installation using the installer
|
|
for the installed Nix version. Check the actual service state before trying to
|
|
bootstrap it again:
|
|
|
|
```sh
|
|
test -x /nix/var/nix/profiles/default/bin/nix
|
|
sudo launchctl print system/org.nixos.nix-daemon
|
|
```
|
|
|
|
`launchctl bootstrap` can report an I/O error when the service is already in
|
|
an inconsistent state; it is not proof that the daemon is stopped.
|
|
|
|
### `xcrun: unable to find utility "metal"`
|
|
|
|
The active developer directory points at Command Line Tools or lacks the Metal
|
|
Toolchain component. Repeat the Xcode selection and Metal verification steps
|
|
above. This is an Apple-host prerequisite and cannot be packaged inside the
|
|
flake.
|
|
|
|
### The first build runs out of space
|
|
|
|
Remove only disposable build outputs, then collect dead Nix store paths:
|
|
|
|
```sh
|
|
rm -rf /private/tmp/amm-pr210-build
|
|
nix-store --gc
|
|
```
|
|
|
|
Do not remove `/nix/store` directly.
|
|
|
|
### A flake lock error mentions an unlocked input
|
|
|
|
The committed `flake.lock` pins the AMM client to the PR branch and hashes the
|
|
local shared-wallet source. Restore that file if a local experiment replaced
|
|
it, then retry:
|
|
|
|
```sh
|
|
git restore flake.lock
|
|
nix flake metadata --no-write-lock-file
|
|
```
|
|
|
|
Run these commands from `apps/amm`.
|