bazelbuild / rules_scala

Scala rules for Bazel
Apache License 2.0
363 stars 278 forks source link

Add toggle-workspace.sh to turn WORKSPACE on/off #1638

Closed mbland closed 2 weeks ago

mbland commented 4 weeks ago

Description

Updates .bazelrc files to enable or disable WORKSPACE builds, or to restore their original state. Part of testing the Bzlmod work in #1482.

Motivation

Like scripts/sync-bazelversion.sh from #1629 does for .bazelversion files, this makes switching between WORKSPACE and Bzlmod builds fast, easy, and safe. This has made working ahead in my Bzlmod working branch while keeping in sync with pull requests landing on master much smoother.

That said, I understand if it isn't accepted. I'm happy to hold onto it in my working branch to suit my needs if folks don't find it generally useful.

mbland commented 2 weeks ago

@simuons Heh, for sure. We can remove it with all the WORKSPACE files in the same PR. That said, I'm setting up the Bzlmod changes to coexist with WORKSPACE, so we won't force users to migrate to Bzlmod right away.

Hopefully that compatibility will sweeten the deal and hasten the process—or we can go full YOLO and tell folks they need to add a MODULE.bazel with bazel_dep(name = "rules_scala", version = "7.0.0") next to their WORKSPACE if they want to upgrade. Personally, I'd be OK with that; this project has got me feeling in my bones why WORKSPACE must be destroyed. 🙂

BTW, assuming we're waiting for @liucijus to approve and merge?

mbland commented 2 weeks ago

Actually, I'm glad you didn't merge this yet. I'm closing it now in favor of #1644.