F-Droid build failed #2357

Closed
opened 2021-07-27 04:09:31 +00:00 by linsui · 37 comments
2021-07-26 21:47:18,646 ERROR: Found binary at app/src/main/assets/fossil_hr/widgetHR.bin
2021-07-26 21:47:18,646 ERROR: Found binary at app/src/main/assets/fossil_hr/widgetDate.bin
2021-07-26 21:47:18,647 ERROR: Found binary at app/src/main/assets/fossil_hr/widgetSteps.bin
2021-07-26 21:47:18,647 ERROR: Found binary at app/src/main/assets/fossil_hr/openSourceWatchface.bin
2021-07-26 21:47:18,647 ERROR: Found binary at app/src/main/assets/fossil_hr/widgetWeather.bin
2021-07-26 21:47:18,655 ERROR: Could not build app nodomain.freeyourgadget.gadgetbridge: Can't build due to 5 errors while scanning

What are these binaries? Is there any way to generate these binaries or they can be ignored safely? Thanks!

``` 2021-07-26 21:47:18,646 ERROR: Found binary at app/src/main/assets/fossil_hr/widgetHR.bin 2021-07-26 21:47:18,646 ERROR: Found binary at app/src/main/assets/fossil_hr/widgetDate.bin 2021-07-26 21:47:18,647 ERROR: Found binary at app/src/main/assets/fossil_hr/widgetSteps.bin 2021-07-26 21:47:18,647 ERROR: Found binary at app/src/main/assets/fossil_hr/openSourceWatchface.bin 2021-07-26 21:47:18,647 ERROR: Found binary at app/src/main/assets/fossil_hr/widgetWeather.bin 2021-07-26 21:47:18,655 ERROR: Could not build app nodomain.freeyourgadget.gadgetbridge: Can't build due to 5 errors while scanning ``` What are these binaries? Is there any way to generate these binaries or they can be ignored safely? Thanks!
Owner

Hi @linsui thank you for getting back to us. Yes, these can be safely ignored, let me add @arjan5 here.

@arjan5 maybe it would be nice to add the jerryscript files to the assets as well?

Hi @linsui thank you for getting back to us. Yes, these can be safely ignored, let me add @arjan5 here. @arjan5 maybe it would be nice to add the jerryscript files to the assets as well?
Owner

That would not help , F-Droid can't build jerryscript, those bin files are meant to be flahed to the watch. F-Droid seems to be too strict here.

That would not help , F-Droid can't build jerryscript, those bin files are meant to be flahed to the watch. F-Droid seems to be too strict here.
Member

That's right. The .bin files are compiled with Jerryscript from the sources here: https://github.com/arjan-s/fossil-hr-watchface

If F-Droid has the Jerryscript 2.1.0 compiler, it could compile them, otherwise it is necessary to have F-Droid accept the binary files.

Is there a way to accomplish either one of these?

That's right. The .bin files are compiled with Jerryscript from the sources here: https://github.com/arjan-s/fossil-hr-watchface If F-Droid has the Jerryscript 2.1.0 compiler, it could compile them, otherwise it is necessary to have F-Droid accept the binary files. Is there a way to accomplish either one of these?
Owner

@linsui

What are these binaries?

Those binaries are compiled javascript bytecode (jerryscript 2.1.0), the source is here https://github.com/arjan-s/fossil-hr-watchface

The files are NOT run inside Gadgetbridge but uploaded to the Fossil Hybrid HR watch to replace the non-free watchface that the official app installs.

In theory it makes your watch more free, but in practice we are kicked out of F-Droid now.

Pesonally I agree with not allowing binaries that run on the phone but having compiled code that is open source and send to a device - I find that ok.

So to follow F-Droid guidelines, what are our options?

Download a jerryscript 2.1.0 compiler and compile during build? Would the F-Droid build server somehow support that?

If so I would still prefer to have the binaries in git even if F-Droids removes and regenerates them to 100% the same compiled code. I do not want to force everyone without a Fossil watch who just wants to compile Gadgetbridge to eventually contribute to do those useless stunts.

