Skip to content

Fix ksp2 reproducibility#5657

Open
Hamza417 wants to merge 3 commits intobumptech:masterfrom
Hamza417:fix-ksp-reproducibility
Open

Fix ksp2 reproducibility#5657
Hamza417 wants to merge 3 commits intobumptech:masterfrom
Hamza417:fix-ksp-reproducibility

Conversation

@Hamza417
Copy link

@Hamza417 Hamza417 commented Feb 4, 2026

Description

This PR modifies IndexerGenerator to enforce deterministic sorting of library modules by their qualified class names. It also adds a unit test (ModuleSortingLogicTest) to verify that the sorting logic remains consistent regardless of the input order provided by the compiler environment.

Motivation and Context

The PR intends to solve the problem of determinism. Since KSP2 the module indexer is not processing the modules in deterministic order leading to unpredictable outcomes over each build, breaking the reproducibility. The problem can be circumvented temporarily by falling back to KSP1 or KAPT, but both of these processors are obsolete now, and Google recently removed KSP1 entirely. The issue was discussed in Inure #440 and Peristyle #239 and the GlideIndexer broke the reproducibility each time the difference is tested.

So far using the fallback worked, but since Gradle 9.0 most of the older methods stopped working and forcing dependency updates now that triggers this non-determinism making it difficult to publish the app on F-Droid repos.

@Hamza417 Hamza417 changed the title Fix ksp reproducibility Fix ksp2 reproducibility Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant