Open probonopd opened 2 months ago
Hi, I'm glad you're interested in this project! :)
I agree that having everything statically linked would be the ideal here, and I appreciate you looking into the initial details for it. Since I'm not an expert on glibc, musl, and whatnot, I don't know what the caveats are for using musl statically instead of dynamically linking to glibc, but it's definitely something I'd like to explore.
My first goal with this runtime is to make a working appimage with it. The last thing I was working on with the project was https://github.com/linux-packaging-rs/squashfuse-rs because there wasn't a squashfs fuse implementation written in rust. I'm still working out the kinks on that implementation, because I'm not a squashfs expert nor a fuse expert :laughing:
A lot of the squashfuse stuff rn is just me mounting a squashfs image and trying to traverse it and see what's working and what's not. If you know anyone with squashfs knowledge and is willing to program in rust that'd definitely be a space where I could use some help!
After I get a working appimage with this, maybe then the "everything statically linked" topic will be more on my mind.
Thanks for the update @ryanabx. No hurries. Adding Rust to my learning TODO list. Unfortunately I don't know anyone with that skillset. You decided against calling into C libsquashfuse by choice, or is that not possible from Rust?
Thanks for the update @ryanabx. No hurries. Adding Rust to my learning TODO list. Unfortunately I don't know anyone with that skillset. You decided against calling into C libsquashfuse by choice, or is that not possible from Rust?
It's possible, when people want to use a C library they will just use FFI https://doc.rust-lang.org/rust-by-example/std_misc/ffi.html https://doc.rust-lang.org/nomicon/ffi.html
I wanted to take a stab at getting the entire stack (or as much of it as possible) in rust. We could always just call into libsquashfuse if it ends up being too cumbersome to recreate a squashfs fuse implementation in rust.
Hello @ryanabx. Very interesting project! In fact, I have wondered for a long time whether writing an AppImage runtime in Rust would be a) feasible and b) beneficial. Unfortunately, I have never done anything with Rust so far.
Could you please add some instructions how to create a static binary for the runtime? It should not depend on glibc (or another C library) being present on the target system. For https://github.com/AppImage/type2-runtime, we are statically linking musl libc.
This is what I figured out so far:
This gives
How to proceed?
For https://github.com/AppImage/type2-runtime, we are building the whole thing in an Alpine Linux chroot. Do we need something similar here?
(At this point I am mainly interested in finding out how large an entirely static AppImage runtime written in Rust might be.)