mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
IJPL-227035 Eel, WSL, IJent: Remove wsl.use.remote.agent.for.nio.filesystem flag
This is a tiny step on the long way of making the WSL support a plugin. GitOrigin-RevId: 5a25e5a9e030942eaba5ffbcb9216e456abc7b35
This commit is contained in:
committed by
intellij-monorepo-bot
parent
19cf509cd7
commit
2b39bfe90e
@@ -1,10 +1,8 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
@file:Suppress("ReplaceGetOrSet")
|
||||
|
||||
package org.jetbrains.intellij.build.impl
|
||||
|
||||
import com.intellij.platform.ijent.community.buildConstants.IJENT_WSL_FILE_SYSTEM_REGISTRY_KEY
|
||||
import com.intellij.platform.ijent.community.buildConstants.MULTI_ROUTING_FILE_SYSTEM_VMOPTIONS
|
||||
import com.intellij.platform.ijent.community.buildConstants.isMultiRoutingFileSystemEnabledForProduct
|
||||
import com.intellij.platform.runtime.product.ProductMode
|
||||
import com.intellij.platform.runtime.product.serialization.ProductModulesSerialization
|
||||
@@ -465,13 +463,6 @@ class BuildContextImpl internal constructor(
|
||||
jvmArgs.add("-Didea.platform.prefix=${productProperties.platformPrefix}")
|
||||
}
|
||||
|
||||
if (os == OsFamily.WINDOWS) {
|
||||
jvmArgs.add("-D${IJENT_WSL_FILE_SYSTEM_REGISTRY_KEY}=${useMultiRoutingFs}")
|
||||
if (useMultiRoutingFs) {
|
||||
jvmArgs.addAll(MULTI_ROUTING_FILE_SYSTEM_VMOPTIONS)
|
||||
}
|
||||
}
|
||||
|
||||
jvmArgs.addAll(productProperties.additionalIdeJvmArguments)
|
||||
jvmArgs.addAll(productProperties.getAdditionalContextDependentIdeJvmArguments(this))
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
@file:Suppress("ReplaceJavaStaticMethodWithKotlinAnalog")
|
||||
|
||||
package com.intellij.platform.ijent.community.buildConstants
|
||||
@@ -39,8 +39,6 @@ private val MRFS_AND_IJENT_DISABLED_BY_DEFAULT_IN: Collection<String> = java.uti
|
||||
|
||||
const val IJENT_BOOT_CLASSPATH_MODULE: String = "intellij.platform.core.nio.fs"
|
||||
|
||||
const val IJENT_WSL_FILE_SYSTEM_REGISTRY_KEY: String = "wsl.use.remote.agent.for.nio.filesystem"
|
||||
|
||||
const val IJENT_REQUIRED_DEFAULT_NIO_FS_PROVIDER_CLASS: String = "com.intellij.platform.core.nio.fs.MultiRoutingFileSystemProvider"
|
||||
|
||||
val MULTI_ROUTING_FILE_SYSTEM_VMOPTIONS: List<String> = java.util.List.of(
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.platform.ide.bootstrap.eel
|
||||
|
||||
import com.intellij.diagnostic.VMOptions
|
||||
import com.intellij.execution.wsl.WslIjentAvailabilityService
|
||||
import com.intellij.openapi.application.ApplicationManager
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo
|
||||
import com.intellij.openapi.application.PathManager
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.platform.core.nio.fs.MultiRoutingFileSystemProvider
|
||||
import com.intellij.platform.ijent.community.buildConstants.IJENT_BOOT_CLASSPATH_MODULE
|
||||
import com.intellij.platform.ijent.community.buildConstants.IJENT_WSL_FILE_SYSTEM_REGISTRY_KEY
|
||||
import com.intellij.platform.ijent.community.buildConstants.isMultiRoutingFileSystemEnabledForProduct
|
||||
import org.jetbrains.annotations.VisibleForTesting
|
||||
import java.io.IOException
|
||||
import java.lang.management.ManagementFactory
|
||||
@@ -22,7 +19,6 @@ object MultiRoutingFileSystemVmOptionsSetter {
|
||||
fun ensureInVmOptionsImpl(
|
||||
isEnabled: Boolean,
|
||||
forceProductionOptions: Boolean,
|
||||
isEnabledByDefault: Boolean = isMultiRoutingFileSystemEnabledForProduct(ApplicationNamesInfo.getInstance().scriptName),
|
||||
getOptionByPrefix: (String) -> List<String>,
|
||||
): Collection<Pair<String, String?>> {
|
||||
val changedOptions = mutableListOf<Pair<String, String?>>()
|
||||
@@ -74,21 +70,6 @@ object MultiRoutingFileSystemVmOptionsSetter {
|
||||
}
|
||||
}
|
||||
|
||||
run {
|
||||
val prefix = "-D$IJENT_WSL_FILE_SYSTEM_REGISTRY_KEY="
|
||||
val valueToSet = when (val actualValue = getOptionByPrefix(prefix).firstOrNull()?.toBooleanStrictOrNull()) {
|
||||
null ->
|
||||
if (isEnabled != isEnabledByDefault && changedOptions.isNotEmpty()) isEnabled
|
||||
else null
|
||||
true, false ->
|
||||
if (isEnabled != actualValue) isEnabled
|
||||
else null
|
||||
}
|
||||
if (valueToSet != null) {
|
||||
changedOptions += prefix to valueToSet.toString()
|
||||
}
|
||||
}
|
||||
|
||||
return changedOptions
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution.wsl
|
||||
|
||||
import com.intellij.platform.ide.bootstrap.eel.MultiRoutingFileSystemVmOptionsSetter
|
||||
@@ -19,87 +19,86 @@ class MultiRoutingFileSystemVmOptionsSetterTest {
|
||||
|
||||
@Test
|
||||
fun `enable when no options set`() {
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = true, forceProductionOptions = true, isEnabledByDefault = false, vmOptionsReader(""))
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = true, forceProductionOptions = true,
|
||||
vmOptionsReader(""))
|
||||
changedOptions shouldMatch listOf(
|
||||
"-Djava.nio.file.spi.DefaultFileSystemProvider=com.intellij.platform.core.nio.fs.MultiRoutingFileSystemProvider",
|
||||
"-Dwsl.use.remote.agent.for.nio.filesystem=true",
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `enable when no options set in unit test mode`() {
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = true, forceProductionOptions = false, isEnabledByDefault = false, vmOptionsReader(""))
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = true, forceProductionOptions = false,
|
||||
vmOptionsReader(""))
|
||||
changedOptions shouldMatch listOf(
|
||||
"-Djava.nio.file.spi.DefaultFileSystemProvider=com.intellij.platform.core.nio.fs.MultiRoutingFileSystemProvider",
|
||||
"-Dwsl.use.remote.agent.for.nio.filesystem=true",
|
||||
"-Xbootclasspath/a:out/classes/production/intellij.platform.core.nio.fs",
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `disable when no options set and disabled by default`() {
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = false, forceProductionOptions = true, isEnabledByDefault = false, vmOptionsReader(""))
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = false, forceProductionOptions = true,
|
||||
vmOptionsReader(""))
|
||||
changedOptions shouldMatch listOf()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `enable when disabling options set`() {
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = true, forceProductionOptions = true, isEnabledByDefault = false, vmOptionsReader("""
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = true, forceProductionOptions = true,
|
||||
vmOptionsReader("""
|
||||
-Didea.force.default.filesystem=true
|
||||
-Djava.nio.file.spi.DefaultFileSystemProvider=com.intellij.platform.core.nio.fs.MultiRoutingFileSystemProvider
|
||||
-Dwsl.use.remote.agent.for.nio.filesystem=false
|
||||
""".trimIndent()))
|
||||
|
||||
changedOptions shouldMatch listOf(
|
||||
"-Didea.force.default.filesystem=false",
|
||||
"-Dwsl.use.remote.agent.for.nio.filesystem=true",
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `disable when enabling options set`() {
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = false, forceProductionOptions = true, isEnabledByDefault = false, vmOptionsReader("""
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = false, forceProductionOptions = true,
|
||||
vmOptionsReader("""
|
||||
-Djava.nio.file.spi.DefaultFileSystemProvider=com.intellij.platform.core.nio.fs.MultiRoutingFileSystemProvider
|
||||
-Dwsl.use.remote.agent.for.nio.filesystem=true
|
||||
""".trimIndent()))
|
||||
|
||||
changedOptions shouldMatch listOf(
|
||||
"-Didea.force.default.filesystem=true",
|
||||
"-Dwsl.use.remote.agent.for.nio.filesystem=false"
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `disable when enabling options set and forcing unset`() {
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = false, forceProductionOptions = true, isEnabledByDefault = false, vmOptionsReader("""
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = false, forceProductionOptions = true,
|
||||
vmOptionsReader("""
|
||||
-Didea.force.default.filesystem=false
|
||||
-Djava.nio.file.spi.DefaultFileSystemProvider=com.intellij.platform.core.nio.fs.MultiRoutingFileSystemProvider
|
||||
-Dwsl.use.remote.agent.for.nio.filesystem=true
|
||||
""".trimIndent()))
|
||||
|
||||
changedOptions shouldMatch listOf(
|
||||
"-Didea.force.default.filesystem=true",
|
||||
"-Dwsl.use.remote.agent.for.nio.filesystem=false",
|
||||
)
|
||||
}
|
||||
|
||||
/** This test checks that IJPL-158020 won't happen again when IJent WSL FS is enabled by default. */
|
||||
@Test
|
||||
fun `disable when no options set and enabled by default`() {
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = false, forceProductionOptions = true, isEnabledByDefault = true, vmOptionsReader(""))
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = false, forceProductionOptions = true,
|
||||
vmOptionsReader(""))
|
||||
|
||||
changedOptions shouldMatch listOf()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `enabled by default but disabled locally with enabling options in distribution vm options file`() {
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = false, forceProductionOptions = true, isEnabledByDefault = true, vmOptionsReader("""
|
||||
val changedOptions = MultiRoutingFileSystemVmOptionsSetter.ensureInVmOptionsImpl(isEnabled = false, forceProductionOptions = true,
|
||||
vmOptionsReader("""
|
||||
-Djava.nio.file.spi.DefaultFileSystemProvider=com.intellij.platform.core.nio.fs.MultiRoutingFileSystemProvider
|
||||
""".trimIndent()))
|
||||
|
||||
changedOptions shouldMatch listOf(
|
||||
"-Didea.force.default.filesystem=true",
|
||||
"-Dwsl.use.remote.agent.for.nio.filesystem=false",
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2026 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package org.jetbrains.idea.devkit.run
|
||||
|
||||
import com.intellij.execution.JavaRunConfigurationBase
|
||||
@@ -21,7 +21,6 @@ import com.intellij.openapi.util.io.FileUtilRt
|
||||
import com.intellij.platform.eel.provider.asEelPath
|
||||
import com.intellij.platform.ijent.community.buildConstants.IJENT_BOOT_CLASSPATH_MODULE
|
||||
import com.intellij.platform.ijent.community.buildConstants.IJENT_REQUIRED_DEFAULT_NIO_FS_PROVIDER_CLASS
|
||||
import com.intellij.platform.ijent.community.buildConstants.IJENT_WSL_FILE_SYSTEM_REGISTRY_KEY
|
||||
import com.intellij.platform.ijent.community.buildConstants.MULTI_ROUTING_FILE_SYSTEM_VMOPTIONS
|
||||
import com.intellij.util.PlatformUtils
|
||||
import com.intellij.util.lang.UrlClassLoader
|
||||
@@ -279,7 +278,10 @@ internal fun enableIjentDefaultFsProvider(
|
||||
project = project,
|
||||
platformPrefix = vmParameters.getPropertyValue("idea.platform.prefix"),
|
||||
)
|
||||
vmParameters.add("-D${IJENT_WSL_FILE_SYSTEM_REGISTRY_KEY}=$isIjentWslFsEnabled")
|
||||
|
||||
// This option doesn't exist anymore, but it used to exist in old versions.
|
||||
vmParameters.add("-Dwsl.use.remote.agent.for.nio.filesystem=$isIjentWslFsEnabled")
|
||||
|
||||
vmParameters.addAll(getMultiRoutingFileSystemVmOptions_Reflective(project))
|
||||
|
||||
val outputRoot = getOutputByModule(project, IJENT_BOOT_CLASSPATH_MODULE, "ijent boot classpath addition")
|
||||
|
||||
Reference in New Issue
Block a user