Qualify Windows IPC client runtime and prepare bounded native providers
Rust development slice / linux (push) Failing after 7s
Rust development slice / linux (push) Failing after 7s
This commit is contained in:
@@ -11,13 +11,58 @@ fn main() {
|
||||
Ok("x86_64"),
|
||||
"Windows clock RPC is qualified only for x86-64"
|
||||
);
|
||||
let out = PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
||||
let idl = env::current_dir().unwrap().join("native/w32time.idl");
|
||||
if env::var("CARGO_CFG_TARGET_ENV").as_deref() == Ok("msvc") {
|
||||
// MIDL and CL come from the explicitly selected native x64 SDK/MSVC
|
||||
// environment. `win64` means IA64 in MIDL: AMD64 must be explicit.
|
||||
println!("cargo:rerun-if-env-changed=RMM_MIDL_EXE");
|
||||
let midl = env::var_os("RMM_MIDL_EXE").expect("Select the native SDK's verified midl.exe");
|
||||
assert!(
|
||||
Command::new(midl)
|
||||
.current_dir(&out)
|
||||
.args([
|
||||
"/nologo",
|
||||
"/env",
|
||||
"amd64",
|
||||
"/Oicf",
|
||||
"/robust",
|
||||
"/Zp8",
|
||||
"/client",
|
||||
"stub",
|
||||
"/server",
|
||||
"none",
|
||||
"/h",
|
||||
"w32time.h",
|
||||
"/cstub",
|
||||
"w32time_c.c",
|
||||
])
|
||||
.arg(&idl)
|
||||
.status()
|
||||
.expect("Install native Microsoft SDK MIDL; no generated-stub fallback")
|
||||
.success(),
|
||||
"Native Microsoft MIDL clock stub generation failed"
|
||||
);
|
||||
// Keep RPC's __try/__except entirely inside native C. Existing C ABI
|
||||
// assertions remain active; never substitute C++/Rust catch_unwind.
|
||||
cc::Build::new()
|
||||
.flag("/std:c11")
|
||||
.flag("/Zp8")
|
||||
.warnings_into_errors(true)
|
||||
.include(&out)
|
||||
.file(out.join("w32time_c.c"))
|
||||
.file("native/clock_rpc.c")
|
||||
.file("native/clock_endpoints.c")
|
||||
.compile("rmm_clock_rpc");
|
||||
println!("cargo:rustc-link-lib=rpcrt4");
|
||||
println!("cargo:rustc-link-lib=advapi32");
|
||||
return;
|
||||
}
|
||||
assert_eq!(
|
||||
env::var("CARGO_CFG_TARGET_ENV").as_deref(),
|
||||
Ok("gnu"),
|
||||
"Windows clock RPC currently requires the qualified GNU/clang toolchain"
|
||||
"Windows clock RPC supports native MSVC or the qualified GNU/clang toolchain"
|
||||
);
|
||||
let out = PathBuf::from(env::var_os("OUT_DIR").unwrap());
|
||||
let idl = env::current_dir().unwrap().join("native/w32time.idl");
|
||||
for args in [
|
||||
vec!["-h", "-H", "w32time.h"],
|
||||
vec!["-c", "-o", "w32time_c.c"],
|
||||
|
||||
Reference in New Issue
Block a user