Skip to content

bazel run //:gazelle failed with error obtaining VCS status: exit status 128 #2323

Closed

Description

@huyquanha

After updating gazelle to 0.48.0, I'm seeing the following issue when running bazel run //:gazelle

$ bazel run //:gazelle

Starting local Bazel server (9.0.0) and connecting to it...
INFO: Invocation ID: fad4bfa8-efb4-431c-b16d-3eac34f8b0aa
DEBUG: /Users/kevinh/Library/Caches/bazel/_bazel_kevinh/2951c33f4d1cb4dd3b7a5b6968513c86/external/gazelle+/internal/bzlmod/go_deps.bzl:819:18: No sum for github.com/bazel-contrib/bazel-gazelle/v2@2.0.0-1 found, run bazel run @rules_go//go -- mod tidy to generate it
INFO: Repo gazelle++non_module_deps+bazel_gazelle_go_repository_tools defined by rule go_repository_tools in @@gazelle+//internal:go_repository_tools.bzl
ERROR: /Users/kevinh/Library/Caches/bazel/_bazel_kevinh/2951c33f4d1cb4dd3b7a5b6968513c86/external/gazelle+/internal/go_repository_tools.bzl:113:13: An error occurred during the fetch of repository 'gazelle++non_module_deps+bazel_gazelle_go_repository_tools':
   Traceback (most recent call last):
        File "/Users/kevinh/Library/Caches/bazel/_bazel_kevinh/2951c33f4d1cb4dd3b7a5b6968513c86/external/gazelle+/internal/go_repository_tools.bzl", line 113, column 13, in _go_repository_tools_impl
                fail("failed to build tools: " + result.stderr)
Error in fail: failed to build tools: error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.
error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.
error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.
ERROR: no such package '@@gazelle++go_deps+com_github_bazelbuild_buildtools//build': failed to build tools: error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.
error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.
error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.
ERROR: /Users/kevinh/Library/Caches/bazel/_bazel_kevinh/2951c33f4d1cb4dd3b7a5b6968513c86/external/gazelle+/merger/BUILD.bazel:3:11: @@gazelle+//merger:merger depends on @@gazelle++go_deps+com_github_bazelbuild_buildtools//build:build in repository @@gazelle++go_deps+com_github_bazelbuild_buildtools which failed to fetch. no such package '@@gazelle++go_deps+com_github_bazelbuild_buildtools//build': failed to build tools: error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.
error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.
error obtaining VCS status: exit status 128
        Use -buildvcs=false to disable VCS stamping.
ERROR: Analysis of target '//:gazelle' failed; build aborted: Analysis failed
INFO: Elapsed time: 14.315s, Critical Path: 0.02s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target
FAILED: 
    Fetching repository @@rules_cc++cc_configure_extension+local_config_cc; starting 4s

I've tried adding the following to .bazelrc to no avail

common --repo_env=GOFLAGS=-buildvcs=false
common --action_env=GOFLAGS=-buildvcs=false

I cannot reproduce in 0.47.0, so it must be some changes in this new release.

Activity

  1. jayconrod commented on Apr 5, 2026

    @jayconrod
    Collaborator

    Could you give more information to help us reproduce this? I haven't seen this error before in this place.

    Are you running Gazelle in an environment where git is installed but is not configured (maybe committer email or name is not configured)? git exits with 128 sometimes in a case like that.

    We could set -buildvcs=false by default in this position, but it would be good to confirm the root cause.

  2. jayconrod commented on Apr 5, 2026

    @jayconrod
    Collaborator

    Maybe a .git directory in some parent directory of where the repository rule is executed?

  3. added 2 commits that reference this issue on Apr 5, 2026
    f0bd3b7
    ba1056d
  4. added a commit that references this issue on Apr 13, 2026
    e4383d6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions