diff --git a/.github/workflows/build-chocolatey.yml b/.github/workflows/build-chocolatey.yml new file mode 100644 index 000000000000..9de87d8e5ad6 --- /dev/null +++ b/.github/workflows/build-chocolatey.yml @@ -0,0 +1,57 @@ +################################################################################################### +### THIS IS A REUSABLE WORKFLOW TO BUILD SCALA WITH CHOCOLATEY ### +### HOW TO USE: ### +### ### +### NOTE: ### +### ### +################################################################################################### + + +name: Build 'scala' Chocolatey Package +run-name: Build 'scala' (${{ inputs.version }}) Chocolatey Package + +on: + workflow_call: + inputs: + version: + required: true + type : string + url: + required: true + type : string + digest: + required: true + type : string + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + - name: Replace the version placeholder + uses: richardrigutins/replace-in-files@v2 + with: + files: ./pkgs/chocolatey/scala.nuspec + search-text: '@LAUNCHER_VERSION@' + replacement-text: ${{ inputs.version }} + - name: Replace the URL placeholder + uses: richardrigutins/replace-in-files@v2 + with: + files: ./pkgs/chocolatey/tools/chocolateyInstall.ps1 + search-text: '@LAUNCHER_URL@' + replacement-text: ${{ inputs.url }} + - name: Replace the CHECKSUM placeholder + uses: richardrigutins/replace-in-files@v2 + with: + files: ./pkgs/chocolatey/tools/chocolateyInstall.ps1 + search-text: '@LAUNCHER_SHA256@' + replacement-text: ${{ inputs.digest }} + - name: Build the Chocolatey package (.nupkg) + run: choco pack ./pkgs/chocolatey/scala.nuspec --out ./pkgs/chocolatey + - name: Upload the Chocolatey package to GitHub + uses: actions/upload-artifact@v4 + with: + name: scala.nupkg + path: ./pkgs/chocolatey/scala.${{ inputs.version }}.nupkg + if-no-files-found: error + \ No newline at end of file diff --git a/.github/workflows/build-sdk.yml b/.github/workflows/build-sdk.yml new file mode 100644 index 000000000000..63b31b742d8b --- /dev/null +++ b/.github/workflows/build-sdk.yml @@ -0,0 +1,58 @@ +################################################################################################### +### THIS IS A REUSABLE WORKFLOW TO BUILD THE SCALA LAUNCHERS ### +### HOW TO USE: ### +### - THSI WORKFLOW WILL PACKAGE THE ALL THE LAUNCHERS AND UPLOAD THEM TO GITHUB ARTIFACTS ### +### ### +### NOTE: ### +### - SEE THE WORFLOW FOR THE NAMES OF THE ARTIFACTS ### +################################################################################################### + + +name: Build Scala Launchers +run-name: Build Scala Launchers + +on: + workflow_call: + inputs: + java-version: + type : string + required : true + outputs: + universal-id: + description: ID of the `universal` package from GitHub Artifacts (Authentication Required) + value : ${{ jobs.build.outputs.universal-id }} + universal-digest: + description: The SHA256 of the uploaded artifact (universal) + value : ${{ jobs.build.outputs.universal-digest }} + + +jobs: + build: + runs-on: ubuntu-latest + outputs: + universal-id : ${{ steps.universal.outputs.artifact-id }} + universal-digest : ${{ steps.universal-digest.outputs.digest }} + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{ inputs.java-version }} + cache : sbt + - uses: sbt/setup-sbt@v1 + - name: Build and pack the SDK (universal) + run : ./project/scripts/sbt dist/pack + + - name: Upload zip archive to GitHub Artifact (universal) + uses: actions/upload-artifact@v4 + id : universal + with: + path: ./dist/target/pack/* + name: scala3-universal + + - name: Compute SHA256 of the uploaded artifact (universal) + id : universal-digest + run : | + curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -o artifact.zip -L https://api.github.com/repos/scala/scala3/actions/artifacts/${{ steps.universal.outputs.artifact-id }}/zip + echo "digest=$(sha256sum artifact.zip | cut -d " " -f 1)" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9cd0f0b3899c..2b46c95e5fe0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -72,7 +72,7 @@ jobs: ## Workaround for https://github.com/actions/runner/issues/2033 (See https://github.com/scala/scala3/pull/19720) - name: Reset existing repo run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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 @@ -125,7 +125,7 @@ jobs: - name: Reset existing repo run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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 @@ -168,7 +168,7 @@ jobs: - name: Reset existing repo shell: cmd run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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: Git Checkout @@ -212,7 +212,7 @@ jobs: - name: Reset existing repo shell: cmd run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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: Git Checkout @@ -254,7 +254,7 @@ jobs: - name: Reset existing repo run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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 @@ -301,7 +301,7 @@ jobs: run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH - name: Reset existing repo run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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 @@ -318,7 +318,7 @@ jobs: - name: Test run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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" @@ -355,7 +355,7 @@ jobs: run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH - name: Reset existing repo run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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 @@ -372,7 +372,7 @@ jobs: - name: Test run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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" @@ -409,7 +409,7 @@ jobs: run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH - name: Reset existing repo run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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 @@ -426,7 +426,7 @@ jobs: - name: Test run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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" @@ -462,7 +462,7 @@ jobs: - name: Reset existing repo run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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 @@ -511,7 +511,7 @@ jobs: - name: Reset existing repo run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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 @@ -559,7 +559,7 @@ jobs: run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH - name: Reset existing repo run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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 @@ -623,7 +623,7 @@ jobs: steps: - name: Reset existing repo run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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 @@ -640,7 +640,7 @@ jobs: - name: Generate Website run: | - git config --global --add safe.directory /__w/scala3/scala3 + git config --global --add safe.directory $GITHUB_WORKSPACE ./project/scripts/genDocs -doc-snapshot - name: Deploy Website to dotty-website @@ -678,7 +678,7 @@ jobs: run: echo "/usr/lib/jvm/java-8-openjdk-amd64/bin" >> $GITHUB_PATH - name: Reset existing repo run: | - git config --global --add safe.directory /__w/scala3/scala3 + 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 @@ -707,7 +707,6 @@ jobs: run: | ./project/scripts/sbt dist/packArchive sha256sum dist/target/scala3-* > dist/target/sha256sum.txt - echo "RELEASE_TAG=${GITHUB_REF#*refs/tags/}" >> $GITHUB_ENV - name: Create GitHub Release id: create_gh_release @@ -752,7 +751,7 @@ jobs: asset_content_type: text/plain - name: Publish Release - run: ./project/scripts/sbtPublish ";project scala3-bootstrapped ;publishSigned ;sonatypeBundleRelease" + run: ./project/scripts/sbtPublish ";project scala3-bootstrapped ;publishSigned ;sonatypeBundleUpload" open_issue_on_failure: @@ -774,3 +773,30 @@ jobs: WORKFLOW_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} with: filename: .github/workflows/issue_nightly_failed.md + + build-sdk-package: + uses: ./.github/workflows/build-sdk.yml + if: + (github.event_name == 'pull_request' && !contains(github.event.pull_request.body, '[skip ci]')) || + (github.event_name == 'workflow_dispatch' && github.repository == 'scala/scala3') || + (github.event_name == 'schedule' && github.repository == 'scala/scala3') || + github.event_name == 'push' + with: + java-version: 8 + + build-chocolatey-package: + uses: ./.github/workflows/build-chocolatey.yml + needs: [ build-sdk-package ] + with: + version: 3.3.5-local # unused + url : https://api.github.com/repos/scala/scala3/actions/artifacts/${{ needs.build-sdk-package.outputs.universal-id }}/zip + digest : ${{ needs.build-sdk-package.outputs.universal-digest }} + + test-chocolatey-package: + uses: ./.github/workflows/test-chocolatey.yml + with: + version : 3.3.5-local # unused + java-version: 8 + if: github.event_name == 'pull_request' && contains(github.event.pull_request.body, '[test_chocolatey]') + needs: [ build-chocolatey-package ] + diff --git a/.github/workflows/dependency-graph.yml b/.github/workflows/dependency-graph.yml index d4be398148c7..7b4d7237a500 100644 --- a/.github/workflows/dependency-graph.yml +++ b/.github/workflows/dependency-graph.yml @@ -9,4 +9,5 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: sbt/setup-sbt@v1 - uses: scalacenter/sbt-dependency-submission@v3 diff --git a/.github/workflows/language-reference.yaml b/.github/workflows/language-reference.yaml index 786785eaa4a2..6406996b7ec5 100644 --- a/.github/workflows/language-reference.yaml +++ b/.github/workflows/language-reference.yaml @@ -36,6 +36,7 @@ jobs: distribution: 'temurin' java-version: 17 cache: 'sbt' + - uses: sbt/setup-sbt@v1 - name: Generate reference documentation and test links run: | diff --git a/.github/workflows/publish-chocolatey.yml b/.github/workflows/publish-chocolatey.yml new file mode 100644 index 000000000000..3b31728a50ba --- /dev/null +++ b/.github/workflows/publish-chocolatey.yml @@ -0,0 +1,39 @@ +################################################################################################### +### THIS IS A REUSABLE WORKFLOW TO PUBLISH SCALA TO CHOCOLATEY ### +### HOW TO USE: ### +### - THE RELEASE WORKFLOW SHOULD CALL THIS WORKFLOW ### +### - IT WILL PUBLISH TO CHOCOLATEY THE MSI ### +### ### +### NOTE: ### +### - WE SHOULD KEEP IN SYNC THE NAME OF THE MSI WITH THE ACTUAL BUILD ### +### - WE SHOULD KEEP IN SYNC THE URL OF THE RELEASE ### +### - IT ASSUMES THAT THE `build-chocolatey` WORKFLOW WAS EXECUTED BEFORE ### +################################################################################################### + + +name: Publish Scala to Chocolatey +run-name: Publish Scala ${{ inputs.version }} to Chocolatey + +on: + workflow_call: + inputs: + version: + required: true + type: string + secrets: + # Connect to https://community.chocolatey.org/profiles/scala + # Accessible via https://community.chocolatey.org/account + API-KEY: + required: true + +jobs: + publish: + runs-on: windows-latest + steps: + - name: Fetch the Chocolatey package from GitHub + uses: actions/download-artifact@v4 + with: + name: scala.nupkg + - name: Publish the package to Chocolatey + run: choco push scala.nupkg --source https://push.chocolatey.org/ --api-key ${{ secrets.API-KEY }} + \ No newline at end of file diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index fa65f8cd5ae6..03ff19444d2f 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -1,4 +1,17 @@ -name: Releases +################################################################################################### +### OFFICIAL RELEASE WORKFLOW ### +### HOW TO USE: ### +### - THIS WORKFLOW WILL NEED TO BE TRIGGERED MANUALLY ### +### ### +### NOTE: ### +### - THIS WORKFLOW SHOULD ONLY BE RUN ON STABLE RELEASES ### +### - IT ASSUMES THAT THE PRE-RELEASE WORKFLOW WAS PREVIOUSLY EXECUTED ### +### ### +################################################################################################### + +name: Official release of Scala +run-name: Official release of Scala ${{ inputs.version }} + on: workflow_dispatch: inputs: @@ -11,7 +24,7 @@ permissions: contents: read jobs: - publish_release: + publish-sdkman: runs-on: [self-hosted, Linux] container: image: lampepfl/dotty:2021-03-22 @@ -35,3 +48,35 @@ jobs: - name: Publish to SDKMAN run: .github/workflows/scripts/publish-sdkman.sh ${{ inputs.version }} + + compute-digest: + runs-on: ubuntu-latest + outputs: + digest: ${{ steps.digest.outputs.digest }} + steps: + - name: Compute the SHA256 of scala3-${{ inputs.version }}.zip in GitHub Release + id: digest + run: | + curl -o artifact.zip -L https://github.com/scala/scala3/releases/download/${{ inputs.version }}/scala3-${{ inputs.version }}.zip + echo "digest=$(sha256sum artifact.zip | cut -d " " -f 1)" >> "$GITHUB_OUTPUT" + + build-chocolatey: + uses: ./.github/workflows/build-chocolatey.yml + needs: compute-digest + with: + version: ${{ inputs.version }} + url : 'https://github.com/scala/scala3/releases/download/${{ inputs.version }}/scala3-${{ inputs.version }}.zip' + digest : ${{ needs.compute-digest.outputs.digest }} + test-chocolatey: + uses: ./.github/workflows/test-chocolatey.yml + needs: build-chocolatey + with: + version : ${{ inputs.version }} + java-version: 8 + publish-chocolatey: + uses: ./.github/workflows/publish-chocolatey.yml + needs: [ build-chocolatey, test-chocolatey ] + with: + version: ${{ inputs.version }} + secrets: + API-KEY: ${{ secrets.CHOCOLATEY_KEY }} diff --git a/.github/workflows/scaladoc.yaml b/.github/workflows/scaladoc.yaml index 7d35aa3e253b..22c49d2ff9c1 100644 --- a/.github/workflows/scaladoc.yaml +++ b/.github/workflows/scaladoc.yaml @@ -15,7 +15,7 @@ permissions: jobs: build: env: - AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }} + AZURE_STORAGE_SAS_TOKEN: ${{ secrets.AZURE_STORAGE_SAS_TOKEN }}m runs-on: ubuntu-latest if: "github.event_name == 'merge_group' || ( github.event_name == 'pull_request' @@ -36,6 +36,7 @@ jobs: java-version: 17 cache: 'sbt' + - uses: sbt/setup-sbt@v1 - name: Compile and test scala3doc-js run: ./project/scripts/sbt scaladoc-js-main/test @@ -62,21 +63,6 @@ jobs: - name: Generate documentation for example project using dotty-sbt run: ./project/scripts/sbt "sbt-test/scripted sbt-dotty/scaladoc" - - name: Generate index file - run: scaladoc/scripts/mk-index.sh scaladoc/output > scaladoc/output/index.html - - - name: Upload documentation to server - uses: azure/CLI@v1 - if: env.AZURE_STORAGE_SAS_TOKEN - env: - PR_NUMBER: ${{ github.event.pull_request.number }} - with: - inlineScript: | - DOC_DEST=$(echo pr-${PR_NUMBER:-${GITHUB_REF##*/}} | tr -d -c "[-A-Za-z0-9]") - echo uplading docs to https://scala3doc.virtuslab.com/$DOC_DEST - az storage container create --name $DOC_DEST --account-name scala3docstorage --public-access container - az storage blob upload-batch --overwrite true -s scaladoc/output -d $DOC_DEST --account-name scala3docstorage - stdlib-sourcelinks-test: runs-on: ubuntu-latest # if false - disable flaky test diff --git a/.github/workflows/test-chocolatey.yml b/.github/workflows/test-chocolatey.yml new file mode 100644 index 000000000000..b6ca9bf74b12 --- /dev/null +++ b/.github/workflows/test-chocolatey.yml @@ -0,0 +1,51 @@ +################################################################################################### +### THIS IS A REUSABLE WORKFLOW TO TEST SCALA WITH CHOCOLATEY ### +### HOW TO USE: ### +### ### +### NOTE: ### +### ### +################################################################################################### + +name: Test 'scala' Chocolatey Package +run-name: Test 'scala' (${{ inputs.version }}) Chocolatey Package + +on: + workflow_call: + inputs: + version: + required: true + type: string + java-version: + required: true + type : string + +env: + CHOCOLATEY-REPOSITORY: chocolatey-pkgs + DOTTY_CI_INSTALLATION: ${{ secrets.GITHUB_TOKEN }} + +jobs: + test: + runs-on: windows-latest + steps: + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: ${{ inputs.java-version }} + - name: Download the 'nupkg' from GitHub Artifacts + uses: actions/download-artifact@v4 + with: + name: scala.nupkg + path: ${{ env.CHOCOLATEY-REPOSITORY }} + - name : Install the `scala` package with Chocolatey + run : choco install scala --source "${{ env.CHOCOLATEY-REPOSITORY }}" --pre # --pre since we might be testing non-stable releases + shell: pwsh + - name : Test the `scala` command + run : scala --version + shell: pwsh + - name : Test the `scalac` command + run : scalac --version + - name : Test the `scaladoc` command + run : scaladoc --version + - name : Uninstall the `scala` package + run : choco uninstall scala + \ No newline at end of file diff --git a/NOTICE.md b/NOTICE.md index e9b64ac262f2..9bb846dbc3f5 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -1,6 +1,6 @@ -Dotty (https://dotty.epfl.ch) -Copyright 2012-2024 EPFL -Copyright 2012-2024 Lightbend, Inc. +Scala 3 (https://www.scala-lang.org) +Copyright 2012-2025 EPFL +Copyright 2012-2025 Lightbend, Inc. dba Akka Licensed under the Apache License, Version 2.0 (the "License"): http://www.apache.org/licenses/LICENSE-2.0 @@ -11,12 +11,13 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -The dotty compiler frontend has been developed since November 2012 by Martin -Odersky. It is expected and hoped for that the list of contributors to the -codebase will grow quickly. Dotty draws inspiration and code from the original -Scala compiler "nsc", which is developed at scala/scala [1]. +The Scala 3 compiler is also known as Dotty. The Dotty compiler +frontend has been developed since November 2012 by Martin Odersky. It +is expected and hoped for that the list of contributors to the +codebase will grow quickly. Dotty draws inspiration and code from the +original Scala 2 compiler "nsc", which is still developed at scala/scala [1]. -The majority of the dotty codebase is new code, with the exception of the +The majority of the Dotty codebase is new code, with the exception of the components mentioned below. We have for each component tried to come up with a list of the original authors in the scala/scala [1] codebase. Apologies if some major authors were omitted by oversight. @@ -28,7 +29,7 @@ major authors were omitted by oversight. * dotty.tools.dotc.classpath: The classpath handling is taken mostly as is from scala/scala [1]. The original authors were Grzegorz Kossakowski, - Michał Pociecha, Lukas Rytz, Jason Zaugg and others. + Michał Pociecha, Lukas Rytz, Jason Zaugg and others. * dotty.tools.dotc.config: The configuration components were adapted and extended from scala/scala [1]. The original sources were authored by Paul diff --git a/changelogs/3.3.5-RC1.md b/changelogs/3.3.5-RC1.md new file mode 100644 index 000000000000..4e565de5da81 --- /dev/null +++ b/changelogs/3.3.5-RC1.md @@ -0,0 +1,162 @@ +# Highlights of the release + +- Use Scala 2.13.15 standard library [#21648](https://github.com/scala/scala3/pull/21648) +- Support JDK 23 [#20144](https://github.com/scala/scala3/pull/20144) +- Add the `-Wall` option that enables all warnings [#20577](https://github.com/scala/scala3/pull/20577) +- Reversed `-Wconf` parsing order to mirror Scala 2 semantics [#18503](https://github.com/scala/scala3/pull/18503) + +# Other changes and fixes + +## Annotations + +- Tighten java annot value parsing [#21650](https://github.com/scala/scala3/pull/21650) + +## Exports + +- Re-use attachment in exportForwarders to handle ambiguous overloads [#21518](https://github.com/scala/scala3/pull/21518) +- Allow export statements in AnyVal [#21653](https://github.com/scala/scala3/pull/21653) + +## Extension Methods + +- Make right assoc ext method fwd refs error [#21641](https://github.com/scala/scala3/pull/21641) + +## Inference + +- Fix #20521: Optimise caching for computing atoms and widened in OrTypes [#21223](https://github.com/scala/scala3/pull/21223) + +## Linting + +- Add origin filter to WConf, DeprecationWarning [#21404](https://github.com/scala/scala3/pull/21404) +- CheckUnused checks type param annotations [#20549](https://github.com/scala/scala3/pull/20549) + +## Match Types + +- Fix #20897: Make `Nothing ⋔ Nothing`, as per spec. [#21241](https://github.com/scala/scala3/pull/21241) +- Always interpret underscores inside patterns as type bounds [#21718](https://github.com/scala/scala3/pull/21718) + +## Overloading + +- Report only non-overridden unimplemented members [#21337](https://github.com/scala/scala3/pull/21337) + +## Parser + +- Harden skip in Scanner [#21607](https://github.com/scala/scala3/pull/21607) +- SimplePattern errors should now be recovered as wildcard instead of unimplemented expr [#21438](https://github.com/scala/scala3/pull/21438) + +## Positions + +- Fix trailing comma Ident's span [#20445](https://github.com/scala/scala3/pull/20445) + +## Presentation Compiler + +- Fix autoimports with using directives [#21590](https://github.com/scala/scala3/pull/21590) +- Remove artificial `CURSOR` added to code in the completions [#20899](https://github.com/scala/scala3/pull/20899) +- Help implement Metals' infer expected type feature [#21390](https://github.com/scala/scala3/pull/21390) +- Weekly metals backport [#21343](https://github.com/scala/scala3/pull/21343) +- Change mock symbol search [#21296](https://github.com/scala/scala3/pull/21296) +- Fix: completions when parenthesis already provided [#21299](https://github.com/scala/scala3/pull/21299) +- Backport from metals [#21196](https://github.com/scala/scala3/pull/21196) +- Fix: don't add suffix if brackets already present [#21259](https://github.com/scala/scala3/pull/21259) + +## Quotes + +- Handle suspension due to macro call in arbitrary phases [#21651](https://github.com/scala/scala3/pull/21651) +- Have a better error message when healing types [#21711](https://github.com/scala/scala3/pull/21711) +- Expr#show: Don't crash when the expression contains an unsupported type (like a SkolemType) [#20494](https://github.com/scala/scala3/pull/20494) +- Quotes type printing: take `infix` type modifier into account [#21726](https://github.com/scala/scala3/pull/21726) + +## Reporting + +- Nicer error message in case a `derived` method has an explicit term param [#21332](https://github.com/scala/scala3/pull/21332) +- Add better error reporting for inlined non-immutable paths [#21639](https://github.com/scala/scala3/pull/21639) + +## Releases + +- Add support for Chocolatey [#20534](https://github.com/scala/scala3/pull/20534) +- Add the merge commit hash to the icon's url [#21221](https://github.com/scala/scala3/pull/21221) +- Add sources of synthetic classes to sources jar [#20904](https://github.com/scala/scala3/pull/20904) + +## REPL + +- Uppdate JLine to 3.27.0 (was 3.25.1) [#21752](https://github.com/scala/scala3/pull/21752) +- Allow JLine to fall back to a dumb terminal [#21330](https://github.com/scala/scala3/pull/21330) + +## Scaladoc + +- Only trim one newline when preprocessing the content of a markdown code snippet [#21519](https://github.com/scala/scala3/pull/21519) +- Bump Inkuire version to fix it for the new Scala versions [#21611](https://github.com/scala/scala3/pull/21611) +- Filter opaque modifier from object documentation [#21640](https://github.com/scala/scala3/pull/21640) + +## TASTy format + +- Add child to parent in completion context [#21214](https://github.com/scala/scala3/pull/21214) + +## Transform + +- Three fixes to SAM type handling [#21596](https://github.com/scala/scala3/pull/21596) +- Fix treatment of separately compiled @native methods in FirstTransform [#21593](https://github.com/scala/scala3/pull/21593) +- Fix #20856: Serialize `Waiting` and `Evaluating` as if `null`. [#21243](https://github.com/scala/scala3/pull/21243) +- Fixes IllegalAccessError with Java package protected class [#21362](https://github.com/scala/scala3/pull/21362) +- Consistently use TypeMismatch in TreeChecker [#21529](https://github.com/scala/scala3/pull/21529) +- Fix: don't use color codes for pattern match code action [#21120](https://github.com/scala/scala3/pull/21120) +- Let show behave more robustly for Recheck [#21678](https://github.com/scala/scala3/pull/21678) +- Always rewrite empty List() to Nil [#21689](https://github.com/scala/scala3/pull/21689) + +## Typer + +- Fix extending protected nested java classes [#21857](https://github.com/scala/scala3/pull/21857) +- Avoid cyclic errors forcing default arg types [#21597](https://github.com/scala/scala3/pull/21597) +- Survive inaccessible types when computing implicit scope [#21589](https://github.com/scala/scala3/pull/21589) +- Revert "Drop redundant `butNot = Param` clause in isAnchor" [#21566](https://github.com/scala/scala3/pull/21566) +- Fail early & more clearly on shaded-broken classfiles [#21262](https://github.com/scala/scala3/pull/21262) +- Fix isomorphism tests of `AndOrType`s under non-empty `BinderPairs` [#21017](https://github.com/scala/scala3/pull/21017) +- Some fixes for AnnotatedTypes mapping [#19957](https://github.com/scala/scala3/pull/19957) +- Simple performance improvement for Denotations [#21584](https://github.com/scala/scala3/pull/21584) +- Avoid import suggestion thread hang if -Ximport-suggestion-timeout <= 1 [#21434](https://github.com/scala/scala3/pull/21434) +- Fix incorrect caching with dependent method parameters [#21699](https://github.com/scala/scala3/pull/21699) + +## Experimental: Explicit Nulls + +- Add tracking of NotNullInfo for Match, Case, Try trees (fix #21380) [#21389](https://github.com/scala/scala3/pull/21389) +- Fix #21392: Adjust `canComparePredefined(Nothing, T)` in explicit nulls [#21504](https://github.com/scala/scala3/pull/21504) + +# Contributors + +Thank you to all the contributors who made this release possible 🎉 + +According to `git shortlog -sn --no-merges 3.3.4..3.3.5-RC1` these are: + +``` + 44 Wojciech Mazur + 14 Dale Wijnand + 10 Katarzyna Marek + 8 rochala + 5 noti0na1 + 4 Hamza Remmal + 4 Matt Bovel + 4 Som Snytt + 3 Jamie Thompson + 3 Martin Odersky + 3 Michał Pałka + 3 dependabot[bot] + 3 kasiaMarek + 2 Aleksander Rainko + 2 Eugene Flesselle + 2 Florian3k + 2 HarrisL2 + 2 Jędrzej Rochala + 2 Kacper Korban + 2 Yichen Xu + 1 Eugene Yokota + 1 Guillaume Martres + 1 Hamza REMMAL + 1 Jan Chyb + 1 Joel Wilsson + 1 Kenji Yoshida + 1 Martin Duhem + 1 Nicolas Stucki + 1 Ondrej Lhotak + 1 Seth Tisue + 1 Sébastien Doeraene + 1 Tomasz Godzik +``` diff --git a/changelogs/3.3.5-RC2.md b/changelogs/3.3.5-RC2.md new file mode 100644 index 000000000000..b961385aa129 --- /dev/null +++ b/changelogs/3.3.5-RC2.md @@ -0,0 +1,15 @@ +# Backported fixes + +- Backport "REPL: JLine: follow recommendation to use JNI, not JNA; also JLine 3.27.1 (was 3.27.0)" to LTS [#22377](https://github.com/scala/scala3/pull/22377) + +# Contributors + +Thank you to all the contributors who made this release possible 🎉 + +According to `git shortlog -sn --no-merges 3.3.5-RC1..3.3.5-RC2` these are: + +``` + 5 Wojciech Mazur + 3 Seth Tisue + 1 Hamza Remmal +``` diff --git a/changelogs/3.3.5-RC3.md b/changelogs/3.3.5-RC3.md new file mode 100644 index 000000000000..872b7d0c68f6 --- /dev/null +++ b/changelogs/3.3.5-RC3.md @@ -0,0 +1,13 @@ +# Backported fixes + +- Fix synchronization of `-java-output-versions` with JVM backend [#22403](https://github.com/scala/scala3/pull/22403) + +# Contributors + +Thank you to all theq contributors who made this release possible 🎉 + +According to `git shortlog -sn --no-merges 3.3.5-RC2..3.3.5-RC3` these are: + +``` + 3 Wojciech Mazur +``` diff --git a/changelogs/3.3.5.md b/changelogs/3.3.5.md new file mode 100644 index 000000000000..a4697c69c895 --- /dev/null +++ b/changelogs/3.3.5.md @@ -0,0 +1,168 @@ +# Highlights of the release + +- Use Scala 2.13.15 standard library [#21648](https://github.com/scala/scala3/pull/21648) +- Support JDK 23 [#20144](https://github.com/scala/scala3/pull/20144) +- Add the `-Wall` option that enables all warnings [#20577](https://github.com/scala/scala3/pull/20577) +- Reversed `-Wconf` parsing order to mirror Scala 2 semantics [#18503](https://github.com/scala/scala3/pull/18503) + +# Other changes and fixes + +## Annotations + +- Tighten java annot value parsing [#21650](https://github.com/scala/scala3/pull/21650) + +## Exports + +- Re-use attachment in exportForwarders to handle ambiguous overloads [#21518](https://github.com/scala/scala3/pull/21518) +- Allow export statements in AnyVal [#21653](https://github.com/scala/scala3/pull/21653) + +## Extension Methods + +- Make right assoc ext method fwd refs error [#21641](https://github.com/scala/scala3/pull/21641) + +## Inference + +- Fix #20521: Optimise caching for computing atoms and widened in OrTypes [#21223](https://github.com/scala/scala3/pull/21223) + +## Linting + +- Add origin filter to WConf, DeprecationWarning [#21404](https://github.com/scala/scala3/pull/21404) +- CheckUnused checks type param annotations [#20549](https://github.com/scala/scala3/pull/20549) + +## Match Types + +- Fix #20897: Make `Nothing ⋔ Nothing`, as per spec. [#21241](https://github.com/scala/scala3/pull/21241) +- Always interpret underscores inside patterns as type bounds [#21718](https://github.com/scala/scala3/pull/21718) + +## Overloading + +- Report only non-overridden unimplemented members [#21337](https://github.com/scala/scala3/pull/21337) + +## Parser + +- Harden skip in Scanner [#21607](https://github.com/scala/scala3/pull/21607) +- SimplePattern errors should now be recovered as wildcard instead of unimplemented expr [#21438](https://github.com/scala/scala3/pull/21438) + +## Positions + +- Fix trailing comma Ident's span [#20445](https://github.com/scala/scala3/pull/20445) + +## Presentation Compiler + +- Fix autoimports with using directives [#21590](https://github.com/scala/scala3/pull/21590) +- Remove artificial `CURSOR` added to code in the completions [#20899](https://github.com/scala/scala3/pull/20899) +- Help implement Metals' infer expected type feature [#21390](https://github.com/scala/scala3/pull/21390) +- Weekly metals backport [#21343](https://github.com/scala/scala3/pull/21343) +- Change mock symbol search [#21296](https://github.com/scala/scala3/pull/21296) +- Fix: completions when parenthesis already provided [#21299](https://github.com/scala/scala3/pull/21299) +- Backport from metals [#21196](https://github.com/scala/scala3/pull/21196) +- Fix: don't add suffix if brackets already present [#21259](https://github.com/scala/scala3/pull/21259) + +## Quotes + +- Handle suspension due to macro call in arbitrary phases [#21651](https://github.com/scala/scala3/pull/21651) +- Have a better error message when healing types [#21711](https://github.com/scala/scala3/pull/21711) +- Expr#show: Don't crash when the expression contains an unsupported type (like a SkolemType) [#20494](https://github.com/scala/scala3/pull/20494) +- Quotes type printing: take `infix` type modifier into account [#21726](https://github.com/scala/scala3/pull/21726) + +## Reporting + +- Nicer error message in case a `derived` method has an explicit term param [#21332](https://github.com/scala/scala3/pull/21332) +- Add better error reporting for inlined non-immutable paths [#21639](https://github.com/scala/scala3/pull/21639) + +## Releases + +- Add support for Chocolatey [#20534](https://github.com/scala/scala3/pull/20534) +- Add the merge commit hash to the icon's url [#21221](https://github.com/scala/scala3/pull/21221) +- Add sources of synthetic classes to sources jar [#20904](https://github.com/scala/scala3/pull/20904) + +## REPL + +- Uppdate JLine to 3.27.0 (was 3.25.1) [#21752](https://github.com/scala/scala3/pull/21752) +- Allow JLine to fall back to a dumb terminal [#21330](https://github.com/scala/scala3/pull/21330) +- JLine: follow recommendation to use JNI, not JNA; also JLine 3.27.1 (was 3.27.0) [#22205](https://github.com/scala/scala3/pull/22205) + +## Runner + +- Fix old scala runner to use correct JLine classpath [#22464](https://github.com/scala/scala3/pull/22464) +- Fix remaining JNA classpath entries in `dist/bin/scaladoc*` scripts [#22471](https://github.com/scala/scala3/pull/22471) + +## Scaladoc + +- Only trim one newline when preprocessing the content of a markdown code snippet [#21519](https://github.com/scala/scala3/pull/21519) +- Bump Inkuire version to fix it for the new Scala versions [#21611](https://github.com/scala/scala3/pull/21611) +- Filter opaque modifier from object documentation [#21640](https://github.com/scala/scala3/pull/21640) + +## TASTy format + +- Add child to parent in completion context [#21214](https://github.com/scala/scala3/pull/21214) + +## Transform + +- Three fixes to SAM type handling [#21596](https://github.com/scala/scala3/pull/21596) +- Fix treatment of separately compiled @native methods in FirstTransform [#21593](https://github.com/scala/scala3/pull/21593) +- Fix #20856: Serialize `Waiting` and `Evaluating` as if `null`. [#21243](https://github.com/scala/scala3/pull/21243) +- Fixes IllegalAccessError with Java package protected class [#21362](https://github.com/scala/scala3/pull/21362) +- Consistently use TypeMismatch in TreeChecker [#21529](https://github.com/scala/scala3/pull/21529) +- Fix: don't use color codes for pattern match code action [#21120](https://github.com/scala/scala3/pull/21120) +- Let show behave more robustly for Recheck [#21678](https://github.com/scala/scala3/pull/21678) +- Always rewrite empty List() to Nil [#21689](https://github.com/scala/scala3/pull/21689) + +## Typer + +- Fix extending protected nested java classes [#21857](https://github.com/scala/scala3/pull/21857) +- Avoid cyclic errors forcing default arg types [#21597](https://github.com/scala/scala3/pull/21597) +- Survive inaccessible types when computing implicit scope [#21589](https://github.com/scala/scala3/pull/21589) +- Revert "Drop redundant `butNot = Param` clause in isAnchor" [#21566](https://github.com/scala/scala3/pull/21566) +- Fail early & more clearly on shaded-broken classfiles [#21262](https://github.com/scala/scala3/pull/21262) +- Fix isomorphism tests of `AndOrType`s under non-empty `BinderPairs` [#21017](https://github.com/scala/scala3/pull/21017) +- Some fixes for AnnotatedTypes mapping [#19957](https://github.com/scala/scala3/pull/19957) +- Simple performance improvement for Denotations [#21584](https://github.com/scala/scala3/pull/21584) +- Avoid import suggestion thread hang if -Ximport-suggestion-timeout <= 1 [#21434](https://github.com/scala/scala3/pull/21434) +- Fix incorrect caching with dependent method parameters [#21699](https://github.com/scala/scala3/pull/21699) + +## Experimental: Explicit Nulls + +- Add tracking of NotNullInfo for Match, Case, Try trees (fix #21380) [#21389](https://github.com/scala/scala3/pull/21389) +- Fix #21392: Adjust `canComparePredefined(Nothing, T)` in explicit nulls [#21504](https://github.com/scala/scala3/pull/21504) + +# Contributors + +Thank you to all the contributors who made this release possible 🎉 + +According to `git shortlog -sn --no-merges 3.3.4..3.3.5-RC1` these are: + +``` + 56 Wojciech Mazur + 14 Dale Wijnand + 10 Katarzyna Marek + 8 rochala + 5 Hamza Remmal + 5 noti0na1 + 4 Matt Bovel + 4 Seth Tisue + 4 Som Snytt + 3 Jamie Thompson + 3 Martin Odersky + 3 Michał Pałka + 3 dependabot[bot] + 3 kasiaMarek + 2 Aleksander Rainko + 2 Eugene Flesselle + 2 Florian3k + 2 HarrisL2 + 2 Jędrzej Rochala + 2 Kacper Korban + 2 Yichen Xu + 1 Eugene Yokota + 1 Guillaume Martres + 1 Hamza REMMAL + 1 Jan Chyb + 1 Joel Wilsson + 1 Kenji Yoshida + 1 Martin Duhem + 1 Nicolas Stucki + 1 Ondrej Lhotak + 1 Sébastien Doeraene + 1 Tomasz Godzik +``` diff --git a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala index 9a4965577cf1..61a69398d66e 100644 --- a/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala +++ b/community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala @@ -68,7 +68,7 @@ class CommunityBuildTestC: @Test def fastparse = projects.fastparse.run() @Test def geny = projects.geny.run() @Test def intent = projects.intent.run() - @Test def jacksonModuleScala = projects.jacksonModuleScala.run() + //@Test def jacksonModuleScala = projects.jacksonModuleScala.run() @Test def libretto = projects.libretto.run() @Test def minitest = projects.minitest.run() @Test def onnxScala = projects.onnxScala.run() diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 0123c8f85e7a..8a273e3c8f41 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -9,6 +9,7 @@ import dotty.tools.dotc.config.SourceVersion import dotty.tools.dotc.core.Contexts.* import dotty.tools.dotc.rewrites.Rewrites import dotty.tools.io.{AbstractFile, Directory, JDK9Reflectors, PlainDirectory} +import dotty.tools.backend.jvm.BackendUtils.classfileVersionMap import Setting.ChoiceWithHelp import scala.util.chaining.* @@ -19,8 +20,8 @@ class ScalaSettings extends SettingGroup with AllScalaSettings object ScalaSettings: // Keep synchronized with `classfileVersion` in `BackendUtils` - private val minTargetVersion = 8 - private val maxTargetVersion = 22 + private lazy val minTargetVersion = classfileVersionMap.keysIterator.min + private lazy val maxTargetVersion = classfileVersionMap.keysIterator.max def supportedTargetVersions: List[String] = (minTargetVersion to maxTargetVersion).toList.map(_.toString) diff --git a/dist/bin/common b/dist/bin/common index e3e4253938fb..6fb828352d52 100755 --- a/dist/bin/common +++ b/dist/bin/common @@ -26,7 +26,7 @@ function onExit() { # to reenable echo if we are interrupted before completing. trap onExit INT TERM EXIT -unset cygwin mingw msys darwin conemu +unset cygwin mingw msys darwin # COLUMNS is used together with command line option '-pageWidth'. if command -v tput >/dev/null 2>&1; then @@ -55,8 +55,6 @@ esac unset CYGPATHCMD if [[ ${cygwin-} || ${mingw-} || ${msys-} ]]; then - # ConEmu terminal is incompatible with jna-5.*.jar - [[ (${CONEMUANSI-} || ${ConEmuANSI-}) ]] && conemu=true # cygpath is used by various windows shells: cygwin, git-sdk, gitbash, msys, etc. CYGPATHCMD=`which cygpath 2>/dev/null` case "$TERM" in @@ -158,10 +156,8 @@ SCALA_LIB=$(find_lib "*scala-library*") SBT_INTF=$(find_lib "*compiler-interface*") JLINE_READER=$(find_lib "*jline-reader-3*") JLINE_TERMINAL=$(find_lib "*jline-terminal-3*") -JLINE_TERMINAL_JNA=$(find_lib "*jline-terminal-jna-3*") - -# jna-5 only appropriate for some combinations -[[ ${conemu-} && ${msys-} ]] || JNA=$(find_lib "*jna-5*") +JLINE_TERMINAL_JNI=$(find_lib "*jline-terminal-jni-3*") +JLINE_NATIVE=$(find_lib "*jline-native-3*") compilerJavaClasspathArgs () { # echo "dotty-compiler: $DOTTY_COMP" @@ -186,8 +182,8 @@ compilerJavaClasspathArgs () { # jine toolchain+="$JLINE_READER$PSEP" toolchain+="$JLINE_TERMINAL$PSEP" - toolchain+="$JLINE_TERMINAL_JNA$PSEP" - [ -n "${JNA-}" ] && toolchain+="$JNA$PSEP" + toolchain+="$JLINE_TERMINAL_JNI$PSEP" + toolchain+="$JLINE_NATIVE$PSEP" if [ -n "${jvm_cp_args-}" ]; then jvm_cp_args="$toolchain$jvm_cp_args" diff --git a/dist/bin/common.bat b/dist/bin/common.bat index 7aef606d5509..ce78d9ed208a 100644 --- a/dist/bin/common.bat +++ b/dist/bin/common.bat @@ -53,5 +53,5 @@ for /f "delims=" %%f in ('dir /a-d /b "%_LIB_DIR%\*scala-library*"') do for /f "delims=" %%f in ('dir /a-d /b "%_LIB_DIR%\*compiler-interface*"') do set "_SBT_INTF=%_LIB_DIR%\%%f" for /f "delims=" %%f in ('dir /a-d /b "%_LIB_DIR%\*jline-reader-3*"') do set "_JLINE_READER=%_LIB_DIR%\%%f" for /f "delims=" %%f in ('dir /a-d /b "%_LIB_DIR%\*jline-terminal-3*"') do set "_JLINE_TERMINAL=%_LIB_DIR%\%%f" -for /f "delims=" %%f in ('dir /a-d /b "%_LIB_DIR%\*jline-terminal-jna-3*"') do set "_JLINE_TERMINAL_JNA=%_LIB_DIR%\%%f" -for /f "delims=" %%f in ('dir /a-d /b "%_LIB_DIR%\*jna-5*"') do set "_JNA=%_LIB_DIR%\%%f" +for /f "delims=" %%f in ('dir /a-d /b "%_LIB_DIR%\*jline-terminal-jni-3*"') do set "_JLINE_TERMINAL_JNI=%_LIB_DIR%\%%f" +for /f "delims=" %%f in ('dir /a-d /b "%_LIB_DIR%\*jline-native-3*"') do set "_JLINE_NATIVE=%_LIB_DIR%\%%f" diff --git a/dist/bin/scala.bat b/dist/bin/scala.bat index ca908fd340be..12b32edc4382 100644 --- a/dist/bin/scala.bat +++ b/dist/bin/scala.bat @@ -77,8 +77,8 @@ set "__TOOLCHAIN=%__TOOLCHAIN%%_SCALA3_TASTY_INSPECTOR%%_PSEP%" @rem # jline set "__TOOLCHAIN=%__TOOLCHAIN%%_JLINE_READER%%_PSEP%" set "__TOOLCHAIN=%__TOOLCHAIN%%_JLINE_TERMINAL%%_PSEP%" -set "__TOOLCHAIN=%__TOOLCHAIN%%_JLINE_TERMINAL_JNA%%_PSEP%" -set "__TOOLCHAIN=%__TOOLCHAIN%%_JNA%%_PSEP%" +set "__TOOLCHAIN=%__TOOLCHAIN%%_JLINE_TERMINAL_JNI%%_PSEP%" +set "__TOOLCHAIN=%__TOOLCHAIN%%_JLINE_NATIVE%%_PSEP%" if defined _SCALA_CPATH ( set "_JVM_CP_ARGS=%__TOOLCHAIN%%_SCALA_CPATH%" diff --git a/dist/bin/scalac.bat b/dist/bin/scalac.bat index 454158c85666..daf678d30c65 100644 --- a/dist/bin/scalac.bat +++ b/dist/bin/scalac.bat @@ -106,8 +106,8 @@ set "__TOOLCHAIN=%__TOOLCHAIN%%_SCALA3_TASTY_INSPECTOR%%_PSEP%" @rem # jline set "__TOOLCHAIN=%__TOOLCHAIN%%_JLINE_READER%%_PSEP%" set "__TOOLCHAIN=%__TOOLCHAIN%%_JLINE_TERMINAL%%_PSEP%" -set "__TOOLCHAIN=%__TOOLCHAIN%%_JLINE_TERMINAL_JNA%%_PSEP%" -set "__TOOLCHAIN=%__TOOLCHAIN%%_JNA%%_PSEP%" +set "__TOOLCHAIN=%__TOOLCHAIN%%_JLINE_TERMINAL_JNI%%_PSEP%" +set "__TOOLCHAIN=%__TOOLCHAIN%%_JLINE_NATIVE%%_PSEP%" if defined _SCALA_CPATH ( set "_JVM_CP_ARGS=%__TOOLCHAIN%%_SCALA_CPATH%" diff --git a/dist/bin/scaladoc b/dist/bin/scaladoc index 8b9ec41a7f8c..b00f183f4e8a 100755 --- a/dist/bin/scaladoc +++ b/dist/bin/scaladoc @@ -95,7 +95,8 @@ classpathArgs () { CLASS_PATH+="$(find_lib "*compiler-interface*")$PSEP" CLASS_PATH+="$(find_lib "*jline-reader*")$PSEP" CLASS_PATH+="$(find_lib "*jline-terminal-3*")$PSEP" - CLASS_PATH+="$(find_lib "*jline-terminal-jna*")$PSEP" + CLASS_PATH+="$(find_lib "*jline-terminal-jni*")$PSEP" + CLASS_PATH+="$(find_lib "*jline-native*")$PSEP" CLASS_PATH+="$(find_lib "*flexmark-formatter*")$PSEP" CLASS_PATH+="$(find_lib "*autolink-0.6*")$PSEP" CLASS_PATH+="$(find_lib "*flexmark-jira-converter*")$PSEP" @@ -107,7 +108,6 @@ classpathArgs () { CLASS_PATH+="$(find_lib "*scala-library*")$PSEP" CLASS_PATH+="$(find_lib "*protobuf-java*")$PSEP" CLASS_PATH+="$(find_lib "*util-interface*")$PSEP" - CLASS_PATH+="$(find_lib "*jna-5*")$PSEP" CLASS_PATH+="$(find_lib "*antlr4-runtime*")$PSEP" jvm_cp_args="-classpath \"$CLASS_PATH\"" diff --git a/dist/bin/scaladoc.bat b/dist/bin/scaladoc.bat index bcc0d71788a3..dbccbba0a064 100644 --- a/dist/bin/scaladoc.bat +++ b/dist/bin/scaladoc.bat @@ -129,7 +129,8 @@ call :updateClasspath "scala-asm" call :updateClasspath "compiler-interface" call :updateClasspath "jline-reader" call :updateClasspath "jline-terminal-3" -call :updateClasspath "jline-terminal-jna" +call :updateClasspath "jline-terminal-jni" +call :updateClasspath "jline-native" call :updateClasspath "flexmark-util" call :updateClasspath "flexmark-formatter" call :updateClasspath "autolink-0.6" @@ -142,7 +143,6 @@ call :updateClasspath "snakeyaml" call :updateClasspath "scala-library" call :updateClasspath "protobuf-java" call :updateClasspath "util-interface" -call :updateClasspath "jna-5" call :updateClasspath "flexmark-ext-tables" call :updateClasspath "flexmark-ext-ins" call :updateClasspath "flexmark-ext-superscript" diff --git a/pkgs/chocolatey/README.md b/pkgs/chocolatey/README.md new file mode 100644 index 000000000000..c8af9cf92666 --- /dev/null +++ b/pkgs/chocolatey/README.md @@ -0,0 +1,17 @@ +