@linsui > What are these binaries? Those binaries are compiled javascript bytecode (jerryscript 2.1.0), the source is here https://github.com/arjan-s/fossil-hr-watchface The files are *NOT* run inside Gadgetbridge but uploaded to the Fossil Hybrid HR watch to replace the non-free watchface that the official app installs. In theory it makes your watch more free, but in practice we are kicked out of F-Droid now. Pesonally I agree with not allowing binaries that run on the phone but having compiled code that is open source and send to a device - I find that ok. So to follow F-Droid guidelines, what are our options? Download a jerryscript 2.1.0 compiler and compile during build? Would the F-Droid build server somehow support that? If so I would still prefer to have the binaries in git even if F-Droids removes and regenerates them to 100% the same compiled code. I do not want to force everyone without a Fossil watch who just wants to compile Gadgetbridge to eventually contribute to do those useless stunts.
Author

The buildserver is debian stretch. I'll yry to compile it.

The buildserver is debian stretch. I'll yry to compile it.
Member

@linsui

Thanks! You can use the instructions and commands on the linked github repo readme to compile the exact same binaries.

Going forward, what is the best way to approach this? I'm working on a new PR that includes even more widget binaries, so that would lead to the same issues again. Should we add the sources and a script to compile them? And what way would work best for F-Droid?

@linsui Thanks! You can use the instructions and commands on the linked github repo readme to compile the exact same binaries. Going forward, what is the best way to approach this? I'm working on a new PR that includes even more widget binaries, so that would lead to the same issues again. Should we add the sources and a script to compile them? And what way would work best for F-Droid?
Author

We can build jerryscript first, then build those binaries. I suggest adding those source code as git submodules and providing a script to build them. Then we can simply execute the build script to prepare those binaries. In this way you can update the build script and external repos easily. To build the current version I'll use srclibs for external repos. But that means we need to update the srclibs manully.

We can build jerryscript first, then build those binaries. I suggest adding those source code as git submodules and providing a script to build them. Then we can simply execute the build script to prepare those binaries. In this way you can update the build script and external repos easily. To build the current version I'll use srclibs for external repos. But that means we need to update the srclibs manully.
Author
https://gitlab.com/fdroid/fdroiddata/-/merge_requests/9450
Owner

Judging from the MR above it seems the fossil sdk is not needed(?), just jerryscript and the watchface repo?

I think we can assume Fossil will stick to Jerryscript 2.1.0, so the only thing we should change is using one submodule which will be updated to a newer revision from time to time and right now stick it to:

fossil-hr-watchface@71374ce959655a56e71ddf70c626f9feba399a89

Then providing a script that builds the jerryscript compiler and then rebuilds the jerryscript, which is then used by F-droid while we still have the compiled code in to make this build more easy for others.

Judging from the MR above it seems the fossil sdk is not needed(?), just jerryscript and the watchface repo? I think we can assume Fossil will stick to Jerryscript 2.1.0, so the only thing we should change is using one submodule which will be updated to a newer revision from time to time and right now stick it to: ``` fossil-hr-watchface@71374ce959655a56e71ddf70c626f9feba399a89 ``` Then providing a script that builds the jerryscript compiler and then rebuilds the jerryscript, which is then used by F-droid while we still have the compiled code in to make this build more easy for others.
Author

Yes, that's good. Thanks!

Yes, that's good. Thanks!
Owner

I have added both the watchface repo and jerryscript as submodules and pushed a simple script thats builds both (basically the same as what fdroid does)

I think this is not enough for fdroid because of the relative paths?

I have added both the watchface repo and jerryscript as submodules and pushed a simple script thats builds both (basically the same as what fdroid does) I think this is not enough for fdroid because of the relative paths?
Author

It would be more robust to have something like

cd "$( dirname "${BASH_SOURCE[0]}" )"
PWD=`pwd`

But it's enough for F-Droid. 👌 Thanks!

It would be more robust to have something like ``` cd "$( dirname "${BASH_SOURCE[0]}" )" PWD=`pwd` ``` But it's enough for F-Droid. :ok_hand: Thanks!
Owner

