Skip to content

default builds on windows failing due to outdated dependencies #638

@Arazu161

Description

@Arazu161

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    untriagedTeam member has to triage this issue - assign priority, type, and owner (if possible).

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions