4 ms·
This could work with Rust? I have a great use case for it and could slash half of my CI if is true!
by mamcx 3y ago
This could work with Rust? I have a great use case for it and could slash half of my CI if is true!
- vitiral 3y agoThe trick could definitely work with rust since fundamentally it's "just" a hack on how the various scripts work on different systems. Actually getting the rust compiler to produce cosmopolitan binaries would likely be a heavy lift though. Also it says it supports WASM (wasi?) so some applications might work out of the box with that.
- ahgamut 3y agohttps://github.com/ahgamut/rust-ape-example https://github.com/ahgamut/rust-ape-example My above repo contains example with the Rust standard library that build as fat executables with Cosmopolitan Libc. I also got ripgrep to build https://github.com/ahgamut/ripgrep/tree/cosmopolitan https://github.com/ahgamut/ripgrep/tree/cosmopolitan, but it wasn't part of the cosmocc binaries because some crates that are part of the build require `#!feature(rustc_private)]` to be added to their source code. Same goes for bat and fd. To summarize, Rust CLI tools can be built with Cosmopolitan Libc, but to build them like we can build gcc/emacs/git right now, we will need some support and Rust expertise.
- Georgelemental 3y agoLast time I looked into Rust-on-Cosmopolitan, I couldn't make it work as Cosmopolitan determined syscall numbers, signal numbers, and such at runtime, but Rust standard library assumes compile-time constants (basically the same issue that C switch-case has). How did you get around that? Have you tested these binaries on non-Linux platforms?
- jart 3y agoWe have about ~700 test executables and two programs called runit/runitd which remote execute them across our entire test fleet each time we run `make test`. Currently, the fleet consists of `freebsd rhel7 xnu win10 openbsd netbsd pi silicon`. We used to have rhel5 and win7 in there too, but I've been slacking off the past few months. You can watch a video of how running all the test executables on all the systems only takes about fifteen seconds. https://justine.lol/sizetricks/#why https://justine.lol/sizetricks/#why
- Georgelemental 3y agoTo clarify, are any of those ~700 executables written in Rust?