This is cool. Will f-droid try to re-run this build or do we need to re-tag?

This is cool. Will f-droid try to re-run this build or do we need to re-tag?
Author

We need a tag covering the change. If you re-tag or add a new tag I'll update the recipe.

We need a tag covering the change. If you re-tag or add a new tag I'll update the recipe.
Owner

The question is weather failed 0.59.0 as tagged can be rebuild. It should work with the current metadata , right?

The question is weather failed 0.59.0 as tagged can be rebuild. It should work with the current metadata , right?
Author

Yes, it will be rebuild.

Yes, it will be rebuild.
Owner

@linsui

Now that everything has been built, would it make sense to switch to exectuing the shell script now? (For the next release)

@linsui Now that everything has been built, would it make sense to switch to exectuing the shell script now? (For the next release)
Author

I'll do that when the next version available. Could you please ping me then? Thanks!

I'll do that when the next version available. Could you please ping me then? Thanks!
Owner

@linsui

We are pretty much ready to tag, if F-Droid builds before you change the metadate we will have a non-working version for Fossil Hybrid HR (because auf the missing new widgets), wouldn't it make sense to first update the metadata?

@linsui We are pretty much ready to tag, if F-Droid builds before you change the metadate we will have a non-working version for Fossil Hybrid HR (because auf the missing new widgets), wouldn't it make sense to first update the metadata?
Author

I opened an MR beased on master. https://gitlab.com/fdroid/fdroiddata/-/merge_requests/9568. The checkupdate bot runs once a day so it's not likely to pick the new version before I merge it.

I opened an MR beased on master. https://gitlab.com/fdroid/fdroiddata/-/merge_requests/9568. The checkupdate bot runs once a day so it's not likely to pick the new version before I merge it.
Owner

@linsui

Thanks!
Just tagged 0.59.1

@linsui Thanks! Just tagged 0.59.1
Author

Done. Thanks!

Done. Thanks!
Owner

@linsui

Many thanks, 0.59.1 was build successfully.

Now I tagged 0.59.2 which introduced C code (ndk), does this require a metadata update?

This is a temporary solution, I would like to convert the code to java later, but right now it is important.

@linsui Many thanks, 0.59.1 was build successfully. Now I tagged 0.59.2 which introduced C code (ndk), does this require a metadata update? This is a temporary solution, I would like to convert the code to java later, but right now it is important.
Author

Thanks! I'll update it.

Thanks! I'll update it.
Owner

@linsui

Oh, then it is neccessary?

@linsui Oh, then it *is* neccessary?
Author

Yes, we need to specify the ndk.

Yes, we need to specify the ndk.
Owner

@linsui

Ok ok, I didn't specify anything, so I have no idea what is appropriate. There is only C code and should compile with any ndk

@linsui Ok ok, I didn't specify anything, so I have no idea what is appropriate. There is only C code and should compile with any ndk
Author

I test it and there is a problem. fdroidserver executes cleam task before scanning so that GBDaoGenerator is built. The clean task shouldn't depends on a build task. I'll add it the scandelete. Could you please also fix it on your side? Thanks!

I test it and there is a problem. fdroidserver executes cleam task before scanning so that GBDaoGenerator is built. The clean task shouldn't depends on a build task. I'll add it the scandelete. Could you please also fix it on your side? Thanks!
Owner

@linsui

I can try, maybe the metadata reveals a hint on how to do that ;)

It might sound odd, but I really hate java and the associated "ecosystem" 😬

@linsui I can try, maybe the metadata reveals a hint on how to do that ;) It might sound odd, but I really hate java and the associated "ecosystem" 😬
Owner

How are we on this ticket guys, is it all sorted or do we still need to do something? cheers P.

How are we on this ticket guys, is it all sorted or do we still need to do something? cheers P.
Author

GBDaoGenerator is still build in gradle clean.

GBDaoGenerator is still build in gradle clean.
Owner

@linsui we are very happy to have you here at Codeberg :)