Configuration for Chocolatey

+ +Official support for Chocolatey started by the release of Scala 3.6.0 and was backported (with modifications) to the Scala 3.3.5 LTS. +Scala 3.3 LTS Chocolatey package uses universal package (.jar) instead of native runners. + +> [!IMPORTANT] +> This folder contains the templates to generate the configuration for Chocolatey. +> The `scala.nuspec` and `chocolateyInstall.ps1` files needs to be rewritten by changing the following placeholders: +> - @LAUNCHER_VERSION@ : Placeholder for the current scala version to deploy +> - @LAUNCHER_URL@ : Placeholder for the URL to the windows zip released on GitHub +> - @LAUNCHER_SHA256@ : Placeholder for the SHA256 of the msi file released on GitHub + +## Important information + +- How to create a *Chocolatey* package: https://docs.chocolatey.org/en-us/create/create-packages/ +- Guidelines to follow for the package icon: https://docs.chocolatey.org/en-us/create/create-packages/#package-icon-guidelines +- `.nuspec` format specification: https://learn.microsoft.com/en-gb/nuget/reference/nuspec diff --git a/pkgs/chocolatey/icon.svg b/pkgs/chocolatey/icon.svg new file mode 100644 index 000000000000..0ccb404b5624 --- /dev/null +++ b/pkgs/chocolatey/icon.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pkgs/chocolatey/scala.nuspec b/pkgs/chocolatey/scala.nuspec new file mode 100644 index 000000000000..83033fe4b349 --- /dev/null +++ b/pkgs/chocolatey/scala.nuspec @@ -0,0 +1,25 @@ + + + + scala + @LAUNCHER_VERSION@ + Scala + scala + scala + scala + Scala + Official release of the Scala Programming Language on Chocolatey. + https://github.com/scala/scala3/tree/main/pkgs/chocolatey + https://github.com/scala/scala3 + https://scala-lang.org/ + https://github.com/scala/scala3/issues + © 2002-2025, LAMP/EPFL + https://cdn.jsdelivr.net/gh/scala/scala3@a046b0014ffd9536144d67a48f8759901b96d12f/pkgs/chocolatey/icon.svg + https://github.com/scala/scala3/blob/main/LICENSE + true + https://github.com/scala/scala3/releases + + + + + diff --git a/pkgs/chocolatey/tools/chocolateyInstall.ps1 b/pkgs/chocolatey/tools/chocolateyInstall.ps1 new file mode 100644 index 000000000000..3117efadaf0e --- /dev/null +++ b/pkgs/chocolatey/tools/chocolateyInstall.ps1 @@ -0,0 +1,46 @@ +$ErrorActionPreference = 'Stop'; + +$unzipLocation = Split-Path -Parent $MyInvocation.MyCommand.Definition # Get the root of chocolatey folder +$unzipLocation = Join-Path $unzipLocation "$($env:chocolateyPackageName)" # Append the package's name +$unzipLocation = Join-Path $unzipLocation "$($env:chocolateyPackageVersion)" # Append the package's version + +# Configure the installation arguments +$packageArgs = @{ + packageName = 'scala' + Url64 = '@LAUNCHER_URL@' + UnzipLocation = $unzipLocation + Checksum64 = '@LAUNCHER_SHA256@' + ChecksumType64 = 'SHA256' +} + +## In case we are running in the CI, add the authorisation header to fetch the zip +## See: https://docs.github.com/en/rest/actions/artifacts?apiVersion=2022-11-28#download-an-artifact +if ($env:DOTTY_CI_INSTALLATION) { + Write-Host "Installing the Chocolatey package in Scala 3's CI" + $packageArgs += @{ + Options = @{ + Headers = @{ + Accept = 'application/vnd.github+json' + Authorization = "Bearer $env:DOTTY_CI_INSTALLATION" + } + } + } +} + +Install-ChocolateyZipPackage @packageArgs + +# Find the path to the bin directory to create the shims +if($env:DOTTY_CI_INSTALLATION) { + $scalaBinPath = Join-Path $unzipLocation 'bin' # Update this path if the structure inside the ZIP changes +} else { + $extractedDir = Get-ChildItem -Path $unzipLocation | Where-Object { $_.PSIsContainer } | Select-Object -First 1 + $scalaBinPath = Join-Path $unzipLocation $extractedDir | Join-Path -ChildPath 'bin' +} + +# Iterate through the .bat files in the bin directory and create shims +Write-Host "Creating shims for .bat file from $scalaBinPath" +Get-ChildItem -Path $scalaBinPath -Filter '*.bat' | ForEach-Object { + $file = $_.FullName + Write-Host "Creating shim for $file..." + Install-BinFile -Name $_.BaseName -Path $file +} diff --git a/pkgs/chocolatey/tools/chocolateyUninstall.ps1 b/pkgs/chocolatey/tools/chocolateyUninstall.ps1 new file mode 100644 index 000000000000..387914af5d09 --- /dev/null +++ b/pkgs/chocolatey/tools/chocolateyUninstall.ps1 @@ -0,0 +1,21 @@ +$ErrorActionPreference = 'Stop'; + +$unzipLocation = Split-Path -Parent $MyInvocation.MyCommand.Definition # Get the root of chocolatey folder +$unzipLocation = Join-Path $unzipLocation "$($env:chocolateyPackageName)" # Append the package's name +$unzipLocation = Join-Path $unzipLocation "$($env:chocolateyPackageVersion)" # Append the package's version + +# Find the path to the bin directory to create the shims +if($env:DOTTY_CI_INSTALLATION) { + $scalaBinPath = Join-Path $unzipLocation 'bin' # Update this path if the structure inside the ZIP changes + } else { + $extractedDir = Get-ChildItem -Path $unzipLocation | Where-Object { $_.PSIsContainer } | Select-Object -First 1 + $scalaBinPath = Join-Path $unzipLocation $extractedDir | Join-Path -ChildPath 'bin' + } + +# Iterate through the .bat files in the bin directory and remove shims +Write-Host "Removing shims for .bat file from $scalaBinPath" +Get-ChildItem -Path $scalaBinPath -Filter '*.bat' | ForEach-Object { + $file = $_.FullName + Write-Host "Removing shim for $file..." + Uninstall-BinFile -Name $_.BaseName -Path $file +} diff --git a/project/Build.scala b/project/Build.scala index 198a4f23646d..35f6bc15095f 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -81,9 +81,9 @@ object DottyJSPlugin extends AutoPlugin { object Build { import ScaladocConfigs._ - val referenceVersion = "3.3.4" + val referenceVersion = "3.3.5" - val baseVersion = "3.3.5-RC1" + val baseVersion = "3.3.6-RC1" // LTS or Next val versionLine = "LTS" @@ -102,7 +102,7 @@ object Build { * set to 3.1.3. If it is going to be 3.1.0, it must be set to the latest * 3.0.x release. */ - val previousDottyVersion = "3.3.3" + val previousDottyVersion = "3.3.5" object CompatMode { final val BinaryCompatible = 0 @@ -582,9 +582,9 @@ object Build { libraryDependencies ++= Seq( "org.scala-lang.modules" % "scala-asm" % "9.7.0-scala-2", // used by the backend Dependencies.compilerInterface, - "org.jline" % "jline-reader" % "3.27.0", // used by the REPL - "org.jline" % "jline-terminal" % "3.27.0", - "org.jline" % "jline-terminal-jna" % "3.27.0", // needed for Windows + "org.jline" % "jline-reader" % "3.27.1", // used by the REPL + "org.jline" % "jline-terminal" % "3.27.1", + "org.jline" % "jline-terminal-jni" % "3.27.1", // needed for Windows ("io.get-coursier" %% "coursier" % "2.0.16" % Test).cross(CrossVersion.for3Use2_13), ), diff --git a/project/scripts/cmdScaladocTests b/project/scripts/cmdScaladocTests index 610f98a55890..b00cc37e71e6 100755 --- a/project/scripts/cmdScaladocTests +++ b/project/scripts/cmdScaladocTests @@ -16,7 +16,7 @@ DOTTY_NONBOOTSTRAPPED_VERSION=$(eval $DOTTY_NONBOOTSTRAPPED_VERSION_COMMAND | ta DOTTY_BOOTSTRAPPED_VERSION_COMMAND="$SBT \"eval println(Build.dottyVersion)\"" DOTTY_BOOTSTRAPPED_VERSION=$(eval $DOTTY_BOOTSTRAPPED_VERSION_COMMAND | tail -n 2 | head -n 1) -SOURCE_LINKS_REPOSITORY="scala/scala3" +SOURCE_LINKS_REPOSITORY="${GITHUB_REPOSITORY:-scala/scala3}" SOURCE_LINKS_VERSION="${GITHUB_SHA:-$DOTTY_BOOTSTRAPPED_VERSION}" "$SBT" "scaladoc/generateTestcasesDocumentation" > "$tmp" 2>&1 || echo "generated testcases project with sbt"