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

Bundle scala cli in scala command #20351

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

bishabosha
Copy link
Member

@bishabosha bishabosha commented May 7, 2024

fixes #20098

Proposed changes to zip/targz archive:

  • in the /bin directory store an extra launcher for Scala CLI (either JAR, or native per platform).
  • /bin/scala[.bat] is modified to invoke Scala CLI stored in /bin
  • new /maven2 directory, which stores all the Jars and POM files necessary (in maven repo style) for scala-cli to invoke scala compiler offline (using the -r launcher option).
  • CHOICE: either replace jar files in /lib by aliases to the corresponding jar in /maven2, OR delete /lib and update references from scripts.
  • add platform specific suffixes to artefacts:
    • e.g. scala-3.5.0-x86_64-pc-linux.tar.gz (for the artefact that bundles the x64 linux launcher)

[skip ci]

@Gedochao Gedochao added the needs-minor-release This PR cannot be merged until the next minor release label May 7, 2024
@bishabosha bishabosha added the release-notes Should be mentioned in the release notes label May 7, 2024
Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

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

I can only comment on what's jumping at me. The timing is way too short to do a real review.

Even if I did find something it wouldn't get addressed and shipped in time at this point, so, to be blunt: why bother?

bin/scala Outdated Show resolved Hide resolved
compiler/test/dotty/tools/scripting/ClasspathTests.scala Outdated Show resolved Hide resolved
@bishabosha
Copy link
Member Author

bishabosha commented May 7, 2024

It appears that on windows a critical class is loaded on boot scala.build.internal.JniGetWinDirs which is compiled by JDK 16, so fails when loading from Java 8. But on Mac OS the jar launcher works fine on java 8 - could it be possible that just this one dependency has a misconfigured build?

Edit: We can not guarantee that the Jar-based launcher works on JDK 17, so this must be do-not-merge until we implement the native launchers

@He-Pin
Copy link

He-Pin commented May 10, 2024

A question is if a new scala-cli is released, will scala update it automatically, like cs update scala-cli?

@bishabosha
Copy link
Member Author

bishabosha commented May 10, 2024

A question is if a new scala-cli is released, will scala update it automatically, like cs update scala-cli?

The way it is currently implemented, the idea would be that each scala version is tied to a specific Scala CLI launcher. and Each scala release would come with whatever is the latest Scala CLI version at that moment

@Kordyjan Kordyjan added this to the 3.5.0 milestone May 10, 2024
@He-Pin
Copy link

He-Pin commented May 15, 2024

  1. When do republishing , is there some kind of Sha or md5 checking ?
  2. Does Windows platform been well tested?

@bishabosha bishabosha force-pushed the bundle-scala-cli branch 4 times, most recently from 28995e1 to 8df9d33 Compare May 17, 2024 15:46
@hamzaremmal
Copy link
Member


val baseVersion = "3.5.0-RC1"

val referenceVersion = "3.4.2-RC1"
Copy link

Choose a reason for hiding this comment

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

Is it right?

@hamzaremmal hamzaremmal force-pushed the bundle-scala-cli branch 6 times, most recently from 0fb67be to 9c3357f Compare May 23, 2024 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-minor-release This PR cannot be merged until the next minor release release-notes Should be mentioned in the release notes stat:do not merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Scala CLI as the scala runner command
6 participants