Our build now fails: https://monitor.f-droid.org/builds/log/nodomain.freeyourgadget.gadgetbridge/211#site-footer

BUILD SUCCESSFUL in 2m 19s
96 actionable tasks: 96 executed
2022-05-21 09:08:33,399 DEBUG: Popen(['git', 'cat-file', '--batch-check'], cwd=/home/vagrant/build/nodomain.freeyourgadget.gadgetbridge, universal_newlines=False, shell=None)
2022-05-21 09:08:33,403 INFO: Successfully built version 0.67.0 of nodomain.freeyourgadget.gadgetbridge from 6a4b28c5e0c2fe516e57514c668cb55284168aa4
2022-05-21 09:08:33,404 ERROR: Could not build app nodomain.freeyourgadget.gadgetbridge: Failed to find any output apks
2022-05-21 09:08:33,405 DEBUG: Error encoutered, stopping by user request.

I presume this is due to a different apk output path, after we added new product flavor for bangle.js:

2cb5844020

2cb5844020/app/build.gradle (L125)

I am not that well versed in fdroid but it seems that we need to tell it which variant to build and/or the output directory? Something like...:

gradle:
	- yes
	- main
    output: build/outputs/apk/main/release

Does it need a human interaction or can fdroid understand what happened and will it try to do this automatically?

@linsui we are very happy to have you here at Codeberg :) Our build now fails: https://monitor.f-droid.org/builds/log/nodomain.freeyourgadget.gadgetbridge/211#site-footer ``` BUILD SUCCESSFUL in 2m 19s 96 actionable tasks: 96 executed 2022-05-21 09:08:33,399 DEBUG: Popen(['git', 'cat-file', '--batch-check'], cwd=/home/vagrant/build/nodomain.freeyourgadget.gadgetbridge, universal_newlines=False, shell=None) 2022-05-21 09:08:33,403 INFO: Successfully built version 0.67.0 of nodomain.freeyourgadget.gadgetbridge from 6a4b28c5e0c2fe516e57514c668cb55284168aa4 2022-05-21 09:08:33,404 ERROR: Could not build app nodomain.freeyourgadget.gadgetbridge: Failed to find any output apks 2022-05-21 09:08:33,405 DEBUG: Error encoutered, stopping by user request. ``` I presume this is due to a different apk output path, after we added new product flavor for bangle.js: https://codeberg.org/Freeyourgadget/Gadgetbridge/commit/2cb5844020a4df0e7eb29180b32a8d93e76fbdd8 https://codeberg.org/Freeyourgadget/Gadgetbridge/src/commit/2cb5844020a4df0e7eb29180b32a8d93e76fbdd8/app/build.gradle#L125 I am not that well versed in fdroid but it seems that we need to tell it which variant to build and/or the output directory? Something like...: ```yaml gradle: - yes - main output: build/outputs/apk/main/release ``` Does it need a human interaction or can fdroid understand what happened and will it try to do this automatically?
Author

I'm going to push a fix. The build falvor need to be set.

I'm going to push a fix. The build falvor need to be set.
Owner

I'm going to push a fix. The build falvor need to be set.

That would be wonderful, please. Thank you.

> I'm going to push a fix. The build falvor need to be set. That would be wonderful, please. Thank you.

This is not fixed?

This is not fixed?
Owner

This is not fixed?

Depends on what you mean. The initial issue is solved. The following:

GBDaoGenerator is still build in gradle clean.

works as is and as nobody complains and the system builds the stuff it seems to be in the "solved" teritory, rather then being an issue...

> This is not fixed? > Depends on what you mean. The initial issue is solved. The following: >GBDaoGenerator is still build in gradle clean. works as is and as nobody complains and the system builds the stuff it seems to be in the "solved" teritory, rather then being an issue...
Author

Ah, I forgot closing this issue. I hardly use codeburg...

Ah, I forgot closing this issue. I hardly use codeburg...
Sign in to join this conversation.
No Milestone
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Freeyourgadget/Gadgetbridge#2357
No description provided.