Fix graal

This commit is contained in:
Nick Pavlov 2024-05-01 11:07:29 +03:00
parent 5924486895
commit 5966cc5dd2
3 changed files with 9 additions and 8 deletions

View File

@ -12,6 +12,7 @@ final case class Imports(
settings: Map[Path, Imports.PathSettings] settings: Map[Path, Imports.PathSettings]
) { ) {
def toIO: IOImports = def toIO: IOImports =
IOImports( IOImports(
settings.view settings.view

View File

@ -219,8 +219,7 @@ lazy val `compiler-native-lib` = project
.settings( .settings(
name := "libaqua", name := "libaqua",
Compile / mainClass := Some("aqua.compiler.Library"), Compile / mainClass := Some("aqua.compiler.Library"),
nativeImageJvm := "graalvm-java20", nativeImageVersion:="22.3.1",
nativeImageVersion:="20.0.2",
nativeImageOptions ++= Seq( nativeImageOptions ++= Seq(
"--verbose", "--verbose",
"--no-fallback", "--no-fallback",
@ -228,8 +227,11 @@ lazy val `compiler-native-lib` = project
"--initialize-at-run-time=aqua.logging.LogFormatter$", "--initialize-at-run-time=aqua.logging.LogFormatter$",
// Uncomment next lines to use llvm backend // Uncomment next lines to use llvm backend
// and obtain bitcode files // and obtain bitcode files
// "-H:CompilerBackend=llvm", // "-H:CompilerBackend=llvm",
// "-H:TempDirectory=temp", // Directory with bc files // "-H:TempDirectory=temp", // Directory with bc files
),
libraryDependencies ++= Seq(
"org.graalvm.sdk" % "graal-sdk" % "24.0.1"
) )
) )
.dependsOn(`aqua-api`.jvm) .dependsOn(`aqua-api`.jvm)

View File

@ -5,10 +5,8 @@ import org.graalvm.nativeimage.c.function.CEntryPoint
import org.graalvm.nativeimage.c.`type`.{CCharPointer, CCharPointerPointer, CTypeConversion} import org.graalvm.nativeimage.c.`type`.{CCharPointer, CCharPointerPointer, CTypeConversion}
import scala.annotation.static import scala.annotation.static
import cats.effect.unsafe.implicits.global import cats.effect.unsafe.implicits.global
import aqua.api.{APICompilation, AquaAPIConfig, Imports}
import aqua.api.{APICompilation, AquaAPIConfig}
import aqua.backend.api.APIBackend import aqua.backend.api.APIBackend
import aqua.logging.LogFormatter import aqua.logging.LogFormatter
@ -32,7 +30,7 @@ object Library {
val result = APICompilation val result = APICompilation
.compileString( .compileString(
code, code,
imports = Nil, imports = Imports(Map.empty),
aquaConfig = AquaAPIConfig(), aquaConfig = AquaAPIConfig(),
backend = APIBackend backend = APIBackend
) )