Add x86_64-unknown-vibix.json target spec and xtask integration#860
Add x86_64-unknown-vibix.json target spec and xtask integration#860
Conversation
Create the custom target spec for vibix userspace as defined in RFC 0009, enabling std Rust programs to be cross-compiled with `cargo +nightly -Z build-std --target x86_64-unknown-vibix.json`. Key properties: os=vibix, static linking via rust-lld, initial-exec TLS, panic=abort, no redzone. Integrate the spec into the build system: - .cargo/config.toml: add [target.x86_64-unknown-vibix] rustflags section - xtask: add VIBIX_USERSPACE_TARGET constant for downstream use - xtask: add `validate-target` subcommand that parses the JSON and checks all required fields/values match the RFC specification Closes #850 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughAdds a new Rust target spec ChangesVibix Target Specification and Validation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
xtask/src/main.rs (2)
3499-3509: 💤 Low valueConsider validating
static-position-independent-executables.The target spec includes
static-position-independent-executables: false, but this field isn't validated. If it's mandated by RFC 0009, consider adding it to the boolean-must-be-false check.Proposed addition
// Boolean fields that must be false. - for key in ["position-independent-executables"] { + for key in ["position-independent-executables", "static-position-independent-executables"] { match obj.get(key) {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@xtask/src/main.rs` around lines 3499 - 3509, The boolean-field validation currently iterates over ["position-independent-executables"] and ensures each obj.get(key) is present and false; add "static-position-independent-executables" to that list so the same logic (obj.get(key) match, errors.push(...) on missing, and errors.push(...) if val.as_bool() != Some(false)) applies to the static-position-independent-executables field as required by RFC 0009.
3474-3481: 💤 Low valueType mismatch produces a misleading error message.
If a field has the wrong JSON type (e.g., boolean instead of string),
as_str().unwrap_or("")returns"", producing an error likeexpected "x86_64", got ""rather than indicating a type mismatch. This is minor since the spec is internally authored.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@xtask/src/main.rs` around lines 3474 - 3481, The comparison currently uses let actual = val.as_str().unwrap_or("") which hides type mismatches (producing an empty string) — change the block around expected_val/val to explicitly check for a string: if let Some(actual) = val.as_str() { compare actual == expected and push the existing errors.push message } else { push a clear type-mismatch error via errors.push that reports either the actual JSON value (format!("{val}")) or its type (e.g., using val.is_* checks or format!("{:?}", val)) so callers see "expected string, got boolean" (reference symbols: expected_val, val, actual, errors.push).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@xtask/src/main.rs`:
- Around line 3499-3509: The boolean-field validation currently iterates over
["position-independent-executables"] and ensures each obj.get(key) is present
and false; add "static-position-independent-executables" to that list so the
same logic (obj.get(key) match, errors.push(...) on missing, and
errors.push(...) if val.as_bool() != Some(false)) applies to the
static-position-independent-executables field as required by RFC 0009.
- Around line 3474-3481: The comparison currently uses let actual =
val.as_str().unwrap_or("") which hides type mismatches (producing an empty
string) — change the block around expected_val/val to explicitly check for a
string: if let Some(actual) = val.as_str() { compare actual == expected and push
the existing errors.push message } else { push a clear type-mismatch error via
errors.push that reports either the actual JSON value (format!("{val}")) or its
type (e.g., using val.is_* checks or format!("{:?}", val)) so callers see
"expected string, got boolean" (reference symbols: expected_val, val, actual,
errors.push).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5a2bc7fe-d0f1-4fbb-aa5f-683a86554b6a
📒 Files selected for processing (4)
.cargo/config.tomlx86_64-unknown-vibix.jsonxtask/Cargo.tomlxtask/src/main.rs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
x86_64-unknown-vibix.jsoncustom target spec per RFC 0009, enablingcargo +nightly -Z build-stdcross-compilation for vibix userspace[target.x86_64-unknown-vibix]rustflags section in.cargo/config.tomlcargo xtask validate-targetsubcommand that parses and validates the target spec against RFC-mandated fields/valuesVIBIX_USERSPACE_TARGETconstant in xtask for downstream build commandsTest plan
cargo xtask build— kernel build unaffected, passes cleanlycargo xtask validate-target— parses JSON, confirms all required fields present and correctCloses #850
🤖 Generated with Claude Code