Skip to content

Upgrade Scala 2.13 LTS to 2.13.16 #1700

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

bartoszkosiorek
Copy link
Contributor

Fixes: #1699

Description

Upgrade Scala 2.13 LTS to 2.13.16

Motivation

Copy link

google-cla bot commented Feb 14, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@bartoszkosiorek bartoszkosiorek force-pushed the master branch 4 times, most recently from daeae57 to dcaad25 Compare February 14, 2025 15:10
@bartoszkosiorek bartoszkosiorek marked this pull request as ready for review February 14, 2025 15:40
@bartoszkosiorek
Copy link
Contributor Author

bartoszkosiorek commented Feb 14, 2025

@WojciechMazur Could you please take a look at this Pull Request to make sure there is no mistakes (or missing dependency updates)?

Copy link
Contributor

@WojciechMazur WojciechMazur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@mbland mbland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated scripts/create_repository.py locally to use 2.13.16, and got almost the same result...except that the io_bazel_rules_scala_scala_compiler{,_2} entries in this pull request are missing the deps field:

    "io_bazel_rules_scala_scala_compiler": {
        "artifact": "org.scala-lang:scala-compiler:2.13.16",
        "sha256": "f59982714591e321ba9c087af2c8666e2f5fb92b11a0cef72c2c5e9b342152d3",
        "deps": [ 
            "@io_bazel_rules_scala_scala_library",
            "@io_bazel_rules_scala_scala_reflect",
            "@io_github_java_diff_utils_java_diff_utils",
            "@org_jline_jline",
        ],
    },

The script is set up not to update existing entries, which is why these were never added before (under the "if it ain't broke" principle). But if the script adds them on update, and the tests pass, we should be able to trust the new information.

At the same time, by the same principle, the tests do appear to be passing after this update without the new deps. So It's not a blocking issue, but I wanted to raise the point that if scripts/create_repository.py generates breaking changes, we should update the script; if its changes pass all tests, in general, we should let its output stand.

@bartoszkosiorek
Copy link
Contributor Author

The script is set up not to update existing entries, which is why these were never added before (under the "if it ain't broke" principle). But if the script adds them on update, and the tests pass, we should be able to trust the new information.

Thanks for Review and quality checks.
How did you force script to update existing entries?

@mbland
Copy link
Contributor

mbland commented Feb 14, 2025

Thanks for Review and quality checks. How did you force script to update existing entries?

To force an update of an artifact, you could remove its existing entry from the third_party/repositories/scala_*.bzl file, and scripts/create_repository.py will add it back. (Unless the artifact is marked "testonly"; these artifacts are manually updated, and the script leaves them alone.) You could also artificially set the entry to reference an older artifact version.


The script will leave alone any entry that already matches the version resolved by cs (executed by ArtifactResolver._fetch_artifact_data()), has "testonly": True set, or has a version newer than the resolved version. In other words, if the script doesn't see a need to update the artifact version, it won't update it at all.

If it does detect the need to update an artifact's entry, it will also set its deps field accordingly, even if it didn't have one before. Hence why org.scala-lang:scala-compiler:2.13.15 didn't have a deps field before (that was the existing version when I update and started running the script), and why org.scala-lang:scala-compiler:2.13.16 generates one.


Now that I think about it, we could add a flag to force an update even for matching versions, to add deps information. Or better yet, instead of adding that complexity, we could just delete all the generated entries and recreate them. I haven't felt the need to do this yet, since everything seems to be working as is, but we could.

@bartoszkosiorek
Copy link
Contributor Author

Thanks for Review and quality checks. How did you force script to update existing entries?

To force an update of an artifact, you could remove its existing entry from the third_party/repositories/scala_*.bzl file, and scripts/create_repository.py will add it back. (Unless the artifact is marked "testonly"; these artifacts are manually updated, and the script leaves them alone.) You could also artificially set the entry to reference an older artifact version.

I have updated the dependencies, to be aligned with your results.
Thanks.

In another branch I have also removed all dependencies, and regenerate it from scratch. A lot of dependencies were simply removed. I will create separate Pull Request with such changes.

Copy link
Collaborator

@simuons simuons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@simuons simuons merged commit 2e59e88 into bazel-contrib:master Feb 26, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please add support to Scala 2.13.16 and make new release
4 participants