generated from bazel-contrib/rules-template
-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: ts_proto_library
protoc cannot execute generated plugin js_binary *.bat file wrappers with forward-slashes
#667
Labels
bug
Something isn't working
Comments
willjschmitt
added a commit
to willjschmitt/rules_ts
that referenced
this issue
Aug 6, 2024
…dows. Fixes aspect-build#667 This takes the approach [rules_proto_grpc does](https://github.com/rules-proto-grpc/rules_proto_grpc/blob/9e61a4c3dfc78de163febe7530bd04dabfbcca16/modules/core/internal/protoc.bzl#L79-L83) to detect if we are building on Windows via the `host_path_separator`. protoc will fail to call into the plugins if they are expressed to protoc as forward-slash paths.
willjschmitt
added a commit
to willjschmitt/rules_ts
that referenced
this issue
Aug 6, 2024
…dows. Fixes aspect-build#667 This takes the approach [rules_proto_grpc does](https://github.com/rules-proto-grpc/rules_proto_grpc/blob/9e61a4c3dfc78de163febe7530bd04dabfbcca16/modules/core/internal/protoc.bzl#L79-L83) to detect if we are building on Windows via the `host_path_separator`. protoc will fail to call into the plugins if they are expressed to protoc as forward-slash paths.
willjschmitt
added a commit
to willjschmitt/rules_ts
that referenced
this issue
Aug 6, 2024
…dows. Fixes aspect-build#667 This takes the approach used [elsewhere in rules_ts](https://github.com/aspect-build/rules_ts/blob/da284adac1fcb6bd9da81ce5d4b3e29660ecface/ts/private/ts_project.bzl#L80) to detect if we are building on Windows. protoc will fail to call into the plugins if they are expressed to protoc as forward-slash paths.
willjschmitt
added a commit
to willjschmitt/rules_ts
that referenced
this issue
Aug 6, 2024
…dows. Fixes aspect-build#667 This takes the approach used [elsewhere in rules_ts](https://github.com/aspect-build/rules_ts/blob/da284adac1fcb6bd9da81ce5d4b3e29660ecface/ts/private/ts_project.bzl#L80) to detect if we are building on Windows. protoc will fail to call into the plugins if they are expressed to protoc as forward-slash paths.
willjschmitt
added a commit
to willjschmitt/rules_ts
that referenced
this issue
Nov 4, 2024
…dows. Fixes aspect-build#667 This takes the approach used [elsewhere in rules_ts](https://github.com/aspect-build/rules_ts/blob/da284adac1fcb6bd9da81ce5d4b3e29660ecface/ts/private/ts_project.bzl#L80) to detect if we are building on Windows. protoc will fail to call into the plugins if they are expressed to protoc as forward-slash paths.
willjschmitt
added a commit
to willjschmitt/rules_ts
that referenced
this issue
Nov 12, 2024
…dows. Fixes aspect-build#667 This takes the approach used [elsewhere in rules_ts](https://github.com/aspect-build/rules_ts/blob/da284adac1fcb6bd9da81ce5d4b3e29660ecface/ts/private/ts_project.bzl#L80) to detect if we are building on Windows. protoc will fail to call into the plugins if they are expressed to protoc as forward-slash paths.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
Building a
ts_proto_library
(with or without connect/query enabled) on Windows, we get an error suggesting'bazel-out' is not recognized as an internal or external command, operable program or batch file.
:which suggests the forward slashes are leading to a failure to find and execute, truncating the rest of the path. Digging in, running the command directly from a shell and toying with the paths, it looks like it's only a problem with the plugin paths and the rest of the toolchain handles the proto, out-dir, and descriptor paths just fine with forward slashes. Manually running the following fails:
while this succeeds to execute:
Version
Development (host) and target OS/architectures: Windows 10 64bit
Output of
bazel --version
: 7.1.1Version of the Aspect rules, or other relevant rules from your
WORKSPACE
orMODULE.bazel
file:Language(s) and/or frameworks involved: Typescript/protobuf/rule
How to reproduce
Build a `ts_proto_library` target on Windows
Any other information?
Workaround patch for v2.4.2, which does a hacky check if the path ends with
*.bat
and rewrites the forward slashes to backslashes (a la https://bazel.build/rules/windows#paths):Also looking at
rules_proto_grpc
it looks like they do a similar path mangling for plugin paths on Windows here: https://github.com/rules-proto-grpc/rules_proto_grpc/blob/9e61a4c3dfc78de163febe7530bd04dabfbcca16/modules/core/internal/protoc.bzl#L79-L83, although they look by looking atctx.configuration.host_path_separator
as the heuristic for WindowsThe text was updated successfully, but these errors were encountered: