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

sbt metabuild support #29127

Open
rarkins opened this issue May 17, 2024 Discussed in #29083 · 2 comments
Open

sbt metabuild support #29127

rarkins opened this issue May 17, 2024 Discussed in #29083 · 2 comments
Assignees
Labels
manager:sbt SBT package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented May 17, 2024

Discussed in #29083

Originally posted by ArtyomGabeev May 15, 2024

What would you like help with?

I think I found a bug

How are you running Renovate?

Self-hosted

If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.

Bitbucket

Please tell us more about your question or problem

sbt has an idea of meta-builds. One of primary usage is to organize dependency management in one place, as documented here:
https://www.scala-sbt.org/1.x/docs/Organizing-Build.html#Tracking+dependencies+in+one+place

The issue comes with scalaVersion resolution.
scalaVersion can be defined only in build.sbt file, e.g.:

ThisBuild / scalaVersion := "3.4.1"

But when there are scala dependencies in Dependencies.scala file from meta-build project directory, there is no information about scala version. We need somehow to propagate this information.

Options considered:

  1. Create some anchor (e.g. via renovate comment) which can be used to specify scala version at top of Dependencies.scala file - the issue is that we will have several places with scalaVersion defined
  2. Pass scala version as sbt manager parameter - same problem, several places with scalaVersion needs to be synced by developers
  3. Parse build.sbt and extract scalaVersion from root file, pass scalaVersion when parsing other files - this is ideal solution, but I'm not sure about implementation feasibility.

Notes:
I'm looking for advice how to proceed and can contribute the fix.

Logs (if relevant)

Logs

Replace this text with your logs, between the starting and ending triple backticks

@rarkins rarkins added type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others manager:sbt SBT package manager labels May 17, 2024
@rarkins
Copy link
Collaborator Author

rarkins commented May 17, 2024

The sbt manager already uses extractAllPackageFiles(), which means it processes every file at the same time and can apply "shared" values before returning them. For example there's already a loop where Renovate iterates over each detected file and applies registryUrls settings:

for (const pkg of packages) {

We could perhaps reuse that loop to apply scala version settings for meta builds

@ArtyomGabeev
Copy link
Contributor

Hi, @rarkins

I've opened PR some time ago, but no reviewers are assigned.
May I ask for a review?

Thanks.

@rarkins rarkins added the status:in-progress Someone is working on implementation label Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manager:sbt SBT package manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others status:in-progress Someone is working on implementation type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

2 participants