Repository navigation
feat(core): add TargetProbe to derive link target from argv and inputs (#178) - #182
Merged
Merged
Conversation
#178) Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This was referenced Sep 18, 2026
Closed
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.
Closes #178
Adds
crates/reld-core/src/target_probe.rs(pub(crate) mod target_probe;inlib.rs). It derives the link target, meaning format, arch, class and endianness plus the signal that decided it, from argv and input headers. It follows the 6-step precedence (explicit emulation > inferred signals > OUTPUT_FORMAT, with -EB/-EL overrides). Header reads are bounds-checked, so malformed input returnsNoneinstead of panicking. No new dependencies and no host-platform cfg.Local verification (rebased on origin/main bc412bf):
cargo test -p reld-core --lib target_probe: 4 passedcargo test -p reld-core --lib tidy_tests: 4 passedcargo fmt --all -- --check: cleancargo clippy --workspace --all-targets -- -D warnings: cleancargo clippy --workspace --all-targets --no-default-features -- -D warnings: cleanpython3 ci/check_dependencies.py: okcargo dylint --path dylints/ban_platform_cfg_outside_boundary --workspace -- --all-targets: cleanNot run: the act hygiene lane (the repo has no .actrc). Its fmt, clippy and dependency steps were run directly above. Cargo.toml and Cargo.lock are unchanged, so
cargo deny check licensesis not affected.🤖 Generated with Claude Code