Skip to content

Tools don't run under windows #78

Closed
@peakschris

Description

@peakschris

I can see that, on Windows, executable versions of tools such as buf.exe exist. But running them in the toolchain fails. This is impacting integrations such as rules_lint which refuse to lint protobuf files on windows (aspect-build/rules_lint#294)

clone rules_buf latest
cd examples\version
bazel run //:print

INFO: Analyzed target //:print (2 packages loaded, 6 targets configured).
ERROR: D:/workdir/rules_buf/examples/version/BUILD.bazel:19:18: Middleman _middlemen/print-runfiles failed: missing input file '@@rules_buf_toolchains//:buf'
ERROR: D:/workdir/rules_buf/examples/version/BUILD.bazel:19:18: Middleman _middlemen/print-runfiles failed: 1 input file(s) do not exist
Target //:print failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: D:/workdir/rules_buf/examples/version/BUILD.bazel:19:18 Middleman _middlemen/print-runfiles failed: 1 input file(s) do not exist
INFO: Elapsed time: 1.249s, Critical Path: 0.01s
INFO: 4 processes: 4 internal.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

If I edit toolchain.bzl and change line 61:
from: cli = str(Label("//:"+ cmd)),
to: cli = str(Label"//:" + cmd + ext)),

Then it gets further, but fails with:

FATAL: ExecuteProgram(D:\udu\b\myor77df\execroot\_main\bazel-out\x64_windows-fastbuild\bin\print) failed: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("D:\udu\b\myor77df\execroot\_main\bazel-out\x64_windows-fastbuild\bin\print"): %1 is not a valid Win32 application.
 (error: 193)

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