Skip to content

Commit

Permalink
Merge branch 'develop' into wip/sergeigarin/fix-inputbindings
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Feb 14, 2025
2 parents e622892 + 566d3d5 commit 26b05e8
Show file tree
Hide file tree
Showing 31 changed files with 353 additions and 128 deletions.
178 changes: 112 additions & 66 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4726,7 +4726,7 @@ lazy val `std-base` = project
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion % "provided",
"com.fasterxml.jackson.core" % "jackson-databind" % jacksonVersion
),
Compile / packageBin := Def.task {
Compile / packageBin := {
val result = (Compile / packageBin).value
val _ensureCoreIsCompiled =
(`common-polyglot-core-utils` / Compile / packageBin).value
Expand All @@ -4738,7 +4738,7 @@ lazy val `std-base` = project
)
.value
result
}.value
}
)
.dependsOn(`common-polyglot-core-utils`)

Expand Down Expand Up @@ -4869,7 +4869,7 @@ lazy val `std-table` = project
),
Compile / packageBin := Def.task {
val result = (Compile / packageBin).value
val _ = StdBits
StdBits
.copyDependencies(
`table-polyglot-root`,
Seq("std-table.jar"),
Expand All @@ -4885,6 +4885,10 @@ lazy val extractNativeLibs = taskKey[Unit](
"Helper task to extract native libraries from OpenCV JAR"
)

lazy val cleanPolyglotRoot = taskKey[Unit](
"Helper task that prepares polyglot directory of a stdlib component"
)

lazy val `std-image` = project
.in(file("std-bits") / "image")
.settings(
Expand All @@ -4903,29 +4907,43 @@ lazy val `std-image` = project
// Extract native libraries from opencv.jar, and put them under
// Standard/Image/polyglot/lib directory. The minimized opencv.jar will
// be put under Standard/Image/polyglot/java directory.
extractNativeLibs := {
extractNativeLibs := (
StdBits
.extractNativeLibsFromOpenCV(
`image-polyglot-root`,
`image-native-libs`,
opencvVersion
)
.value
},
Compile / packageBin := Def.task {
val result = (Compile / packageBin).value
// Ensure dependencies are first copied.
StdBits
.copyDependencies(
`image-polyglot-root`,
Seq("std-image.jar", "opencv.jar"),
ignoreScalaLibrary = true,
ignoreDependency = Some("org.openpnp" % "opencv" % opencvVersion)
)
.value
extractNativeLibs.value
result
}.value
)
.dependsOn(
// Ensure dependencies are first copied.
StdBits
.copyDependencies(
`image-polyglot-root`,
Seq("std-image.jar", "opencv.jar"),
ignoreScalaLibrary = true,
ignoreDependency = Some("org.openpnp" % "opencv" % opencvVersion)
)
)
.value,
cleanPolyglotRoot := Def.task {
StdBits.ensureDirExistsAndIsClean(
`image-polyglot-root`.toPath,
streams.value.log
)
StdBits.ensureDirExistsAndIsClean(
`image-native-libs`.toPath,
streams.value.log
)
}.value,
Compile / packageBin := Def
.task {
val result = (Compile / packageBin).value
extractNativeLibs.value
result
}
.dependsOn(cleanPolyglotRoot)
.value
)
.dependsOn(`std-base` % "provided")

Expand All @@ -4949,29 +4967,43 @@ lazy val `std-google-api` = project
// Extract native libraries from grpc-netty-shaded-***.jar, and put them under
// Standard/Google_Api/polyglot/lib directory. The minimized jar will
// be put under Standard/Google_Api/polyglot/java directory.
extractNativeLibs := {
extractNativeLibs := (
StdBits
.extractNativeLibsFromGrpc(
`google-api-polyglot-root`,
`google-api-native-libs`,
grpcVersion
)
.value
},
Compile / packageBin := Def.task {
val result = (Compile / packageBin).value
StdBits
.copyDependencies(
`google-api-polyglot-root`,
Seq("std-google-api.jar"),
ignoreScalaLibrary = true,
ignoreDependencyIncludeTransitive =
Some(s"grpc-netty-shaded-${grpcVersion}")
)
.value
extractNativeLibs.value
result
}.value
)
.dependsOn(
StdBits
.copyDependencies(
`google-api-polyglot-root`,
Seq("std-google-api.jar"),
ignoreScalaLibrary = true,
ignoreDependencyIncludeTransitive =
Some(s"grpc-netty-shaded-${grpcVersion}")
)
)
.value,
cleanPolyglotRoot := Def.task {
StdBits.ensureDirExistsAndIsClean(
`google-api-polyglot-root`.toPath,
streams.value.log
)
StdBits.ensureDirExistsAndIsClean(
`google-api-native-libs`.toPath,
streams.value.log
)
}.value,
Compile / packageBin := Def
.task {
val result = (Compile / packageBin).value
extractNativeLibs.value
result
}
.dependsOn(cleanPolyglotRoot)
.value
)
.dependsOn(`std-table` % "provided")

Expand All @@ -4991,17 +5023,17 @@ lazy val `std-database` = project
"org.xerial" % "sqlite-jdbc" % sqliteVersion,
"org.postgresql" % "postgresql" % postgresVersion
),
Compile / packageBin := Def.task {
Compile / packageBin := {
val result = (Compile / packageBin).value
val _ = StdBits
StdBits
.copyDependencies(
`database-polyglot-root`,
Seq("std-database.jar"),
ignoreScalaLibrary = true
)
.value
result
}.value
}
)
.dependsOn(`std-base` % "provided")
.dependsOn(`std-table` % "provided")
Expand All @@ -5028,17 +5060,17 @@ lazy val `std-aws` = project
"software.amazon.awssdk" % "sso" % awsJavaSdkV2Version,
"software.amazon.awssdk" % "ssooidc" % awsJavaSdkV2Version
),
Compile / packageBin := Def.task {
Compile / packageBin := {
val result = (Compile / packageBin).value
val _ = StdBits
StdBits
.copyDependencies(
`std-aws-polyglot-root`,
Seq("std-aws.jar"),
ignoreScalaLibrary = true
)
.value
result
}.value
}
)
.dependsOn(`std-base` % "provided")
.dependsOn(`std-table` % "provided")
Expand All @@ -5058,17 +5090,17 @@ lazy val `std-snowflake` = project
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion % "provided",
"net.snowflake" % "snowflake-jdbc" % snowflakeJDBCVersion
),
Compile / packageBin := Def.task {
Compile / packageBin := {
val result = (Compile / packageBin).value
val _ = StdBits
StdBits
.copyDependencies(
`std-snowflake-polyglot-root`,
Seq("std-snowflake.jar"),
ignoreScalaLibrary = true
)
.value
result
}.value
}
)
.dependsOn(`std-base` % "provided")
.dependsOn(`std-table` % "provided")
Expand All @@ -5088,17 +5120,17 @@ lazy val `std-microsoft` = project
"org.netbeans.api" % "org-openide-util-lookup" % netbeansApiVersion % "provided",
"com.microsoft.sqlserver" % "mssql-jdbc" % mssqlserverJDBCVersion
),
Compile / packageBin := Def.task {
Compile / packageBin := {
val result = (Compile / packageBin).value
val _ = StdBits
StdBits
.copyDependencies(
`std-microsoft-polyglot-root`,
Seq("std-microsoft.jar"),
ignoreScalaLibrary = true
)
.value
result
}.value
}
)
.dependsOn(`std-base` % "provided")
.dependsOn(`std-table` % "provided")
Expand Down Expand Up @@ -5205,30 +5237,44 @@ lazy val `std-tableau` = project
),
// Extract native libraries from tableau's jar, and put them under
// Standard/Tableau/polyglot/lib directory.
extractNativeLibs := {
extractNativeLibs := (
StdBits
.extractNativeLibsFromTableau(
`std-tableau-polyglot-root`,
`std-tableau-native-libs`,
tableauVersion,
jnaVersion
)
.value
},
Compile / packageBin := Def.task {
val result = (Compile / packageBin).value
StdBits
.copyDependencies(
`std-tableau-polyglot-root`,
Seq("std-tableau.jar"),
ignoreScalaLibrary = true,
ignoreUnmanagedDependency =
Some(!_.getName.endsWith("tableauhyperapi.jar"))
)
.value
extractNativeLibs.value
result
}.value
)
.dependsOn(
StdBits
.copyDependencies(
`std-tableau-polyglot-root`,
Seq("std-tableau.jar"),
ignoreScalaLibrary = true,
ignoreUnmanagedDependency =
Some(!_.getName.endsWith("tableauhyperapi.jar"))
)
)
.value,
cleanPolyglotRoot := Def.task {
StdBits.ensureDirExistsAndIsClean(
`std-tableau-polyglot-root`.toPath,
streams.value.log
)
StdBits.ensureDirExistsAndIsClean(
`std-tableau-native-libs`.toPath,
streams.value.log
)
}.value,
Compile / packageBin := Def
.task {
val result = (Compile / packageBin).value
extractNativeLibs.value
result
}
.dependsOn(cleanPolyglotRoot)
.value
)
.dependsOn(`std-base` % "provided")
.dependsOn(`std-table` % "provided")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ private static LanguageServerConfig parseServerOptions(
if (rootPath == null) {
throw new WrongOption("Root path must be provided");
}
UUID projectId;
try {
var id = line.getOptionValue(LanguageServerApi.PROJECT_ID_OPTION);
if (id == null) {
projectId = UUID.fromString("00000000-0000-0000-0000-000000000000");
} else {
projectId = UUID.fromString(id);
}
} catch (IllegalArgumentException e) {
throw new WrongOption("Project ID must be UUID");
}
var interfac = line.getOptionValue(LanguageServerApi.INTERFACE_OPTION, "127.0.0.1");
int rpcPort;
try {
Expand Down Expand Up @@ -79,6 +90,7 @@ private static LanguageServerConfig parseServerOptions(
scala.Option.apply(secureDataPort),
rootId,
rootPath,
projectId,
profilingConfig,
new StartupConfig(graalVMUpdater),
"language-server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
{
"name":"java.util.Collections$EmptyMap"
},
{
"name":"java.util.Collections$UnmodifiableMap"
},
{
"name":"java.util.HashMap"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import scala.concurrent.{ExecutionContext, ExecutionContextExecutor}
* @param secureDataPort an optional secure data port that the server listen to
* @param contentRootUuid an id of content root
* @param contentRootPath a path to the content root
* @param projectId an id of project
* @param profilingConfig an application profiling configuration
* @param startupConfig a startup configuration
*/
Expand All @@ -25,6 +26,7 @@ case class LanguageServerConfig(
secureDataPort: Option[Int],
contentRootUuid: UUID,
contentRootPath: String,
projectId: UUID,
profilingConfig: ProfilingConfig,
startupConfig: StartupConfig,
name: String = "language-server",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ import org.enso.text.{ContentBasedVersioning, Sha3_224VersionCalculator}
import org.enso.version.BuildVersion
import org.graalvm.polyglot.io.MessageEndpoint
import org.slf4j.event.Level
import org.slf4j.LoggerFactory
import org.slf4j.{LoggerFactory, MDC}

import java.io.{File, PrintStream}
import java.net.URI
Expand Down Expand Up @@ -514,6 +514,7 @@ class MainModule(serverConfig: LanguageServerConfig, logLevel: Level) {
contextSupervisor.close()
runtimeEventsMonitor.close()
log.info("Stopped Language Server")
MDC.remove("project.id")
}

private def akkaHttpsConfig(): com.typesafe.config.Config = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
{
"name":"java.util.Collections$EmptyMap"
},
{
"name":"java.util.Collections$UnmodifiableMap"
},
{
"name":"java.util.HashMap"
},
Expand Down
Loading

0 comments on commit 26b05e8

Please sign in to comment.