Skip to content

Conversation

@goderbauer
Copy link
Member

@goderbauer goderbauer commented Jan 24, 2018

Previously, the AssetBundle would use URIs and file paths interchangeable. This works on POSIX platforms because they are essentially the same there. However, on Windows they are not: A URI uses a / as path separator while a file path (on Windows) uses a \. As a result, assets could sometimes not be located on Windows.

This patch ensures that the platform-independent URIs are used everywhere to resolve this problem. It also removes the MemoryFileSystem from all asset-related tests, which has been hiding this problem (MemoreyFileSystem emulates POSIX and therefore hides problems specific to Windows file paths).

Fixes #14220.

@goderbauer goderbauer requested a review from tvolkert January 24, 2018 19:23
@mravn-google
Copy link
Contributor

This change appears to have made flutter_tools test execution subject to race conditions.

We claim here and here that one can run flutter_tools test by executing

../../bin/cache/dart-sdk/bin/pub run test

However, the non-hermetic file manipulation introduced by this change seems to require the use of the -j1 concurrency flag, similar to how our bots execute these tests.

@goderbauer
Copy link
Member Author

@mravn-google that's probably a side-effect of changing the tests to operate on the real file system. That change was necessary to make sure that the logic works on all platforms (especially Windows). Previously, the logic was only tested with posix-like paths and had many flaws on Windows.

Work-around: let's document that you need to specify -j1 like the bots do.

The real fix is: https://github.com/google/file.dart/issues/68.

@goderbauer goderbauer added the platform-windows Building on or for Windows specifically label Mar 5, 2018
@tvolkert
Copy link
Contributor

FYI, google/file.dart#68 was fixed yesterday, so we should be able now to make these tests run using MemoryFileSystem and thus not subject to race conditions.

@tvolkert tvolkert mentioned this pull request Apr 10, 2018
@tvolkert
Copy link
Contributor

As of #16442, the new package:file APIs are available for use in flutter.

DaveShuckerow pushed a commit to DaveShuckerow/flutter that referenced this pull request May 14, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

platform-windows Building on or for Windows specifically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to load asset in master

5 participants