Uh oh!
There was an error while loading. Please reload this page.
Weekly Stable Updates 20211202 - #436
Conversation
PawKanarek
commented
Jan 19, 2022
Hello @moljac i see that some checks have failed due to DetailsDo you have idea when this PR will be merged? |
moljac
commented
Jan 19, 2022
After this one is approved/merged and packages published I can continue with updates and this PR should be 1st |
| "version": "1.0.0", | ||
| "nugetVersion": "1.0.0", | ||
| "nugetId": "Xamarin.AndroidX.Emoji2", | ||
| "excludedRuntimeDependencies": "androidx.lifecycle.lifecycle-process", |
There was a problem hiding this comment.
This seems to be an actual needed runtime dependency. Removing it will likely cause this package to not work:
<dependency>
<groupId>androidx.lifecycle</groupId>
<artifactId>lifecycle-process</artifactId>
<version>2.4.0</version>
<scope>runtime</scope>
<type>aar</type>
</dependency>| "artifactId": "kotlin-stdlib", | ||
| "version": "1.5.31", | ||
| "nugetVersion": "1.5.31.3", | ||
| "version": "1.6.0", |
There was a problem hiding this comment.
I think we need to hold off on updating Kotlin to 1.6.0. Looking at the diffs makes me think they may have changed how they are encoding their "unsigned" types, and we may need a fix there or else all of our Kotlin support around them will be incorrect.
Example: these changed from uint to int for a type called UIntArray:
Type Changed: Kotlin.UIntArray
Removed methods:
publicstaticuintGet(int[]_this,intindex);publicstaticvoidSet(int[]_this,intindex,uintvalue);Added methods:
publicstaticintGet(int[]arg0,intindex);publicstaticvoidSet(int[]arg0,intindex,intvalue);There was a problem hiding this comment.
Seems like API was changed:
Type Changed: Kotlin.UByteArray
Removed methods:
publicstaticbyteGet(byte[]_this,intindex);publicstaticvoidSet(byte[]_this,intindex,bytevalue);publicvirtualintSize();Decompiled:
publicfinalclassUByteArrayimplementsCollection<UByte>, KMappedMarker
{
// removedpublicstaticfinalbyteget-w2LRezQ(finalbyte[] arg0, finalintindex) {
Intrinsics.checkNotNullParameter(arg0, "arg0");
returnUByte.constructor-impl(arg0[index]);
}
publicstaticfinalvoidset-VurrAj0(finalbyte[] arg0, finalintindex, finalbytevalue) {
Intrinsics.checkNotNullParameter(arg0, "arg0");
arg0[index] = value;
}
publicstaticintgetSize-impl(finalbyte[] arg0) {
Intrinsics.checkNotNullParameter(arg0, "arg0");
returnarg0.length;
}
publicintgetSize() {
returngetSize-impl(this.storage);
}
// removed
}Type Changed: Kotlin.UIntArray
Removed interfaces:
Java.Lang.IIterableJava.Util.ICollectionRemoved methods:
publicstaticuintGet(int[]_this,intindex);publicstaticvoidSet(int[]_this,intindex,uintvalue);publicvirtualintSize();Decompiled:
publicfinalclassUIntArrayimplementsCollection<UInt>, KMappedMarker
{
// removedpublicstaticfinalintget-pVg5ArA(finalint[] arg0, finalintindex) {
Intrinsics.checkNotNullParameter(arg0, "arg0");
returnUInt.constructor-impl(arg0[index]);
}
publicstaticfinalvoidset-VXSXFK8(finalint[] arg0, finalintindex, finalintvalue) {
Intrinsics.checkNotNullParameter(arg0, "arg0");
arg0[index] = value;
}
// removed
}Type Changed: Kotlin.ULongArray
Removed methods:
publicstaticulongGet(long[]_this,intindex);publicstaticvoidSet(long[]_this,intindex,ulongvalue);publicvirtualintSize();Decompiled:
publicfinalclassULongArrayimplementsCollection<ULong>, KMappedMarker
{
// removedpublicstaticfinallongget-s-VKNKU(finallong[] arg0, finalintindex) {
Intrinsics.checkNotNullParameter(arg0, "arg0");
returnULong.constructor-impl(arg0[index]);
}
publicstaticfinalvoidset-k8EXiF4(finallong[] arg0, finalintindex, finallongvalue) {
Intrinsics.checkNotNullParameter(arg0, "arg0");
arg0[index] = value;
}
publicstaticintgetSize-impl(finallong[] arg0) {
Intrinsics.checkNotNullParameter(arg0, "arg0");
returnarg0.length;
}
publicintgetSize() {
returngetSize-impl(this.storage);
}
// removed
}Type Changed: Kotlin.UShortArray
Removed methods:
publicstaticushortGet(short[]_this,intindex);publicstaticvoidSet(short[]_this,intindex,ushortvalue);publicvirtualintSize();Decompiled:
publicfinalclassUShortArrayimplementsCollection<UShort>, KMappedMarker
{
// removedpublicstaticfinalshortget-Mh2AYeg(finalshort[] arg0, finalintindex) {
Intrinsics.checkNotNullParameter(arg0, "arg0");
returnUShort.constructor-impl(arg0[index]);
}
publicstaticfinalvoidset-01HTLdE(finalshort[] arg0, finalintindex, finalshortvalue) {
Intrinsics.checkNotNullParameter(arg0, "arg0");
arg0[index] = value;
}
publicstaticintgetSize-impl(finalshort[] arg0) {
Intrinsics.checkNotNullParameter(arg0, "arg0");
returnarg0.length;
}
publicintgetSize() {
returngetSize-impl(this.storage);
}
// removed
}| "artifactId": "activity", | ||
| "version": "1.3.1", | ||
| "nugetVersion": "1.3.1.2", | ||
| "nugetVersion": "1.3.1.3", |
There was a problem hiding this comment.
There's about 20 artifacts that are bumping the nugetVersion but are not bumping the artifact version, What is this for?
There was a problem hiding this comment.
I don't remember. It was begining of December. I might have rebased/merged some change from other PRs
Fixes: #945 Context: dotnet/android-libraries#436 (comment) Consider the following Kotlin function: fun get (index: Int) : UInt { … } When `get` is compiled with Kotlin 1.5, `class-parse` would emit: <method abstract="false" final="true" name="get-pVg5ArA" return="uint" jni-return="I" static="true" visibility="public" jni-signature="([II)I"> <parameter name="$this" type="int[]" jni-type="[I" /> <parameter name="index" type="int" jni-type="I" /> </method> However, when `get` is compiled with Kotlin 1.6, `class-parse` sees: <method abstract="false" final="true" name="get-pVg5ArA" return="int" jni-return="I" static="true" visibility="public" jni-signature="([II)I"> <parameter name="arg0" type="int[]" jni-type="[I" /> <parameter name="index" type="int" jni-type="I" /> </method> Note that the name of the first `int[]` parameter changes from `$this` to `arg0`, and the return type changed from `uint` to `int`. The parameter name change is annoying; the return type change is an ABI break, and makes many package updates impossible. What happened? Recall commit 71afce5: Kotlin-compiled `.class` files contain a `kotlin.Metadata` type-level annotation blob, which contains a Protobuf stream containing Kotlin metadata for the type. The `kotlin.Metadata` annotation contains information about Kotlin functions, and `class-parse` needs to associate the information about the Kotlin functions to Java methods. This can be tricky because there is not an explicit way to do this, and one must rely on trying to match function names and parameter types. Previously, this was accomplished by looping through the parameters and comparing types. However, the `kotlin.Metadata` annotation only includes "user created" method parameters, while the Java method may include "compiler created" method parameters. We attempted to skip these by ignoring Java parameters whose names begin with a dollar sign (ex `$this`). This "worked" most of the time. This broke in Kotlin 1.6, as the compiler generated method parameters stopped using `$` for compiler-generated parameter names. algorithm. We need something better. The `kKotlin.Metadata` annotation provides a `JvmSignature` property -- which matches the `JvmName` property which we already use -- which sounds promising. However, `JvmSignature` is sometimes `null`, and sometimes it doesn't actually match. But it's closer. So now we try to match with signatures. * If `JvmSignature` matches the Java signature we use that. * If `JvmSignature` is `null`, calculate it from the Kotlin parameters and try to match with that. * Note it wants unsigned types as `Lkotlin/UInt;` and not the primitive encoding (`I`). * If Kotlin metadata defines a `ReceiverType`, add that as the first parameter to the signature. Using `kotlin-stdlib-1.5.31.jar` as a baseline, we get much better results: | Version | Matched Functions | Unmatched Functions | | --------------- | ----------------: | --------------------: | | main @ 32635fd | 946 | 154 | | This PR | 1100 | 0 | Now that we can match Kotlin functions to Java methods, we still have to match up the parameters so we can apply parameter-level transforms. Do this by removing Java method parameters from the front and back of the list to account for cases where the compiler adds "hidden" parameters: * Remove Kotlin `ReceiverType` from beginning of list. * Remove Kotlin `Lkotlin/coroutines/Continuation;` from end of list. * Note this _could_ be a legitimate user supplied parameter so we try to restrict it to "unnamed" parameters. * Remove the `this` parameter added to `static` functions. Note: the test classes `DeepRecursiveKt.class`, `DeepRecursiveScope.class`, and `UByteArray.class` are pulled from [`kotlin-stdlib-1.5.31.jar`][0]. [0]: https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib/1.5.31
Fixes: dotnet/java-interop#945 Context: dotnet/android-libraries#436 (comment) Consider the following Kotlin function: fun get (index: Int) : UInt { … } When `get` is compiled with Kotlin 1.5, `class-parse` would emit: <method abstract="false" final="true" name="get-pVg5ArA" return="uint" jni-return="I" static="true" visibility="public" jni-signature="([II)I"> <parameter name="$this" type="int[]" jni-type="[I" /> <parameter name="index" type="int" jni-type="I" /> </method> However, when `get` is compiled with Kotlin 1.6, `class-parse` sees: <method abstract="false" final="true" name="get-pVg5ArA" return="int" jni-return="I" static="true" visibility="public" jni-signature="([II)I"> <parameter name="arg0" type="int[]" jni-type="[I" /> <parameter name="index" type="int" jni-type="I" /> </method> Note that the name of the first `int[]` parameter changes from `$this` to `arg0`, and the return type changed from `uint` to `int`. The parameter name change is annoying; the return type change is an ABI break, and makes many package updates impossible. What happened? Recall commit 004aae6: Kotlin-compiled `.class` files contain a `kotlin.Metadata` type-level annotation blob, which contains a Protobuf stream containing Kotlin metadata for the type. The `kotlin.Metadata` annotation contains information about Kotlin functions, and `class-parse` needs to associate the information about the Kotlin functions to Java methods. This can be tricky because there is not an explicit way to do this, and one must rely on trying to match function names and parameter types. Previously, this was accomplished by looping through the parameters and comparing types. However, the `kotlin.Metadata` annotation only includes "user created" method parameters, while the Java method may include "compiler created" method parameters. We attempted to skip these by ignoring Java parameters whose names begin with a dollar sign (ex `$this`). This "worked" most of the time. This broke in Kotlin 1.6, as the compiler generated method parameters stopped using `$` for compiler-generated parameter names. algorithm. We need something better. The `kKotlin.Metadata` annotation provides a `JvmSignature` property -- which matches the `JvmName` property which we already use -- which sounds promising. However, `JvmSignature` is sometimes `null`, and sometimes it doesn't actually match. But it's closer. So now we try to match with signatures. * If `JvmSignature` matches the Java signature we use that. * If `JvmSignature` is `null`, calculate it from the Kotlin parameters and try to match with that. * Note it wants unsigned types as `Lkotlin/UInt;` and not the primitive encoding (`I`). * If Kotlin metadata defines a `ReceiverType`, add that as the first parameter to the signature. Using `kotlin-stdlib-1.5.31.jar` as a baseline, we get much better results: | Version | Matched Functions | Unmatched Functions | | --------------- | ----------------: | --------------------: | | main @ 24dced0 | 946 | 154 | | This PR | 1100 | 0 | Now that we can match Kotlin functions to Java methods, we still have to match up the parameters so we can apply parameter-level transforms. Do this by removing Java method parameters from the front and back of the list to account for cases where the compiler adds "hidden" parameters: * Remove Kotlin `ReceiverType` from beginning of list. * Remove Kotlin `Lkotlin/coroutines/Continuation;` from end of list. * Note this _could_ be a legitimate user supplied parameter so we try to restrict it to "unnamed" parameters. * Remove the `this` parameter added to `static` functions. Note: the test classes `DeepRecursiveKt.class`, `DeepRecursiveScope.class`, and `UByteArray.class` are pulled from [`kotlin-stdlib-1.5.31.jar`][0]. [0]: https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib/1.5.31
Updated aritfact bindings
androidx.annotation:annotation - 1.2.0 -> 1.3.0
Xamarin.AndroidX.Annotation
androidx.collection:collection - 1.1.0 -> 1.2.0
Xamarin.AndroidX.Collection
androidx.collection:collection-ktx - 1.1.0 -> 1.2.0
Xamarin.AndroidX.Collection.Ktx
diff.md
breaking.md
androidx.compose.animation:animation - 1.0.0 -> 1.0.5
androidx.compose.animation:animation-core - 1.0.0 -> 1.0.5
androidx.compose.foundation:foundation - 1.0.0 -> 1.0.5
androidx.compose.foundation:foundation-layout - 1.0.0 -> 1.0.5
androidx.compose.material:material - 1.0.0 -> 1.0.5
androidx.compose.material:material-icons-core - 1.0.0 -> 1.0.5
androidx.compose.material:material-icons-extended - 1.0.0 -> 1.0.5
androidx.compose.material:material-ripple - 1.0.0 -> 1.0.5
androidx.compose.runtime:runtime - 1.0.0 -> 1.0.5
androidx.compose.runtime:runtime-livedata - 1.0.0 -> 1.0.5
androidx.compose.runtime:runtime-rxjava2 - 1.0.0 -> 1.0.5
androidx.compose.runtime:runtime-saveable - 1.0.0 -> 1.0.5
androidx.compose.ui:ui - 1.0.0 -> 1.0.5
androidx.compose.ui:ui-geometry - 1.0.0 -> 1.0.5
androidx.compose.ui:ui-graphics - 1.0.0 -> 1.0.5
androidx.compose.ui:ui-text - 1.0.0 -> 1.0.5
androidx.compose.ui:ui-unit - 1.0.0 -> 1.0.5
androidx.compose.ui:ui-util - 1.0.0 -> 1.0.5
androidx.compose.ui:ui-viewbinding - 1.0.0 -> 1.0.5
androidx.constraintlayout:constraintlayout - 2.1.1 -> 2.1.2
Xamarin.AndroidX.ConstraintLayout
diff.md
breaking.md
androidx.constraintlayout:constraintlayout-core - 1.0.1 -> 1.0.2
androidx.emoji2:emoji2 - -> 1.0.0
androidx.emoji2.emoji2
Xamarin.AndroidX.Emoji2
diff.md
breaking.md
androidx.emoji2:emoji2-views-helper - -> 1.0.0
Xamarin.AndroidX.Emoji2.ViewsHelper
diff.md
breaking.md
androidx.resourceinspection:resource-inspection-annotation - -> 1.0.0
androidx.lifecycle:lifecycle-common - 2.3.1 -> 2.4.0
Xamarin.AndroidX.Lifecycle.Common
androidx.lifecycle:lifecycle-common-java8 - 2.3.1 -> 2.4.0
androidx.lifecycle:lifecycle-livedata - 2.3.1 -> 2.4.0
androidx.lifecycle:lifecycle-livedata-core - 2.3.1 -> 2.4.0
androidx.lifecycle:lifecycle-livedata-core-ktx - 2.3.1 -> 2.4.0
androidx.lifecycle:lifecycle-livedata-ktx - 2.3.1 -> 2.4.0
androidx.lifecycle:lifecycle-process - 2.3.1 -> 2.4.0
Xamarin.AndroidX.Lifecycle.Process
diff.md
breaking.md
androidx.lifecycle:lifecycle-reactivestreams - 2.3.1 -> 2.4.0
androidx.lifecycle:lifecycle-reactivestreams-ktx - 2.3.1 -> 2.4.0
androidx.lifecycle:lifecycle-runtime - 2.3.1 -> 2.4.0
androidx.lifecycle:lifecycle-runtime-ktx - 2.3.1 -> 2.4.0
androidx.lifecycle.lifecycle-runtime-ktx
Xamarin.AndroidX.Lifecycle.Runtime.Ktx
androidx.lifecycle:lifecycle-service - 2.3.1 -> 2.4.0
androidx.lifecycle:lifecycle-viewmodel - 2.3.1 -> 2.4.0
androidx.lifecycle.lifecycle-viewmodel
Xamarin.AndroidX.Lifecycle.ViewModel
diff.md
breaking.md
androidx.lifecycle:lifecycle-viewmodel-ktx - 2.3.1 -> 2.4.0
Xamarin.AndroidX.Lifecycle.ViewModel.Ktx
diff.md
breaking.md
androidx.lifecycle:lifecycle-viewmodel-savedstate - 2.3.1 -> 2.4.0
androidx.lifecycle.lifecycle-viewmodel-savedstate
Xamarin.AndroidX.Lifecycle.ViewModelSavedState
androidx.paging:paging-common - 3.0.1 -> 3.1.0
Xamarin.AndroidX.Paging.Common
diff.md
breaking.md
androidx.paging:paging-common-ktx - 3.0.1 -> 3.1.0
androidx.paging:paging-runtime - 3.0.1 -> 3.1.0
androidx.paging.paging-runtime
Xamarin.AndroidX.Paging.Runtime
androidx.paging:paging-runtime-ktx - 3.0.1 -> 3.1.0
androidx.paging:paging-rxjava2 - 3.0.1 -> 3.1.0
androidx.paging:paging-rxjava2-ktx - 3.0.1 -> 3.1.0
androidx.profileinstaller:profileinstaller - 1.0.0 -> 1.0.4
androidx.profileinstaller.profileinstaller
Xamarin.AndroidX.ProfileInstaller.ProfileInstaller
diff.md
breaking.md
androidx.work:work-runtime - 2.7.0 -> 2.7.1
Xamarin.AndroidX.Work.Runtime
androidx.work:work-runtime-ktx - 2.7.0 -> 2.7.1
io.reactivex.rxjava3:rxjava - 3.1.2 -> 3.1.3
org.jetbrains:annotations - 22.0.0 -> 23.0.0
Xamarin.Jetbrains.Annotations
Changed but not updated
androidx.appcompat.appcompat
Xamarin.AndroidX.AppCompat
diff.md
breaking.md
androidx.biometric.biometric
Xamarin.AndroidX.Biometric
androidx.core.core
Xamarin.AndroidX.Core
androidx.leanback.leanback
Xamarin.AndroidX.Leanback
diff.md
breaking.md
androidx.recyclerview.recyclerview
Xamarin.AndroidX.RecyclerView
androidx.resourceinspection.resourceinspection-annotation
Xamarin.AndroidX.ResourceInspection.Annotation
diff.md
breaking.md
androidx.security.security-crypto
Xamarin.AndroidX.Security.SecurityCrypto
diff.md
breaking.md
androidx.webkit.webkit
Xamarin.AndroidX.WebKit
androidx.window.window
Xamarin.AndroidX.Window
diff.md
breaking.md
androidx.window.window-java
Xamarin.AndroidX.Window.WindowJava
diff.md
breaking.md
com.google.android.material.material
Xamarin.Google.Android.Material
diff.md
breaking.md
com.google.code.gson.gson
GoogleGson
com.google.crypto.tink.tink-android
Xamarin.Google.Crypto.Tink.Android
diff.md
breaking.md
io.reactivex.rxjava2.rxjava
Xamarin.Android.ReactiveX.RxJava
diff.md
breaking.md
org.jetbrains.kotlin.kotlin-stdlib
Xamarin.Kotlin.StdLib
diff.md
breaking.md
org.reactivestreams.reactive-streams
Xamarin.Android.ReactiveStreams