diff --git a/crate_universe/src/config.rs b/crate_universe/src/config.rs index 5f9b14822e..c635de3e5d 100644 --- a/crate_universe/src/config.rs +++ b/crate_universe/src/config.rs @@ -716,7 +716,15 @@ pub(crate) struct Config { impl Config { pub(crate) fn try_from_path>(path: T) -> Result { let data = fs::read_to_string(path)?; - Ok(serde_json::from_str(&data)?) + let mut res: Config = serde_json::from_str(&data)?; + + // rules_rust/crate_universe/private/generate_utils.bzl:generate_config + // injects the cargo_config as a literal JSON string, this causes line ending + // instability in Unix vs Windows. Parsing it here fixes any cross platform differences. + if let Some(Some(config)) = res.cargo_config.as_ref().map(|v| v.as_str()) { + res.cargo_config = Some(config.parse()?) + } + Ok(res) } }