Skip to content

Conversation

@chingjun
Copy link
Contributor

@chingjun chingjun commented Jan 29, 2022

...using an rsync-like algorithm. This reduces the data that needs to be
transferred, and removes the need to retransfer the assets on subsequent
calls on flutter start.

Also, the reason I'm not using rsync directly is to not introduce any external dependencies, or in case we need to do this on a Windows machine.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard flutter-dashboard bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 29, 2022
@chingjun
Copy link
Contributor Author

chingjun commented Feb 4, 2022

Friendly ping on this, PTAL, thanks :)

Copy link
Contributor

Choose a reason for hiding this comment

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

delete?

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

Copy link
Contributor

Choose a reason for hiding this comment

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

what's the difference here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've changed it to use the same temp directory every time the app runs, so that we could reuse the file that is transferred from the previous run.

Copy link
Contributor

Choose a reason for hiding this comment

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

ahh, makes sense.

Copy link
Contributor

Choose a reason for hiding this comment

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

could you leave a breadcrumb comment, lest someone revert this in a "cleanup"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point about leaving a comment, just added. Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

should we put a debug log if _deltaFileTransfer == true && rollingHashResultJson == null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is normal when it's the first run. But it's probably still a good idea to add a log, just added, thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

oh good point about first run.

Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

Also, the reason I'm not using rsync directly is to not introduce any external dependencies, or in case we need to do this on a Windows machine.

Can we rsync when it is available, and fall back to this when it's not? The tool already uses it in a few places.

if (_processManager.canRun('rsync')) {

@christopherfujino
Copy link
Contributor

Also, the reason I'm not using rsync directly is to not introduce any external dependencies, or in case we need to do this on a Windows machine.

Can we rsync when it is available, and fall back to this when it's not? The tool already uses it in a few places.

if (_processManager.canRun('rsync')) {

This is a good suggestion (we might as well use rsync if it's present on the path)

@chingjun
Copy link
Contributor Author

Sorry for the late reply, missed the email from two weeks ago :(

Currently rsync is only used for more efficiently transferring files within a single machine.

Remote rsync requires different setup. We need to make sure that rsync is available on both ends and that they are compatible (rsync protocol is at version 31 now), and then (without assuming that there is SSH connection available between both ends) start an "rsync daemon" on one machine, forward the port and start an "rsync client" on the other end.

I'm mostly worried about the possible edge cases that we'll need to cover, and the security implications of doing this.

IMO if we already have to implement the algorithm in the flutter_tools, it is better to use it for all platforms to increase the chance of it being used, therefore higher chance that any bug will be found and fixed.

What do you think?

@christopherfujino
Copy link
Contributor

Sorry for the late reply, missed the email from two weeks ago :(

Currently rsync is only used for more efficiently transferring files within a single machine.

Remote rsync requires different setup. We need to make sure that rsync is available on both ends and that they are compatible (rsync protocol is at version 31 now), and then (without assuming that there is SSH connection available between both ends) start an "rsync daemon" on one machine, forward the port and start an "rsync client" on the other end.

I'm mostly worried about the possible edge cases that we'll need to cover, and the security implications of doing this.

IMO if we already have to implement the algorithm in the flutter_tools, it is better to use it for all platforms to increase the chance of it being used, therefore higher chance that any bug will be found and fixed.

What do you think?

Ahh, good point. Makes sense to me.

@chingjun
Copy link
Contributor Author

Jenn, what do you think @jmagman ?

@jmagman
Copy link
Member

jmagman commented Feb 23, 2022

Jenn, what do you think @jmagman ?

Whatever you and @christopherfujino think to do here rsync or not works for me. 🙂

@christopherfujino
Copy link
Contributor

Jenn, what do you think @jmagman ?

Whatever you and @christopherfujino think to do here rsync or not works for me. slightly_smiling_face

This PR LGTM as is; however merging is blocked by your requested changes @jmagman

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

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

Jenn, what do you think @jmagman ?

Whatever you and @christopherfujino think to do here rsync or not works for me. slightly_smiling_face

This PR LGTM as is; however merging is blocked by your requested changes @jmagman

Ah, sorry, missed that.

Using an rsync-like algorithm. This reduces the data that needs to be
transferred, and removes the need to retransfer the assets on subsequent
calls on flutter start.
@chingjun
Copy link
Contributor Author

Thanks!

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 23, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Feb 23, 2022
clocksmith pushed a commit to clocksmith/flutter that referenced this pull request Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants