Always use POSIX paths for generated CMake files#65493
Always use POSIX paths for generated CMake files#65493stuartmorgan-g merged 1 commit intoflutter:masterfrom
Conversation
The Windows plugin CMake generation had code to ensure that the paths written to it used POSIX separators, but the Linux version didn't; that meant that plugin updates run on Windows machines would corrupt the generated (but checked in) Linux CMake file. This change shares that code so that both will use POSIX paths regardless of what OS they are generated on. Fixes flutter#64591
|
The way I got the test setup working to allow running a test with the Windows filesystem is kind of ugly; if you have a cleaner suggestion that would be great. (I couldn't find obvious precedent for this in other tests; some set the test-fixture-wide |
|
Generally what I've been doing in tests that don't use the context is to just create the filesystem in each test case (if the test actually depends on the context), or just use the posix context in setup if the test is filesystem/context agnostic. Unfortunately I think the plugins tests are a complete mess right now, but what you've got is a reasonable addition IMO. |
jonahwilliams
left a comment
There was a problem hiding this comment.
LGTM but make sure the tests pass once the infrastructure issue is resolved
Description
The Windows plugin CMake generation had code to ensure that the paths
written to it used POSIX separators, but the Linux version didn't; that
meant that plugin updates run on Windows machines would corrupt the
generated (but checked in) Linux CMake file.
This change shares that code so that both will use POSIX paths
regardless of what OS they are generated on.
Related Issues
Fixes #64591
Tests
I added the following tests: Ensures that both Windows and Linux files have the correct separators when run with a Windows-style filesystem.
Checklist
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.