Skip to main content

Crate oxdock_process

Crate oxdock_process 

Source

Re-exports§

pub use builtin_env::BuiltinEnv;
pub use env_policy::check_spawn_anchors;
pub use env_policy::has_var;
pub use env_policy::is_sanctioned_seed;
pub use env_policy::names_eq;
pub use env_policy::needs_path_lookup;
pub use env_policy::seed_defaults;
pub use env_policy::seed_differs;
pub use env_policy::seed_transport;
pub use env_policy::seeded_env_names;
pub use pump::CancelGuard;
pub use pump::CancelHub;
pub use pump::PUMP_CHUNK;
pub use pump::read_pump_chunk;
pub use pump::run_guarded;

Modules§

builtin_env
env_policy
Central host-injection policy: the single place deciding what may flow from the host OS into scripts and spawned children.
pump
Event-driven pump mechanism shared by host plugins.
serial_cargo_env

Structs§

ChildHandle
CommandBuilder
Builder wrapper that centralizes direct usages of std::process::Command.
CommandContext
Context passed to process managers describing the current execution environment. Clones are cheap and explicit so background handles can own their working roots without juggling lifetimes.
CommandOptions
CommandOutput
CommandSnapshot
OsPipeReader
Owned OS kernel pipe reader half behind a single use slot. Clone shares the slot; take transfers the handle exactly once so no parent copy survives spawn to starve the consumer of EOF. Backed by std::io::pipe (stable since Rust 1.87): pipe on Unix, CreatePipe on Windows. Moved verbatim from oxdock-process so handle slots can own kernel pairs without a dependency cycle; behavior is unchanged.
OsPipeWriter
Owned OS kernel pipe writer half behind a single use slot. See OsPipeReader for the shared slot semantics. Moved verbatim from oxdock-process; behavior is unchanged.
PipedChild
A spawned child with its stdio halves detached for frame pumps. Dropping stdin/stdout/stderr closes the pipes; handle keeps kill-on-drop and reaping semantics. Only constructed by CommandBuilder::spawn_piped (stderr stays inherited there) and CommandBuilder::spawn_piped_with_stderr.
ShellLauncher
ShellProcessManager
Default process manager that shells out using the system shell.
StreamingExpand
Streaming template expansion state machine.
TestEnvGuard

Enums§

CommandMode
CommandResult
CommandStderr
CommandStdin
CommandStdout

Constants§

INHERIT_STDOUT_ENV_VAR
Host environment variable that forces spawned children to inherit the parent’s stdout/stderr instead of using the executor’s stream routing. Recognized values are "1" and case-insensitive "true". Set on the script environment (an ENV step or host inherit), not the process environment: the executor reads it from CommandContext::envs.
PROCESS_DEBUG_ENV_VAR
Host process-environment variable enabling eprintln! diagnostics for every spawned command (program plus argv/script). Read from the process environment at spawn time; any value (including empty) enables it.

Traits§

BackgroundHandle
Handle for background processes spawned by a ProcessManager.
ProcessManager
Abstraction for running shell commands both in the foreground and background. oxdock-core relies on this trait to decouple the executor from std::process::Command, which in turn enables Miri-friendly test doubles.

Functions§

batch_shell
Deterministic batch shell for RUN step execution: sh on Unix, cmd on Windows. Never the operator’s $SHELL: login shells re-pollute scrubbed children (observed live: zsh sourcing /etc/zshenv and synthesizing HOME/LOGNAME from getpwuid regardless of flags) and break script portability (fish/tcsh cannot run POSIX step text). Interactive use (oxdock --shell) keeps shell_program().
create_os_pipe
Create a cross platform anonymous OS pipe pair for concurrent ASYNC pipelines. The caller moves each half into a spawn and drops any other copies immediately after spawning, otherwise the reader never sees EOF. Moved verbatim from oxdock-process; behavior is unchanged.
default_process_manager
expand_command_env
expand_script_env
format_value_for_string
Format a Value as a string for inline interpolation. Render a script value as inline text: the single renderer behind placeholder expansion everywhere (streaming file templates and engine string expansion alike), so one value renders one way in every context. Pipes are refused: they carry streams between steps, not text, and silently rendering a handle hides a bug.
interpreter_exe
Path of the running interpreter binary, for scripts that reinvoke the engine on another script (RUN [$exe, "other.oxdock"]) instead of bridging an env var. current_exe is an unsupported isolation operation under Miri (hard error, not a recoverable Err), so Miri builds report it as unsupported instead of calling through.
parse_placeholder_call
Split a MODULE::FUNC(args) placeholder body for call resolution outside the streaming expander. Returns None when the body is not call shaped, so plain keys keep their own handling. Shared with engine-side string expansion so both paths parse identically.
resolve_placeholder_arg
Resolve one placeholder call argument against script variables for call resolution outside the streaming expander. Same grammar there: $var.path, string, int, float, and bool literals, plus {...} and [...] literals holding those shapes nested.
shell_program
spawn_interactive_shell
Spawn an interactive shell rooted at cwd, printing banner before handing control to the user’s shell.

Type Aliases§

DefaultProcessManager
PlaceholderCall
Resolver for {{ MODULE::FUNC(args) }} placeholder calls.
SharedInput
Shared reader half: mutex-guarded Read behind an Arc, so every binding aliases one channel.
SharedOutput
Shared writer half: mutex-guarded Write behind an Arc.