From ac7ec63d48fb7b38ba4b4705e225372dd3659355 Mon Sep 17 00:00:00 2001 From: Frederick Roth Date: Wed, 23 Oct 2024 19:14:23 +0200 Subject: [PATCH] Remove support for graalvm --- .github/workflows/ci.yml | 23 +-- build.sbt | 11 -- ...mage.truthy)$native-image-readme.md$endif$ | 6 - src/main/g8/build.sbt | 3 - src/main/g8/default.properties | 4 - .../$package__packaged$/reflect-config.json | 180 ------------------ 6 files changed, 1 insertion(+), 226 deletions(-) delete mode 100644 src/main/g8/$if(graal_native_image.truthy)$native-image-readme.md$endif$ delete mode 100644 src/main/g8/src/main/resources/$if(graal_native_image.truthy)$META-INF$endif$/native-image/$package__packaged$/reflect-config.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4af595dc..83e03daf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest] scala: [2.12] - java: [temurin@11, temurin@17, graalvm@17] + java: [temurin@11, temurin@17] runs-on: ${{ matrix.os }} timeout-minutes: 60 steps: @@ -66,29 +66,8 @@ jobs: if: matrix.java == 'temurin@17' && steps.setup-java-temurin-17.outputs.cache-hit == 'false' run: sbt +update - - name: Setup Java (graalvm@17) - id: setup-java-graalvm-17 - if: matrix.java == 'graalvm@17' - uses: actions/setup-java@v4 - with: - distribution: graalvm - java-version: 17 - cache: sbt - - - name: sbt update - if: matrix.java == 'graalvm@17' && steps.setup-java-graalvm-17.outputs.cache-hit == 'false' - run: sbt +update - - name: Check that workflows are up to date run: sbt githubWorkflowCheck - name: Test generated template run: sbt '++ ${{ matrix.scala }}' g8Test - - - name: Build native assembly - if: startsWith(matrix.java, 'graalvm') - run: | - cd target/sbt-test/http4s-g8/scripted - sbt assembly - gu install native-image - cat native-image-readme.md | grep 'native-image -H*' | sh diff --git a/build.sbt b/build.sbt index b645493d..63db18fd 100644 --- a/build.sbt +++ b/build.sbt @@ -4,16 +4,6 @@ ThisBuild / githubWorkflowBuild := Seq( WorkflowStep.Sbt(List("g8Test"), name = Some("Test generated template")), - WorkflowStep.Run( - List( - "cd target/sbt-test/http4s-g8/scripted", - "sbt assembly", - "gu install native-image", - "cat native-image-readme.md | grep 'native-image -H*' | sh" - ), - cond = Some("startsWith(matrix.java, 'graalvm')"), - name = Some("Build native assembly") - ) ) val PrimaryOS = "ubuntu-latest" @@ -22,7 +12,6 @@ ThisBuild / githubWorkflowOSes := Seq(PrimaryOS, MacOS) ThisBuild / githubWorkflowJavaVersions := Seq( JavaSpec.temurin("11"), JavaSpec.temurin("17"), - JavaSpec.graalvm("17") ) ThisBuild / githubWorkflowPublishTargetBranches := Seq.empty diff --git a/src/main/g8/$if(graal_native_image.truthy)$native-image-readme.md$endif$ b/src/main/g8/$if(graal_native_image.truthy)$native-image-readme.md$endif$ deleted file mode 100644 index e022957d..00000000 --- a/src/main/g8/$if(graal_native_image.truthy)$native-image-readme.md$endif$ +++ /dev/null @@ -1,6 +0,0 @@ -You can build a native-image binary as mentioned in the http4s deployment [section] (https://github.com/drocsid/http4s/blob/docs/deployment/docs/src/main/tut/deployment.md) . You will need to follow the directions there to provide GraalVM / native-image plugin and provide a muslC bundle. Then populate the UseMuslC path with it's location. - -``` -native-image $if(is_linux_build.truthy)$--static -H:UseMuslC="/path.to/muslC"$endif$ -H:+ReportExceptionStackTraces -H:+AddAllCharsets --allow-incomplete-classpath --no-fallback --initialize-at-build-time --enable-http --enable-https --enable-all-security-services --verbose -jar "./target/$scala_assembly_target$/$name$-assembly-0.0.1-SNAPSHOT.jar" $name$BinaryImage -``` - diff --git a/src/main/g8/build.sbt b/src/main/g8/build.sbt index 7c2fc325..9bf3b961 100644 --- a/src/main/g8/build.sbt +++ b/src/main/g8/build.sbt @@ -19,9 +19,6 @@ lazy val root = (project in file(".")) "org.scalameta" %% "munit" % MunitVersion % Test, "org.typelevel" %% "munit-cats-effect" % MunitCatsEffectVersion % Test, "ch.qos.logback" % "logback-classic" % LogbackVersion % Runtime, - $if(graal_native_image.truthy)$ - "org.scalameta" % "svm-subs" % "101.0.0" - $endif$ ), addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.13.3" cross CrossVersion.full), addCompilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1"), diff --git a/src/main/g8/default.properties b/src/main/g8/default.properties index 00691a53..6dd63895 100644 --- a/src/main/g8/default.properties +++ b/src/main/g8/default.properties @@ -3,7 +3,3 @@ organization = com.example package = $organization$.$name;format="norm,word"$ scala_version = 2.13.14 -# graal_vm_specific -graal_native_image = true -is_linux_build = false -scala_assembly_target = scala-2.13 diff --git a/src/main/g8/src/main/resources/$if(graal_native_image.truthy)$META-INF$endif$/native-image/$package__packaged$/reflect-config.json b/src/main/g8/src/main/resources/$if(graal_native_image.truthy)$META-INF$endif$/native-image/$package__packaged$/reflect-config.json deleted file mode 100644 index d297bd6a..00000000 --- a/src/main/g8/src/main/resources/$if(graal_native_image.truthy)$META-INF$endif$/native-image/$package__packaged$/reflect-config.json +++ /dev/null @@ -1,180 +0,0 @@ -[ - { - "name": "org.slf4j.impl.StaticLoggerBinder", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.DateConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.MessageConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.ThrowableProxyConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.NopThrowableInformationConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.ContextNameConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.BoldYellowCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.LoggerConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.ReplacingCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.BoldBlueCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.CyanCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.RedCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.WhiteCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.PropertyConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.ExtendedThrowableProxyConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.RootCauseFirstThrowableProxyConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.MethodOfCallerConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.LevelConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.IdentityCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.BoldWhiteCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.MarkerConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.BoldCyanCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.BoldMagentaCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.RelativeTimeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.MagentaCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.ClassOfCallerConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.LineOfCallerConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.FileOfCallerConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.BoldGreenCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.LocalSequenceNumberConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.YellowCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.ExtendedThrowableProxyConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.color.HighlightingCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.GrayCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.MDCConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.ClassOfCallerConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.BoldRedCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.GreenCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.pattern.color.BlackCompositeConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.ThreadConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.pattern.LineSeparatorConverter", - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.classic.encoder.PatternLayoutEncoder", - "allPublicMethods":true, - "allDeclaredConstructors": true - }, - { - "name": "ch.qos.logback.core.ConsoleAppender", - "allPublicMethods":true, - "allDeclaredConstructors": true - }, - { - "name": "com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl", - "allDeclaredConstructors": true - } -]