nix-community / nix-on-droid

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

GNU Make 4.3 from 20.09 is broken on some devices #91

Closed t184256 closed 3 years ago

t184256 commented 3 years ago

GNU Make 4.3 from 20.09 cannot spawn any processes, aborting with Function not implemented. https://discourse.nixos.org/t/9875 A workaround that builds gnumake-4.3 that works and doesn't trigger a rebuild of everything is enabled with system.workaround.make-posix-spawn.enable, but it's ugly. The issue currently known to manifest on only one device now. Please, contribute by reporting your Android/kernel versions and whether or not unworkarounded make 4.3 is functional on your device, especially if it's not.

t184256 commented 3 years ago

@Gerschtli, let's move the make discussion here out of #90.

Yes, I have limited access to a device that seems to have gnumake-4.3 spawn processes fine. The regression came with the rebase to Make 4.3 (NixOS/nixpkgs#0cfe9f3ae25f5c4627664476bececb31e8b0143e), which was the first release to default to using posix_spawn, IIRC.

Gerschtli commented 3 years ago

Alright, I will add myself to the list of broken devices:

ShamrockLee commented 3 years ago

It also happen to my phone.

noonien commented 3 years ago

I'm hitting the same error,

device: Samsung Galaxy Tab S7+
android: 11
kernel: Linux 4.19.113-21033171
system: "aarch64-linux"
multi-user?: no
version: nix-env (Nix) 2.4pre20201201_5a6ddb3
channels(nix-on-droid): "nix-on-droid-20.09, nixpkgs-20.09.3376.1ac507ba981"
nixpkgs: /data/data/com.termux.nix/files/home/.nix-defexpr/channels/nixpkgs

I'm getting the error when trying to build a flaked config in a nix-shell -p nixFlakes

ghost commented 3 years ago

Same problem. I'm getting the error when usin make, cargo, or cabal.

device: Asus ZenFone Max Pro M2
android: 9 (API 28)
system: aarch64-linux
kernel: Linux 4.4.153-perf+
multi-user?: no
version: niv-env (Nix) 2.3.10
channels: "home-manager release-20.09, nix-on-droid release-20.09, nixpkgs nixos-20.09"
nixpkgs: /data/data/com.termux.nix/files/home/.nix-defexpr/channels/nixpkgs
t184256 commented 3 years ago

Notes to self: right before the crash proot catches a SIGSYS, caused by seccomp. Can be observed with elevated proot's verbosity. tracee/seccomp.c already has handle_seccomp_event_common to retrigger modified calls. Next steps seem to be, learning what setresgid does, who called it, why is it blocked, how to sidestep it and why is this device-specific.

t184256 commented 3 years ago

I can't believe it. Call for testing!

Either

Then test compiling pretty much anything using make, the bare minimum should be running a nix-shell -p gnumake --run make after creating Makefile containing

all:
    echo test
noonien commented 3 years ago

The test ran successfully on my device.

Welcome to Nix-on-Droid!
If nothing works, open an issue at https://github.com/t184256/nix-on-droid/issues or try the rescue shell.

bash-4.4$ nix-channel --add https://github.com/t184256/nix-on-droid/archive/refs/heads/does-this-fix-make.tar.gz nix-on-droid
bash-4.4$ nix-channel --list
nix-on-droid https://github.com/t184256/nix-on-droid/archive/refs/heads/does-this-fix-make.tar.gz
nixpkgs https://nixos.org/channels/nixos-20.09
bash-4.4$ nix-channel --update
these derivations will be built:
  /nix/store/6476ycaff46d54aknzvzsllr60i8c8bl-nix-on-droid.drv
building '/nix/store/6476ycaff46d54aknzvzsllr60i8c8bl-nix-on-droid.drv'...
unpacking channels...
created 2 symlinks in user environment

bash-4.4$ nix-on-droid switch
Building activation package...
[9 built, 62 copied (405.9 MiB), 77.0 MiB DL]
Executing activation script...
Activating linkBinSh
Activating linkUsrBinEnv
Activating installLogin
Activating installLoginInner
Activating installPackages
replacing old 'nix-on-droid-path'
installing 'nix-on-droid-path'
building '/nix/store/rs03pvv6p9nc4fg52ngggrhxjiyxmb8k-user-environment.drv'...
created 7 symlinks in user environment
Activating installProotStatic
Activating setUpEtc
Activating linkProfile

bash-4.4$ cat > Makefile
all:
    echo test
bash-4.4$ nix-shell -p gnumake --run make
echo test
test
bash-4.4$ nix-shell -p gnumake --run make --version
nix-shell (Nix) 2.3.11
t184256 commented 3 years ago

Awesome, thanks for the report!