Skip to content

bazel: set BAZEL_SH only when msys2 bash exists - #8323

Open
l46983284-cpu wants to merge 1 commit into
ScoopInstaller:masterfrom
l46983284-cpu:fix/bazel-bazel-sh-7402
Open

bazel: set BAZEL_SH only when msys2 bash exists#8323
l46983284-cpu wants to merge 1 commit into
ScoopInstaller:masterfrom
l46983284-cpu:fix/bazel-bazel-sh-7402

Conversation

@l46983284-cpu

Copy link
Copy Markdown
Contributor

Prerequisites

  • Use conventional PR title: <manifest-name[@version]|chore>: <general summary of the pull request>
  • I have read the Contributing Guide

Summary

bazel used env_set to always write BAZEL_SH to $(appdir msys2)/current/usr/bin/bash.exe. If msys2 was only suggested (not installed), users got a non-existent path (#7402).

This PR:

  • removes unconditional env_set
  • sets BAZEL_SH in installer only when that bash path exists
  • removes BAZEL_SH on uninstall
  • documents manual override when using another bash (e.g. git)

Closes #7402

Test plan

  • bazel.json parses as JSON
  • Windows: install without msys2 → no broken BAZEL_SH
  • Windows: install with msys2 → BAZEL_SH points at msys2 bash

env_set always wrote $(appdir msys2)/.../bash.exe even when msys2
was not installed, leaving a broken BAZEL_SH (ScoopInstaller#7402). Set the var
only after Test-Path, document manual override, remove on uninstall.

Closes ScoopInstaller#7402

Signed-off-by: Alex Chen <l46983284@gmail.com>
@l46983284-cpu

Copy link
Copy Markdown
Contributor Author

/verify

@github-actions

Copy link
Copy Markdown
Contributor

All changes look good.

Wait for review from human collaborators.

bazel

  • Lint
  • Description
  • License
  • Hashes
  • Checkver
  • Autoupdate
  • Autoupdate Hash Extraction

Check the full log for details.

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 47b987ac-2456-4f0c-999c-8a09551f7691

📥 Commits

Reviewing files that changed from the base of the PR and between 9806b94 and 0ef150a.

📒 Files selected for processing (1)
  • bucket/bazel.json

Summary by CodeRabbit

  • Bug Fixes
    • Improved Bazel installation handling for the BAZEL_SH environment variable.
    • BAZEL_SH is now configured automatically only when the expected MSYS2 Bash executable is available.
    • Added guidance for manually configuring BAZEL_SH when MSYS2 is not installed or an alternative Bash source is used.
    • Uninstallation now reliably removes the configured BAZEL_SH setting.

Walkthrough

Changes

Bazel shell configuration

Layer / File(s) Summary
Conditional BAZEL_SH setup
bucket/bazel.json
Installation notes document the msys2 requirement and issue reference. Installer scripts set BAZEL_SH only when the expected bash.exe exists, otherwise prompting manual configuration; uninstallation removes the recorded variable.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR fixes the msys2-path bug, but it does not implement the issue's requested Get-Command bash resolution. Set BAZEL_SH from the detected bash path when msys2 is absent, rather than only skipping the variable or requiring manual setup.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main manifest change.
Description check ✅ Passed The description includes the required summary, prerequisites, issue link, and test plan.
Out of Scope Changes check ✅ Passed The changes stay focused on BAZEL_SH handling and manifest notes, with no clear unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: bazel sets wrong BAZEL_SH env var on install

1 participant