Skip to content
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

Introduce 'SCALA_VERSIONS' config setting #1552

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

mateuszkuta256
Copy link
Contributor

Description

Extend scala_config repo with a scala_versions property

This is the first step for cross-compilation feature. User should be able to define multiple scala versions supported by the repository:

scala_config(
    scala_version = "3.2.1",
    scala_versions = [
        "2.13.12",
        "3.2.1",
    ],
)

the semantics will be:

  • scala_version - default version for repository. Will always fall back to this value when a rule does not specify the version explicitly
  • scala_versions - a list of all the versions supported by the repository

This change is backward-compatible. scala_versions is optional and default to [scala_version]

This PR also registers toolchain-related repositories with a versions suffix. It is needed to avoid collisions, e.g. when 2.13.12 and 3.3.1 are set, we will register two io_bazel_rules_scala_scala_compiler:
io_bazel_rules_scala_scala_compiler_2_13_12
io_bazel_rules_scala_scala_compiler_3_3_1

In the follow-up PR I'm gonna add a transition, that will select proper toolchains based on scala_version config

Motivation

Extracted from #1546

@mateuszkuta256
Copy link
Contributor Author

I think that build fails because of a problem with CI
first of all, works on my local macOs machine 😃
also noticed a difference in environment variables. For this PR:
BUILDKITE_LABEL="./test_rules_scala on :ubuntu: Ubuntu 20.04 LTS"
my another PR that passes, points:
BUILDKITE_LABEL="./test_rules_scala on :ubuntu: 20.04 LTS (OpenJDK 11, gcc 9.4.0)"

@lukaszwawrzyk
Copy link

@simuons Can you take a look at this PR? As @mateuszkuta256 said, it focuses on adding a possibility to define all repositories and toolchains with variants for specified scala versions. This is a base for actually enabling crossbuild in next PRs

@simuons
Copy link
Collaborator

simuons commented Mar 20, 2024

@mateuszkuta256 please rebase your pr to see if it passes build.

@simuons
Copy link
Collaborator

simuons commented Mar 20, 2024

Unfortunately CI still fails with jdk 21. I'm trying to solve that first and will get back to this PR

@aszady
Copy link
Contributor

aszady commented Mar 20, 2024

Hi there!
I will be continuing the work of @mateuszkuta256 in this (and the remaining) PRs.
It seems that after recovering accidentally removed cfgs, the build passes again!

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.

4 participants