Finding target based on source files

98 views
Skip to first unread message

Paulo Maia

unread,
Dec 13, 2021, 5:50:32 PM12/13/21
to Android Building
Hello ,
Currently I have been working on a feature to build gerrit single or chained changes 
Ex: 
Some makes a change (gerrit patchset update) to frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileSignalController.java
I know just for experience that I need to make SystemUI target to check if that change is going to compile successful .
But I want to automate this somehow, so far I have been using module-info.json to try and find target to build based on the checkout path , but this is not very reliable (since I can pickup extra targets on the same repo/project)

I wonder if anyone here has any insights on that matter or have implemented something similar. If so please do share :D

PS: There is one very cool project called bgraph (https://pypi.org/project/bgraph/) but relies only on the existence of Android.bp file it works pretty good , but it is limited.

BR,
Paul

Dan Willemsen

unread,
Dec 13, 2021, 7:48:23 PM12/13/21
to android-...@googlegroups.com
This isn't a simple problem, even just in Soong (what do you do when an Android.bp file changes? what about a product config file that changes how a module is built, but is nowhere near it?). At Google we're largely just building a representative sample, but using incremental builds -- so we're always doing a bunch of builds, but if we've determined nothing interesting has changed, they're very short. There are some out-of-tree configurations that trigger more presubmit builds in some cases where the representative sample is not large enough, but those are all maintained by hand, not automatically.

Test capacity is also a concern, and you'll find TEST_MAPPING files throughout AOSP that attempt to say which tests should be run when files under them are changed. Here are the docs for these: https://source.android.com/compatibility/tests/development/test-mapping

- Dan

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-...@googlegroups.com
To unsubscribe from this group, send email to
android-buildi...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/c0052985-6923-42e7-adb7-1ade271cf966n%40googlegroups.com.

Paulo Maia

unread,
Dec 14, 2021, 7:39:59 PM12/14/21
to android-...@googlegroups.com
Hi Dan,
Thank you for the response.
Yeah it's not a very simple problem to solve , for product configuration I`m skipping the builds for now since I have to build the product for those changes to take effect.
For Android.mk and Android.bp files the script checkout the changes from gerrit and rebuilds the module-info.json(make out/target/product/TARGET/module-info.json) file with the updated/added module changes.
For now I am more concerned about compilation so I can avoid devs to "break" branches.
Anyway thank you for your insights.
BR,
Paul

You received this message because you are subscribed to a topic in the Google Groups "Android Building" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/android-building/Mon9kAQBxsQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to android-buildi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-building/CALQgHdkr37PrOd1uKc-a2jeAYVSpfd8T6KWdJmpfPXiZc0Z0Fg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages