Skip to content

Conversation

@WojciechMazur
Copy link
Contributor

@WojciechMazur WojciechMazur commented Dec 31, 2025

  • Restores clean alias which cleans both bootstrapped and unbootstrapped project - currently running sbt clean does only clean unbootstrapped. Additionally extends it to also clean dist and test utilities projects
  • Restores repl as alias to scala3-repl/run
  • Restores publishLocal as alias to scala3-bootstrapped/publishLocal

All of these aliases were defined in 3.7.4 build

scala3/project/Build.scala

Lines 3502 to 3512 in 40be760

nonBootstrappedSettings(
addCommandAlias("run", "scala3-compiler/run"),
// Clean everything by default
addCommandAlias("clean", ";scala3/clean;scala3-bootstrapped/clean;scala2-library-bootstrapped/clean;scala2-library-cc/clean"),
// `publishLocal` on the non-bootstrapped compiler does not produce a
// working distribution (it can't in general, since there's no guarantee
// that the non-bootstrapped library is compatible with the
// non-bootstrapped compiler), so publish the bootstrapped one by
// default.
addCommandAlias("publishLocal", "scala3-bootstrapped/publishLocal"),
repl := (`scala3-compiler-bootstrapped` / repl).value,

Fixes publishing to Sonatype Central be creating 2 new aliases, each dedicated to publish artifacts to either org.scala-lang or org.scala-js. Sonatype Central validation would fail the release if deployment defines more then 1 namespace/organization in the artifacts, (see 1987102)

Each of releaseOrgScalaLang or releaseOrgScalaJs alias would publish are artifacts for given organization.
It also cleans target/sona-staging which cannot be cleaned - it uses a fixed target/sona-staging path while root project overrides target directory (see 2968bbf)

@WojciechMazur WojciechMazur force-pushed the build/root-project-aliases branch from b10f90c to 59199e9 Compare December 31, 2025 00:41
Copy link
Member

@hamzaremmal hamzaremmal left a comment

Choose a reason for hiding this comment

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

This was removed for a reason. This is completely unintuitive and we should not bring it back. I've spent a lot of time to understand this build and we should not undo everything I've done without a good enough reason.

@hamzaremmal
Copy link
Member

I'd be happy to discuss this more during one of the core's meetings or a on a call but please don't undo what it took me a long time to untangle and to make work in an intuitive way without any surprises and gotchas.

@tgodzik
Copy link
Contributor

tgodzik commented Dec 31, 2025

This was removed for a reason. This is completely unintuitive and we should not bring it back. I've spent a lot of time to understand this build and we should not undo everything I've done without a good enough reason.

These are just aliases for existing commands, why is this a problem? Which ones are you against? Aliases overall? If not aliases, what should be done? Always full commands? I think we need a bit more feedback here 😅

// A single Sonatype Central deployment cannot mix artifacts from different namespaces
// Compiler artifacts (org.scala-lang) cannot be mixed with Scala.js artifacts (org.scala-js)
// Explicit deletation of target/sona-staging is needed becouse root project overrides targetDirectory, while `localStaging` uses fixed target/sona-staging path
addCommandAlias("releaseOrgScalaLang", Seq(
Copy link
Contributor

Choose a reason for hiding this comment

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

@hamzaremmal for example, how would you solve this one instead? Have the full command type in somewhere?

Copy link
Member

Choose a reason for hiding this comment

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

This one is fine.

Copy link
Member

Choose a reason for hiding this comment

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

My point was made specifically about the others.


.settings( // aliases for root project
// Clean everything by default, overrides default `scala3-nonbootstrapped/clean` which would leave remaining projects with stale artifacts
addCommandAlias("clean", (Seq(
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we shouldn't override the clean and just add something that is obviously an alias? Like cleanAllProjects?

Copy link
Member

Choose a reason for hiding this comment

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

Those are the ones are very problematic, they had completely impredictable behaviour. As I said, I would be happy to discuss this further over a call.

@WojciechMazur
Copy link
Contributor Author

What actually is intuitive right now is that when I've worked on #24843 every change in the compiler required me to clean sources manually (becouse clean was not working as intended, so ended up with find -name target | rm -r) and compilation of stdlib was failing due to stale artifacts.

It seems like build is borked recently, I agree that we should get to the clue of the problem, instead of adjusting aliases, but it's a quick fix to current problems while we can think about proper solution.

The proper solution would be to have a correct aggregation of projects in actual root project. Right now root aggregates only non-bootstrapped projects, leaving bootstrapped and dist/test helpers untouched.

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.

3 participants