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
fix: convert forward slashes to backslashes for protoc plugins on Windows. #668
Open
willjschmitt
wants to merge
3
commits into
aspect-build:main
Choose a base branch
from
willjschmitt:fix/667/windows-backslashes-ts_proto_library
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix: convert forward slashes to backslashes for protoc plugins on Windows. #668
willjschmitt
wants to merge
3
commits into
aspect-build:main
from
willjschmitt:fix/667/windows-backslashes-ts_proto_library
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Would you be able to add some initial |
willjschmitt
force-pushed
the
fix/667/windows-backslashes-ts_proto_library
branch
from
November 4, 2024 19:22
3ac906a
to
461bb13
Compare
…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
force-pushed
the
fix/667/windows-backslashes-ts_proto_library
branch
from
November 12, 2024 22:48
461bb13
to
03327a1
Compare
Now that #671 is merged in, I rebased and the same unit test should apply, showing a noop on Linux and now should work on Windows |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #667
This takes the approach rules_proto_grpc does 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. Alternatively, we could make this more limited like my patch in the linked issue to check.bat
file extensions, which is fragile in its own way, but works for the given use case.Changes are visible to end-users: no
Test plan
bazel build //:foo_ts_pb
. This PR's change is a patch in that repo, so I could also change that to directly use my commit instead, if preferredThere aren't any tests as far as I can tell currently for ts_proto_library, so my manual test is the best I can currently offer, and it's not clear if the Windows test runners are fully active, but I'd be happy to write a test for initial coverage on
ts_proto_library
if desired