Skip to content

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

@7lb

Description

@7lb

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues/PRs to ensure it has not already been reported or fixed.
  • I have verified that I am using the latest version of Scoop and corresponding bucket.

Package Name

bazel

Expected/Current Behaviour

After installing bazel via scoop, I noticed the BAZEL_SH environment variable pointed at a non-existing path.

More specifically, it pointed to C:\Users\<user>\scoop\apps\msys2\current\usr\bin\bash.exe but I don't have an msys2 directory inside scoop\apps at all.

In powershell, Get-Command bash returns C:\Users\<user>\scoop\shims\bash.exe.

Bazel uses BAZEL_SH at the very least to resolve genrule() calls, which is how I noticed the issue. Setting BAZEL_SH to the path returned by Get-Command allowed bazel to correctly resolve genrule() calls.

Steps to Reproduce

PS> scoop install bazel
PS> gci env:* | Select-String BAZEL

Possible Solution

Scoop should set the BAZEL_SH variable according to the result of running Get-Command bash

Scoop and Buckets Version

PS> scoop --version
Current Scoop version:
b588a06e (HEAD -> master, tag: v0.5.3, origin/master, origin/HEAD) chore(release): Bump to version 0.5.3 (resync) (#6436)

'main' bucket:
65972aee6 (HEAD -> master, origin/master, origin/HEAD) jdtls: Update to version 1.55.0-202511271007

'extras' bucket:
2861015e31 (HEAD -> master, origin/master, origin/HEAD) treesheets: Update to version 2782

Scoop Config

PS> scoop config

last_update         scoop_repo                              scoop_branch
-----------         ----------                              ------------
2025-11-27 14:30:45 https://github.com/ScoopInstaller/Scoop master

PowerShell Version

PS> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.5.4
PSEdition                      Core
GitCommitId                    7.5.4
OS                             Microsoft Windows 10.0.26200
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Additional Softwares

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions