Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build scala-cli with jvm 11 #212

Merged
merged 5 commits into from
Nov 26, 2021

Conversation

tpasternak
Copy link
Contributor

Let's check what happens

@tpasternak tpasternak marked this pull request as ready for review October 13, 2021 12:03
Copy link
Contributor

@alexarchambault alexarchambault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make sure that the runner, test-runner, and stub modules are still fine with Java 8, by passing them the right javac and scalac options (see this SO question, I think we need both its javac and scalac options). These are the modules that are sometimes added to the user class path by Scala CLI.

To be sure it works, we can add a simple test in RunTestDefinitions say, that passes --jvm 8 to scala-cli.

@MarcinAman
Copy link
Contributor

Wouldn't upgrading to latest LTS (JDK 17) make sense? Afaik this is quite a problematic release as oracle decided to encapsulate some of its internals therefore some tooling may not be compatible. So if it works on JDK 17 it will probably run on older JDK-s

@alexarchambault
Copy link
Contributor

For now, we're using the Java 11 version of GraalVM to build the native launcher, so switching to Java 11 isn't a problem. Maybe the upcoming GraalVM version will have Java 17 versions, and allow to switch to Java 17 then.

@tpasternak
Copy link
Contributor Author

@tpasternak tpasternak force-pushed the try-build-on-java-11 branch 2 times, most recently from ca804c7 to 1866f29 Compare November 24, 2021 15:43
@tpasternak tpasternak changed the title Try bulid with jvm 11 Build scala-cli with jvm 11 Nov 24, 2021
@tpasternak tpasternak force-pushed the try-build-on-java-11 branch 2 times, most recently from 1ddd820 to 99b932d Compare November 24, 2021 19:39
build.sc Outdated Show resolved Hide resolved
@@ -214,7 +214,7 @@ class NativePackagerTests extends munit.FunSuite {
// format: off
val cmd = Seq[os.Shellable](
TestUtil.cli,
"package", helloWorldFileName,
"package", "--jvm", "8", helloWorldFileName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should just change the base image in Package.scala.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, but this does not fully resolve the problem. I opened an issue #413

@@ -114,7 +114,7 @@ The docker image name parameter `--docker-image-repository` is mandatory.
The following command generates a `hello-docker` image with the `latest` tag:

```bash
scala-cli package --docker HelloDocker.scala --docker-image-repository hello-docker
scala-cli package --jvm 8 --docker HelloDocker.scala --docker-image-repository hello-docker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above, this shouldn't be needed with a change of base image.

@tpasternak tpasternak merged commit c200399 into VirtusLab:master Nov 26, 2021
@tpasternak tpasternak deleted the try-build-on-java-11 branch November 26, 2021 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants