nix-community / nix-on-droid

Nix-enabled environment for your Android device. [maintainers=@t184256,@Gerschtli]
https://nix-on-droid.unboiled.info
MIT License
1.23k stars 65 forks source link

fails to build ghc #8

Closed chenyulue closed 4 years ago

chenyulue commented 5 years ago

I use nix-env -i ghc to install GHC. However, when compiling Distribution.SPDX.LIcenseId, I get the following error:

[123 of 270] Compiling Distribution.SPDX.LicenseId ( libraries/Cabal/Cabal/Distribution/SPDX/LicenseId.hs, bootstrapping/Distribution/SPDX/LicenseId.o ) utils/genprimopcode/ghc.mk:19: utils/genprimopcode/dist/package-data.mk: No such file or directory make[1]: [utils/ghc-cabal/ghc.mk:56: utils/ghc-cabal/dist/build/tmp/ghc-cabal] Killed make: [Makefile:123: all] Error 2 error (ignored): getting status of '/data/data/com.termux.nix/files/usr/tmp/nix-build-ghc-8.6.4.drv-1/ghc-8.6.4/utils/unlit/fs.c': Operation not permitted error: cannot unlink '/data/data/com.termux.nix/files/usr/tmp/nix-build-ghc-8.6.4.drv-1/ghc-8.6.4/utils/fs': Directory not empty

I have no idea why this happens and whether it is related to Nix-on-droid or just to GHC.

Could you take some time to look into it when you are free? Thanks!

My android version is 7.1.1

t184256 commented 5 years ago

Attempted to look into that, but hit an out-of-space error. Just wanted you to know that I'm on it, but it'll take some time.

t184256 commented 5 years ago

Can reproduce under nix-on-droid.

t184256 commented 5 years ago

By the way, how do you prevent long builds in nix-on-droid from being killed? =)

Building ghc times out even on Hydra (10h) and Hydra got some powerful hardware.

bbigras commented 5 years ago

Can we use nix-on-droid on the android emulator? I tried and the app crashed (or maybe just exited with an error).

t184256 commented 5 years ago

I foresee no problems with that approach as long as either:

1) the emulator emulates aarch64

or

2) you teach me how to run it in the emulator and I'll add support for the required architectures.

chenyulue commented 5 years ago

@t184256 I re-install the app, and building ghc succeeds.

BTW, on my phone (Meizu Pro 6s) building ghc took about 30 minutes, not as long as 10h. So I don't know your problem that long building is killed. But sometimes flyme os (customized Android by Meizu) can kill nix-on-droid when the screen is locked. So I permit nix-on-droid to run in the background and keep the screen unlocked while building ghc. This may help.

t184256 commented 5 years ago

I re-install the app, and building ghc succeeds.

I reinstalled the app and ghc just installed without any compilation. O_o

Hydra shows nixos:release-19.03-aarch64 builds now.

Hooray?

puffnfresh commented 4 years ago

Yeah I had no problem with GHC. Should close this.