build: add reproducible macOS, Windows and wasm cross-check scripts
The non-Linux code paths can only be compile-checked on this machine; agents had used ad-hoc wrapper setups. These scripts make the checks reproducible and are wired into `just check-macos`, `check-windows`, `check-wasm` and `check-all`: - macos-crosscheck.sh: zig cc wrappers (dropping -arch/-mmacosx- version-min) plus a declaration-only os/log.h stub so the few C build scripts compile; clippy -D warnings on all 17 cross-platform crates for aarch64/x86_64-apple-darwin. - windows-crosscheck.sh: mingw toolchain and a stub fontconfig.pc; clippy -D warnings for x86_64-pc-windows-gnu. - wasm-check.sh: wasm32 clippy/build and the node-based wasm tests. Also fixes a needless_pass_by_value lint in osbytes' non-Unix branch that only the Windows check surfaces. Test Plan: - just check-macos; just check-macos x86_64-apple-darwin - just check-windows; just check-wasm
This commit is contained in:
1 parent
a9f3856b15
commit
231ee35ea9
5 files changed
+120
-7
No files matched your search
@@ -84,7 +84,11 @@ pub fn os_from_bytes(b: Vec<u8>) -> OsString {
|
||||
|
||||
#[cfg(not(unix))]
|
||||
pub fn os_from_bytes(b: Vec<u8>) -> OsString {
|
||||
OsString::from(String::from_utf8_lossy(&b).into_owned())
|
||||
// Windows OS strings are WTF-16; valid UTF-8 converts losslessly and is
|
||||
// reused without copying, anything else is replaced like Zig's utf8ToUtf16.
|
||||
OsString::from(
|
||||
String::from_utf8(b).unwrap_or_else(|e| String::from_utf8_lossy(e.as_bytes()).into_owned()),
|
||||
)
|
||||
}
|
||||
|
||||
/// OS string to reversible `String` (see the module docs).
|
||||
|
||||
Reference in new issue
Block a user