summaryrefslogtreecommitdiff
path: root/scripts/gen_build_prop.py
diff options
context:
space:
mode:
author Spandan Das <spandandas@google.com> 2024-12-12 23:40:52 +0000
committer Spandan Das <spandandas@google.com> 2024-12-13 21:17:09 +0000
commit301c2300444b06c107e8fc9ccc0fd1599c4132a8 (patch)
tree1582e9658ae50d88aede2ef2c0e97ca3b1bb3b76 /scripts/gen_build_prop.py
parentc064b1b4cc6c6c5106fefbca3871e4af15bead29 (diff)
Normalize filepath comment for gen files in build.prop
build.prop contains a `# from $filepath` comment to log the origin of a sysprop. This is useful to have, but causes the metadata of vendor/build.prop to be different between make and soong built partitions. This CL replaces the absolute filepath of generated files with their filenames in the build.prop comment. Bug: 382295862 Test: commented out notice files in build/make/core/Makefile Test: lunch aosp_cf_x86_64_phone-trunk_staging-userdebug Test: export BUILD_DATETIME=10 Test: verified that vendor.img built by make and soong have the same sha Change-Id: Ib0caad5fa0171c39317646e49372a69534a42af0
Diffstat (limited to 'scripts/gen_build_prop.py')
-rw-r--r--scripts/gen_build_prop.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/gen_build_prop.py b/scripts/gen_build_prop.py
index 47bbf590a..430e6134a 100644
--- a/scripts/gen_build_prop.py
+++ b/scripts/gen_build_prop.py
@@ -108,7 +108,7 @@ def parse_args():
def generate_common_build_props(args):
print("####################################")
- print("# from generate_common_build_props")
+ print("# from generate-common-build-props")
print("# These properties identify this partition image.")
print("####################################")
@@ -243,9 +243,15 @@ def generate_build_info(args):
print(f"# end build properties")
def write_properties_from_file(file):
+ # Make and Soong use different intermediate files to build vendor/build.prop.
+ # Although the sysprop contents are same, the absolute paths of these
+ # intermediate files are different.
+ # Print the filename for the intermediate files (files in OUT_DIR).
+ # This helps with validating mk->soong migration of android partitions.
+ filename = os.path.basename(file.name) if file.name.startswith(os.environ.get("OUT_DIR")) else file.name
print()
print("####################################")
- print(f"# from {file.name}")
+ print(f"# from {filename}")
print("####################################")
print(file.read(), end="")