Compiling ARM binaries for large piers
Edit: You can also now download a pre-compiled static ARM binary with increased LMDB mapsize from ~botter-nidnul’s Urbit ARM page
With the release of the 1.9 binary, I thought it would be a useful time to highlight an esoteric issue that popped up for me previously, and how to fix it. By default, Urbit ARM binaries allow a maximum pier size of 60GB. This is plenty for most people (who mostly aren’t using ARM anyway), but not for a star that has been running continuously for years and hosting a large group, like ~matwet
. ~matwet
’s pier currently sits around 70GB, which would cause it to fail to boot using unmodified binaries, with the following error:
lmdb: write failed: MDB_MAP_FULL: Environment mapsize limit reached
ames: live on 54321
pier: disk write bail
home: bailing out
Aborted (core dumped)
However, there is a simple solution to this problem, as documented by ~roller-foster
. I’ll include it with compile instructions provided by ~tinnus-napbus
.
- $> sh <(curl -L https://nixos.org/nix/install) --daemon
- $> nix-env -iA cachix -f https://cachix.org/api/v1/install
- $> cachix use ares
This will install and prepare your Nix environment. Next, let’s grab the source code for 1.9:
- $> wget https://github.com/urbit/urbit/archive/refs/tags/urbit-v1.9.tar.gz
- $> tar xvzf urbit-v1.9.tar.gz
- $> cd urbit-urbit-v1.9
Here’s the part we need to modify – pkg/urbit/vere/disk.c
, line 887 (this may be slightly different if you’re editing a different version):
const size_t siz_i =
#if (defined(U3_CPU_aarch64) && defined(U3_OS_linux)) || defined
(U3_OS_mingw)
0xf00000000;
#else
0x10000000000;
#endif
The hex value 0xf00000000
represents 60GB – we’re going to edit it, so that it matches the value below it – 0x10000000000
(1TB).
Once you’ve edited and saved this file, you can proceed with compilation:
- $> nix-build -A urbit
- $> nix-env -f . -iA urbit
Note that this will build a dynamically linked binary, so it’s not portable between machines. Now it’s built and in your PATH, so you can just run urbit
and make sure it says 1.9 at the top.
1.9 introduces ‘docking’, which will install the binary into your pier. You install and run your pier like this:
- $> urbit dock path/to/pier
- $> path/to/pier/.run