introduced RoboVM platform. Goal to allow use AndroidSocketAdapter with RoboVM#6133
introduced RoboVM platform. Goal to allow use AndroidSocketAdapter with RoboVM#6133dkimitsa wants to merge 3 commits into
Conversation
RoboVM is android4 based runtime and it shares amount of classes from Android4. Its important to check for RoboVM platform before Android as RoboVM gets classified as Android and then will crash with `java.lang.NoClassDefFoundError: android/os/Build$VERSION`. RoboVMPlatform class is based on Android one. Unsupported entities were removed.
swankjesse
left a comment
There was a problem hiding this comment.
I don’t like the PR description... “support” is an overstatement, we just aren’t breaking RoboVM in ways we currently know about. If you’d like to contribute configuration to regression test on CI, that’d be rad.
This was also something I was looking into, we don't intend to break RoboVM, is just isn't a normal platform that we commit to supporting. A regression test on CI is great if we intend to actively support it. How do RoboVM users choose an OkHttp version. How does the cipher workarounds you've posted about get applied? Does the post suggest maybe you should be providing a module that provides OkHttp 3.12.12 and Google Conscrypt to get back a secure well maintained set of Ciphers? https://dkimitsa.github.io/2020/06/16/broken-ssl-handshake-okhttp4/ |
I don't think this is the case since Android and RoboVM both do similar checks "Dalvik" vs "RoboVM". Both can't be true. |
Why master then? Should you be pinning to OkHttp 3.12.x and get it working there? Should we attempt to support RoboVM with OkHttp 4 since we assume Android 5+ for OkHttp 4.x |
* removed DeferredSocketAdapter(ConscryptSocketAdapter.factory) as it is not supported
* have to remove `filter { it.isSupported() }` as StandardAndroidSocketAdapter will return false on non-android systems
|
thank you for quick review, please find responses inlined in comment bellow:
Would CI test similar to ones done in square/retrofit#3424 work here as well (can prepare and push)?
If users use OkHttp directly in code there are plenty options for versions and workarounds. But its real problem when OkHttp is used by third party library where user have no control. Thats the goal to have it compatible without workarounds. Once changes described in post applied there will be no need to have cipher workaround.
Sorry my bad, the statement was based on what I saw in okhttp 4.4, in 4.8 the order doesn't matter.
Its about what user uses directly or through third party dependencies. Why not have better compatibility if it doesn't cost much ? |
|
@dkimitsa Thanks, no objection from me to this PR. But I think we should get a test in place that leaves you happy that each incremental release we do is still working. Can be a separate PR if that means we can get a full end to end test with RoboVM for example. |
|
@yschimke thanks, will prepare another PR with test, will use approach similar to RoboVM test integration from square/retrofit#3424 |
…. detection moved to findJvmPlatform * fixed condition for RoboVM platform: build it only if StandardAndroidSocketAdapter (otherwise makes no sense)
yschimke
left a comment
There was a problem hiding this comment.
Looks pretty clean, minimal impact won't even be seen on JDK 9+ or Android.
|
@swankjesse @JakeWharton any objection if I merge? I think the 180° alternative would making Platform API public-ish and allowing clients in unsupported environments to control. This seems less worse. |
|
I don't mind. But without any test I have no confidence in this actually working as-is or staying as working in the future. The Retrofit test doesn't exercise any real codepaths so I'm not even convinced that it works there either. |
|
I've tried running this in the other PR, and I've got a few errors so far, finally stuck on Which I'm not real motivated to work around. Not going to land as is. Other diff required |
|
@dkimitsa Is this and the other PR still something you are keen on? I think we'd need a github actions build showing this working. Not sure who is doing that, who can and is spending the time. |
|
@yschimke probably actions similar from retrofit project can be used here, sadly have no experience setting it up. Following pr shows changes were done to retrofit square/retrofit#3424 |
|
@swankjesse @JakeWharton I'd be ok landing this and asking RoboVM to setup a test in their CI that shows it working with our latest release. It's probably better than what we currently have. I suspect I might be in the minority here. The CI tests PR wasn't going anywhere #6134 We could start with a 4.10-RC2 and see it work downstream before landing? |
|
Discussed offline, too much work to support easily here without someone setting up and maintaining the tests. |
|
@yschimke why not use GitHub actions for test as its done for similar case in square/retrofit#3424 |
|
Should we take a look again after a future migration to GitHub CI. From other PR we were blocked in circle ci without paid account and no-one is investing time on migration yet. |
RoboVM is android4 based runtime and it shares amount of classes from Android4.
Its important to check for RoboVM platform before Android as RoboVM gets classified as Android and then okhttp will crash with
java.lang.NoClassDefFoundError: android/os/Build$VERSION.RoboVMPlatform class is based on Android one. Unsupported entities were removed.