Commit graph

10 commits

Author SHA1 Message Date
Spandan Das
87f5ee4cb6 Fix some non-determinism in aconfigMerge operation
Sorted iteration ensures that `mergeAconfigFiles` generates the ninja
rules in a deterministic fashion.

Test: mv out/soong/build.ninja; regenerate; compare; bit-identical
after this change

Change-Id: Ic9bee14374fa1eb7adee670eaed42ad6ffdd9010
2024-03-28 21:26:49 +00:00
Yu Liu
67a28425a7 Validate aconfig libs are built with the correct modes.
Bug: 323071835
Test: Unit tests and manual tests.
Change-Id: I32de90826c7c8bb4d8495608e959d554820ab9a2
2024-03-07 18:51:16 +00:00
Zi Wang
0e5d16c6f0 Add property Exportable to aconfig_declarations
Only when aconfig_declarations explicitly set this property true,
its flags will be repackaged.

If a java_aconfig_library has mode "exported", its corresponding
aconfig_declarations must have exportable prop set to true.

Test: Added unit tests and CI

Bug: 310504781

Ignore-AOSP-First: this change will be cherry picked to aosp
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:e4527f3010b3fd6f33948a15a9b4fdc944da34f0)
Merged-In: Ie9526e3755a6e7d142b377d5dd85a1bc60ffabc5
Change-Id: Ie9526e3755a6e7d142b377d5dd85a1bc60ffabc5
2024-02-08 06:19:34 +00:00
Spandan Das
4d4edfb8d8 Sort the inputs to mergedAconfigFilesRule
The aconfig files are collected by visiting the direct deps of the
module. VisitDirectDeps does not guarantee ordered traversal. To prevent
non-determinism in the generated ninja file, sort the inputs.

Test: go build ./android
Change-Id: Ic67fc0859bf18de62b6297ed502d1d495cc3a780
2024-02-05 19:34:48 +00:00
LaMont Jones
b509938e4f Propagate AconfigFiles in ModuleBase.
Aconfig file dependencies are module-independent, and properly part of
ModuleBase.

Bug: b/308625757
Test: manual

Change-Id: I38c5907d1671cc69bb198345201316ae781fdc9f
2024-01-24 23:45:12 +00:00
LaMont Jones
34314b7d15 Add VisitDirectDepsIgnoreBlueprint
This method allows dependencies on non-Android modules, which it ignores
in strict mode, rather than flagging the dependency as an error.

Bug: none
Test: manual
Change-Id: I9575e46638fa8ffc69c8935b1b65aab37ceab3c3
2024-01-19 20:22:10 +00:00
Yu Liu
edeadbfdcf Add container to the path of the merged aconfig files.
Bug: 312769710
Test: CI
Change-Id: I4b8a71cf86a3bcefc4a41360a241aa14b798f6e8
2024-01-10 23:38:09 +00:00
LaMont Jones
acae2d7656 move SetAconfigFileMkEntries to android
This will need to be called by some modules handled in android.

Bug: 308625757
Test: manual
Change-Id: Ic56e8ef3a453c59866aab6d39a21108cf8536b56
2024-01-10 14:03:29 +00:00
LaMont Jones
1e0a69a02e aconfig: harden dependency collection
To prevent errors, when we collect dependencies for a module, walk the
blueprint modules, and ignore blueprint and disabled modules.

This avoids errors in validateAndroidModule when a android.Module (such
as a genrule) depends on a blueprint.Module, and strict checking is
enabled.

Bug: 308625757
Test: manual

Change-Id: I11f0a0b504aa18d6d786cc91319b9d1d9497c04f
2024-01-10 14:02:47 +00:00
LaMont Jones
aa005ae080 move CollectDependencyAconfigFiles to android
This needs to be called by some modules in android.

Bug: 308625757
Test: manual
Change-Id: I389fcfd88a3f4bd85a9218fdd4dd66d8a239bb67
2023-12-19 19:34:00 +00:00