Skip to content

Commit d519966

Browse files
committed
Add release notes for v1.4.0
1 parent 0f7c5e8 commit d519966

File tree

1 file changed

+187
-1
lines changed

1 file changed

+187
-1
lines changed

website/docs/release_notes.md

Lines changed: 187 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,192 @@ import ReactPlayer from 'react-player'
88

99
# Release notes
1010

11+
## [v1.4.0](https://github.com/VirtusLab/scala-cli/releases/tag/v1.4.0)
12+
13+
### Running the REPL with the test scope included
14+
It is now possible to start the Scala REPL with access to the test scope.
15+
To do so, it's enough to pass the `--test` flag with the `repl` sub-command.
16+
17+
```scala title=ReplTestScopeExample.test.scala
18+
package example
19+
object ReplTestScopeExample {
20+
def message: String = "calling test scope from repl"
21+
}
22+
```
23+
24+
```bash ignore
25+
scala-cli repl ReplTestScopeExample.test.scala --test
26+
# Compiling project (test, Scala 3.4.2, JVM (17))
27+
# Compiled project (test, Scala 3.4.2, JVM (17))
28+
# Welcome to Scala 3.4.2 (17, Java OpenJDK 64-Bit Server VM).
29+
# Type in expressions for evaluation. Or try :help.
30+
#
31+
# scala> example.ReplTestScopeExample.message
32+
# val res0: String = calling test scope from repl
33+
#
34+
# scala>
35+
```
36+
37+
Added by [@Gedochao](https://github.com/Gedochao) in [#2971](https://github.com/VirtusLab/scala-cli/pull/2971.)
38+
39+
### The `using jvm` directives are now always respected
40+
Formerly, if the build server (Bloop) was running on an older JVM than the one specified in a `using jvm` directive, the directive wouldn't be respected. We now restart the build server based on both the directive and the respective command line option (`--jvm`).
41+
42+
```java title=Simple.java
43+
//> using jvm 22
44+
//> using javacOpt --enable-preview -Xlint:preview
45+
//> using javaOpt --enable-preview
46+
//> using mainClass Simple
47+
48+
void main() {
49+
System.out.println("Hello from Java 22");
50+
}
51+
```
52+
53+
Added by [@kasiaMarek](https://github.com/kasiaMarek) in [#2972](https://github.com/VirtusLab/scala-cli/pull/2972)
54+
55+
### Support for Scala Native 0.5.4
56+
This Scala CLI version adds support for Scala Native 0.5.4.
57+
Native platform builds will now use 0.5.4 as the default version.
58+
59+
```bash
60+
scala-cli -e 'println("Hello, Scala Native!")' --native
61+
# Compiling project (Scala 3.4.2, Scala Native 0.5.4)
62+
# Compiled project (Scala 3.4.2, Scala Native 0.5.4)
63+
# [info] Linking (multithreadingEnabled=true, disable if not used) (902 ms)
64+
# [info] Discovered 882 classes and 5384 methods after classloading
65+
# [info] Checking intermediate code (quick) (37 ms)
66+
# [info] Multithreading was not explicitly enabled - initial class loading has not detected any usage of system threads. Multithreading support will be disabled to improve performance.
67+
# [info] Linking (multithreadingEnabled=false) (292 ms)
68+
# [info] Discovered 499 classes and 2497 methods after classloading
69+
# [info] Checking intermediate code (quick) (10 ms)
70+
# [info] Discovered 478 classes and 1912 methods after optimization
71+
# [info] Optimizing (debug mode) (445 ms)
72+
# [info] Produced 9 LLVM IR files
73+
# [info] Generating intermediate code (353 ms)
74+
# [info] Compiling to native code (1619 ms)
75+
# [info] Linking with [pthread, dl]
76+
# [info] Linking native code (immix gc, none lto) (137 ms)
77+
# [info] Postprocessing (0 ms)
78+
# [info] Total (3753 ms)
79+
# Hello, Scala Native!
80+
```
81+
82+
Added by [@scala-steward](https://github.com/scala-steward) in [#2982.](https://github.com/VirtusLab/scala-cli/pull/2982.)
83+
84+
### Scala Toolkit 0.4.0 & 0.3.0 defaults
85+
This Scala CLI version treats Scala Toolkit 0.4.0 as the default version under most circumstances.
86+
```scala
87+
//> using toolkit default
88+
@main def main() = println(os.pwd)
89+
```
90+
This unlocks the Scala Toolkit to be used with Scala Native 0.5.x.
91+
92+
```bash
93+
scala-cli -e 'println(os.pwd)' --toolkit default --native
94+
# Compiling project (Scala 3.4.2, Scala Native 0.5.4)
95+
# Compiled project (Scala 3.4.2, Scala Native 0.5.4)
96+
# [info] Linking (multithreadingEnabled=true, disable if not used) (1051 ms)
97+
# [info] Discovered 1047 classes and 6745 methods after classloading
98+
# [info] Checking intermediate code (quick) (46 ms)
99+
# [info] Multithreading was not explicitly enabled - initial class loading has not detected any usage of system threads. Multithreading support will be disabled to improve performance.
100+
# [info] Linking (multithreadingEnabled=false) (543 ms)
101+
# [info] Discovered 880 classes and 5417 methods after classloading
102+
# [info] Checking intermediate code (quick) (15 ms)
103+
# [info] Discovered 857 classes and 4238 methods after optimization
104+
# [info] Optimizing (debug mode) (651 ms)
105+
# [info] Produced 9 LLVM IR files
106+
# [info] Generating intermediate code (663 ms)
107+
# [info] Compiling to native code (1621 ms)
108+
# [info] Linking with [pthread, dl]
109+
# [info] Linking native code (immix gc, none lto) (81 ms)
110+
# [info] Postprocessing (0 ms)
111+
# [info] Total (4542 ms)
112+
```
113+
114+
Scala Native 0.4.x has been dropped in Scala Toolkit 0.4.0 and above, so the last version supporting it, 0.3.0 (and lower), will now make the build default to Scala Native 0.4.17.
115+
116+
```bash
117+
scala-cli -e 'println(os.pwd)' --toolkit 0.3.0 --native
118+
# [warn] Scala Toolkit Version(0.3.0) does not support Scala Native 0.5.3, 0.4.17 should be used instead.
119+
# [warn] Scala Native default version 0.5.3 is not supported in this build. Using 0.4.17 instead.
120+
# Compiling project (Scala 3.4.2, Scala Native 0.4.17)
121+
# Compiled project (Scala 3.4.2, Scala Native 0.4.17)
122+
# [info] Linking (900 ms)
123+
# [info] Checking intermediate code (quick) (63 ms)
124+
# [info] Discovered 888 classes and 5298 methods
125+
# [info] Optimizing (debug mode) (836 ms)
126+
# [info] Generating intermediate code (620 ms)
127+
# [info] Produced 10 files
128+
# [info] Compiling to native code (1860 ms)
129+
# [info] Linking with [pthread, dl]
130+
# [info] Total (4406 ms)
131+
# ~/scala-cli-tests
132+
```
133+
:::caution
134+
The troublesome case is when Scala Native 0.4.x is passed explicitly, while the Scala Toolkit is set to the default.
135+
Scala CLI does not currently support downgrading the Scala Toolkit in this case, and fails the build.
136+
137+
```bash fail
138+
scala-cli -e 'println(os.pwd)' --toolkit default --native --native-version 0.4.17
139+
# Downloading 4 dependencies and 2 internal dependencies
140+
# [error] Error downloading org.scala-lang:toolkit-test_native0.4_3:0.4.0
141+
# [error] not found: ~/.ivy2/local/org.scala-lang/toolkit-test_native0.4_3/0.4.0/ivys/ivy.xml
142+
# [error] not found: https://repo1.maven.org/maven2/org/scala-lang/toolkit-test_native0.4_3/0.4.0/toolkit-test_native0.4_3-0.4.0.pom
143+
# [error] not found: ~/Library/Caches/ScalaCli/local-repo/1.4.0/org.scala-lang/toolkit-test_native0.4_3/0.4.0/ivys/ivy.xml
144+
# [error] No fallback URL found
145+
# [error] COMMAND_LINE
146+
# [error] Error downloading org.scala-lang:toolkit_native0.4_3:0.4.0
147+
# [error] not found: ~/.ivy2/local/org.scala-lang/toolkit_native0.4_3/0.4.0/ivys/ivy.xml
148+
# [error] not found: https://repo1.maven.org/maven2/org/scala-lang/toolkit_native0.4_3/0.4.0/toolkit_native0.4_3-0.4.0.pom
149+
# [error] not found: ~/Library/Caches/ScalaCli/local-repo/1.4.0/org.scala-lang/toolkit_native0.4_3/0.4.0/ivys/ivy.xml
150+
# [error] No fallback URL found
151+
# [error] COMMAND_LINE
152+
```
153+
:::
154+
155+
Added by [@Gedochao](https://github.com/Gedochao) in [#2955](https://github.com/VirtusLab/scala-cli/pull/2955)
156+
157+
### Features
158+
* Include test scope in the REPL when the `--test` flag is passed by [@Gedochao](https://github.com/Gedochao) in [#2971](https://github.com/VirtusLab/scala-cli/pull/2971)
159+
160+
### Fixes
161+
* Fix BSP IllegalArgumentException when loading project in Metals by [@joan38](https://github.com/joan38) in [#2950](https://github.com/VirtusLab/scala-cli/pull/2950)
162+
* Don't check for newer CLI versions when the `--cli-version` launcher param is passed (v1.4.0 and onwards, only) by [@Gedochao](https://github.com/Gedochao) in [#2957](https://github.com/VirtusLab/scala-cli/pull/2957)
163+
* fix: start bloop with jvm version from using directives for JVMs > 17 by [@kasiaMarek](https://github.com/kasiaMarek) in [#2972](https://github.com/VirtusLab/scala-cli/pull/2972)
164+
165+
### Documentation changes
166+
* Typo fixed in scripts.md by [@vaivanov95](https://github.com/vaivanov95) in [#2974](https://github.com/VirtusLab/scala-cli/pull/2974)
167+
168+
### Internal changes
169+
* Tag flaky docker image with scala.js app test by [@Gedochao](https://github.com/Gedochao) in [#2977](https://github.com/VirtusLab/scala-cli/pull/2977)
170+
171+
### Updates
172+
* Update scala-cli.sh launcher for 1.3.2 by [@github-actions](https://github.com/github-actions) in [#2938](https://github.com/VirtusLab/scala-cli/pull/2938)
173+
* Update Scala Native to 0.5.2 by [@scala-steward](https://github.com/scala-steward) in [#2946](https://github.com/VirtusLab/scala-cli/pull/2946)
174+
* Update guava to 33.2.1-jre by [@scala-steward](https://github.com/scala-steward) in [#2947](https://github.com/VirtusLab/scala-cli/pull/2947)
175+
* Update os-lib to 0.10.2 by [@scala-steward](https://github.com/scala-steward) in [#2949](https://github.com/VirtusLab/scala-cli/pull/2949)
176+
* Update ammonite to 3.0.0-M2-8-ba4429a2 by [@scala-steward](https://github.com/scala-steward) in [#2948](https://github.com/VirtusLab/scala-cli/pull/2948)
177+
* Update Scala Native to 0.5.3 by [@scala-steward](https://github.com/scala-steward) in [#2951](https://github.com/VirtusLab/scala-cli/pull/2951)
178+
* Update case-app to 2.1.0-M28 by [@scala-steward](https://github.com/scala-steward) in [#2956](https://github.com/VirtusLab/scala-cli/pull/2956)
179+
* Update Scala Toolkit to 0.4.0 & dynamically adjust Scala Native defaults by [@Gedochao](https://github.com/Gedochao) in [#2955](https://github.com/VirtusLab/scala-cli/pull/2955)
180+
* Update munit to 1.0.0 by [@scala-steward](https://github.com/scala-steward) in [#2935](https://github.com/VirtusLab/scala-cli/pull/2935)
181+
* Update ammonite to 3.0.0-M2-9-88291dd8 by [@scala-steward](https://github.com/scala-steward) in [#2960](https://github.com/VirtusLab/scala-cli/pull/2960)
182+
* Update `scalameta` to 4.9.6 by [@scala-steward](https://github.com/scala-steward) in [#2967](https://github.com/VirtusLab/scala-cli/pull/2967)
183+
* Update ammonite to 3.0.0-M2-10-f6e2c001 by [@scala-steward](https://github.com/scala-steward) in [#2965](https://github.com/VirtusLab/scala-cli/pull/2965)
184+
* Update scalafmt-cli_2.13, scalafmt-core to 3.8.2 by [@scala-steward](https://github.com/scala-steward) in [#2966](https://github.com/VirtusLab/scala-cli/pull/2966)
185+
* Update scalameta to 4.9.7 by [@scala-steward](https://github.com/scala-steward) in [#2983](https://github.com/VirtusLab/scala-cli/pull/2983)
186+
* Pin `scala-cli-setup` to v1 and update CI scripts' dependencies by [@Gedochao](https://github.com/Gedochao) in [#2984](https://github.com/VirtusLab/scala-cli/pull/2984)
187+
* Update Scala Native to 0.5.4 by [@scala-steward](https://github.com/scala-steward) in [#2982](https://github.com/VirtusLab/scala-cli/pull/2982)
188+
* Update mill-main to 0.11.8 by [@scala-steward](https://github.com/scala-steward) in [#2980](https://github.com/VirtusLab/scala-cli/pull/2980)
189+
* Update bloop-config_2.13 to 2.0.2 by [@scala-steward](https://github.com/scala-steward) in [#2978](https://github.com/VirtusLab/scala-cli/pull/2978)
190+
* Update ammonite to 3.0.0-M2-12-951bbc1e by [@scala-steward](https://github.com/scala-steward) in [#2979](https://github.com/VirtusLab/scala-cli/pull/2979)
191+
192+
## New Contributors
193+
* [@vaivanov95](https://github.com/vaivanov95) made their first contribution in [#2974](https://github.com/VirtusLab/scala-cli/pull/2974)
194+
195+
**Full Changelog**: https://github.com/VirtusLab/scala-cli/compare/v1.3.2...v1.4.0
196+
11197
## [v1.3.2](https://github.com/VirtusLab/scala-cli/releases/tag/v1.3.2)
12198

13199
### Support for Scala 3.4.2
@@ -754,7 +940,7 @@ It is now possible to run Scala CLI in offline mode for the cases when you don't
754940
to make any network requests for whatever reason.
755941
This changes Coursier's cache policy to `LocalOnly`, preventing it from downloading anything.
756942

757-
```bash
943+
```bash ignore
758944
scala-cli compile . --offline --power
759945
```
760946

0 commit comments

Comments
 (0)