You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Keep in mind that it ONLY applies to Scala 2! Scala 3 script wrappers are not affected!**
16
+
17
+
Scala CLI now uses a different kind of script wrappers for Scala 2 by default, which support running background threads.
18
+
This has been introduces as an answer to the [issue #2470](https://github.com/VirtusLab/scala-cli/issues/2470), where a running a script in Scala 2 would end up in a deadlock due to background threads being run.
19
+
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.
20
+
21
+
However, the new solution brings some incompatibilities with the old behaviour:
22
+
- 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:
23
+
```bash ignore
24
+
scala-cli foo.sc bar.sc --main-class foo_sc
25
+
```
26
+
should be replaced with
27
+
```bash ignore
28
+
scala-cli foo.sc bar.sc --main-class foo
29
+
```
30
+
- it is impossible to access the contents of a script named `main.sc` from another source, any references to the script object `main` will result in a compilation error.
31
+
E.g. Accessing the contents of `main.sc` using the following code:
32
+
```scala
33
+
println(main.somethingDefinedInMainScript)
34
+
```
35
+
Will result in the following compilation error:
36
+
```bash ignore
37
+
[error] ./foo.sc:2:11
38
+
[error] missing argument list for method main in trait App
39
+
[error] Unapplied methods are only converted to functions when a function type is expected.
40
+
[error] You can make this conversion explicit by writing `main _` or `main(_)` instead of `main`.
41
+
```
42
+
When `main.sc` is passed as argument together with other scripts, a warning will be displayed:
43
+
```bash ignore
44
+
[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
45
+
```
46
+
47
+
Added by [@MaciejG604](https://github.com/MaciejG604) in [#2556](https://github.com/VirtusLab/scala-cli/pull/2556)
48
+
49
+
### "Drive relative" paths on Windows
50
+
51
+
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`.
52
+
This allows for compatibility of programs referencing paths with e.g. `//> using file /foo/bar` with Windows.
53
+
54
+
Added by [@philwalk](https://github.com/philwalk) in [#2516](https://github.com/VirtusLab/scala-cli/pull/2516)
55
+
56
+
### UX improvements
57
+
* React to some HTTP responses by [@MaciejG604](https://github.com/MaciejG604) in [#2007](https://github.com/VirtusLab/scala-cli/pull/2007)
58
+
* Chore/group warnings about directives in multiple files by [@MaciejG604](https://github.com/MaciejG604) in [#2550](https://github.com/VirtusLab/scala-cli/pull/2550)
59
+
* Migrate to Docusaurus v3, add local search plugin by [@MaciejG604](https://github.com/MaciejG604) in [#2590](https://github.com/VirtusLab/scala-cli/pull/2590)
60
+
61
+
### Enhancements
62
+
* Default to publish repository configured for local machine when inferring publish.ci.repository by [@MaciejG604](https://github.com/MaciejG604) in [#2571](https://github.com/VirtusLab/scala-cli/pull/2571)
63
+
* Skip validation for default Scala versions, add build test by [@MaciejG604](https://github.com/MaciejG604) in [#2576](https://github.com/VirtusLab/scala-cli/pull/2576)
64
+
65
+
### Fixes
66
+
* Take into consideration --project-version when creating BuildInfo by [@MaciejG604](https://github.com/MaciejG604) in [#2548](https://github.com/VirtusLab/scala-cli/pull/2548)
67
+
* Workaround for home.dir property not being set by [@MaciejG604](https://github.com/MaciejG604) in [#2573](https://github.com/VirtusLab/scala-cli/pull/2573)
68
+
* Pass scalac arguments as file by [@MaciejG604](https://github.com/MaciejG604) in [#2584](https://github.com/VirtusLab/scala-cli/pull/2584)
69
+
70
+
### Documentation changes
71
+
* Add a doc on Windows anti-malware submission procedure by [@Gedochao](https://github.com/Gedochao) in [#2546](https://github.com/VirtusLab/scala-cli/pull/2546)
72
+
* Fix list of licenses URL by [@JD557](https://github.com/JD557) in [#2552](https://github.com/VirtusLab/scala-cli/pull/2552)
73
+
* Fix Windows secrets path in the documentation by [@JD557](https://github.com/JD557) in [#2561](https://github.com/VirtusLab/scala-cli/pull/2561)
74
+
* Update the pgp-pair section of publish setup docs by [@MaciejG604](https://github.com/MaciejG604) in [#2565](https://github.com/VirtusLab/scala-cli/pull/2565)
75
+
* Back port of documentation changes to main by @github-actions in [#2569](https://github.com/VirtusLab/scala-cli/pull/2569)
76
+
* Document --python flag by [@MaciejG604](https://github.com/MaciejG604) in [#2574](https://github.com/VirtusLab/scala-cli/pull/2574)
77
+
* Document publishing process configuration by [@MaciejG604](https://github.com/MaciejG604) in [#2580](https://github.com/VirtusLab/scala-cli/pull/2580)
78
+
* Back port of documentation changes to main by @github-actions in [#2593](https://github.com/VirtusLab/scala-cli/pull/2593)
79
+
80
+
### Build and internal changes
81
+
* Exclude conflicting dependencies by [@MaciejG604](https://github.com/MaciejG604) in [#2541](https://github.com/VirtusLab/scala-cli/pull/2541)
82
+
* Generate test reports on the CI by [@Gedochao](https://github.com/Gedochao) in [#2543](https://github.com/VirtusLab/scala-cli/pull/2543)
83
+
* Use the latest `scala-cli` in `macos-m1-tests` by [@Gedochao](https://github.com/Gedochao) in [#2554](https://github.com/VirtusLab/scala-cli/pull/2554)
84
+
* Install `scala-cli` with `cs` on M1 by [@Gedochao](https://github.com/Gedochao) in [#2555](https://github.com/VirtusLab/scala-cli/pull/2555)
85
+
* Fix generating test reports for failed suites by [@Gedochao](https://github.com/Gedochao) in [#2564](https://github.com/VirtusLab/scala-cli/pull/2564)
86
+
* Pin `scala-cli-setup` version to be M1-compatible & use it in `native-macos-m1-tests` by [@Gedochao](https://github.com/Gedochao) in [#2568](https://github.com/VirtusLab/scala-cli/pull/2568)
87
+
* Add log separators for integration and build tests by [@MaciejG604](https://github.com/MaciejG604) in [#2570](https://github.com/VirtusLab/scala-cli/pull/2570)
88
+
* Adjust test report generation to mill 0.11.6 bump changes by [@Gedochao](https://github.com/Gedochao) in [#2577](https://github.com/VirtusLab/scala-cli/pull/2577)
89
+
* Bump MacOS CI to `macOS-13` by [@Gedochao](https://github.com/Gedochao) in [#2579](https://github.com/VirtusLab/scala-cli/pull/2579)
90
+
* Add env for configuring home directory overriding by [@MaciejG604](https://github.com/MaciejG604) in [#2587](https://github.com/VirtusLab/scala-cli/pull/2587)
91
+
92
+
### Updates and maintenance
93
+
* Update trees_2.13 to 4.8.13 by [@scala-steward](https://github.com/scala-steward) in [#2532](https://github.com/VirtusLab/scala-cli/pull/2532)
94
+
* Update scala-cli.sh launcher for 1.0.6 by @github-actions in [#2542](https://github.com/VirtusLab/scala-cli/pull/2542)
95
+
* chore: Update Bloop to v1.5.11-sc by [@tgodzik](https://github.com/tgodzik) in [#2557](https://github.com/VirtusLab/scala-cli/pull/2557)
96
+
* Update trees_2.13 to 4.8.14 by [@scala-steward](https://github.com/scala-steward) in [#2560](https://github.com/VirtusLab/scala-cli/pull/2560)
97
+
* Update scalafmt-cli_2.13, scalafmt-core to 3.7.17 by [@scala-steward](https://github.com/scala-steward) in [#2559](https://github.com/VirtusLab/scala-cli/pull/2559)
98
+
* Bump VirtusLab/scala-cli-setup from 1.0.5 to 1.0.6 by [@dependabot](https://github.com/dependabot) in [#2567](https://github.com/VirtusLab/scala-cli/pull/2567)
99
+
* Update ammonite to 3.0.0-M0-59-cdeaa580 by [@scala-steward](https://github.com/scala-steward) in [#2558](https://github.com/VirtusLab/scala-cli/pull/2558)
100
+
* Update mill-main to 0.11.6 by [@scala-steward](https://github.com/scala-steward) in [#2572](https://github.com/VirtusLab/scala-cli/pull/2572)
101
+
* Update coursier-jvm_2.13, ... to 2.1.8 by [@scala-steward](https://github.com/scala-steward) in [#2575](https://github.com/VirtusLab/scala-cli/pull/2575)
102
+
* Update ammonite to 3.0.0-M0-60-89836cd8 by [@scala-steward](https://github.com/scala-steward) in [#2586](https://github.com/VirtusLab/scala-cli/pull/2586)
103
+
* Bump `coursier` to `v2.1.8` where it wasn't consistent by [@Gedochao](https://github.com/Gedochao) in [#2588](https://github.com/VirtusLab/scala-cli/pull/2588)
104
+
105
+
## New Contributors
106
+
* [@philwalk](https://github.com/philwalk) made their first contribution in [#2516](https://github.com/VirtusLab/scala-cli/pull/2516)
0 commit comments