Fix file paths for exec launcher on Windows #3073
Open
+250
−108
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.
Motivation
I noticed that we were getting failures for launcher mode on Windows. After some research, it seems that the issue is with the long file path format (prefixed by
//?/
), which is a valid way of representing paths, but not suitable for command line execution.When we invoke
exec
with a path prefixed like that, it fails with an invalid argument error coming from the system.Implementation
I tried several things to normalize the file paths, but it doesn't seem like Ruby has anything available. None of these options worked:
Shellwords.escape
,File.expand_path
,File.realpath
.So I went with just deleting the prefix manually, which makes the new launch test pass.
Automated Tests
I added a new launch integration test, which would've surfaced this issue before to us. Additionally, I made some adjustments to existing tests.