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

Implement Scala CLI as the scala runner command #20098

Closed
8 of 10 tasks
Gedochao opened this issue Apr 5, 2024 · 1 comment · Fixed by #20351
Closed
8 of 10 tasks

Implement Scala CLI as the scala runner command #20098

Gedochao opened this issue Apr 5, 2024 · 1 comment · Fixed by #20351
Assignees
Labels
area:ci Issues tied with CI/CD workflows area:runner Issues tied to the scala runner command. itype:enhancement

Comments

@Gedochao
Copy link
Contributor

Gedochao commented Apr 5, 2024

Corresponding Scala CLI issue

Relevant docs

Requirements

  • set up downloading of Scala CLI JVM launcher from GitHub VirtusLab/scala-cli
  • download library dependencies to the dist/target/pack in maven repo style
  • fix scripts to wrap Scala CLI launcher, setting both the local repo and default scala version launcher options
    • update for windows (batch)
    • update for linux/mac (bash)
  • run any existing legacy (old) scala runner tests against the Scala CLI launcher on the scala/scala3 CI
  • use the Scala CLI launcher instead of the scala runner in official Scala 3 distributions
    • coursier
    • brew
    • SDKMAN
@bishabosha
Copy link
Member

bishabosha commented May 1, 2024

the strategy of downloading the launcher looks looks slightly problematic for script files compiled with a higher tasty version than scala-cli itself (e.g. a new minor release):

echo 'println(23)' >> local/foo.sc

scala-cli --cli-default-scala-version 3.5.0-RC1-bin-SNAPSHOT \
  -r file://dist/target/pack/maven2  \
  local/foo.sc \
  --server=false

Scala CLI (v1.3.0) cannot post process TASTY files from Scala 3.5.0-RC1-bin-SNAPSHOT.
This is not a fatal error since post processing only cleans up source paths in TASTY file.
It should not affect your application.
You may be getting this warning because you are using a newer version of Scala than the one supported by Scala CLI (v1.3.0).
Make sure your Scala CLI is up-to-date.
You may need to wait for 3.5.0-RC1-bin-SNAPSHOT support in a future version of Scala CLI.

23

however it still executes this simple script, as the error says, its only a problem "cleaning up" the source paths.
Is there a possible case that would actually fail?

hamzaremmal added a commit that referenced this issue Jun 11, 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. (Looks like symlinks are not portable, so probably we
should encode the classpath in a file, or adjust slightly how we build
the toolchain)
- 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)

---------

Co-authored-by: Hamza REMMAL <[email protected]>
WojciechMazur pushed a commit to WojciechMazur/dotty that referenced this issue Jun 20, 2024
fixes scala#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. (Looks like symlinks are not portable, so probably we
should encode the classpath in a file, or adjust slightly how we build
the toolchain)
- 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)

---------

Co-authored-by: Hamza REMMAL <[email protected]>
WojciechMazur pushed a commit to WojciechMazur/dotty that referenced this issue Jun 20, 2024
fixes scala#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. (Looks like symlinks are not portable, so probably we
should encode the classpath in a file, or adjust slightly how we build
the toolchain)
- 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)

---------

Co-authored-by: Hamza REMMAL <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:ci Issues tied with CI/CD workflows area:runner Issues tied to the scala runner command. itype:enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants