Verify the possibility of adding a file duplication check to soong
Activity

Carlos Seo May 15, 2023 at 11:52 PM
Although the patch is already approved, Stephen Hines wanted to double check a few things. It’s been 3 weeks, so I pinged him and I’m waiting for a response.

Carlos Seo March 2, 2023 at 10:03 PM
Upstream review: https://android-review.googlesource.com/c/platform/build/+/2467321

Carlos Seo December 22, 2022 at 3:44 PM
Patch sent to Google. If they think it’s interesting to add it to the build system, I’ll submit to AOSP upstream.

Carlos Seo December 7, 2022 at 7:22 PM
It is possible to add a script to the build system. As long as the commands used in the script are in the allowed list in PathConfig
in build/soong/ui/build/paths/config.go
, it should run.
The build system creates the rules from build/make/core/Makefile
, so the script must be included in a target that depends on the file system image being generated. Soong will use this Makefile to generate a ninja file and the build will run as usual.
If we were to submit such a check to AOSP, I think it would be best to avoid changing the list of allowed commands, or at least not add anything that might be controversial in there (i.e. impacts security or reproducibility of builds).
Details
Details
Assignee

Reporter

Task 782 show that there are many file duplications (or nearly identical duplications). Check if there is a way to add a verification in soong at the end of the build so that it warns about this.