Skip to content

Commit 6c1ca90

Browse files
committed
Merge branch 'master' into fix-11251
2 parents fac7dcf + 0273336 commit 6c1ca90

File tree

1,951 files changed

+7722
-17549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,951 files changed

+7722
-17549
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
- name: Add SBT proxy repositories
101101
run: cp -vf .github/workflows/repositories /root/.sbt/ ; true
102102

103-
- name: Test
103+
- name: Cmd Tests
104104
run: |
105105
./project/scripts/sbt ";scala3-bootstrapped/compile ;scala3-bootstrapped/test;sjsSandbox/run;sjsSandbox/test;sjsJUnitTests/test;sjsCompilerTests/test ;sbt-dotty/scripted scala2-compat/* ;configureIDE ;stdlib-bootstrapped/test:run ;stdlib-bootstrapped-tasty-tests/test"
106106
./project/scripts/bootstrapCmdTests

.github/workflows/scaladoc.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
with:
3636
java-version: 11
3737

38+
- name: Compile and test scala3doc-js
39+
run: ./project/scripts/sbt scaladoc-js/test
40+
3841
- name: Compile and test
3942
run: ./project/scripts/sbt scaladoc/test
4043

@@ -66,7 +69,7 @@ jobs:
6669
DOC_DEST=pr-${PR_NUMBER:-${GITHUB_REF##*/}}
6770
echo uplading docs to https://scala3doc.virtuslab.com/$DOC_DEST
6871
az storage container create --name $DOC_DEST --account-name scala3docstorage --public-access container
69-
az storage blob sync -s scaladoc/output -c $DOC_DEST --account-name scala3docstorage
72+
az storage blob upload-batch -s scaladoc/output -d $DOC_DEST --account-name scala3docstorage
7073
7174
community-docs:
7275
env:
@@ -105,4 +108,4 @@ jobs:
105108
DOC_DEST=pr-${PR_NUMBER:-${GITHUB_REF##*/}}-docs
106109
echo uplading docs to https://scala3doc.virtuslab.com/$DOC_DEST
107110
az storage container create --name $DOC_DEST --account-name scala3docstorage --public-access container
108-
az storage blob sync -s community-build/docsOutput -c $DOC_DEST --account-name scala3docstorage
111+
az storage blob upload-batch -s community-build/docsOutput -d $DOC_DEST --account-name scala3docstorage

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,9 @@ community-build/sbt-scalajs-sbt
8989
*.check.out
9090
!/dist/bin/
9191

92+
# semanticdb test output files
93+
*.expect.scala.out
94+
*.expect.out
95+
9296
# Bloop
9397
.bsp

bench-run/src/main/scala/dotty/tools/benchmarks/tuples/TupleOps.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class TupleOps {
5050
def tupleMergeSort(tuple: Tuple): Tuple =
5151
if (tuple.size <= 1) tuple
5252
else {
53-
val (tuple1, tuple2) = tuple.splitAt(tuple.size / 2)
53+
val (tuple1, tuple2) = tuple.splitAt(tuple.size / 2): (Tuple, Tuple)// TODO remove ascriptions (issue with type variable constraints)
5454
val (sorted1, sorted2) = (tupleMergeSort(tuple1), tupleMergeSort(tuple2))
5555
tupleMerge(sorted1, sorted2)
5656
}

bench/tests/Vector.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ package immutable
1212

1313
import scala.annotation.unchecked.uncheckedVariance
1414
import scala.compat.Platform
15-
import scala.collection.generic._
15+
import scala.collection.generic.*
1616
import scala.collection.mutable.Builder
1717
import compiletime.uninitialized
1818

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
object PowerInlined {
2-
import PowerMacro._
2+
import PowerMacro.*
33

44
power(1, 5.0) // 1 quotes to unpickle
55
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
object PowerInlined {
2-
import PowerMacro._
2+
import PowerMacro.*
33

44
power(1, 5.0) // 1 quotes to unpickle
55
}

bin/scalad renamed to bin/scaladoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" >& /dev/null && pwd)/.."
44

5-
"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/scalad" "$@"
5+
"$ROOT/bin/common" "$ROOT/dist/target/pack/bin/scaladoc" "$@"

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
val scala3 = Build.scala3
22
val `scala3-bootstrapped` = Build.`scala3-bootstrapped`
33
val `scala3-interfaces` = Build.`scala3-interfaces`
4-
val `scala3-doc` = Build.`scala3-doc`
5-
val `scala3-doc-bootstrapped` = Build.`scala3-doc-bootstrapped`
64
val `scala3-compiler` = Build.`scala3-compiler`
75
val `scala3-compiler-bootstrapped` = Build.`scala3-compiler-bootstrapped`
86
val `scala3-library` = Build.`scala3-library`
@@ -12,6 +10,7 @@ val `scala3-sbt-bridge` = Build.`scala3-sbt-bridge`
1210
val `scala3-sbt-bridge-tests` = Build.`scala3-sbt-bridge-tests`
1311
val `scala3-staging` = Build.`scala3-staging`
1412
val `scala3-tasty-inspector` = Build.`scala3-tasty-inspector`
13+
val `scala3-tasty-inspector-nonbootstrapped` = Build.`scala3-tasty-inspector-nonbootstrapped`
1514
val `scala3-language-server` = Build.`scala3-language-server`
1615
val `scala3-bench` = Build.`scala3-bench`
1716
val `scala3-bench-bootstrapped` = Build.`scala3-bench-bootstrapped`
@@ -21,6 +20,7 @@ val `tasty-core` = Build.`tasty-core`
2120
val `tasty-core-bootstrapped` = Build.`tasty-core-bootstrapped`
2221
val `tasty-core-scala2` = Build.`tasty-core-scala2`
2322
val scaladoc = Build.scaladoc
23+
val `scaladoc-nonBootstrapped` = Build.`scaladoc-nonBootstrapped`
2424
val `scaladoc-testcases` = Build.`scaladoc-testcases`
2525
val `scaladoc-js` = Build.`scaladoc-js`
2626
val `scala3-bench-run` = Build.`scala3-bench-run`
Submodule geny updated 1 file
Submodule upickle updated 1 file

community-build/src/scala/dotty/communitybuild/Main.scala

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,36 @@ object Main:
1919
e.printStackTrace()
2020
Nil
2121

22+
def withProjects[T](names: Seq[String], opName: String)(op: CommunityProject => T): Seq[T] =
23+
val missing = names.filterNot(projectMap.contains)
24+
if missing.nonEmpty then
25+
val allNames = allProjects.map(_.project).mkString(", ")
26+
println(s"Missing projects: ${missing.mkString(", ")}. All projects: $allNames")
27+
sys.exit(1)
28+
29+
val (failed, completed) = names.flatMap(projectMap.apply).partitionMap( o =>
30+
try
31+
Right(op(o))
32+
catch case e: Throwable =>
33+
e.printStackTrace()
34+
Left(o)
35+
)
36+
37+
if failed.nonEmpty then
38+
println(s"$opName failed for ${failed.mkString(", ")}")
39+
sys.exit(1)
40+
41+
completed
42+
2243
/** Allows running various commands on community build projects. */
2344
def main(args: Array[String]): Unit =
2445
args.toList match
25-
case "publish" :: name :: Nil =>
46+
case "publish" :: names if names.nonEmpty =>
47+
withProjects(names, "Publishing")(_.publish())
48+
49+
case "build" :: names if names.nonEmpty =>
50+
withProjects(names, "Build")(_.build())
51+
2652
case "doc" :: "all" :: destStr :: Nil =>
2753
val dest = Paths.get(destStr)
2854
Seq("rm", "-rf", destStr).!
@@ -66,26 +92,23 @@ object Main:
6692
sys.exit(1)
6793

6894
case "doc" :: names if names.nonEmpty =>
69-
val missing = names.filterNot(projectMap.contains)
70-
if missing.nonEmpty then
71-
println(s"Missing projects: ${missing.mkString(", ")}. All projects: ${allProjects.mkString(", ")}")
72-
sys.exit(1)
73-
74-
val failed = names.filter{ p =>
75-
val docsRoots = generateDocs(projectMap(p))
95+
val failed = withProjects(names, "Documenting"){ p =>
96+
val docsRoots = generateDocs(p)
97+
println(docsRoots)
7698
if docsRoots.nonEmpty then println(s"Docs for $p generated in $docsRoots")
77-
docsRoots.isEmpty
78-
}
99+
if docsRoots.isEmpty then Some(p.project) else None
100+
}.flatten
101+
79102
if failed.nonEmpty then
80103
println(s"Documentation not found for ${failed.mkString(", ")}")
81104
sys.exit(1)
82105

83106
case args =>
84107
println("USAGE: <COMMAND> <PROJECT NAME>")
85-
println("COMMAND is one of: publish doc")
108+
println("COMMAND is one of: publish doc run")
86109
println("Available projects are:")
87110
allProjects.foreach { k =>
88-
println(s"\t$k")
111+
println(s"\t${k.project}")
89112
}
90113
sys.exit(1)
91114

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,24 @@ sealed trait CommunityProject:
8484
if exitCode != 0 then
8585
throw RuntimeException(s"Doc command exited with code $exitCode for project $project. Project details:\n$this")
8686

87+
final def build(): Int = exec(projectDir, binaryName, buildCommands: _*)
88+
89+
final def buildCommands = runCommandsArgs :+ testCommand
90+
8791
end CommunityProject
8892

8993
final case class MillCommunityProject(
9094
project: String,
9195
baseCommand: String,
92-
dependencies: List[CommunityProject] = Nil) extends CommunityProject:
96+
dependencies: List[CommunityProject] = Nil,
97+
ignoreDocs: Boolean = false,
98+
) extends CommunityProject:
9399
override val binaryName: String = "./mill"
94100
override val testCommand = s"$baseCommand.test"
95101
override val publishCommand = s"$baseCommand.publishLocal"
96102
override val docCommand = null
103+
// uncomment once mill is released
104+
// if ignoreDocs then null else s"$baseCommand.docJar"
97105
override val runCommandsArgs = List("-i", "-D", s"dottyVersion=$compilerVersion")
98106

99107
final case class SbtCommunityProject(
@@ -160,10 +168,9 @@ final case class SbtCommunityProject(
160168
"""set testOptions in Global += Tests.Argument(TestFramework("munit.Framework"), "+l"); """
161169
++ s"$baseCommand$sbtTestCommand"
162170

163-
override val publishCommand = if sbtPublishCommand eq null then null else
164-
val disableDocCommand =
165-
if sbtDocCommand eq null then "" else "set every useScaladoc := false;"
166-
s"$baseCommand$disableDocCommand$sbtPublishCommand"
171+
override val publishCommand =
172+
if sbtPublishCommand eq null then null else s"$baseCommand$sbtPublishCommand"
173+
167174
override val docCommand =
168175
if sbtDocCommand eq null then null else
169176
val cmd = if sbtDocCommand.startsWith(";") then sbtDocCommand else s";$sbtDocCommand"
@@ -175,7 +182,7 @@ final case class SbtCommunityProject(
175182
case Some(ivyHome) => List(s"-Dsbt.ivy.home=$ivyHome")
176183
case _ => Nil
177184
extraSbtArgs ++ sbtProps ++ List(
178-
"-sbt-version", "1.4.4",
185+
"-sbt-version", "1.4.7",
179186
"-Dsbt.supershell=false",
180187
s"--addPluginSbtFile=$sbtPluginFilePath"
181188
)
@@ -195,11 +202,13 @@ object projects:
195202
lazy val utest = MillCommunityProject(
196203
project = "utest",
197204
baseCommand = s"utest.jvm[$compilerVersion]",
205+
ignoreDocs = true
198206
)
199207

200208
lazy val sourcecode = MillCommunityProject(
201209
project = "sourcecode",
202210
baseCommand = s"sourcecode.jvm[$compilerVersion]",
211+
ignoreDocs = true
203212
)
204213

205214
lazy val oslib = MillCommunityProject(
@@ -211,7 +220,8 @@ object projects:
211220
lazy val oslibWatch = MillCommunityProject(
212221
project = "os-lib",
213222
baseCommand = s"os.watch[$compilerVersion]",
214-
dependencies = List(utest, sourcecode)
223+
dependencies = List(utest, sourcecode),
224+
ignoreDocs = true
215225
)
216226

217227
lazy val ujson = MillCommunityProject(
@@ -241,13 +251,15 @@ object projects:
241251
lazy val fansi = MillCommunityProject(
242252
project = "fansi",
243253
baseCommand = s"fansi.jvm[$compilerVersion]",
244-
dependencies = List(utest, sourcecode)
254+
dependencies = List(utest, sourcecode),
255+
ignoreDocs = true
245256
)
246257

247258
lazy val pprint = MillCommunityProject(
248259
project = "PPrint",
249260
baseCommand = s"pprint.jvm[$compilerVersion]",
250-
dependencies = List(fansi)
261+
dependencies = List(fansi),
262+
ignoreDocs = true
251263
)
252264

253265
lazy val requests = MillCommunityProject(
@@ -409,7 +421,7 @@ object projects:
409421
sbtTestCommand = "testsJVM/test;testsJS/test;",
410422
// Hardcode the version to avoid having to deal with something set by sbt-dynver
411423
sbtPublishCommand = s"""set every version := "${Versions.munit}"; munitJVM/publishLocal; munitJS/publishLocal; munitScalacheckJVM/publishLocal; munitScalacheckJS/publishLocal; junit/publishLocal""",
412-
sbtDocCommand = "munitJVM/doc",
424+
sbtDocCommand = "junit/doc; munitJVM/doc",
413425
dependencies = List(scalacheck)
414426
)
415427

@@ -627,7 +639,7 @@ object projects:
627639
sbtPublishCommand = "publishLocal",
628640
dependencies = List(scalatest)
629641
)
630-
642+
631643
lazy val perspective = SbtCommunityProject(
632644
project = "perspective",
633645
// No library with easy typeclasses to verify data against exist for Dotty, so no tests yet
@@ -702,4 +714,4 @@ def allProjects = List(
702714
projects.perspective,
703715
)
704716

705-
lazy val projectMap = allProjects.map(p => p.project -> p).toMap
717+
lazy val projectMap = allProjects.groupBy(_.project)

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ abstract class CommunityBuildTest:
2222
*/
2323
extension (self: CommunityProject) def run()(using suite: CommunityBuildTest) =
2424
self.dependencies.foreach(_.publish())
25-
suite.test(self.project, self.binaryName, self.runCommandsArgs :+ self.testCommand)
25+
suite.test(self)
2626

2727
/** Build the given project with the published local compiler and sbt plugin.
2828
*
@@ -34,10 +34,14 @@ abstract class CommunityBuildTest:
3434
* a build tool like SBT or Mill
3535
* @param arguments Arguments to pass to the testing program
3636
*/
37-
def test(project: String, command: String, arguments: Seq[String]): Unit = {
37+
def test(projectDef: CommunityProject): Unit = {
38+
val project = projectDef.project
39+
val command = projectDef.binaryName
40+
val arguments = projectDef.buildCommands
41+
3842
@annotation.tailrec
39-
def execTimes(task: => Int, timesToRerun: Int): Boolean =
40-
val exitCode = task
43+
def execTimes(task: () => Int, timesToRerun: Int): Boolean =
44+
val exitCode = task()
4145
if exitCode == 0
4246
then true
4347
else if timesToRerun == 0
@@ -60,7 +64,7 @@ abstract class CommunityBuildTest:
6064
|""".stripMargin)
6165
}
6266

63-
val testsCompletedSuccessfully = execTimes(exec(projectDir, command, arguments: _*), 3)
67+
val testsCompletedSuccessfully = execTimes(projectDef.build, 3)
6468

6569
if (!testsCompletedSuccessfully) {
6670
fail(s"""

compiler/src/dotty/tools/backend/jvm/BCodeIdiomatic.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ trait BCodeIdiomatic {
5050
case "14" => asm.Opcodes.V14
5151
case "15" => asm.Opcodes.V15
5252
case "16" => asm.Opcodes.V16
53+
case "17" => asm.Opcodes.V17
5354
}
5455

5556
lazy val majorVersion: Int = (classfileVersion & 0xFF)

0 commit comments

Comments
 (0)