xenia a38a6219c2 | ||
---|---|---|
scripts | ||
.gitignore | ||
Makefile | ||
README.md | ||
main_bc.c | ||
run.rkt |
README.md
racket-static
a base set of scripts that let you build fully self-contained static binaries for racket applications
depending on your needs, this can be preferred to the usual raco exe
/raco dist
because that
tooling can generate distribution folders that still depend on dynamic libraries the target system
might not have (actually, i was prompted to make this partially by someone running into this exact
problem on mastodon). additionally, one single binary can be more convenient to distribute than a
whole dist
folder structure
dependencies
- systemd-nspawn (containers!)
- sudo (for running the above)
- rsync (copying files into container)
- wget (downloading stuff)
limitations
because the runtime is hosted in a static binary, dynamic ffi is unavailable (eg, ffi-lib
) will
not work. the workaround for this currently provided is static ffi, where loading table
from
static-ffi
(a primitive module instatiated by the runtime wrapper) will produce a table of
available static ffi functions - the integer pointer will need to be cast
to the correct function
type but after that it works as expected
further work will automate the generation and loading of static ffi tables, ideally out of C headers
using c-utils
currently if the racket code runs into an error it segfaults. i think i have to register a handler for this but idk how the internals work
runtime include paths probably don't work as expected. i have not tested but ideally don't use those yet
hello world demo
first time you run make it'll take a while. be patient. having more cores helps
make
./run