Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Only synchronize used Dart sources to DevFS. #6668

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

Merged
merged 1 commit into from
Nov 3, 2016
Merged

Only synchronize used Dart sources to DevFS. #6668

merged 1 commit into from
Nov 3, 2016

Conversation

johnmccutchan
Copy link
Contributor

  • Remove the second full-sync on startup.
  • Always invoke the snapshotter to determine the minimal set of Dart sources used.
  • Only synchronize the used Dart sources to DevFS.
  • Detect syntax / file missing errors on the host and gate reloads / restarts.

@johnmccutchan
Copy link
Contributor Author

This needs a roll of the engine too but the bots are red, so, I'm putting this up for review in the meantime.

@johnmccutchan
Copy link
Contributor Author

@Hixie

/// Run cmd and return stdout on success.
///
/// Throws the standard error output if cmd exits with a non-zero value.
String runSyncAndThrowStdErrOnError(List<String> cmd) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we really should avoid adding more ways to run subprocesses... I don't suppose I can get you to embrace a yak shave that involves cleaning up this file, can I? :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed but I'm thinking more about instance field initializers...

/// Run cmd and return stdout on success.
///
/// Throws the standard error output if cmd exits with a non-zero value.
String runSyncAndThrowStdErrOnError(List<String> cmd) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably move away from "Sync" ways of running subprocesses, by the way, since they block progress meters.

} catch (e) {
return null;
rethrow;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped the try { } catch {}.

result = await _restartFromSources();
}
if (!result.isOk) {
printStatus('Try again after fixing the above error(s).', emphasis: true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonus points if you can figure out how many errors there were, and use error/errors appropriately instead of "error(s)". :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line count might be sufficient. I've added a TODO here.

bool updatedDevFS = await _updateDevFS();
if (!updatedDevFS) {
return new OperationResult(1, 'Dart Source Error');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extraneous braces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

if (_devFS != null) {
bool updatedDevFS = await _updateDevFS();
if (!updatedDevFS) {
return new OperationResult(1, 'Dart Source Error');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extraneous braces

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@Hixie
Copy link
Contributor

Hixie commented Nov 2, 2016

LGTM with comments

- [x] Remove the second full-sync on startup.
- [x] Always invoke the snapshotter to determine the minimal set of Dart sources used.
- [x] Only synchronize the *used* Dart sources to DevFS.
- [x] Detect syntax / file missing errors on the host and gate reloads / restarts.
@johnmccutchan johnmccutchan merged commit 594c4f9 into flutter:master Nov 3, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants