Skip to content

Conversation

@janwinkler1
Copy link
Contributor

@janwinkler1 janwinkler1 commented Jun 28, 2025

  • Upgrade Bazel version from 7.6.1 to 8.2.1
  • Add compatibility flags for Bazel 8's required bzlmod/WORKSPACE selection
  • Update test shell rules to use external rules_shell dependency (required in Bazel 8.0+ tests)
  • Pass all existing tests on all platforms except:
    • symlink_dir_test: IIUC this tests file watching through symlinks but Windows symlinks require admin privileges and behave fundamentally differently
    • incompatible_by_default_test : IIUC this tests platform constraint system with shell scripts; here, Windows users would typically use batch files/executables, not shell scripts for platform-specific binaries
  • I prioritized the upgrade to Bazel 8 over the test infrastructure improvement to get runtime compatibility because Bazel 8 does support WORKSPACE. IIUC Bazel 9 will not support WORKSPACE files anymore.

@achew22
Copy link
Member

achew22 commented Jun 28, 2025

Another avenue to look into is this and the code that generates WORKSPACE files. I think the latest version of bazel doesn't support WORKSPACE files at all and that may need to be updated to be a really bare bones module file file

@janwinkler1 janwinkler1 force-pushed the bump-bazel8 branch 7 times, most recently from eb7833c to afe8be5 Compare July 19, 2025 09:29
@janwinkler1 janwinkler1 changed the title WIP: Upgrade bazel version Add Bazel 8 compatibility with automatic bzlmod/WORKSPACE detection Jul 19, 2025
@janwinkler1 janwinkler1 marked this pull request as ready for review July 19, 2025 15:58
@janwinkler1 janwinkler1 requested a review from achew22 as a code owner July 19, 2025 15:58
@janwinkler1
Copy link
Contributor Author

@chickenandpork you mentioned me in #669. i wanted to ask you if you have some resources to help / experience with bazel builds on windows?

@chickenandpork
Copy link
Contributor

@chickenandpork you mentioned me in #669. i wanted to ask you if you have some resources to help / experience with bazel builds on windows?

I don't have Windows; haven't used it with any efficiency since 2004. I've simply got a lot of different MacOS. I'd likely blindly go at each item such as:

Error in fail: No suitable shell toolchain found:
        * if you are running Bazel on Windows, set the BAZEL_SH environment variable to the path of bash.exe

@janwinkler1 janwinkler1 force-pushed the bump-bazel8 branch 9 times, most recently from c412a1a to e19343c Compare August 8, 2025 12:50
@janwinkler1 janwinkler1 force-pushed the bump-bazel8 branch 7 times, most recently from 117c03e to 5265a11 Compare August 16, 2025 12:31
@janwinkler1
Copy link
Contributor Author

@achew22, I'd be happy to get a review now that CI is green. I spent some time debugging the Windows CI failures and found that migrating to the external rules_shell dependency (required in Bazel 8.0) fixed the issues.

(i ended up running an unsigned version of windows 10 in a vm on my linux machine, that helped a bit but it sure wasnt pretty)

@github-actions
Copy link

Stale pull request message

@achew22
Copy link
Member

achew22 commented Oct 16, 2025

@janwinkler1 is this still necessary? I was, maybe wrongly, under the impression that bzlmod was now supported. Can you correct my understanding?

@janwinkler1
Copy link
Contributor Author

@achew22 ty for your comment, i will look into it.

"-k",
"--nocache_test_results",
"--noenable_bzlmod",
"--noenable_workspace",
Copy link
Contributor

Choose a reason for hiding this comment

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

hey @janwinkler1 with changes like this, and where bazel changes an --experimental_<something> into a --<something> do we need to start determining the bazel version before choosing which arguments pass-through ? Or should we keep a super-set of all arguments, and let bazel figure out which don't work for its version ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chickenandpork TBH i am a bit torn on what the best approach might be. AFAIU

bazel 7: WORKSPACE is the default, BZLMOD needs to be enabled
bazel 8: WORKSPACE needs to be enabled, BZLMOD is the default
bazel 9: according to https://bazel.build/about/roadmap WORKSPACE might not even be supported anymore, BZLMOD is the default

therefore, if we want to cater all versions, something where bazel "figures this out itself" might be the best option? altough not the safest?

but ATM i was too invested with trying to fight windows, without a windows PC :/

Copy link
Contributor

Choose a reason for hiding this comment

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

@janwinkler1 your efforts are appreciated too -- I don't think any of us has a Windows box online :)

The CI presents its own challenges.

Are you on the ibazel slack channel ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chickenandpork thank you! no i am not :)

@janwinkler1 janwinkler1 force-pushed the bump-bazel8 branch 5 times, most recently from 9f160db to 0fd4e4f Compare October 31, 2025 14:47
@janwinkler1
Copy link
Contributor Author

@janwinkler1 is this still necessary? I was, maybe wrongly, under the impression that bzlmod was now supported. Can you correct my understanding?

@achew22 AFAIU yes it would still be necessary, though i have very limited time ATM to work on this.

it is directly related to the bazel 8. on ubuntu and macos we dont need the shell toolchains. on windows however we need them. therefore for our test harness we need to inject them into every ephemeral workspace.

does this answer your question? i wasnt entirely sure what you were referring to with "this"

@github-actions
Copy link

Stale pull request message

@achew22
Copy link
Member

achew22 commented Dec 31, 2025

My general rule of thumb is still in force here. Happy to take a look once we get CI green

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