v1.6.0
Pre-releaseScala CLI 1.6.0 will not be available on all distribution channels
Due to technical difficulties with our release pipeline, Scala CLI 1.6.0 release distribution channels were limited to:
- its GitHub release page, where launchers for all platforms are available as normal
- Maven Central
- WinGet
- Chocolatey
While it can be used as such, it was followed up with a hotfix 1.6.1 release, which should be available through all standard distribution channels.
Fixed commas being treated as using
directive value separators & deprecated using them with whitespace
NOTE: these are breaking changes affecting using directives syntax.
They're technically fixes + a deprecation, but in a very rare scenario existing builds could break, if they were relying on the erroneous syntax.
This Scala CLI version fixes commas (,
) being treated as using
directive value separators on their own.
Formerly, a directive like:
//> using options -Wunused:locals,privates
Would be (erroneously) interpreted as the following 2 options for the compiler: -Wunused:locals
and privates
.
As a comma will now no longer be treated as a separator (which it never should have been), it will now be interpreted correctly as
a single option: -Wunused:locals,privates
.
Before this change, the only way to pass this value to the options
directive key was escaping the comma with double quotes:
//> using options "-Wunused:locals,privates"
The escaping is no longer necessary.
Additionally, using commas along with whitespace as separators is now deprecated for future removal.
scala-cli compile --scala-snippet '//> using options -Wunused:locals, -Wunused:privates'
# [warn] <snippet>-scala-snippet:1:34
# [warn] Use of commas as separators is deprecated. Only whitespace is neccessary.
# Starting compilation server
# Compiling project (Scala 3.6.3, JVM (23))
# Compiled project (Scala 3.6.3, JVM (23))
Finally, the use of /* (..) */
comments in using
directives is no longer supported.
//> using /* some comment */ options -Wunused:locals /* some other comment */ -Wunused:privates
// this syntax used to be supported, but will now fail.
Added by @Gedochao in #3381 and #3333 and
Cap vague Scala versions at defaults
NOTE: this is a breaking change regarding how the Scala version is resolved.
We have changed how a Scala version is picked when major
or major.minor
prefixes are passed, rather than the full version tag:
-S 3
will now point to the launcher default Scala 3 Next version, rather than whatever is the latest stable version thatcoursier
can find upstream- similarly,
-S 3.<current launcher default minor>
will now point to the launcher default Scala 3 Next version -S 2.13
will point to the launcher default Scala 2.13 version (which up till now only affected tests and generated docs)- similarly,
-S 2.12
will now point to the launcher default Scala 2.12 version - launcher defaults are overridden for a particular Scala series with the
--cli-user-scala-version
to accommodate for Scala CLI installed asscala
For example:
//> using scala 3
// When compiled with Scala CLI v1.6.0, this snippet will use Scala 3.6.3 (the built-in default), even if a newer version has been released.
Support for Scala 3.6.3 and 2.13.16
This Scala CLI version switches the default Scala version to 3.6.3.
scala-cli version
# Scala CLI version: 1.6.0
# Scala version (default): 3.6.3
It has also been tested with Scala 2.13.16.
Added by @Gedochao in #3426 and #3418
Support for Scala.js 1.18.1
This Scala CLI version adds support for Scala.js 1.18.1.
scala-cli -e 'println("Hello")' --js
# Compiling project (Scala 3.6.3, Scala.js 1.18.1)
# Compiled project (Scala 3.6.3, Scala.js 1.18.1)
# Hello
Added in #3440 and VirtusLab/scala-js-cli#113
(⚡️ experimental) scalafix
integration
We now support running scalafix
rules with the fix
sub-command.
scala-cli fix . --power
# The `fix` sub-command is experimental
# Please bear in mind that non-ideal user experience should be expected.
# If you encounter any bugs or have feedback to share, make sure to reach out to the maintenance team at https://github.com/VirtusLab/scala-cli
# Running built-in rules...
# Writing project.scala
# Removing directives from Smth.scala
# Built-in rules completed.
# Running scalafix rules...
# Starting compilation server
# Compiling project (Scala 3.6.3, JVM (23))
# [warn] ./Main.scala:2:7
# [warn] unused local definition
# [warn] val unused = "unused"
# [warn] ^^^^^^
# Compiled project (Scala 3.6.3, JVM (23))
# scalafix rules completed.
Former fix functionalities are now referred to in the code as the built-in rules.
Effectively, fix now runs 2 separate sets of rules (both enabled by default): built-in and scalafix.
They can be controlled via the --enable-scalafix
and --enable-built-in
command line options.
scalafix
rules are ran according to the configuration in <project-root>/.scalafix.conf
.
It is possible to run external scalafix rules
with the (⚡️ experimental) scalafix.dep
directive:
//> using scalafix.dep com.github.xuwei-k::scalafix-rules:0.6.0
Added by @Vigorge and @dos65 in #2968
Support for running snapshot versions of the build server (Bloop)
It is now possible to pass a snapshot version to the --bloop-version
command line option.
scala-cli compile . --bloop-version 2.0.7-8-fe3f53d9-SNAPSHOT
# Starting compilation server
# Compiling project (Scala 3.6.3, JVM (23))
# Compiled project (Scala 3.6.3, JVM (23))
scala-cli --power bloop about
# bloop v2.0.7-8-fe3f53d9-SNAPSHOT
#
# Using Scala v2.12.20 and Zinc v1.10.7
# Running on Java JDK v23.0.1 (~/Library/Caches/Coursier/arc/https/github.com/adoptium/temurin23-binaries/releases/download/jdk-23.0.1%252B11/OpenJDK23U-jdk_aarch64_mac_hotspot_23.0.1_11.tar.gz/jdk-23.0.1+11/Contents/Home)
# -> Supports debugging user code, Java Debug Interface (JDI) is available.
# Maintained by the Scala Center and the community.
Support for suppressing deprecation warnings
It is now possible to suppress deprecation warnings with the --suppress-deprecated-warnings
command line option.
scala-cli project-with-deprecated-stuff --suppress-deprecated-warnings
You can also suppress deprecation warnings globally by setting the suppress-warning.deprecated-features
configuration key.
scala-cli config suppress-warning.deprecated-features true
Features
- Scalafix command for scala-cli with basic options and tests by @Vigorge and @dos65 in #2968
- Ensure vague Scala versions are capped at defaults by @Gedochao in #3259
- Merge
scalafix
intofix
by @Gedochao in #3400 - Allow to use Bloop snapshot versions by @Gedochao in #3405
- Add ways to suppress deprecation warnings by @Gedochao in #3406
Fixes
- Misc improvements in compiler options handling by @Gedochao in #3253
- Allow shading of single-choice compiler options from the command line regardless of
-
/--
prefix by @Gedochao in #3279 - Fix dependency main class detection throwing an NPE when JAR manifest doesn't list the main class correctly by @Gedochao in #3319
- Fix commas being treated as
using
directives value separators & deprecate using them with whitespace by @Gedochao in #3333 - Retain Bloop connection when restarting a build with
--watch
by @Gedochao in #3351 - Improve deprecation warnings for commas with whitespace used as using directive value separators by @Gedochao in #3366
- Recover from invalid paths returned from Bloop diagnostics by @Gedochao in #3372
- Add missing support for excluding transient dependencies when publishing by @Gedochao in #3357
- Fix using directives crashing on
*/
by removing/* (..) */
comments support inusing_directives
by @Gedochao in #3381 fix
built-in rules: don't wrap directive values in double quotes if not necessary by @Gedochao in #3414- Don't migrate directives with
fix
for single-file projects by @Gedochao in #3422 - Temporarily disable built-in rules of
fix
when--check
is enabled, until fully supported by @Gedochao in #3427 - Ensure test source directives with test scope equivalents are migrated by
fix
toproject.scala
by @Gedochao in #3425
Internal and build changes
- Retry some of the occasionally flaky tests when failing on the CI by @Gedochao in #3320
- Retry more occasionally flaky tests on the CI by @Gedochao in #3331
- Tag
scalajs-dom
tests as flaky by @Gedochao in #3336 - Tag native packager tests as flaky by @Gedochao in #3344
- Make
generate-junit-reports.sc
script recover from test failures containing no trace data by @Gedochao in #3341 - Support
coursier
-downloadedscala
wrapper tests on Windows by @Gedochao in #3325 - Get rid of duplicate names for uploaded/downloaded artifacts on the CI by @Gedochao in #3342
- Retry generating the Windows launcher up to 5 times by @Gedochao in #3349
- Retry generating Windows launchers in the
generate-native-image.sh
script directly, rather than the entire CI step by @Gedochao in #3350 - Fix integration tests when run with a Scala 3 LTS RC version by @Gedochao in #3362
- Retry some more flaky tests on the CI by @Gedochao in #3382
- Run extra tests for main supported JVM versions by @Gedochao in #3375
- tests: Add tests for issue with rereporting errors by @tgodzik in #3390
- Add extra logs when retrying flaky tests by @Gedochao in #3433
Deprecations
Documentation changes
- docs: document Scala Native flag options by @scarf005 in #3386
- docs: document Scala Native flag options by @scarf005 in #3416
- Back port of documentation changes to main by @github-actions in #3419
- Merge
scalafix
doc intofix
by @Gedochao in #3420
Updates
- Update Scala 3 Next RC to 3.6.2-RC1 by @Gedochao in #3305
- Update scala-cli.sh launcher for 1.5.4 by @github-actions in #3308
- Update
coursier
to 2.1.18 by @Gedochao in #3312 - Update
scala-packager
to 0.1.31 by @Gedochao in #3311 - Update jsoup to 1.18.2 by @scala-steward in #3323
- Update Scala 3 Next RC to 3.6.2-RC2 by @Gedochao in #3321
- Bump
coursier
to 2.1.19 by @Gedochao in #3326 - Bump Typelevel toolkit to 0.1.29 by @Gedochao in #3332
- Bump Scala 3 Next RC to 3.6.2-RC3 by @Gedochao in #3334
- Update jsoup to 1.18.3 by @scala-steward in #3338
- Update sbt, scripted-plugin to 1.10.6 by @scala-steward in #3339
- Bump actions/upload-artifact & actions/download-artifact from 3 to 4 by @Gedochao in #2701
- Update munit to 1.0.3 by @scala-steward in #3346
- Update dependency to 0.3.2 by @scala-steward in #3353
- Update
coursier
to 2.1.20 by @Gedochao in #3356 - Bump Scala Next to 3.6.2 by @Gedochao in #3358
- Bump Scala Next RC to 3.6.3-RC1 by @Gedochao in #3360
- Update metaconfig-typesafe-config to 0.14.0 by @scala-steward in #3364
- Update coursier-jvm_2.13, ... to 2.1.21 by @scala-steward in #3363
- Set Scala 3.6.2 as the latest Next announced version by @Gedochao in #3365
- Update bloop-rifle_2.13 to 2.0.6 by @scala-steward in #3368
- Update guava to 33.4.0-jre by @scala-steward in #3376
- Update
coursier
to 2.1.22 by @scala-steward in #3378 - Bump the announced Scala 3 Next RC version to 3.6.3-RC1 by @Gedochao in #3380
- Update bloop-config_2.13 to 2.2.0 by @scala-steward in #3392
- Update
coursier
to 2.1.23 by @scala-steward in #3395 - Update Scala 3 Next RC to 3.6.3-RC2 by @Gedochao in #3398
- Set Scala 3.6.3-RC2 as the latest announced RC version by @Gedochao in #3407
- Update Scala 2.13 series to 2.13.16 by @Gedochao in #3418
- Update
coursier
to 2.1.24 by @Gedochao in #3429 - Update Scala Next to 3.6.3 by @Gedochao in #3426
- Update Scala Next RC to 3.6.4-RC1 by @Gedochao in #3431
- Update bloop-config_2.13 to 2.3.1 by @scala-steward in #3435
- Update core_2.13 to 3.10.2 by @scala-steward in #3439
- Update scalafix-interfaces to 0.14.0 by @scala-steward in #3437
- Update munit to 1.0.4 by @scala-steward in #3441
- Update Scala.js to 1.18.1 by @scala-steward in #3440
New Contributors
Full Changelog: v1.5.4...v1.6.0