Skip to content
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

[RFE] consider adding GSI, EMU builds to your buildbot #462

Closed
Lanchon opened this issue Aug 2, 2023 · 10 comments
Closed

[RFE] consider adding GSI, EMU builds to your buildbot #462

Lanchon opened this issue Aug 2, 2023 · 10 comments
Assignees

Comments

@Lanchon
Copy link

Lanchon commented Aug 2, 2023

please consider adding LOS20 target lineage_gsi_arm64 and maybe lineage_sdk_phone_x86_64 to your buildbot, for GSI users and emulator users.

see: https://wiki.lineageos.org/emulator#start-the-build

thanks!

EDIT: come to think about it, people using GSI builds are probably stuck with older kernels, so a LOS18.1 lineage_arm64 build would also be useful. android 12+ kernels require BPF support, which is the reason why many LOS targets are stuck on LOS18.1 and why the LOS team did not deprecate 18.1.

@petefoth
Copy link
Contributor

petefoth commented Aug 2, 2023

The gsi targets look feasible.

Not sure about the emulator builds which seem to involve an extra step, beyond the mka bacon that our build script does

PS what is '[RFE]'?

@petefoth
Copy link
Contributor

petefoth commented Aug 2, 2023

I plan to try a test build of the 20.1 lineage_gsi_arm64-userdebug target when I get some time. If it goes OK we can add it - and maybe the 18.1 & 19.1 versions as well - and to the build target list for the September build run

@petefoth petefoth self-assigned this Aug 2, 2023
@Lanchon
Copy link
Author

Lanchon commented Aug 2, 2023

what is '[RFE]'?

request for enhancement, meaning it's really not a bug or issue.

and maybe the 18.1 & 19.1 versions as well

thanks! 18.1 is much more important. i think that GSI 20 builds would mostly work where 19 builds do, as kernels are similar. but neither of those would work with the non-BPF kernels of older devices, so a 18.1 build is important.

@petefoth
Copy link
Contributor

petefoth commented Aug 2, 2023

OK. I'll try an 18.1 build

@petefoth
Copy link
Contributor

petefoth commented Aug 5, 2023

Adding 'Fix next' label. We'll give this a try when the current build run is complete

@petefoth
Copy link
Contributor

petefoth commented Aug 27, 2023

OK. I'll try an 18.1 build

From what I have read, GSI's are useful for Treble-capable devices, which are not yet supported by LOS, possibly because they are too new, which means they are probably running Android 13, and almost certainly arm64. So I'll start with a 20.0 build of lineage_gsi_arm64 target.

Later:

So trying to build using Docker failed,

>> [Sun Aug 27 12:27:51 UTC 2023] breakfast failed for lineage_gsi_arm64, lineage-20.0 branch

breakfast failed because there is not device tree

Device lineage_gsi_arm64 not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Repository for lineage_gsi_arm64 not found in the LineageOS Github repository list. If this is in error, you may need to manually add it to your local_manifests/roomservice.xml.

This is not going to be straightforward, and I'm nt interested enough to send much time researching / working out how to build. I'm happy tp receive ideas fromanyone else, but I won;t be following it up myself.

Changing label to Fix sometime

@petefoth
Copy link
Contributor

petefoth commented Dec 2, 2024

This is not a feature we need, and I've not seen any much demand for it.

Closing it as 'Won't fix'

@petefoth petefoth closed this as completed Dec 2, 2024
@Phyks
Copy link

Phyks commented Dec 4, 2024

Hi,

I came across this issue while trying to build an emulator image with the provided Docker. Out of the box, it does not work:

docker run   -e "BRANCH_NAME=lineage-18.1"     -e "DEVICE_LIST=arm64"     -v "./src:/srv/src"     -v "./zips:/srv/zips"     -v "./logs:/srv/logs"     -v "./cache:/srv/ccache"  -e "CCACHE_SIZE=10G"  -e "PARALLEL_JOBS=4"   lineageos4microg/docker-lineage-cicd

fails with an enigmatic build error on bacon (FAILED: bacon).

I found out that the Docker image runs mka target-files-package bacon which does not apply for emulator image (https://wiki.lineageos.org/emulator states to just run mka).

With the following diff:

diff --git a/src/legacy-build.sh b/src/legacy-build.sh
index f168fd2..5aba92f 100755
--- a/src/legacy-build.sh
+++ b/src/legacy-build.sh
@@ -484,7 +484,7 @@ for branch in ${BRANCH_NAME//,/ }; do
           build_successful=false
           files_to_hash=()
 
-          if (set +eu ; mka "${jobs_arg[@]}" target-files-package bacon) &>> "$DEBUG_LOG"; then
+          if (set +eu ; mka "${jobs_arg[@]}") &>> "$DEBUG_LOG"; then
 
             if [ "$MAKE_IMG_ZIP_FILE" = true ]; then
               # make the `-img.zip` file

The docker can successfully build a Lineage-18.1 arm64 emulator image. ZIP files are not produced (should run mka sdk_addon afterwards), but built images can be found under ./src/LINEAGE_18_1/out/target/product/generic_arm64/.

Few questions if interested:

  • Would it make sense to clean the code and make a proper PR to handle arm64 target (and equivalent emulator targets) by not building bacon in this case? In which case, it should also run the mka command to build the ZIP of images and cp it to the zips folder.
  • If so, I'm relatively new to the Android build system, is there a more specific target than mka (without any explicit one) which should be preferred for building the emulator (instead of bacon)?

Best

@petefoth
Copy link
Contributor

petefoth commented Dec 4, 2024

Thanks for taking the time to look into this.

We're not going to change our docker image to allow building emulator images, because the scope of this project is to make regular builds for real devices. If we changed the image as you describe to call just mka instead of mka target-files-package bacon it would no longermake the artefacts we need for our device builds.

A small number of people have asked about building emulator images and / or GSIs. It should be possible to do this using our image as a base, and modifying it, as described in this article to include your changes. If anyone does try that approach, please do report back here on how you get on.

But, as stated above, we are not going to make any changes to our images, because this feature is outside the scope of - and not needed by - this project.

Thanks again.

@Phyks
Copy link

Phyks commented Dec 4, 2024

Hi,

Thanks a lot for your feedback. Just a clarification on what I had in mind when offering a PR:

We're not going to change our docker image to allow building emulator images, because the scope of this project is to make regular builds for real devices. If we changed the image as you describe to call just mka instead of mka target-files-package bacon it would no longermake the artefacts we need for our device builds.

I was not thinking about changing the line to a plain mka for all builds (since this would change the current behavior of the Docker image), and was only showcasing the diff as an example for whoever might come across this thread.

What I had in mind would be to check the value of current built device (from DEVICE_LIST)

  • If arm64 (or any such build target for emulator, see table in https://wiki.lineageos.org/emulator#start-the-build), then run mka sdk_addon / mka emu_img_zip (depending on Lineage branch)
  • Otherwise, build with the current line, mka target-files-package bacon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants