Giter Club home page Giter Club logo

Comments (6)

DavHau avatar DavHau commented on June 19, 2024 2

Currently nix-portable doesn't support anything else than x86_64-linux. So that would have to be the first thing to fix. The main reason that restricts its compatibility is that the static proot binary is pulled from proots original pipeline. (And they don't provide binaries for aarch64). Therefore we'd need to fix the static nix build for proot in nixpkgs first. It builds, but try executing it in a debian docker container and it will fail.

Theoretically the bundling mechanism used here could be carved out and used for other stuff as well. But currently the bundling logic is not separated from the nix-portable specific things.

Another feature that you would probably want by a general bundler is a cleanup procedure that makes sure the temporary unpacked binaries get deleted after process execution. The arx bundler, which nix-bundle is relying on, does that via trap AFAIK.

In general I think it could be a good approach to build a general bundler out of the nix-portable logic. Since it is all just nix based, we could achieve good customizability. Also the amount of dependencies we require on the target system is very minimal. Another good thing is, the nix-portable approach uses zip + zstd compression which is orders of magnitude faster upon execution compared to nix-bundle and achieves better compression ratio at the same time.

from nix-portable.

573 avatar 573 commented on June 19, 2024 1

@DavHau, regarding the static build of proot: https://github.com/t184256/nix-on-droid/search?q=proot-static

from nix-portable.

573 avatar 573 commented on June 19, 2024

This is great news !

Glad to see there are chances to get something new on nix-bundle's and nix-portable's shoulders. In fact I tried / am trying multiple approaches getting static binaries. Especially when it comes to non-toplevel packages i. e. some haskell artifacts I guess it heavily depends on which ghc version is used etc. long read short: Even if they compile ldd on aarch64 in fact states a different outcome (still dynamic exe).

Another path taken was nix-copy-closure, but there the closure sizes are a real blocker (again when using haskell binaries especially) as my phone is low on storage.

Thus I am happy to have you join in as still the best option to me in this area seems to be some kind of bundling.

from nix-portable.

573 avatar 573 commented on June 19, 2024

@DavHau would you mind joining ZuriHac this weekend (registration link) ?
We could make this a project there.

from nix-portable.

DavHau avatar DavHau commented on June 19, 2024

Sounds like a nice idea. I cannot yet tell how much I can get involved, because I will be traveling a bit this weekend. But I will try to allocate at least some time.
When I register there, should I put some project name?

Another path taken was nix-copy-closure, but there the closure sizes are a real blocker (again when using haskell binaries especially) as my phone is low on storage.

I mean, in the end, the bundler will also just unpack the closure to some location on disk. That might just be temporary, but you still need the space. I guess building actual static binaries is the only way to prevent copying the closure.

Also, when bundling multiple apps separately, it might require even more disk space compared to pure nix, since both app archives might contain redundant store paths.

from nix-portable.

573 avatar 573 commented on June 19, 2024

No hurries.

I still like the idea of a bundler and both nix-bundle and nix-portable provide useful shortcuts at least for executables with small to medium size closures. In my case and I cannot speak in general there are 2 or 3 apps I'd like to just have usable on aarch64 host.

Static cross compilation is still blocked for me via Template Haskell as I'm still in the process of figuring out how to utilize the iserv process to handle those compile time code executions on host instead of build platform. There is some light at the end of the tunnel currently at least it seems as I'm approaching successful run via iohk's haskell.nix but I'm still not sure the main road blocks are passed in the near future.

So yes, #static-proot might be a project title and maybe as 2nd milestone we try the cross build maybe not this weekend. 1st milestone could just be to extract proot build and make it static as you proposed.

from nix-portable.

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.