Open psatler opened 6 months ago
Reproduced this locally. The issue seems to be that our linker does not currently work with obfuscated builds.
We could also just disable the linker for obfuscated builds for now?
interesting @bryanoltman , thanks for the feedback.
I am not sure if it's worth mentioning, but I believe I was able to successfully execute the patch ios-alpha
command along with the obfuscation flags when I used a previous version of flutter, more precisely, version 3.10.6
. See this link here, please. This is a repo I created a while ago when I was first experimenting Shorebird.
I hope this helps to figure out the issue.
Yes, obfuscation is expected to work on Flutter 3.16.4 and before. We broke it (accidentally) in 3.16.5 (Shorebird 0.20.0, end of Dec 2023) with our new iOS runtime + linking.
I suspect that this will have a similar fix to what @felangel is working on the dart compiler now. He's making the dart compiler (gen_snapshot) aware of the existence of the "release" build when building the patch. Making obfuscation work with our linker will probably be similar.
However the way this is failing (vm sections differing) may just suggest that obfuscation needs to be disabled for the vm section of the snapshot, since the vm section is the same for all apps compiled with the same Dart compiler, there isn't a lot of purpose in obfuscating that code.
However obfuscation will probably break our linker in other ways, since it renames methods and variables which likely will cause their heap indices to change, which will likely cause all code which references those names to fail to link (for similar reasons to what Felix is working on right now).
This will probably take us a few weeks to fix and will be after we fix https://github.com/shorebirdtech/shorebird/issues/1665
I'm having the same issue here.
We're aware that the --obfuscate flag is broken for iOS builds at the moment. Android works without issue. This issue tracks fixing --obfuscate
on iOS.
+1 for this!
@felangel is finishing the last patch for https://github.com/shorebirdtech/shorebird/issues/1892 and then plans to work on this.
Work here involves trying shorebird release ios --obfuscate
, shorebird patch ios --obfuscate
and see what breaks.
Assuming that --obfuscate
is deterministic (same inputs produce same outputs) then it should already "just work" with shorebird patch
and we'd need to investigate why it doesn't.
If --obfuscate
is not deterministic, then we probably need to change Dart's built-in obfuscate to be deterministic, which may involve having it take a "seed" value for whatever random/hashing it uses for the plain_name->obfuscated_name mappings.
It would be OK (as a v1) for --obfuscate
to "work" but just cause very low link percentages (because the obfuscation might confuse how we link code between the patch and the release). We can later come back with a "v2" which teaches our linker to be aware of obfuscated selectors, etc.
Description
Running
shorebird patch ios-alpha
on an app that uses flavors fails with the following messageI created a repo and manually added flavors/schemes to iOS (development and production). The repo I used to reproduce the issue can be found here. I was also able to reproduce this issue using the very good CLI which automatically sets up an app with flavors from the get-go when running
very_good create flutter_app <app-name>
Android
release
andpatch
are working fine.Steps To Reproduce
On a project that uses flavors/schemes
development
:Again, a reproducible repo was created here.
Expected Behavior
To be able to publish a patch release for the respective flavor/target.
Screenshots
initializing shorebird![image](https://github.com/shorebirdtech/shorebird/assets/3421410/c98fafca-0ae3-42de-b893-4bcb4e75936c)
triggering a release![image](https://github.com/shorebirdtech/shorebird/assets/3421410/1c60f375-6b75-4cbf-b517-367a113878a1)
triggering a patch![image](https://github.com/shorebirdtech/shorebird/assets/3421410/3fa858bd-beb1-4c8f-8f15-fe14a8017478)
Additional Context
shorebird doctor
:✓ Shorebird is up-to-date (0.6s) ✓ Flutter install is correct (0.5s) ✓ AndroidManifest.xml files contain INTERNET permission (35ms) ✓ Has access to storage.googleapis.com (0.2s)
No issues detected!