I'm trying to build the project for the first time, and I'm having trouble with the Nix build. When running:
make shell TARGET=android
the build fails on
copying path '/nix/store/psx79cnz1khfjlzkw3j8x9sb1jhk1v1a-ndk-bundle-21.0.6113669' from 'https://nix-cache.status.im'...
NAR for '/nix/store/psx79cnz1khfjlzkw3j8x9sb1jhk1v1a-ndk-bundle-21.0.6113669' fetched from 'https://nix-cache.status.im' is incomplete
error: build of '/nix/store/pdhb0fgdg39nm884vz7mkm3bg2mhmdaj-licensed-android-sdk.drv' failed
make: *** [shell] Error 1
I've subsequently tried to download the package manually, to verify that the download works, but the server connection closes before the download completes, around the 2 minute mark. As a result the downloaded .nar is always broken. I've tried this on multiple machines, and Internet connections.
The build should complete.
s.a.
It seems pretty likely to me that there is some server timeout at play. I've tried to fire up a Digital Ocean VM to check if the download succeeds with a much faster internet connection, and it does.
It should be possible to complete the build on normal ADSL connection speeds.
Run
make shell TARGET=android
n/a
...
We are already tracking this issue in: https://github.com/status-im/infra-ci/issues/17
There are no timeouts that I can find involved in this, this must be some weird interaction between CloudFlare, Nginx, and the Perl script that is hosting the NDK. I have no clue what is causing this.
It is possible that this PR for Nixpkgs will fix this: https://github.com/NixOS/nixpkgs/pull/89775
A simple temporary fix is to edit the nix/nix.conf and temporarily comment out extra-substituters:
https://github.com/status-im/status-react/blob/001789f76160a2511ec61764d5845b910764b323/nix/nix.conf#L2
Which should let Nix download the Android NDK directly from Google servers.
Thanks. That worked. This at least allows me to build for now.
Closing as tracked elsewhere.
Most helpful comment
A simple temporary fix is to edit the
nix/nix.confand temporarily comment outextra-substituters:https://github.com/status-im/status-react/blob/001789f76160a2511ec61764d5845b910764b323/nix/nix.conf#L2
Which should let Nix download the Android NDK directly from Google servers.