diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6995f4141cd2..4f7ac5c51ef5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -168,177 +168,6 @@ jobs: run: sbt ";scala3-bootstrapped-new/compile ;scala3-compiler-bootstrapped-new/test" shell: cmd - community_build_a: - runs-on: [self-hosted, Linux] - container: - image: lampepfl/dotty:2024-10-18 - options: --cpu-shares 4096 - volumes: - - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - - ${{ github.workspace }}/../../cache/general:/root/.cache - if: "github.event_name == 'schedule' && github.repository == 'scala/scala3' - || github.event_name == 'push' - || github.event_name == 'merge_group' - || ( - github.event_name == 'pull_request' - && !contains(github.event.pull_request.body, '[skip ci]') - && !contains(github.event.pull_request.body, '[skip community_build]') - && !contains(github.event.pull_request.body, '[skip community_build_a]') - ) - || ( - github.event_name == 'workflow_dispatch' - && github.repository == 'scala/scala3' - )" - - steps: - ############################################################################################## - ## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA 3.8.0+ IS DISTRIBUTED USING JAVA 17. ## - ############################################################################################## - - name: Set JDK 17 as default - run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH - - name: Reset existing repo - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true - - - name: Checkout cleanup script - uses: actions/checkout@v5 - - - name: Cleanup - run: .github/workflows/cleanup.sh - - - name: Git Checkout - uses: actions/checkout@v5 - - - name: Add SBT proxy repositories - run: cp -vf .github/workflows/repositories /root/.sbt/ ; true - - - name: Test - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - git submodule sync - git submodule update --init --recursive --jobs 7 - ./project/scripts/sbt "community-build/testOnly dotty.communitybuild.CommunityBuildTestA" - - - name: Show dependency tracking file - if: ${{ always() }} - run: cat community-build/dotty-community-build-deps || true - - community_build_b: - runs-on: [self-hosted, Linux] - container: - image: lampepfl/dotty:2024-10-18 - options: --cpu-shares 4096 - volumes: - - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - - ${{ github.workspace }}/../../cache/general:/root/.cache - if: "github.event_name == 'schedule' && github.repository == 'scala/scala3' - || github.event_name == 'push' - || github.event_name == 'merge_group' - || ( - github.event_name == 'pull_request' - && !contains(github.event.pull_request.body, '[skip ci]') - && !contains(github.event.pull_request.body, '[skip community_build]') - && !contains(github.event.pull_request.body, '[skip community_build_b]') - ) - || ( - github.event_name == 'workflow_dispatch' - && github.repository == 'scala/scala3' - )" - - steps: - ############################################################################################## - ## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA 3.8.0+ IS DISTRIBUTED USING JAVA 17. ## - ############################################################################################## - - name: Set JDK 17 as default - run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH - - name: Reset existing repo - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true - - - name: Checkout cleanup script - uses: actions/checkout@v5 - - - name: Cleanup - run: .github/workflows/cleanup.sh - - - name: Git Checkout - uses: actions/checkout@v5 - - - name: Add SBT proxy repositories - run: cp -vf .github/workflows/repositories /root/.sbt/ ; true - - - name: Test - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - git submodule sync - git submodule update --init --recursive --jobs 7 - ./project/scripts/sbt "community-build/testOnly dotty.communitybuild.CommunityBuildTestB" - - - name: Show dependency tracking file - if: ${{ always() }} - run: cat community-build/dotty-community-build-deps || true - - community_build_c: - runs-on: [self-hosted, Linux] - container: - image: lampepfl/dotty:2024-10-18 - options: --cpu-shares 4096 - volumes: - - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - - ${{ github.workspace }}/../../cache/general:/root/.cache - if: "github.event_name == 'schedule' && github.repository == 'scala/scala3' - || github.event_name == 'push' - || github.event_name == 'merge_group' - || ( - github.event_name == 'pull_request' - && !contains(github.event.pull_request.body, '[skip ci]') - && !contains(github.event.pull_request.body, '[skip community_build]') - && !contains(github.event.pull_request.body, '[skip community_build_c]') - ) - || ( - github.event_name == 'workflow_dispatch' - && github.repository == 'scala/scala3' - )" - - steps: - ############################################################################################## - ## WARNING: DO NOT CHANGE THE JAVA VERSION HERE. SCALA 3.8.0+ IS DISTRIBUTED USING JAVA 17. ## - ############################################################################################## - - name: Set JDK 17 as default - run: echo "/usr/lib/jvm/java-17-openjdk-amd64/bin" >> $GITHUB_PATH - - name: Reset existing repo - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/scala/scala3" && git reset --hard FETCH_HEAD || true - - - name: Checkout cleanup script - uses: actions/checkout@v5 - - - name: Cleanup - run: .github/workflows/cleanup.sh - - - name: Git Checkout - uses: actions/checkout@v5 - - - name: Add SBT proxy repositories - run: cp -vf .github/workflows/repositories /root/.sbt/ ; true - - - name: Test - run: | - git config --global --add safe.directory $GITHUB_WORKSPACE - git submodule sync - git submodule update --init --recursive --jobs 7 - ./project/scripts/sbt "community-build/testOnly dotty.communitybuild.CommunityBuildTestC" - - - name: Show dependency tracking file - if: ${{ always() }} - run: cat community-build/dotty-community-build-deps || true - publish_release: permissions: contents: write # for GH CLI to create a release @@ -350,9 +179,8 @@ jobs: - ${{ github.workspace }}/../../cache/sbt:/root/.sbt - ${{ github.workspace }}/../../cache/ivy:/root/.ivy2/cache - ${{ github.workspace }}/../../cache/general:/root/.cache - needs: [test, community_build_a, community_build_b, community_build_c, build-sdk-package, build-msi-package] - if: "github.event_name == 'push' - && startsWith(github.event.ref, 'refs/tags/')" + needs: [test, build-sdk-package, build-msi-package] + if: "github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/')" env: RELEASEBUILD: yes diff --git a/.github/workflows/stdlib.yaml b/.github/workflows/stdlib.yaml index 68f77761a8a3..e3387059c2c1 100644 --- a/.github/workflows/stdlib.yaml +++ b/.github/workflows/stdlib.yaml @@ -563,3 +563,58 @@ jobs: - uses: sbt/setup-sbt@v1 - name: Run SBT scripted tests run: ./project/scripts/sbt scala3-bootstrapped-new/scripted + + community_build_a: + runs-on: ubuntu-latest + steps: + - name: Checkout cleanup script + uses: actions/checkout@v5 + with: + submodules: true + - name: Set up JDK 17 + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: 17 + cache: 'sbt' + - uses: sbt/setup-sbt@v1 + - name: Run Community Build A + run: | + ./project/scripts/sbt "community-build/testOnly dotty.communitybuild.CommunityBuildTestA" + + community_build_b: + runs-on: ubuntu-latest + steps: + - name: Checkout cleanup script + uses: actions/checkout@v5 + with: + submodules: true + - name: Set up JDK 17 + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: 17 + cache: 'sbt' + - uses: sbt/setup-sbt@v1 + - name: Run Community Build B + run: | + ./project/scripts/sbt "community-build/testOnly dotty.communitybuild.CommunityBuildTestB" + + + community_build_c: + runs-on: ubuntu-latest + steps: + - name: Checkout cleanup script + uses: actions/checkout@v5 + with: + submodules: true + - name: Set up JDK 17 + uses: actions/setup-java@v5 + with: + distribution: 'temurin' + java-version: 17 + cache: 'sbt' + - uses: sbt/setup-sbt@v1 + - name: Run Community Build C + run: | + ./project/scripts/sbt "community-build/testOnly dotty.communitybuild.CommunityBuildTestC" diff --git a/.gitmodules b/.gitmodules index 411e17a9e5a9..344daf0fa899 100644 --- a/.gitmodules +++ b/.gitmodules @@ -39,7 +39,7 @@ url = https://github.com/dotty-staging/intent [submodule "community-build/community-projects/utest"] path = community-build/community-projects/utest - url = https://github.com/dotty-staging/utest.git + url = https://github.com/dotty-staging/utest-new.git [submodule "community-build/community-projects/os-lib"] path = community-build/community-projects/os-lib url = https://github.com/dotty-staging/os-lib.git @@ -90,9 +90,9 @@ [submodule "community-build/community-projects/PPrint"] path = community-build/community-projects/PPrint url = https://github.com/dotty-staging/PPrint.git -[submodule "community-build/community-projects/requests-scala"] - path = community-build/community-projects/requests-scala - url = https://github.com/dotty-staging/requests-scala.git +[submodule "community-build/community-projects/requests"] + path = community-build/community-projects/requests + url = https://github.com/dotty-staging/requests.git [submodule "community-build/community-projects/cats-effect-3"] path = community-build/community-projects/cats-effect-3 url = https://github.com/dotty-staging/cats-effect.git diff --git a/community-build/community-projects/Lucre b/community-build/community-projects/Lucre index 5f2ca01f44ce..24fef41ec374 160000 --- a/community-build/community-projects/Lucre +++ b/community-build/community-projects/Lucre @@ -1 +1 @@ -Subproject commit 5f2ca01f44ce0784ebce0d5455d996fb05a81fdb +Subproject commit 24fef41ec3741a7fd5fa493f4068bc0ec65083f5 diff --git a/community-build/community-projects/Monocle b/community-build/community-projects/Monocle index b303aa3b98d9..f888e69e29b6 160000 --- a/community-build/community-projects/Monocle +++ b/community-build/community-projects/Monocle @@ -1 +1 @@ -Subproject commit b303aa3b98d9a10c3f77a56765ca5be2f3cc51f7 +Subproject commit f888e69e29b63157aa0db992d762fbd1cc8367cc diff --git a/community-build/community-projects/PPrint b/community-build/community-projects/PPrint index 2203dc6081f5..706fbeadeb5f 160000 --- a/community-build/community-projects/PPrint +++ b/community-build/community-projects/PPrint @@ -1 +1 @@ -Subproject commit 2203dc6081f5e8fa89f552b155724b0a8fdcec03 +Subproject commit 706fbeadeb5f79ac8b5828858a71d2b93674c438 diff --git a/community-build/community-projects/akka b/community-build/community-projects/akka index ee0ac854f36f..12a6ee3319e2 160000 --- a/community-build/community-projects/akka +++ b/community-build/community-projects/akka @@ -1 +1 @@ -Subproject commit ee0ac854f36f537bf3062fd4e9d9f2ff5c1de4c9 +Subproject commit 12a6ee3319e25627eab2416c9ddfa9f0309e2800 diff --git a/community-build/community-projects/cask b/community-build/community-projects/cask index 2db6020a2d11..27dfe9a79f68 160000 --- a/community-build/community-projects/cask +++ b/community-build/community-projects/cask @@ -1 +1 @@ -Subproject commit 2db6020a2d11566d504ae9af4de28c7a6e20b7ed +Subproject commit 27dfe9a79f686a06b976d099337bc1cd4013ade7 diff --git a/community-build/community-projects/fansi b/community-build/community-projects/fansi index 953306f8139f..c8d4e5b56c46 160000 --- a/community-build/community-projects/fansi +++ b/community-build/community-projects/fansi @@ -1 +1 @@ -Subproject commit 953306f8139f6eaabf9f4ae7707906f9d2ba236a +Subproject commit c8d4e5b56c46f2b360a441ca6d35620819a1ee52 diff --git a/community-build/community-projects/geny b/community-build/community-projects/geny index d981da16a05f..62f4846a5749 160000 --- a/community-build/community-projects/geny +++ b/community-build/community-projects/geny @@ -1 +1 @@ -Subproject commit d981da16a05ff4978857e7aa88489c873b8d8922 +Subproject commit 62f4846a5749264dcbcea8940ecf607db201f364 diff --git a/community-build/community-projects/os-lib b/community-build/community-projects/os-lib index 4c8c82b23d76..29e60d5fb803 160000 --- a/community-build/community-projects/os-lib +++ b/community-build/community-projects/os-lib @@ -1 +1 @@ -Subproject commit 4c8c82b23d767bc927290829514b8de7148052d9 +Subproject commit 29e60d5fb8036e8a0f0f83bd50cf7cca17731674 diff --git a/community-build/community-projects/requests b/community-build/community-projects/requests new file mode 160000 index 000000000000..dd17681c10b8 --- /dev/null +++ b/community-build/community-projects/requests @@ -0,0 +1 @@ +Subproject commit dd17681c10b892fa2b0ada6924cb8cbd1ebf8efc diff --git a/community-build/community-projects/requests-scala b/community-build/community-projects/requests-scala deleted file mode 160000 index 8e4a40588491..000000000000 --- a/community-build/community-projects/requests-scala +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8e4a40588491608aa40099f79c881d54a5094e75 diff --git a/community-build/community-projects/scalatest b/community-build/community-projects/scalatest index ab674686d089..7ec23fb0e90c 160000 --- a/community-build/community-projects/scalatest +++ b/community-build/community-projects/scalatest @@ -1 +1 @@ -Subproject commit ab674686d089f13da2e29c3b78fe6c3ab0211189 +Subproject commit 7ec23fb0e90cab50c3e54eb35aeb240574cca4c7 diff --git a/community-build/community-projects/scalatestplus-testng b/community-build/community-projects/scalatestplus-testng index ea7aaebfb820..a5b834d041e3 160000 --- a/community-build/community-projects/scalatestplus-testng +++ b/community-build/community-projects/scalatestplus-testng @@ -1 +1 @@ -Subproject commit ea7aaebfb82098204b2ff3ce5e210c820f95853e +Subproject commit a5b834d041e35dff4ed15c4134ac14aea07deb23 diff --git a/community-build/community-projects/sourcecode b/community-build/community-projects/sourcecode index 28b4f6c21fdd..7e738aa077e6 160000 --- a/community-build/community-projects/sourcecode +++ b/community-build/community-projects/sourcecode @@ -1 +1 @@ -Subproject commit 28b4f6c21fddeb33d694dc210f51b0535a2ada68 +Subproject commit 7e738aa077e6634fc5346df5f6ccbac52be861ec diff --git a/community-build/community-projects/spire b/community-build/community-projects/spire index 993e8c8c7a8e..4da8fa1af67a 160000 --- a/community-build/community-projects/spire +++ b/community-build/community-projects/spire @@ -1 +1 @@ -Subproject commit 993e8c8c7a8e55be943d63c07c8263c1021add2f +Subproject commit 4da8fa1af67afb0873d562fb9073c64d42bf9867 diff --git a/community-build/community-projects/upickle b/community-build/community-projects/upickle index 0c09bbcabc66..4b8ad06b23e0 160000 --- a/community-build/community-projects/upickle +++ b/community-build/community-projects/upickle @@ -1 +1 @@ -Subproject commit 0c09bbcabc664abf98462022fc9036a366135e70 +Subproject commit 4b8ad06b23e0f561af77ff7948306fb2771afcfd diff --git a/community-build/community-projects/utest b/community-build/community-projects/utest index f828696abf2f..610ecb8680d1 160000 --- a/community-build/community-projects/utest +++ b/community-build/community-projects/utest @@ -1 +1 @@ -Subproject commit f828696abf2fd554d37e8020fc5b4aaa2d143325 +Subproject commit 610ecb8680d1d02720fbe1c6dff52b36b2314048 diff --git a/community-build/community-projects/verify b/community-build/community-projects/verify index f82bb3f52623..30c782d2facd 160000 --- a/community-build/community-projects/verify +++ b/community-build/community-projects/verify @@ -1 +1 @@ -Subproject commit f82bb3f52623e44f02b4b43f8bdf27f4f0a7d3d4 +Subproject commit 30c782d2facd40623859db9461d8c997d13d5708 diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index 853e9fcd3f5e..dfe5f3724312 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -66,15 +66,17 @@ end CommunityProject final case class MillCommunityProject( project: String, baseCommand: String, - ignoreDocs: Boolean = false + ignoreDocs: Boolean = false, + sourcecodeTestCommand: Boolean = false, ) extends CommunityProject: override val binaryName: String = "./mill" - override val testCommand = s"$baseCommand.test" + override val testCommand = if sourcecodeTestCommand then s"$baseCommand.test.run" else s"$baseCommand.test" override val publishCommand = s"$baseCommand.publishLocal" override val docCommand = null // uncomment once mill is released // if ignoreDocs then null else s"$baseCommand.docJar" override val runCommandsArgs = List("-i", "-D", s"dottyVersion=$compilerVersion") + override val environment = Map.empty final case class SbtCommunityProject( project: String, @@ -145,7 +147,8 @@ object projects: lazy val sourcecode = MillCommunityProject( project = "sourcecode", baseCommand = s"sourcecode.jvm[$compilerVersion]", - ignoreDocs = true + ignoreDocs = true, + sourcecodeTestCommand = true, ) lazy val oslib = MillCommunityProject( @@ -202,8 +205,8 @@ object projects: ) lazy val requests = MillCommunityProject( - project = "requests-scala", - baseCommand = s"requests[$compilerVersion]", + project = "requests", + baseCommand = s"requests.jvm[$compilerVersion]", ) lazy val cask = MillCommunityProject( diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index 4591f0914dfd..f83078f26c36 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -91,8 +91,7 @@ class CommunityBuildTestC: @Test def scalatestplusScalacheck = projects.scalatestplusScalacheck.run() @Test def scalaXml = projects.scalaXml.run() @Test def scalaz = projects.scalaz.run() - // mill 1.0.5 fails to build, cannot find scala-library artifact on classpath - // @Test def scas = projects.scas.run() + @Test def scas = projects.scas.run() @Test def sconfig = projects.sconfig.run() @Test def shapeless3 = projects.shapeless3.run() @Test def sourcecode = projects.sourcecode.run() diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala index ba7b9132e88a..2686b50bd5e4 100644 --- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala +++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala @@ -336,7 +336,7 @@ object desugar { case Some(param) if param.mods.isOneOf(GivenOrImplicit) => param.mods.flags & GivenOrImplicit case _ => - if Feature.sourceVersion.isAtLeast(`3.6`) then Given + if Feature.sourceVersion.isAtLeast(`3.6`) && !Feature.sourceVersion.isScala2 then Given else Implicit val flags = if isPrimaryConstructor then iflag | LocalParamAccessor else iflag | Param mapParamss(paramss) { diff --git a/project/Build.scala b/project/Build.scala index 68e10fd3d28b..9241c05996e0 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -3551,22 +3551,21 @@ object Build { val prepareCommunityBuild = taskKey[Unit]("Publish local the compiler and the sbt plugin. Also store the versions of the published local artefacts in two files, community-build/{scala3-bootstrapped.version,sbt-injected-plugins}.") - lazy val `community-build` = project.in(file("community-build")). - dependsOn(dottyLibrary(Bootstrapped)). - settings(commonBootstrappedSettings). - settings( + lazy val `community-build` = project.in(file("community-build")) + .settings(commonSettings) + .settings( + scalaVersion := referenceVersion, prepareCommunityBuild := { - (`scala3-sbt-bridge` / publishLocal).value - (`scala3-interfaces` / publishLocal).value - (`tasty-core-bootstrapped` / publishLocal).value - (`scala-library-bootstrapped` / publishLocal).value - (`scala3-library-bootstrapped` / publishLocal).value - (`scala3-tasty-inspector` / publishLocal).value - (`scaladoc` / publishLocal).value - (`scala3-compiler-bootstrapped` / publishLocal).value - (`scala3-bootstrapped` / publishLocal).value - (`scala3-library-bootstrappedJS` / publishLocal).value - // (publishLocal in `scala3-staging`).value + (`scala3-sbt-bridge-bootstrapped` / publishLocalBin).value + (`scala3-interfaces` / publishLocalBin).value + (`tasty-core-bootstrapped-new` / publishLocalBin).value + (`scala3-library-bootstrapped-new` / publishLocalBin).value + (`scala-library-bootstrapped` / publishLocalBin).value + (`scala3-tasty-inspector-new` / publishLocalBin).value + (`scaladoc-new` / publishLocalBin).value + (`scala3-compiler-bootstrapped-new` / publishLocalBin).value + (`scala-library-sjs` / publishLocalBin).value + (`scala3-library-sjs` / publishLocalBin).value val pluginText = s"""addSbtPlugin("org.scala-js" % "sbt-scalajs" % "$scalaJSVersion")""" IO.write(baseDirectory.value / "sbt-injected-plugins", pluginText)