[FEATURE] Retained native build-script producers #663

Open
opened 2026-11-10 09:34:27 +01:00 by erikinkinen · 0 comments
Owner

Problem and motivation

Bootloader and Procd have required host build-script executable outputs. The native root-object route currently rejects custom-build units, preventing their complete native build recipes.

Proposed behavior and scope

Compile the actual registered host dependency unit, retain its executable, and execute it through a bounded original caller. Use a distinct narrowly typed recipe-backed root unit for Bootloader and Procd, binding actual source, dependency, compiler and script-policy provenance. Keep observed CompiledUnit unchanged; extend only the closed replay/link unions. Do not run Cargo again to recompile or reexecute these scripts, and do not fabricate Cargo compiler observations. Bind its package, source, host target, features and profile to the selected root graph. Validate Bootloader’s source watches and per-binary UEFI debug linker directive, and Procd’s linker-script watch; connect the resulting policy to the native link DAG. Preserve every production obligation. Unsupported proc macros, generated OUT_DIR products and arbitrary script directives remain refused.

Authority, security and reliability

Graph and source registrations precede all compiler or script effects. Filenames and diagnostic records confer no ownership. Original retained executable, source, tool and output duties remain live through caller retirement and postproof. Preserve existing finite work, native, capture and retirement limits, raw first failures and independent partial cleanup. No arbitrary callbacks, ambient tool fallback or fake Cargo selector.

The script is trusted host code execution, not an OS sandbox. Restrict it to the exact reviewed maintained script source closure; changed script bodies require an explicit recipe review. Original source classification and byte/OFD checks remain independent of this selection. Bind the original package cwd, fixed target/debug and C-locale environment, bounded captured stdio and process forest; supply no PATH, HOME, proxy or credential environment. Host-user filesystem/network permissions, the selected compiler and installed loader/Rust runtime remain explicit trusted premises. Do not infer confinement from executable copies or output policy. A newly admitted copy may reuse ImageInputOwner and ExecutableInput only while the actual original compiler output and source provenance remain held and checked.

Acceptance criteria

  • Actual host build-script compiler and executable custody for both selected source families.
  • Bounded script execution with exact environment and directive validation.
  • Native DAG consumes only the original root-bound policy.
  • Refuse copied/foreign units, scripts, policy, unsupported outputs and directives before effects.
  • Preserve primary and independent cleanup failures and original resource limits.
  • Document source/recipe scope separately from connected full native build acceptance.

Alternatives and tradeoffs

Publishing contract rows alone leaves the native producer absent. Cargo has no custom-build selector; treating a build script as an ordinary binary or assuming a completed final Cargo link would misrepresent its actual unit and lifetime. Use a fixed dependency-unit producer instead.

Tracking and rollout

Implement on feature/native-build-script-producers. Integrate retained compilation and native link producers without changing existing library, binary or harness publication semantics. Full connected native graph acceptance remains a separate required gate.

## Problem and motivation Bootloader and Procd have required host build-script executable outputs. The native root-object route currently rejects custom-build units, preventing their complete native build recipes. ## Proposed behavior and scope Compile the actual registered host dependency unit, retain its executable, and execute it through a bounded original caller. Use a distinct narrowly typed recipe-backed root unit for Bootloader and Procd, binding actual source, dependency, compiler and script-policy provenance. Keep observed CompiledUnit unchanged; extend only the closed replay/link unions. Do not run Cargo again to recompile or reexecute these scripts, and do not fabricate Cargo compiler observations. Bind its package, source, host target, features and profile to the selected root graph. Validate Bootloader’s source watches and per-binary UEFI debug linker directive, and Procd’s linker-script watch; connect the resulting policy to the native link DAG. Preserve every production obligation. Unsupported proc macros, generated OUT_DIR products and arbitrary script directives remain refused. ## Authority, security and reliability Graph and source registrations precede all compiler or script effects. Filenames and diagnostic records confer no ownership. Original retained executable, source, tool and output duties remain live through caller retirement and postproof. Preserve existing finite work, native, capture and retirement limits, raw first failures and independent partial cleanup. No arbitrary callbacks, ambient tool fallback or fake Cargo selector. The script is trusted host code execution, not an OS sandbox. Restrict it to the exact reviewed maintained script source closure; changed script bodies require an explicit recipe review. Original source classification and byte/OFD checks remain independent of this selection. Bind the original package cwd, fixed target/debug and C-locale environment, bounded captured stdio and process forest; supply no PATH, HOME, proxy or credential environment. Host-user filesystem/network permissions, the selected compiler and installed loader/Rust runtime remain explicit trusted premises. Do not infer confinement from executable copies or output policy. A newly admitted copy may reuse ImageInputOwner and ExecutableInput only while the actual original compiler output and source provenance remain held and checked. ## Acceptance criteria - [ ] Actual host build-script compiler and executable custody for both selected source families. - [ ] Bounded script execution with exact environment and directive validation. - [ ] Native DAG consumes only the original root-bound policy. - [ ] Refuse copied/foreign units, scripts, policy, unsupported outputs and directives before effects. - [ ] Preserve primary and independent cleanup failures and original resource limits. - [ ] Document source/recipe scope separately from connected full native build acceptance. ## Alternatives and tradeoffs Publishing contract rows alone leaves the native producer absent. Cargo has no custom-build selector; treating a build script as an ordinary binary or assuming a completed final Cargo link would misrepresent its actual unit and lifetime. Use a fixed dependency-unit producer instead. ## Tracking and rollout Implement on feature/native-build-script-producers. Integrate retained compilation and native link producers without changing existing library, binary or harness publication semantics. Full connected native graph acceptance remains a separate required gate.
erikinkinen added this to the Alpha 1 milestone 2026-11-10 09:34:27 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/integration#663
No description provided.