Skip to content

Bazel build on windows fails with error from swift #8301

@peakschris

Description

@peakschris

I'm not sure if it's supposed to work, but the bazel build of latest on windows is broken:

git clone flatbuffers
cd flatbuffers
bazel build //...
INFO: Repository build_bazel_rules_swift_local_config instantiated at:
  D:/workdir/flatbuffers/WORKSPACE:53:25: in <toplevel>
  external/build_bazel_rules_swift/swift/repositories.bzl:114:11: in swift_rules_dependencies
  build_bazel_rules_swift/swift/repositories.bzl:32:18: in _maybe
Repository rule swift_autoconfiguration defined at:
  external/build_bazel_rules_swift/swift/internal/swift_autoconfiguration.bzl:302:42: in <toplevel>
ERROR: An error occurred during the fetch of repository 'build_bazel_rules_swift_local_config':
   Traceback (most recent call last):
        File "external/build_bazel_rules_swift/swift/internal/swift_autoconfiguration.bzl", line 300, column 32, in _swift_autoconfiguration_impl
                _create_linux_toolchain(repository_ctx)
        File "external/build_bazel_rules_swift/swift/internal/swift_autoconfiguration.bzl", line 212, column 13, in _create_linux_toolchain
                fail("ERROR: rules_swift uses Bazel's CROSSTOOL to link, but Swift " +
Error in fail: ERROR: rules_swift uses Bazel's CROSSTOOL to link, but Swift requires that the driver used is clang. Please set `CC=clang` in your environment before invoking Bazel.

We have a requirement to compile the flatbuffers library with msvc, so switching to clang is a non-starter for us. Is swift a real prerequisite for C++?

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