Skip to content

default builds on windows failing due to outdated dependencies #638

Open

Description

@oli-ej

Building a simple project (i.e., a single cc_binary(..) such as the bazelbuild/examples/cpp-tutorial projects) fails on windows with the following error:

ERROR: .../external/rules_swift++non_module_deps+build_bazel_rules_swift_local_config/BUILD:54:58: name 'arch' is not defined
ERROR: package contains errors: : name 'arch' is not defined

Confused as to why rules_swift was getting involved in a simple c++ only project being build with MSVC I did some digging.

Bazel mod graph (with some entries omitted to keep it brief) gives:

<root> (@_)
└───rules_cc@0.2.17
    ├───....
    └───protobuf@33.4
        ├───....
        ├───rules_apple@4.1.0
        │   ├───....
        │   └───rules_swift@3.1.2

The specific issue with rules_swift was fixed in Nov 2025, and the fix was included in release 3.4.

Although doing a single_verision_override() to pin rules_swift to a newer version works, rules_swift is only getting included because of the dep that protobuf has on rules_apple. But protobuf dropped that requirement with version 34.0.

so TLDR, rules_cc is pulling in an old version of protobuf which pulls in an old version of rules_swift which doesn't run on windows even if all you want to do is build a simple cc_binary()

I see that rules_cc/MODULE.bazel only specifies protobuf 27.0, so I'm assuming Version 33.4 is coming from somewhere else in the dep graph (there are a number of circular dependencies on protobuf inside the protobuf dep graph).

Activity

  1. added
    untriaged
    on May 15, 2026
  2. added
    P2
    and removed
    untriaged
    on Sep 11, 2026
  3. pzembrod commented on Sep 11, 2026

    @pzembrod
    Collaborator

    We are considering to establish a routine to update the dependencies in bazelbuild/examples after releases of rules so that https://buildkite.com/bazel/bazel-bazel-examples should catch these things in the future.

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

    P2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions