diff --git a/distribution/manifest.template.yaml b/distribution/manifest.template.yaml index ceaeca9193..f6500e184a 100644 --- a/distribution/manifest.template.yaml +++ b/distribution/manifest.template.yaml @@ -1,5 +1,5 @@ -minimum-launcher-version: 0.2.0 -minimum-project-manager-version: 0.2.0 +minimum-launcher-version: 0.2.4-SNAPSHOT +minimum-project-manager-version: 0.2.4-SNAPSHOT jvm-options: - value: "-Dpolyglot.engine.IterativePartialEscape=true" - value: "-Dtruffle.class.path.append=$enginePackagePath\\component\\runtime.jar" diff --git a/lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/enso/enso-0.0.0/manifest.yaml b/lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/enso/enso-0.0.0/manifest.yaml index e8e2378989..10571a0ec5 100644 --- a/lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/enso/enso-0.0.0/manifest.yaml +++ b/lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/enso/enso-0.0.0/manifest.yaml @@ -1,6 +1,6 @@ minimum-launcher-version: 0.0.1 minimum-project-manager-version: 0.0.1 -graal-vm-version: 1.0.0 +graal-vm-version: 1.0.0.1.foo graal-java-version: 11 jvm-options: - value: "-Dtruffle.class.path.append=$enginePackagePath\\component\\runtime.jar" diff --git a/lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/graalvm/vm-1.0.0/graalvm-ce-java11-darwin-amd64-1.0.0.tar.gz/graalvm-ce-java11-1.0.0/Contents/Home/bin/java b/lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/graalvm/vm-1.0.0.1.foo/graalvm-ce-java11-darwin-amd64-1.0.0.1.foo.tar.gz/graalvm-ce-java11-1.0.0.1.foo/Contents/Home/bin/java similarity index 100% rename from lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/graalvm/vm-1.0.0/graalvm-ce-java11-darwin-amd64-1.0.0.tar.gz/graalvm-ce-java11-1.0.0/Contents/Home/bin/java rename to lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/graalvm/vm-1.0.0.1.foo/graalvm-ce-java11-darwin-amd64-1.0.0.1.foo.tar.gz/graalvm-ce-java11-1.0.0.1.foo/Contents/Home/bin/java diff --git a/lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/graalvm/vm-1.0.0/graalvm-ce-java11-linux-amd64-1.0.0.tar.gz/graalvm-ce-java11-1.0.0/bin/java b/lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/graalvm/vm-1.0.0.1.foo/graalvm-ce-java11-linux-amd64-1.0.0.1.foo.tar.gz/graalvm-ce-java11-1.0.0.1.foo/bin/java similarity index 100% rename from lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/graalvm/vm-1.0.0/graalvm-ce-java11-linux-amd64-1.0.0.tar.gz/graalvm-ce-java11-1.0.0/bin/java rename to lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/graalvm/vm-1.0.0.1.foo/graalvm-ce-java11-linux-amd64-1.0.0.1.foo.tar.gz/graalvm-ce-java11-1.0.0.1.foo/bin/java diff --git a/lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/graalvm/vm-1.0.0/graalvm-ce-java11-windows-amd64-1.0.0.zip/graalvm-ce-java11-1.0.0/bin/java.exe b/lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/graalvm/vm-1.0.0.1.foo/graalvm-ce-java11-windows-amd64-1.0.0.1.foo.zip/graalvm-ce-java11-1.0.0.1.foo/bin/java.exe similarity index 100% rename from lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/graalvm/vm-1.0.0/graalvm-ce-java11-windows-amd64-1.0.0.zip/graalvm-ce-java11-1.0.0/bin/java.exe rename to lib/scala/runtime-version-manager-test/src/main/resources/org/enso/runtimeversionmanager/test/fake-releases/graalvm/vm-1.0.0.1.foo/graalvm-ce-java11-windows-amd64-1.0.0.1.foo.zip/graalvm-ce-java11-1.0.0.1.foo/bin/java.exe diff --git a/lib/scala/runtime-version-manager-test/src/test/scala/org/enso/runtimeversionmanager/components/RuntimeVersionManagerSpec.scala b/lib/scala/runtime-version-manager-test/src/test/scala/org/enso/runtimeversionmanager/components/RuntimeVersionManagerSpec.scala index ba42c4eb37..680d4ad2ac 100644 --- a/lib/scala/runtime-version-manager-test/src/test/scala/org/enso/runtimeversionmanager/components/RuntimeVersionManagerSpec.scala +++ b/lib/scala/runtime-version-manager-test/src/test/scala/org/enso/runtimeversionmanager/components/RuntimeVersionManagerSpec.scala @@ -34,7 +34,7 @@ class RuntimeVersionManagerSpec extends RuntimeVersionManagerTest with OsSpec { ) val runtime = componentsManager.findGraalRuntime(engine) - runtime.value.version shouldEqual GraalVMVersion(SemVer(2, 0, 0), "11") + runtime.value.version shouldEqual GraalVMVersion("2.0.0", "11") assert( runtime.value.path.startsWith(distributionManager.paths.runtimes), "Engine should be installed in the engines directory." @@ -47,8 +47,8 @@ class RuntimeVersionManagerSpec extends RuntimeVersionManagerTest with OsSpec { Set(SemVer(0, 0, 0), SemVer(0, 0, 1), SemVer(0, 0, 1, Some("pre"))) val runtimeVersions = Set( - components.GraalVMVersion(SemVer(1, 0, 0), "11"), - components.GraalVMVersion(SemVer(2, 0, 0), "11") + components.GraalVMVersion("1.0.0.1.foo", "11"), + components.GraalVMVersion("2.0.0", "11") ) engineVersions.map(componentsManager.findOrInstallEngine) @@ -63,7 +63,7 @@ class RuntimeVersionManagerSpec extends RuntimeVersionManagerTest with OsSpec { val runtime2 = componentsManager - .findGraalRuntime(components.GraalVMVersion(SemVer(2, 0, 0), "11")) + .findGraalRuntime(components.GraalVMVersion("2.0.0", "11")) .value componentsManager.findEnginesUsingRuntime(runtime2) should have length 2 } @@ -138,7 +138,7 @@ class RuntimeVersionManagerSpec extends RuntimeVersionManagerTest with OsSpec { val runtimes2 = componentsManager.listInstalledGraalRuntimes() runtimes2 should have length 1 runtimes2.map(_.version).head shouldEqual components.GraalVMVersion( - SemVer(1, 0, 0), + "1.0.0.1.foo", "11" ) @@ -183,7 +183,7 @@ class RuntimeVersionManagerSpec extends RuntimeVersionManagerTest with OsSpec { "support bundled components" in { val engineVersion = SemVer(0, 1, 0) - val runtimeVersion = GraalVMVersion(SemVer(1, 0, 0), "11") + val runtimeVersion = GraalVMVersion("1.0.0.1.foo", "11") prepareBundle( engines = Seq(engineVersion), runtimes = Seq(runtimeVersion) @@ -201,7 +201,7 @@ class RuntimeVersionManagerSpec extends RuntimeVersionManagerTest with OsSpec { "fail to uninstall a read-only bundled component" taggedAs OsUnix in { val engineVersion = SemVer(0, 1, 0) - val runtimeVersion = GraalVMVersion(SemVer(1, 0, 0), "11") + val runtimeVersion = GraalVMVersion("1.0.0.1.foo", "11") prepareBundle( engines = Seq(engineVersion), runtimes = Seq(runtimeVersion) @@ -211,8 +211,9 @@ class RuntimeVersionManagerSpec extends RuntimeVersionManagerTest with OsSpec { def installedRuntimes = manager.listInstalledGraalRuntimes().map(_.version) - val enginePath = getTestDirectory / "dist" / "0.1.0" - val runtimePath = getTestDirectory / "runtime" / "graalvm-ce-java11-1.0.0" + val enginePath = getTestDirectory / "dist" / "0.1.0" + val runtimePath = + getTestDirectory / "runtime" / "graalvm-ce-java11-1.0.0.1.foo" enginePath.toFile.setWritable(false) try { @@ -246,7 +247,7 @@ class RuntimeVersionManagerSpec extends RuntimeVersionManagerTest with OsSpec { "include both bundled and installed components in list" in { prepareBundle( engines = Seq(SemVer(0, 0, 1)), - runtimes = Seq(GraalVMVersion(SemVer(1, 0, 0), "11")) + runtimes = Seq(GraalVMVersion("1.0.0.1.foo", "11")) ) val manager = makeRuntimeVersionManager() manager.findOrInstallEngine(SemVer(0, 1, 0)) @@ -260,8 +261,8 @@ class RuntimeVersionManagerSpec extends RuntimeVersionManagerTest with OsSpec { val runtimeVersions = manager.listInstalledGraalRuntimes().map(_.version) runtimeVersions.map(_.graalVersion) should contain theSameElementsAs Seq( - SemVer(1, 0, 0), - SemVer(2, 0, 0) + "1.0.0.1.foo", + "2.0.0" ) runtimeVersions.map(_.java).toSet shouldEqual Set("11") } @@ -286,7 +287,7 @@ class RuntimeVersionManagerSpec extends RuntimeVersionManagerTest with OsSpec { private def fakeInstallEngine(searchPath: Path, version: SemVer): Unit = { val manifest = """minimum-launcher-version: 0.0.1 |minimum-project-manager-version: 0.0.1 - |graal-vm-version: 1.0.0 + |graal-vm-version: 1.0.0.1.foo |graal-java-version: 11""".stripMargin val root = searchPath / version.toString Files.createDirectories(root) diff --git a/lib/scala/runtime-version-manager/src/main/scala/org/enso/runtimeversionmanager/components/GraalVMVersion.scala b/lib/scala/runtime-version-manager/src/main/scala/org/enso/runtimeversionmanager/components/GraalVMVersion.scala index f71cd35509..c0feda2f54 100644 --- a/lib/scala/runtime-version-manager/src/main/scala/org/enso/runtimeversionmanager/components/GraalVMVersion.scala +++ b/lib/scala/runtime-version-manager/src/main/scala/org/enso/runtimeversionmanager/components/GraalVMVersion.scala @@ -1,14 +1,12 @@ package org.enso.runtimeversionmanager.components -import nl.gn0s1s.bump.SemVer - /** Version information identifying the runtime that can be used with an engine * release. * * @param graalVersion version of the GraalVM * @param java Java version of the GraalVM flavour that should be used */ -case class GraalVMVersion(graalVersion: SemVer, java: String) { +case class GraalVMVersion(graalVersion: String, java: String) { /** @inheritdoc */ diff --git a/lib/scala/runtime-version-manager/src/main/scala/org/enso/runtimeversionmanager/components/Manifest.scala b/lib/scala/runtime-version-manager/src/main/scala/org/enso/runtimeversionmanager/components/Manifest.scala index 54686c2143..14694154ef 100644 --- a/lib/scala/runtime-version-manager/src/main/scala/org/enso/runtimeversionmanager/components/Manifest.scala +++ b/lib/scala/runtime-version-manager/src/main/scala/org/enso/runtimeversionmanager/components/Manifest.scala @@ -36,7 +36,7 @@ import scala.util.{Failure, Try, Using} */ case class Manifest( requiredInstallerVersions: RequiredInstallerVersions, - graalVMVersion: SemVer, + graalVMVersion: String, graalJavaVersion: String, jvmOptions: Seq[JVMOption], brokenMark: Boolean @@ -200,7 +200,7 @@ object Manifest { minimumProjectManagerVersion <- json.get[SemVer]( Fields.minimumProjectManagerVersion ) - graalVMVersion <- json.get[SemVer](Fields.graalVMVersion) + graalVMVersion <- json.get[String](Fields.graalVMVersion) graalJavaVersion <- json .get[String](Fields.graalJavaVersion) diff --git a/lib/scala/runtime-version-manager/src/main/scala/org/enso/runtimeversionmanager/components/RuntimeVersionManager.scala b/lib/scala/runtime-version-manager/src/main/scala/org/enso/runtimeversionmanager/components/RuntimeVersionManager.scala index 28841d464f..88bf167dfa 100644 --- a/lib/scala/runtime-version-manager/src/main/scala/org/enso/runtimeversionmanager/components/RuntimeVersionManager.scala +++ b/lib/scala/runtime-version-manager/src/main/scala/org/enso/runtimeversionmanager/components/RuntimeVersionManager.scala @@ -593,15 +593,7 @@ class RuntimeVersionManager( val regex = """graalvm-ce-java(\d+)-(.+)""".r name match { case regex(javaVersionString, graalVersionString) => - SemVer(graalVersionString) match { - case Some(graalVersion) => - Some(GraalVMVersion(graalVersion, javaVersionString)) - case None => - logger.warn( - s"Invalid runtime version string `$graalVersionString`." - ) - None - } + Some(GraalVMVersion(graalVersionString, javaVersionString)) case _ => logger.warn( s"Unrecognized runtime name `$name`."