-
Notifications
You must be signed in to change notification settings - Fork 93
Resolve injected client using package_config in AOT mode #2801
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
Closed
+31
−4
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What packageConfig does this actually find here? I'm confused about how there could be one when this is running in AOT mode so it makes me suspect this is just finding some random packageConfig on your local machine that happens to some entry in it that works.
That could explain why this doesn't work on CI when the test runs since it is starting from a clean state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nick's right. This method checks for
.dart_tool/package_config.jsonin the CWD, and if it can't find it, it checks for.dart_tool/package_config.jsonin the parent directory. If it still can't find it, it repeats the process until we hit the root directory.We somehow need to be able to determine the
package:dwdsversion being used, find thePUB_CACHE, and search for the directory for the correct version of DWDS. That's unfortunately going to be brittle since an installed, precompiledwebdevinstance doesn't require its dependencies to still be present in thePUB_CACHE.@dcharkes, this seems like something that should be solved by packaging
client.jswithwebdevas part ofdart install. Can you provide any guidance here? 😄There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have enough context here. DWDS is called from webdev directly?
Why are you finding the package config here? For what purpose?
I believe
webdevwas partially fixed to be able to work viadart install:DevToolsServer.serveDevTools()throws while spawning DTD when run in AOT mode #2759With
dart installyou cannot rely on:dart installsomething and then remove the Dart or Flutter SDK and the installed apps should keep working.)Can you explain in more detail what dwds is trying to do here?
I have no idea what this means.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are absolutely right guys! My apologies. I had mistakenly assumed that globally activated packages would preserve their
.dart_tool/package_config.jsonlayout relative to the generated snapshot inside~/.pub-cache/. I'll continue to investigate thisUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dart data assets are not here yet:
As discussed offline with @bkonyi, until data assets are in Dart standalone, the best way to bundle a file is to just have it as a string or base64 encoded byte array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After talking with @dcharkes, I think that #2768 is going to be the right path forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback guys! I will use the embedded string approach moving forward.