You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reld uses host #[cfg] like C++ preprocessor macros — #[cfg(target_os = "linux")], #[cfg(unix)], #[cfg(windows)], #[cfg(target_os = "wasi")], #[cfg(target_os = "illumos")] — scattered across production sources. This is the same problem soldr (#2493, #2498) and zccache (#1365, #1366) already fixed by centralizing host-platform mechanics behind a crate::platform facade and enforcing the boundary with a Dylint.
soldr treats target_arch as host selection. reld must not: #[cfg(target_arch = "x86_64" | "aarch64" | …)] in args/elf.rs selects the linker target architecture (reld is a cross-target linker; it defaults to the host arch), which is a different concept from host OS mechanics. The boundary lint must forbid host-OS/family selectors (target_os, target_family, unix, windows, …) but must allowtarget_arch/target_endian target selection.
Plan
Bootstrap crates/reld-core/src/platforms/ with a cfg_select! selector and concrete trees (platform_linux.rs, platform_macos.rs, platform_win.rs, plus platform_wasi.rs/platform_illumos.rs as needed), a neutral platform.rs facade, and crate::platform::fs / crate::platform::process / crate::platform::path capability namespaces.
Bootstrap a dylints/ workspace (excluded from the main workspace, discovered by a lint script, formatted/tested in CI) with ban_platform_cfg_outside_boundary — a pre-expansion Dylint that denies host-platform #[cfg], #[cfg_attr], and cfg!() outside the platforms/ boundary, mirroring soldr's lint.
Migrate the ~28 host-cfg sites behind the facade, shrinking a ratcheting baseline to zero.
Wire CI: run the Dylint (+ its UI tests) in the existing hygiene/lint path.
Activity
feat(diagnostics): colorize native diagnostics behind one helper (rel…