Repository navigation
feat(bridge): explicit engine override + registry — polylinker router foundation (B8a) - #35
Merged
Merged
Conversation
… foundation (B8a) First implementation slice of the polylinker router (B8/#30). Turn the bridge's fixed platform->engine mapping into explicit, overridable engine selection: - An `Engine` registry (name + object format + linker basename + rust-lld flavor) — the capability seed: lld-link/COFF, ld64.lld/Mach-O. - `select_engine(target, override)`: no override -> the target's default engine (byte-for-byte the previous behavior); an override names an engine, with a hard error on an unknown name (listing valid engines) or a format mismatch (e.g. ld64.lld requested for a COFF link) — never a silent fallback. - Override source, in precedence: a reld-specific `--engine=<name>` argv token (consumed/stripped from the forwarded argv like `-flavor`, at any position), then the `RELD_ENGINE` env var. - The routing note now carries the reason: `reld: engine=<name> (bridge, reason=default|override(--engine)|override(RELD_ENGINE)) -> <path>`. Default (no-override) behavior, discovery order, `-flavor` handling, exit-code propagation, and `RELD_BRIDGE_LINKER` are all unchanged; ELF/native untouched. Flag/LTO-based routing (the Linux native->lld case) is a later slice. Closes #34 Co-Authored-By: Claude Fable 5 <[email protected]>
This was referenced Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements B8a (#34) — the first code slice of the polylinker router (B8 in #17; design in #30 /
agents/docs/polylinker.md). Follows the polylinker docs (#33).What
Turns the bridge's fixed platform→engine mapping into explicit, overridable engine selection:
Engine= name + object format + linker basename + rust-lld flavor. Two entries:lld-link/COFF,ld64.lld/Mach-O.select_engine(target, override): no override → the target's default engine (byte-for-byte the previous behavior); an override names an engine, with a hard error on an unknown name (listing valid engines) or a format mismatch (e.g.ld64.lldfor a COFF link) — never a silent fallback.--engine=<name>argv token (consumed/stripped from the forwarded argv like-flavor, at any position), then theRELD_ENGINEenv var.reld: engine=<name> (bridge, reason=default|override(--engine)|override(RELD_ENGINE)) -> <path>.Default (no-override) behavior, discovery order,
-flavorhandling, exit-code propagation, andRELD_BRIDGE_LINKERare all unchanged; ELF/native untouched. Flag/LTO-based routing (Linux native→lld) is a later slice.Testing
crates/reld-core/src/bridge.rs. 25/25 bridge tests pass (12 new:select_enginedefault/valid-override/unknown/format-mismatch both directions;--engine=stripping at start/middle/end + combined with-flavor;engine_override_from_argvpresent/absent).fmt/clippy --all-targetsclean.OK;RELD_ENGINE=lld-link(explicit) →OK;RELD_ENGINE=bogus→ build fails withreld: error: Unknown engine 'bogus'. Valid engines: lld-link, ld64.lld.(hard error, not silently ignored).Review
Independent review: APPROVE-WITH-NITS — confirmed the default path is byte-for-byte identical, an invalid/mismatched override cannot be silently ignored, and
--engine=can never leak to the child linker at any argv position. Both LOW nits (symmetric mismatch test;engine_override_from_argvskipping argv[0] to mirrorforwarded_args) are applied in this PR.🤖 Generated with Claude Code