GithubHelp home page GithubHelp logo

Comments (6)

t184256 avatar t184256 commented on August 26, 2024 3

Oh god, I pulled it off! I've cross-compiled a proot that works!

Everybody with even a bit of Nix knowledge is welcome to my proot.nix to fix my sloppy cross-compiling (seriously, I've cut a lot of corners on that way, like, all of them).

Everybody with aarch64 devices is kindly asked to wipe+reinstall (or substitute proot) and go for another hunt for the dreaded bus error.

from nix-on-droid.

 avatar commented on August 26, 2024

it may be useful: NixOS/nixpkgs@52566c3 (not yet merged)

from nix-on-droid.

t184256 avatar t184256 commented on August 26, 2024

Mindlessly tried building

pkgsCross.aarch64-multiplatform.pkgsStatic.proot
.overrideAttrs (oa: {
  version = "2019-03-12";
  src = pkgs.fetchFromGitHub {
    repo = "proot";
    owner = "termux";
    rev = "09568e21ff9fee7a6907be34a2d0fde3bacca7eb";
    sha256 = "1091si4i07349y7x7sx1r904gg3c9a3m39xkv24fakjlirpi3lpy";
  };
  makeFlags = [ "-Csrc CFLAGS=-D__ANDROID__" ];
}))
.override {
  enablePython = false;
)

from that checkout, got a proot that dies with a Bus Error on a very early mkdir.

from nix-on-droid.

matthewbauer avatar matthewbauer commented on August 26, 2024

Hmm... it's possible that the proot fork only works with bionic? That gets trickier because we don't have a good way to cross execute android linker. Something like this should work:

let
  pkgs = import <nixpkgs> {
    crossSystem = (import <nixpkgs/lib>).systems.examples.aarch64-multiplatform-musl;
    crossOverlays = [ (import <nixpkgs/pkgs/top-level/static.nix>) ];
  };
  proot = pkgs.proot.override { enablePython = false; };
in pkgs.runCommand "test" {} ''
  ${pkgs.stdenv.hostPlatform.emulator pkgs.buildPackages} ${proot}/bin/proot --version
''

but there's obviously some things specific to android that could be causing the bus error.

from nix-on-droid.

t184256 avatar t184256 commented on August 26, 2024

Interesting, maybe I do need bionic.

Did I understand your suggestion correctly: build proot statically, but use aarch64-android-prebuilt (and not aarch64-multiplatform-musl like in your example) to get it statically linked against bionic?

from nix-on-droid.

matthewbauer avatar matthewbauer commented on August 26, 2024

Yeah, Musl should work with Android fine after all it is just linux. But it's definitely possible something is causing an issue.

from nix-on-droid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.