-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated EventBusIndex.class order should not change on every build #715
Comments
Yes, you configured it to be that. The index is re-created each time the annotation processor runs. So IIRC if Gradle detects any changes it will re-run. As for determinism, one would have to check the annotation processor source code in this repo if it e.g. sorts things in a stable way. I don't have time right now, but maybe at some point. |
Ok, thanks for the answer. I hope in the future someone of your team will have the time to deepen this topic. |
I'm guessing the issue is that for (TypeElement subscriberTypeElement : methodsByClass.keySet()) {
...
} but should probably use something like List<TypeElement> keys = new ArrayList<>(methodsByClass.keySet());
keys.sort((o1, o2) -> o1.getQualifiedName().compareTo(o2.getQualifiedName()));
for (TypeElement subscriberTypeElement : keys) {
...
} |
For your information: Here you can find the commit: BasicAirData/GPSLogger@3bfee78 |
@greenrobot-team do you have in plan to check the annotation processor source code and to fix soon the sorting problem? I kindly ask it because I can use the sorting python patch mentioned above to test the reproducibility with method sorting, but I cannot use it to make the signed APK, due to the new lint checks on Gradle 8. Thanks in advance. |
@GrazianoCapelli There likely won't be a release anytime soon as I'm busy with other stuff. |
Hi,
First of all thanks for making and publishing your great EventBus library.
Very simple to use and stable, I love it.
I opened this issue because I'm trying to compile our free and open source app BasicAirData GPS Logger in a deterministic way in order to have a reproducible build of the APK.
One of the first tests I made is to build the app 2 times and verify if the 2 builds are identical, and I found that they differ on the
EventBusIndex.class
, that have the rows in a different order.Here below you can view an extract of the output of my
diffoscope
:I made the test using your latest EventBus v3.3.1 and the v3.2.0, and both have this issue.
I'm using the following Java version on Android Studio Electric Eel | 2022.1.1 for Linux:
I have two questions:
EventBusIndex.class
the Subscriber Index? If so: I generated the Subscriber Index once (like suggested on your web page) and then I commented that line (https://github.com/BasicAirData/GPSLogger/blob/966a9a8841cd7df4bb515a722eee54c94a7b48ae/app/src/main/java/eu/basicairdata/graziano/gpslogger/GPSApplication.java#LL1033C20-L1033C20). Why the build process creates a new Subscriber Index every time I compile the app?EventBusIndex.class
file in a deterministic way?Thanks and regards.
The text was updated successfully, but these errors were encountered: