mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
GTW-8754: re-add missing ipv4 preference for wsl in native launcher
GitOrigin-RevId: ef24762d790cd2671cf36819cf3527b486c6bd44
This commit is contained in:
committed by
intellij-monorepo-bot
parent
46121e11bc
commit
f85ff34eeb
@@ -31,6 +31,11 @@ impl LaunchConfiguration for RemoteDevLaunchConfiguration {
|
||||
// TODO: add default Xmx to productInfo as right now we patch the user one
|
||||
vm_options.push("-Xmx2048m".to_string());
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
if is_wsl2() && !parse_bool_env_var("REMOTE_DEV_SERVER_ALLOW_IPV6_ON_WSL2", false)? {
|
||||
vm_options.push("-Djava.net.preferIPv4Stack=true".to_string())
|
||||
}
|
||||
|
||||
Ok(vm_options)
|
||||
}
|
||||
|
||||
@@ -611,3 +616,10 @@ fn preload_native_libs(ide_home_dir: &PathBuf) -> Result<()> {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
fn is_wsl2() -> bool {
|
||||
fs::read_to_string("/proc/sys/kernel/osrelease")
|
||||
.map(|x| x.contains("WSL2"))
|
||||
.unwrap_or(false)
|
||||
}
|
||||
Reference in New Issue
Block a user