13.4. Runtime and Dev Builds

The Morloc runtime — the shared library (libmorloc.so) and the nexus binary (morloc-nexus) — is written in Rust. Language-specific pools and extensions still use their own compilers (g++ for C++, etc.), but they link against the Rust-built libmorloc.so through a stable C ABI defined in a single header (morloc.h).

13.4.1. Build modes

morloc init -f installs the runtime by building it from source. It reads one environment variable:

Variable Purpose

MORLOC_RUST_DIR

Path to the data/rust/ Cargo workspace. morloc init runs cargo build --release there and copies the artifacts into place. Requires a working Rust toolchain (cargo).

libmorloc.so and morloc-nexus are deliberately not shipped as prebuilt binaries. A Morloc release publishes the compiler per platform plus the platform-independent Rust workspace as morloc-rust-src.tar.gz; the runtime is then built from that source with the environment’s own toolchain, so the library every pool links is ABI-coherent with the compilers that built those pools.

Under mim this is automatic: mim unpacks the release’s Rust source into its runtime store, points MORLOC_RUST_DIR at it, and provisions cargo through the environment’s conda toolchain. You only set the variable by hand when building from a source checkout:

export MORLOC_RUST_DIR=/path/to/compiler/data/rust
morloc init -f

13.4.2. What the runtime provides

The Rust workspace produces two artifacts:

libmorloc.so

Shared library linked by every pool. Provides the IPC layer (Unix domain sockets), shared-memory allocator, packet codec, JSON/MessagePack serialization, and worker-pool concurrency primitives.

morloc-nexus

Pre-compiled CLI entry point. Reads a program’s manifest.json file, parses command-line arguments, starts pool daemons, dispatches calls, and prints results.

13.4.3. Build dependencies

Tool When needed

cargo

Always — morloc init builds the runtime from source. Provisioned by mim through the environment’s conda toolchain; install via rustup only for an unmanaged build.

gcc / g++

Still required for C++ pool compilation and Python/R language extensions. No longer needed for the runtime itself.

13.4.4. Container images

An environment’s container image is generated by mim from the same requirements the native backend solves; there is no hand-authored base image to pull. The generated image stages the release’s Rust source and sets MORLOC_RUST_DIR itself, so users of mim never set it manually on either backend.