Skip to content

Hover: offline building #169

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
chengxuncc opened this issue Jun 26, 2019 · 3 comments · Fixed by go-flutter-desktop/hover#12
Closed

Hover: offline building #169

chengxuncc opened this issue Jun 26, 2019 · 3 comments · Fixed by go-flutter-desktop/hover#12
Labels
enhancement New feature or request hover

Comments

@chengxuncc
Copy link

Flutter version

Flutter 1.7.10-pre.18 • channel master • https://github.com/flutter/flutter.git
Framework • revision 577c2fc48c (20 hours ago) • 2019-06-26 05:40:55 +1200
Engine • revision ae8e6d9f46
Tools • Dart 2.4.0

Advise

It can be slow when using hover run to debug golang code, which usually need to reboot many times. Especially when my network become bad or going down, it keep killing my time. I think hover run shouldn't execute go: finding github.com/go-gl/glfw latest every time, it wastes time.

Steps to Reproduce

hover run
@pchampio
Copy link
Member

pchampio commented Jun 26, 2019

flutter build bundle is also executed every time (about a second).
Having a --cached flag to hover run sound a good fix to me.

Lines of hover that trigger the sluggishness. (you can remove them and run go install to install a "home made" version of hover)

@pchampio pchampio added enhancement New feature or request hover labels Jun 26, 2019
@pchampio
Copy link
Member

pchampio commented Jun 28, 2019

I take back what I said about --cached.

Having a periodic go get -u (one a week for example) is the best way to resolve this issue.
Plus we could use the same trigger to check for changes on hover itself.

@GeertJohan
Copy link
Member

Agreed, perhaps the go get should be less aggressive. Although a weekly go get will result in unexpected behavior. Either we should run it, or we don't and leave go get to the user.

pchampio added a commit to go-flutter-desktop/hover that referenced this issue Jul 19, 2019
  - fixes: go-flutter-desktop/go-flutter#169
 - provide a `hover upgrade `command (like flutter upgrade)
 - every 2 days a check is made to see if the current project tags uses the last
   github release. if a new release is available print a message about
   `hover upgrade`
 - adds more debug message, 'bundling flutter', 'compiling
   go-flutter', 'running project',...
 - only print the 'channel beta' message if the user is on master,
  if the user was on stable the message was printed for no reason.

The behaviour of `hover run` and `hover build` is the same as before
when `--branch` is provided.
But there is a little twist, if the current version is a valid release
(available on github), `hover run` will not overwrite the 'go-flutter'
version. Example:

```
$ hover run --branch '@v0.20.0'
$ hover run # no upgrade trigged running on v0.20.0, at some point you
            # will get a `hover upgrade` notice

$ hover upgrade # user has to run to upgrade away from v0.20.0

$

$ hover run --branch '@master'
$ hover run # auto upgrade trigged! Not a real release.
            # If the user hasn't access to internet, fail silently and
            # keep using '@master'
```

To check every two days, a hidden file `./desktop/.last_goflutter_check`
is created on a project bases, the file contains a timestamps indicating
the last hover update check.

About the hover repo:
A empty go.mod file has been added to hover/assets/app/ this prevent adding
`go-flutter` as a go mod dependency. (because `go mod tidy` was peeking
listing hover/asset/options.go as a hover code file)
@pchampio pchampio changed the title Speed up hover run Hover: offline building Jul 23, 2019
pchampio added a commit to go-flutter-desktop/hover that referenced this issue Aug 30, 2019
*  - hover doesn't update on every run
  - fixes: go-flutter-desktop/go-flutter#169
 - provide a `hover upgrade `command (like flutter upgrade)
 - every 2 days a check is made to see if the current project tags uses the last
   github release. if a new release is available print a message about
   `hover upgrade`
 - adds more debug message, 'bundling flutter', 'compiling
   go-flutter', 'running project',...
 - only print the 'channel beta' message if the user is on master,
  if the user was on stable the message was printed for no reason.

The behaviour of `hover run` and `hover build` is the same as before
when `--branch` is provided.
But there is a little twist, if the current version is a valid release
(available on github), `hover run` will not overwrite the 'go-flutter'
version. Example:

```
$ hover run --branch '@v0.20.0'
$ hover run # no upgrade trigged running on v0.20.0, at some point you
            # will get a `hover upgrade` notice

$ hover upgrade # user has to run to upgrade away from v0.20.0

$

$ hover run --branch '@master'
$ hover run # auto upgrade trigged! Not a real release.
            # If the user hasn't access to internet, fail silently and
            # keep using '@master'
```

To check every two days, a hidden file `./desktop/.last_goflutter_check`
is created on a project bases, the file contains a timestamps indicating
the last hover update check.

About the hover repo:
A empty go.mod file has been added to hover/assets/app/ this prevent adding
`go-flutter` as a go mod dependency. (because `go mod tidy` was peeking
listing hover/asset/options.go as a hover code file)

* chore: add last_goflutter_check into gitignore

* feat:run omit building flutter project or embedder

When using hover only for building plugin the `flutter build bundle`
slows down the process. Add a flag to omit `flutter build bundle`.

When making changes to the flutter package only, omit `go build
'go-flutter'` with the flag omit-embedder.

* doc: expose the branch hover flag

* fix runcmd and add observatory-port

* ecosystem consideration: prefixing files with 'go-' (#13)

* chore: add last_goflutter_check into gitignore

* ecosystem consideration: prefixing files with 'go-'

* add --path flag to all commands

* chore: fix indent

* Update init.go

* address the PR comments

* address PR comment

* move enginecache func to new versioncheck package

* updates the hover's gitignore file when migrating

adds the '.last_goflutter_check' entry to the go/.gitignore file if
needed

* internal/versioncheck: (chore) Renamed utility function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hover
Development

Successfully merging a pull request may close this issue.

3 participants