Skip to content

Combine repository override configuration with file existence#148

Merged
eed3si9n merged 1 commit into
sbt:1.xfrom
anatoliykmetyuk:fix/repository-override-or-property
Jul 15, 2026
Merged

Combine repository override configuration with file existence#148
eed3si9n merged 1 commit into
sbt:1.xfrom
anatoliykmetyuk:fix/repository-override-or-property

Conversation

@anatoliykmetyuk

@anatoliykmetyuk anatoliykmetyuk commented Jul 14, 2026

Copy link
Copy Markdown
Member

First step to solving sbt/sbt#9369. Second part of the fix is sbt/sbt#9452.

Prior work that changed the JVM flag processing semantics, thereby causing the issue: sbt/sbt#8761

The processing pipeline involved in the issue:

  1. sbt-launcher - configures the launcher to launch sbt. Propagates user-supplied configuration to the launcher:
    • config fieldoverride-build-repos: JVM flag sbt.override.build.repos=true
    • config field repository-override: File repositories_force
  2. launcher - consumes sbt-launcher-supplied config. Outputs isOverrideRepositories boolean flag based on the data supplied by (1) sbt-launcher.
  3. Project-specific sbt runtime. Launcher by the launcher. Sets a setting whether or not to override repos.
    • sbt 1: sets it to (2) launcher output flag.
    • sbt 2: (2) launcher output flag OR (1) JVM flag sbt.override.build.repos=true

The fix is two-fold:

  1. Teach launcher that repos are meant to be overridden either on flag or file presence. isOverrideRepositories = configuredOverrideRepos || repoConfigOverrideExists.
  2. In the sbt-launcher template, restore override-build-repos that was removed in https://github.com/sbt/sbt/pull/8761/changes#diff-f12f6468a3b483d79284e248213d4c1897f90ab80159db60343f9d907abf5188L28. This would propagate the JVM flag to the launcher to be used in isOverrideRepositories computation.

This PR is the implementation of the part 1 of the fix. Once launcher is released, we can bump the launcher version on sbt/sbt and implement step (2).

@eed3si9n eed3si9n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@eed3si9n eed3si9n merged commit 95963d7 into sbt:1.x Jul 15, 2026
1 check passed
@anatoliykmetyuk anatoliykmetyuk deleted the fix/repository-override-or-property branch July 15, 2026 04:53
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.

2 participants