Bump Minimal PM/Launcher Versions for New Engine (#1854)

This commit is contained in:
Radosław Waśko 2021-07-13 13:08:00 +02:00 committed by GitHub
parent b3badf1b80
commit 2eadf9f19f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 6 deletions

View File

@ -243,6 +243,9 @@ lazy val enso = (project in file("."))
launcher, launcher,
`runtime-version-manager`, `runtime-version-manager`,
`runtime-version-manager-test`, `runtime-version-manager-test`,
editions,
`distribution-manager`,
`library-manager`,
syntax.jvm, syntax.jvm,
testkit testkit
) )

View File

@ -1,5 +1,5 @@
minimum-launcher-version: 0.2.4-SNAPSHOT minimum-launcher-version: 0.2.13
minimum-project-manager-version: 0.2.4-SNAPSHOT minimum-project-manager-version: 0.2.13
jvm-options: jvm-options:
- value: "-Dpolyglot.engine.IterativePartialEscape=true" - value: "-Dpolyglot.engine.IterativePartialEscape=true"
- value: "-Dtruffle.class.path.append=$enginePackagePath\\component\\runtime.jar" - value: "-Dtruffle.class.path.append=$enginePackagePath\\component\\runtime.jar"

View File

@ -2,6 +2,7 @@ package org.enso.runner
import akka.http.scaladsl.model.{IllegalUriException, Uri} import akka.http.scaladsl.model.{IllegalUriException, Uri}
import cats.implicits._ import cats.implicits._
import com.typesafe.scalalogging.Logger
import org.apache.commons.cli.{Option => CliOption, _} import org.apache.commons.cli.{Option => CliOption, _}
import org.enso.editions.DefaultEdition import org.enso.editions.DefaultEdition
import org.enso.languageserver.boot import org.enso.languageserver.boot
@ -11,6 +12,7 @@ import org.enso.pkg.{Contact, PackageManager}
import org.enso.polyglot.{LanguageInfo, Module, PolyglotContext} import org.enso.polyglot.{LanguageInfo, Module, PolyglotContext}
import org.enso.version.VersionDescription import org.enso.version.VersionDescription
import org.graalvm.polyglot.PolyglotException import org.graalvm.polyglot.PolyglotException
import java.io.File import java.io.File
import java.util.UUID import java.util.UUID
import scala.Console.err import scala.Console.err
@ -42,6 +44,8 @@ object Main {
private val LOGGER_CONNECT = "logger-connect" private val LOGGER_CONNECT = "logger-connect"
private val NO_LOG_MASKING = "no-log-masking" private val NO_LOG_MASKING = "no-log-masking"
private lazy val logger = Logger[Main.type]
/** Builds the [[Options]] object representing the CLI syntax. /** Builds the [[Options]] object representing the CLI syntax.
* *
* @return an [[Options]] object representing the CLI syntax * @return an [[Options]] object representing the CLI syntax
@ -258,10 +262,18 @@ object Main {
val authors = val authors =
if (authorName.isEmpty && authorEmail.isEmpty) List() if (authorName.isEmpty && authorEmail.isEmpty) List()
else List(Contact(name = authorName, email = authorEmail)) else List(Contact(name = authorName, email = authorEmail))
val edition = DefaultEdition.getDefaultEdition
logger.whenTraceEnabled {
val baseEdition = edition.parent.getOrElse("<no-base>")
logger.trace(
s"Creating a new project $name based on edition [$baseEdition]."
)
}
PackageManager.Default.create( PackageManager.Default.create(
root = root, root = root,
name = name, name = name,
edition = Some(DefaultEdition.getDefaultEdition), edition = Some(edition),
authors = authors, authors = authors,
maintainers = authors maintainers = authors
) )

View File

@ -51,6 +51,7 @@ class ProjectCreateHandler[F[+_, +_]: Exec: CovariantFlatMap: ErrorChannel](
s"Could not determine the default version: $error" s"Could not determine the default version: $error"
) )
} }
_ = logger.trace(s"Creating project using engine $actualVersion")
projectId <- projectService.createUserProject( projectId <- projectService.createUserProject(
progressTracker = self, progressTracker = self,
name = params.name, name = params.name,

View File

@ -1,7 +1,9 @@
package org.enso.projectmanager.service package org.enso.projectmanager.service
import akka.actor.ActorRef import akka.actor.ActorRef
import com.typesafe.scalalogging.Logger
import nl.gn0s1s.bump.SemVer import nl.gn0s1s.bump.SemVer
import org.enso.logger.masking.MaskedPath
import org.enso.projectmanager.control.core.CovariantFlatMap import org.enso.projectmanager.control.core.CovariantFlatMap
import org.enso.projectmanager.control.core.syntax._ import org.enso.projectmanager.control.core.syntax._
import org.enso.projectmanager.control.effect.{ErrorChannel, Sync} import org.enso.projectmanager.control.effect.{ErrorChannel, Sync}
@ -25,6 +27,8 @@ class ProjectCreationService[
loggingServiceDescriptor: LoggingServiceDescriptor loggingServiceDescriptor: LoggingServiceDescriptor
) extends ProjectCreationServiceApi[F] { ) extends ProjectCreationServiceApi[F] {
private lazy val logger = Logger[ProjectCreationService[F]]
/** @inheritdoc */ /** @inheritdoc */
override def createProject( override def createProject(
progressTracker: ActorRef, progressTracker: ActorRef,
@ -56,6 +60,10 @@ class ProjectCreationService[
runner.newProject(path, name, engineVersion, None, None, Seq()).get runner.newProject(path, name, engineVersion, None, None, Seq()).get
val jvmSettings = distributionConfiguration.defaultJVMSettings val jvmSettings = distributionConfiguration.defaultJVMSettings
runner.withCommand(settings, jvmSettings) { command => runner.withCommand(settings, jvmSettings) { command =>
logger.trace(
s"Running engine $engineVersion to create project $name at " +
s"[${MaskedPath(path).applyMasking()}]."
)
command.run().get command.run().get
} }
} }

View File

@ -17,11 +17,9 @@ trait ProjectManagementOps { this: BaseServerSpec =>
def createProject( def createProject(
name: String, name: String,
version: Option[SemVer] = None,
missingComponentAction: Option[MissingComponentAction] = None missingComponentAction: Option[MissingComponentAction] = None
)(implicit client: WsTestClient): UUID = { )(implicit client: WsTestClient): UUID = {
val fields = Seq("name" -> name.asJson) ++ val fields = Seq("name" -> name.asJson) ++
version.map(v => "version" -> v.asJson).toSeq ++
missingComponentAction missingComponentAction
.map(a => "missingComponentAction" -> a.asJson) .map(a => "missingComponentAction" -> a.asJson)
.toSeq .toSeq

View File

@ -23,8 +23,15 @@ object Editions {
): Unit = { ): Unit = {
val editions = file("distribution") / "editions" val editions = file("distribution") / "editions"
IO.createDirectory(editions) IO.createDirectory(editions)
val edition = editions / (editionName + ".yaml") val edition = editions / (editionName + ".yaml")
for (file <- IO.listFiles(editions)) {
if (file.getName != edition.getName) {
IO.delete(file)
log.warn(s"Removed spurious file in editions directory: $file")
}
}
if (!edition.exists()) { if (!edition.exists()) {
val librariesConfigs = standardLibraries.map { libName => val librariesConfigs = standardLibraries.map { libName =>
s""" - name: $libName s""" - name: $libName