Skip to content
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 file paths for exec launcher on Windows #3073

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

vinistock
Copy link
Member

@vinistock vinistock commented Jan 16, 2025

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.

Copy link
Member Author

vinistock commented Jan 16, 2025


How to use the Graphite Merge Queue

Add the label graphite-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock added bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes labels Jan 16, 2025
@vinistock vinistock force-pushed the 01-16-fix_file_paths_for_exec_launcher_on_windows branch 21 times, most recently from 5544e76 to de6ec13 Compare January 23, 2025 18:30
@vinistock vinistock force-pushed the 01-16-fix_file_paths_for_exec_launcher_on_windows branch from de6ec13 to 504d98e Compare January 23, 2025 18:37
@vinistock vinistock self-assigned this Jan 23, 2025
@vinistock vinistock marked this pull request as ready for review January 23, 2025 19:15
@vinistock vinistock requested a review from a team as a code owner January 23, 2025 19:16
@vinistock vinistock requested a review from andyw8 January 23, 2025 19:16
@vinistock vinistock requested review from st0012 and removed request for a team January 23, 2025 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant