-
Notifications
You must be signed in to change notification settings - Fork 81
Add AOT building #147
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
Add AOT building #147
Conversation
0ddcac2
to
dc8eb8f
Compare
Awesome work!!!
I don't think it matter that much, the shell lib seems to only be slightly bigger than the 'raw' engine embedding ABI lib. The issues I see:
The usage of the shell lib instead of embedding ABI is LGTM for me. go-flutter is capable of AOT and it will allow more people to test AOT. |
Testing this out based on @jld3103 request. MacOS 10.15.5 Build: When I run the output bin:
|
Ok thanks for trying! I think it's fairly easy to fix it |
4f2e8e8
to
2ca674f
Compare
There is this issue to keep in mind: flutter/flutter#38935 https://flutter-review.googlesource.com/c/recipes/+/3220/2/recipes/engine.py#1330 - flutter_infra/flutter/2d72510e447ab60a9728aeea2362d8be2cbd7789/linux-x64/linux-x64-flutter-gtk.zip
+ flutter_infra/flutter/2d72510e447ab60a9728aeea2362d8be2cbd7789/linux-x64-debug/linux-x64-flutter-gtk.zip |
This doesn't work anymore: flutter/engine#18735 |
2ca674f
to
861c9b1
Compare
The problem with MacOS seems that it uses assembly code and not a shared ELF library (See https://github.com/flutter/flutter/blob/cd593dae1961ca2bc5c045a310f16e6cdffc8294/packages/flutter_tools/lib/src/base/build.dart#L146). |
The flutter team didn't had flutter/flutter#50778 to read shared ELF library in a cross platform manner when they first implemented AOT on macos. Now that flutter/flutter#50778 is available, we should provide an ELF for all platforms. I don't want to go through |
Hm I'm not sure if AOT on MacOS is then going to work for now. The current error I'm stuck on is this:
The |
What can we do about it? |
Wait for: flutter/flutter#44577 |
Ouch. AOT was working a few days and now it's gone again... sad :( |
I was just pointed to this PR; I'm sorry that the bug wasn't fixed much earlier so that it would have been clear up front that this wasn't a viable approach. |
https://github.com/flutter-rs/engine-builds seems to be working properly again. I'm going to change the engine downloads URLs so this PR will work again and then we can see how far everything works. |
861c9b1
to
2465697
Compare
@jld3103 Yea, good idea! |
I needed to align some flag usage between build and run and also simplified a lot of other stuff. It's working on linux and on windows through although somehow the font was missing (app comes with font bundled). I need to check if the lost font is due to my changes or also happened before. I will push the changes tomorrow to test them in my MacOS VM and for others to test. Getting it to work on MacOS seems to have gotten easier, because the darwin engine uses a shared library like linux and windows and not a framework like in the official engine builds. I have high hopes that it will work. |
@pchampio Btw is there anything holding us back from merging the aot branch into the master branch of go-flutter? |
No, the aot branch can be merged on the go-flutter side! |
It seems to be working on MacOS! I need to make some small changes and then it works completely. Someone would need to test it on a real machine, but I'm 99% sure it will work there. |
I need to change some things in go-flutter and I will put them directly into the aot branch so please don't merge yet. |
2465697
to
9c2a94e
Compare
I got everything to work! I needed to create a hack to fix the linking of the flutter engine to the executable, because it was using a relative path which wouldn't work if you weren't in the directory of the executable. The changes in go-flutter needed for this to work are now in the aot branch so simply use @etx would you be able to test this on a real Mac? That would help a lot |
260d4c6
to
87b219f
Compare
internal/enginecache/cache.go
Outdated
if err != nil { | ||
log.Warnf("%v", err) | ||
log.Errorf("Failed to download engine: %v", err) | ||
log.Infof("That may mean no engine download is currently available. You'll have to wait for one to get available") |
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.
Maybe we can improve the wording a bit here and give better advice.
A possible "solution" for the user may be to go back an older flutter version. We could advice the user to use the beta channel if they aren't using that already, since those engines are more likely to be available.
We may also explain where we get the engine builds from, so the user knows where to look which versions are available.
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.
Looking up the versions manually isn't really fun. We could just download the engine versions for all branches and then tell the user which ones are already built so they can use that branch.
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've changed the wording, but it's still not perfect
87b219f
to
17faead
Compare
Hover now requires |
17faead
to
9ad26f5
Compare
hover build linux -b @aot
).hover build ...
Closes go-flutter-desktop/go-flutter#259
Closes go-flutter-desktop/go-flutter#452