From e494000d1a690219ea28f8122d3127837eea6a17 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Tue, 14 Oct 2025 10:22:17 +0800 Subject: [PATCH 1/4] connect CB with the new artifacts --- .github/workflows/ci.yaml | 176 +--------------------------------- .github/workflows/stdlib.yaml | 55 +++++++++++ project/Build.scala | 29 +++--- 3 files changed, 71 insertions(+), 189 deletions(-) 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/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) From b6b0a72569a9ef08d3182134321abaa9a5534ea6 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Wed, 15 Oct 2025 12:48:58 +0800 Subject: [PATCH 2/4] curious if it fixes everything --- compiler/src/dotty/tools/dotc/ast/Desugar.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { From 0b1071b5cb3c88626b5d0e84e5fee2b894f4d378 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Thu, 16 Oct 2025 01:15:21 +0800 Subject: [PATCH 3/4] migrate mill projects to Mill 1.0.6 --- .gitmodules | 8 ++++---- community-build/community-projects/PPrint | 2 +- community-build/community-projects/cask | 2 +- community-build/community-projects/fansi | 2 +- community-build/community-projects/geny | 2 +- community-build/community-projects/os-lib | 2 +- community-build/community-projects/requests | 1 + community-build/community-projects/requests-scala | 1 - community-build/community-projects/sourcecode | 2 +- community-build/community-projects/upickle | 2 +- community-build/community-projects/utest | 2 +- .../src/scala/dotty/communitybuild/projects.scala | 13 ++++++++----- .../dotty/communitybuild/CommunityBuildTest.scala | 3 +-- 13 files changed, 22 insertions(+), 20 deletions(-) create mode 160000 community-build/community-projects/requests delete mode 160000 community-build/community-projects/requests-scala 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/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/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..9526084ba7e3 --- /dev/null +++ b/community-build/community-projects/requests @@ -0,0 +1 @@ +Subproject commit 9526084ba7e352c8ada3815cf09f438b719ce813 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/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/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..d0d91b976765 160000 --- a/community-build/community-projects/utest +++ b/community-build/community-projects/utest @@ -1 +1 @@ -Subproject commit f828696abf2fd554d37e8020fc5b4aaa2d143325 +Subproject commit d0d91b9767654868778a4e6a698206c327908bc1 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() From 44eab3fc62b63aaeedff3c6842f337792736afb1 Mon Sep 17 00:00:00 2001 From: Hamza Remmal Date: Tue, 21 Oct 2025 20:41:12 +0100 Subject: [PATCH 4/4] migrate and update CommunityBuildB --- community-build/community-projects/Monocle | 2 +- community-build/community-projects/spire | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/community-build/community-projects/Monocle b/community-build/community-projects/Monocle index b303aa3b98d9..1cccddaafa19 160000 --- a/community-build/community-projects/Monocle +++ b/community-build/community-projects/Monocle @@ -1 +1 @@ -Subproject commit b303aa3b98d9a10c3f77a56765ca5be2f3cc51f7 +Subproject commit 1cccddaafa194345fecf502e724e62d01ea2b386 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