Skip to main content

Module package

Module package 

Source
Expand description

rl package - bundle a .rl program into a self-contained binary.

Copies the rl binary itself, then appends the source text and a magic footer so the copy can detect and run the embedded program at startup without any arguments.

Β§Binary layout after packaging

[ original rl binary bytes ] [ rl source text (UTF-8) ] [ magic marker: \x00RL_PACKAGE_V1\x00 ] [ source length: u64 little-endian ]

The magic + length are appended after the source so detection only needs to read the last few bytes β€” no full scan required.

ConstantsΒ§

FOOTER_LEN πŸ”’
MAGIC πŸ”’
MAGIC_LEN πŸ”’

FunctionsΒ§

bundle πŸ”’
bundle_inner πŸ”’
find_embedded
Searches the running binary’s own bytes for an embedded rl program.
package
Packages source_path into a self-contained binary at output_path.
try_package πŸ”’