Repository navigation
build: bump backend, duplicating the backend library on disk - #22670
Conversation
433ad65 to
70f4d59
Compare
Update the backend to 0.1.72-anki26.09.3 Independent JVM and Robolectric classloaders can now call the native backend in the same process. This is done by duplicating the backend library. A warning is added when the retained test libraries exceed 1 GiB Fixes 14796 Related to https://redirect.github.com/ankidroid/Anki-Android-Backend/pull/713 Assisted-by: Claude Opus 5 - original gradle script Assisted-by: GPT-6-Astra xhigh - reviewed, rewrote & tested it Assisted-by: GPT-6.1-Sol xhigh
`RobolectricTestParameterInjector` can be used now the backend supports multiple classloaders. Part of 14796 Assisted-by: GPT-6-Astra xhigh
Now we can have multiple classloaders loading the backend, run more tests without Android dependencies `EmptyApplication` is also used where possible. Temp folder/coroutine setup us replaced with scoped rules Typed Answer tests are now split into Android/Non-Android Part of 14796 Assisted-by: GPT-6-Astra xhigh
For why some tests unexpectedly still need `@RunsWith/RobolectricTest` and the work we should do to avoid it. Related to 14796 Assisted-by: GPT-6-Astra xhigh
70f4d59 to
299f6c8
Compare
mikehardy
left a comment
There was a problem hiding this comment.
Assisted-by: grok-4.7-medium
Thanks — the per-classloader backend copy and the temp-dir warning look right for the mixed Jvm/Robolectric suite.
Replayed four commits onto current main without pushing (PRE_TIP 299f6c8f). Local buildSrc, lint/CQ, full unit, and playRelease emulator on API 36 (emulator-5554 / API36_GAPI_PS16K) passed.
Backend 0.1.72 loads a separate native library file per classloader, Robolectric always runs ensureSetup(), and the Gradle report warns when temp rsdroid copies exceed the configured threshold.
|
@ankidroid/reviewers - this is a potentially big one - deep review requested of the gradle change |
mikehardy
left a comment
There was a problem hiding this comment.
It seems fine on a read, and I don't think it'll get better with age
can always follow on...
Upgrade Anki desktop backend to 26.09.3 and handle RELATIVE_OVERDUENESS enum. Allows independent JVM and Robolectric classloaders to call the native backend. Upstream-commits: b720d97128, c58a477a94, 5371107add Upstream-PRs: `ankidroid/Anki-Android#22154`, `ankidroid/Anki-Android#22670`
Note
Assisted-by: Claude Opus 5 - original gradle script
Assisted-by: GPT-6-Astra xhigh - reviewed, rewrote & tested it
Purpose / Description
By duplicating the backend library on disk, we allow support for multiple classloaders.
As these libraries are persistent (but hashed) on-disk, we need a utility to inform developers that old versions are taking up space.
Now this is implemented, we then start improving tests to move them away from Robolectric.
Fixes
RunWith(AndroidJUnit4::class)#14796/tmp/librsdroid-[hash]#21769Approach
How Has This Been Tested?
Performance: we're likely only looking at 5s of difference, this mostly exists to fix various test-related frustrations and flakes.
./gradlew :AnkiDroid:testFullDebugUnitTest --rerun -PbackendTempLibraryWarnBytes=0 --console=plainLearning
I had a longer writeup, but forgot to submit it last night :/
Checklist