open-mpi/hwloc

F-Droid can't build

licaon-kter opened this issue · 13 comments

Hello. It's my first time hwloc build fails since it was added to fdroid, hence I am not sure if there are some obvious candidates to look at. Does this usually mean that I need to upgrade my gradle version? (4.10.1) I didn't change anything in the android build stuff recently. Did anything change on the fdroid side? The java version?

As said, currently we have Java 17 by default ( https://f-droid.org/2024/03/21/twif.html ) but I tested with both 11 and 8 and got the same error.

Ok so you upgraded your java from 11 to 17, that was my question. My build machine has no issue with both java 11 and 17, but I only using gradlew bundleRelease for google play store there, I'll run some real fdroid tests.

My old build machine didn't have any problem with fdroid or google play builds but it was too old to upgrade, so I deployed a new VM with a recent android studio etc. Now both fdroid and google play now fail with:

> Failed to notify project evaluation listener.
   > Could not initialize class com.sun.xml.bind.v2.runtime.reflect.opt.Injector

This is on Java 21. Java 17 fails with a different error. Tried with a recent gradle instead of our old 4.10, no luck.

It's not related to the new hwloc 2.11 release, the previous release fails the same (there's no Android related change in this release anyway). Something changed in the Android build stuff but I have no idea how to debug this further are java errors are useless as usual.

You also need to update AGP.

You also need to update AGP.

Is this something to change inside my project/build or inside the Android Studio install? Android Studio is 2024.1.

Thanks @linsui I managed to get things to work with gradle 8.8 and APG 8.5 (and after fixing some random stuff in the code). One hopefully-last thing to understand: Do you have any recommendation about the ndk version to use? my fdroid yaml currently says r20 but Android Studio seems to rather use 26.1. I don't know if upgrading this is recommended too.

Any ndk versions work for us. :)

Any ndk versions work for us. :)

So do you even specify any in the yaml? Right now I have r20, but Android Studio actually installs in Android/Sdk/ndk/20.0.5594570 and I have to create a symlink "r20" for fdroid build to find. If I just remove "ndk: r20" from the yaml, it builds fine (and I don't even know if it used r20 or r26)

Usually you can add ndkVersion around here https://github.com/open-mpi/hwloc/blob/master/contrib/android/AndroidApp/lstopo/build.gradle#L8 and gradle will install the right one as needed.

You'll use the NDK before running gradle? If yes, then do add ndk: in the recipe so it's present from the start.

It's better to have the version in sync between the recipe and your build machine.

It works, thanks!

Oh you fixed the metadata upstream already, great!
Thanks to both of you for the help.