diff --git a/api/api/src/main/scala/aqua/api/Imports.scala b/api/api/src/main/scala/aqua/api/Imports.scala index 880dad2f..f2ff23e3 100644 --- a/api/api/src/main/scala/aqua/api/Imports.scala +++ b/api/api/src/main/scala/aqua/api/Imports.scala @@ -12,6 +12,7 @@ final case class Imports( settings: Map[Path, Imports.PathSettings] ) { + def toIO: IOImports = IOImports( settings.view diff --git a/build.sbt b/build.sbt index b1d44274..2bb3738a 100644 --- a/build.sbt +++ b/build.sbt @@ -219,8 +219,7 @@ lazy val `compiler-native-lib` = project .settings( name := "libaqua", Compile / mainClass := Some("aqua.compiler.Library"), - nativeImageJvm := "graalvm-java20", - nativeImageVersion:="20.0.2", + nativeImageVersion:="22.3.1", nativeImageOptions ++= Seq( "--verbose", "--no-fallback", @@ -228,8 +227,11 @@ lazy val `compiler-native-lib` = project "--initialize-at-run-time=aqua.logging.LogFormatter$", // Uncomment next lines to use llvm backend // and obtain bitcode files - // "-H:CompilerBackend=llvm", - // "-H:TempDirectory=temp", // Directory with bc files + // "-H:CompilerBackend=llvm", + // "-H:TempDirectory=temp", // Directory with bc files + ), + libraryDependencies ++= Seq( + "org.graalvm.sdk" % "graal-sdk" % "24.0.1" ) ) .dependsOn(`aqua-api`.jvm) diff --git a/compiler-native-lib/src/main/scala/aqua/compiler/Library.scala b/compiler-native-lib/src/main/scala/aqua/compiler/Library.scala index 9bf3e6f6..a5707617 100644 --- a/compiler-native-lib/src/main/scala/aqua/compiler/Library.scala +++ b/compiler-native-lib/src/main/scala/aqua/compiler/Library.scala @@ -5,10 +5,8 @@ import org.graalvm.nativeimage.c.function.CEntryPoint import org.graalvm.nativeimage.c.`type`.{CCharPointer, CCharPointerPointer, CTypeConversion} import scala.annotation.static - import cats.effect.unsafe.implicits.global - -import aqua.api.{APICompilation, AquaAPIConfig} +import aqua.api.{APICompilation, AquaAPIConfig, Imports} import aqua.backend.api.APIBackend import aqua.logging.LogFormatter @@ -32,7 +30,7 @@ object Library { val result = APICompilation .compileString( code, - imports = Nil, + imports = Imports(Map.empty), aquaConfig = AquaAPIConfig(), backend = APIBackend )