Open mpolitzer opened 1 year ago
(For reference)
As mentioned, there are a couple of problems with the musl solution, both regarding rust.
We should not forget about this, there have been some interest from others to use Alpine for example. I also have interest to make "distroless" dapps, where I would install tools into an empty filesystem and copy my dapp statically linked, the dapp rootfs would be very tiny this way.
To make this happen we need to:
busybox
or toybox
libc-cartesi.so
There are plans to deprecate the rollup-http-server
and remove it from this repo.
We'll have a lot more flexibility when that happens.
With only C/C++ code on the repository we'll be able to experiment with a statically compiled tools.
On the boxybox
, toybox
, I'd suggest taking a look at s6
ecosystem, where is provided a lot of simple versions of useful linux tools with support for musl
and multicall binary just like busybox
.
I've already used its s6-rc and s6-overlays on container environments, but I never used it inside cartesi-machine, but I plan to test it.
Statically linking to MUSL instead of GLIBC would make the final binaries smaller, allowing rootfs to be more compact. Also statically linking GLIBC is not recommend, though @mpolitzer pointed this does not impact us.
To do this we would need to use a MUSL toolchain to build the tools, we could probably use Alpine toolchain or some other distro to compile them instead of creating our own toolchain, or maybe we could move our toolchain to use MUSL once we get rid of buildroot.