Skip to content

v1.1.0

Compare
Choose a tag to compare
@MaciejG604 MaciejG604 released this 29 Nov 16:10
· 249 commits to main since this release
9385014

Breaking update to Scala 2 scripts

Keep in mind that it ONLY applies to Scala 2! Scala 3 script wrappers are not affected!

Scala CLI now uses a different kind of script wrappers for Scala 2 by default, which support running background threads.
This has been introduces as an answer to the issue #2470, where a running a script in Scala 2 would end up in a deadlock due to background threads being run.
Also the change makes the Scala 2 scripts run significantly faster, as the code can be optimized due to not residing in the object's initialization clause.

However, the new solution brings some incompatibilities with the old behaviour:

  • main classes are now named the same as the file they are defined in, they do not have the '_sc' suffix anymore, so any calls like:
scala-cli foo.sc bar.sc --main-class foo_sc

should be replaced with

scala-cli foo.sc bar.sc --main-class foo
  • it is impossible to access the contents of a script named main.sc from another script, any references to the script object main will result in a compilation error.
println(main.somethingDefinedInMainScript)

Will result in the following compilation error:

[error] ./foo.sc:2:11
[error] missing argument list for method main in trait App
[error] Unapplied methods are only converted to functions when a function type is expected.
[error] You can make this conversion explicit by writing `main _` or `main(_)` instead of `main`.

When main.sc is passed as argument together with other scripts, a warning will be displayed:

[warn]  Script file named 'main.sc' detected, keep in mind that accessing it from other scripts is impossible due to a clash of `main` symbols

Added by @MaciejG604 in #2556

"Drive relative" paths on Windows

Scala CLI now correctly recognizes "drive relative" paths on Windows, so paths like /foo/bar will be treated as relative from the root of the current drive - e.g. C:\foo\bar.
This allows for compatibility of programs referencing paths with e.g. //> using file /foo/bar with Windows.

Added by @philwalk in #2516

UX improvements

Enhancements

  • Default to publish repository configured for local machine when infering publish.ci.repository by @MaciejG604 in #2571
  • Skip validation for default Scala versions, add build test by @MaciejG604 in #2576

Fixes

Documentation changes

  • Add a doc on Windows anti-malware submission procedure by @Gedochao in #2546
  • Fix list of licenses URL by @JD557 in #2552
  • Fix Windows secrets path in the documentation by @JD557 in #2561
  • Update the pgp-pair section of publish setup docs by @MaciejG604 in #2565
  • Back port of documentation changes to main by @github-actions in #2569
  • Document --python flag by @MaciejG604 in #2574
  • Document publishing process configuration by @MaciejG604 in #2580

Build and internal changes

Updates and maintenance

New Contributors

Full Changelog: v1.0.6...v1.1.0