summaryrefslogtreecommitdiff
path: root/android/module.go
AgeCommit message (Collapse)Author
2024-06-19Merge "Experimental code to support build action caching." into main Yu Liu
2024-06-19Experimental code to support build action caching. Yu Liu
Bug: 335718784 Test: build locally Change-Id: Icc1f1fb15f9fe305e95dd51e2e7aff1e9cbf340c
2024-06-17Make required a configurable property Cole Faust
So that users can use select statements with it. Fixes: 347605145 Bug: 342006386 Test: m nothing --no-skip-soong-tests Change-Id: Ica0ca6d1725b000b3748c0293e5a9f9b38ed87f9
2024-06-04Use OutputFilesProvider on bpf mrziwang
This changes makes bpf module type uses OutputFilesProvider, instead of current OutputFileProducer for inter-module- communication. Test: CI Bug: 339477385 Bug: 342406930 Change-Id: I85d1141e9f6583cc5427756107da99f56b0c7ea1
2024-05-28Required deps don't track native bridge architectures Jiyong Park
Bug: 342945184 Test: build aosp_cf_x86_64_only_phone and check if out/target/product/vsoc_x86_64_only/system/lib64/arm64 directory doesn't exist. Change-Id: I1638610ac686b369b23390768af1564b3cf38d9b
2024-05-21Export release flag types to make/soong Cole Faust
And use the types to appropriately type selects on the release variables. Bug: 323382414 Test: Presubmits Change-Id: Ide7eca95662caaa7b4be42e20399d9fcd7fed35f
2024-05-20Dump the required modules into module-info.json Hugo Drumond Jacob
Certain applications, like tracking the dependency chain of modules, knowing the "required" dependencies is required. In this context, "required" here means the `required` field in Android.bp files. Bug: 339193439 Test: Inspect module-info.json for the `required` field Change-Id: I420c781d410e715ef86823278f99e4ffe51f8022
2024-05-17Select supports product_variable("debuggable") Jiyong Park
Bug: N/A Test: run soong test with the next change Change-Id: Id7a83961dc9f47191135219f0cea2c02b64a1666
2024-05-14Merge changes I5645ddb9,Ib3d50f15,Ib4c5815a,If3b63706 into main Treehugger Robot
* changes: Revert "Revert^2 "Always embed jni libs and store uncompressed"" Revert "Revert "Revert "Collect transitve deps of jni libs only for bund..."" Revert "Add SkipToTransitiveDepsTag interface for dependency tags" Revert "Install transitive deps of jni libs, but not the jni libs themselves"
2024-05-15Revert "Add SkipToTransitiveDepsTag interface for dependency tags" Jiyong Park
This reverts commit 1fb7c3512989311818af83d6aee246f171907a05. Change-Id: Ib4c5815a06785cd876caa37acc0522adc26bc495
2024-05-14Merge "Fix: required deps from native module to phony module is respected" ↵ Jiyong Park
into main
2024-05-13Soong filesystem may install aconfig_flags.pb Justin Yun
By setting aconfig_flags: true, soong filesystem module installs the aconfig_flags.pb file to its etc directory. We need to define aconfigFilePaths to ModuleBase to store the list of aconfig file paths that is generated from the GenerateBuildActions(). The aconfigFilePaths are collected when build the filesystem module to build the aconfig_flags.pb for the filesystem image. Bug: 335363964 Test: compare the cache list with those generated from make. Change-Id: Ia32b566bf43174e94b9e610b9503608c6b583899
2024-05-13Fix: required deps from native module to phony module is respected Jiyong Park
This change fixes a bug that required deps from native module to phony module was ignored. It happened because addRequireDeps incorrectly thought that both are native modules with different bitness (32->64), which isn't. Fix this by doing the bitness check only when both the current module and the required module are native modules. Bug: N/A Test: go test ./... under build/soong/filesystem Change-Id: I494ebc47e29001f174fa44d72809041f8ceffb0b
2024-05-10Merge changes from topic "reland_embedded_jni" into main Jiyong Park
* changes: Install transitive deps of jni libs, but not the jni libs themselves Add SkipToTransitiveDepsTag interface for dependency tags Revert "Revert "Collect transitve deps of jni libs only for bund..." Revert^2 "Always embed jni libs and store uncompressed"
2024-05-10Add SkipToTransitiveDepsTag interface for dependency tags Jiyong Park
Consider this dependency graph: A --> B --> C And let's assume that B is built into A (e.g. static_libs), while B --> C is a runtime dependency (e.g. required). We want to install C (but not B of course) when A gets installed. However, before this change, it was not supported because the dependency A -> B was not tracked in computeInstallDeps. One had to explicitly add a A -> C dependency. This change fixes the problem by introducing the new interface SkipToTransitiveDepsTag. computeInstallDeps uses it to decide whether to take all install files and packaging specs or only those from transitive dependencies. In the above example, if the dependency A --> B implements the new interface and returns true, B's transitive dependencies (i.e. C) are added into A's transitive dependencies. B's outputs are not added. Bug: N/A Test: go test ./... under soong/android Change-Id: I3ca03a21633883f320ecb9e5bc82eb134519cd88
2024-05-10Remove duplicated CollectDependencyAconfigFiles() Justin Yun
android.ModuleBase already calls aconfigUpdateAndroidBuildActions() that is the same with CollectDependencyAconfigFiles(). Remove the CollectDependencyAconfigFiles() to avoid duplication with aconfigUpdateAndroidBuildActions(). To make the aconfig information available in GenerateAndroidBuildActions() of all modules, call aconfigUpdateAndroidBuildActions() before calling GenerateAndroidBuildActions() of each module. Also, we don't need SetAconfigFileMkEntries(), which is a duplicate of aconfigUpdateAndroidMkData() Bug: 335363964 Test: diff `adb shell printflags` before and after the change. Change-Id: I52808e442e9fed7db1eae7b7c5ed0b1c5ba74f5d
2024-05-09Rename release_variable to release_flag in selects Cole Faust
To be more consistent with the terminology used in the rest of the release flag infrastructure. Bug: 323382414 Test: Presubmits Change-Id: I176ce164c00e95ef7653608298b0051da3298aa9
2024-05-07Merge "Make the enabled property configurable" into main Cole Faust
2024-05-02Make the enabled property configurable Cole Faust
This allows using select statements with it. Bug: 323382414 Test: m nothing --no-skip-soong-tests Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191 Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
2024-05-01Use no_full_install: true instead of installable: false Jiyong Park
So far, we have used `instalable: false` to avoid collision with the other modules that are installed to the same path. A typical example was <foo> and <foo>.microdroid. The latter is a modified version of the former for the inclusion of the microdroid image. They however both have the same instalation path (ex: system/bin) and stem (ex: foo) so that we can reference them using the same path regardless of whether we are in Android or microdroid. However, the use of `installable: false` for the purpose is actually incorrect, because `installable: false` also means, obviously, "this module shouldn't be installed". The only reason this incorrect way has worked is simply because packaging modules (ex: android_filesystem) didn't respect the property when gathering the modules. As packaging modules are now fixed to respect `installable: false`, we need a correct way of avoiding the collision. `no_full_install: true` is it. If a module has this property set to true, it is never installed to the full instal path like out/target/product/<partition>/... It can be installed only via packaging modules. Bug: 338160898 Test: m Change-Id: Iee9be674951d0bf3d5e26432fcbae9afebb6007b
2024-04-26Update accesses to ConfigurableCondition Cole Faust
So that we can have a guarantee that ConfigurableCondition is immutable. Bug: 323382414 Test: m nothing --no-skip-soong-tests Change-Id: I7c42d6899914bc5fa8927377d359ed6506ba7378
2024-04-17Merge "Revert^2 "Use Module interface in addRequiredDeps"" into main Treehugger Robot
2024-04-17Revert^2 "Use Module interface in addRequiredDeps" Jiyong Park
This reverts commit bbcdaa0c32498d212e2af65984b0180bfbf3925b. Reason for revert: relanding with a forward fix Change-Id: I14b83010a4b8d9cb9cb317f2aa07875c17f6cdaa
2024-04-17Merge "Revert "Use Module interface in addRequiredDeps"" into main Daren Liao
2024-04-17Revert "Use Module interface in addRequiredDeps" Daren Liao
This reverts commit de18a3d55a46c5647039f8fe38ff13a9372e7b1b. Reason for revert: b/335332155 Change-Id: Ib5b74b1704c1446713466e8617c42b212c960d49
2024-04-16Merge "Change the syntax for arch selecting and add os selecting" into main Treehugger Robot
2024-04-16Merge "Use Module interface in addRequiredDeps" into main Jiyong Park
2024-04-13Use Module interface in addRequiredDeps Jiyong Park
Previously, addRequiredDeps directly called RequiredModuleNames directly on ModuleBase. As a result, it failed to correctly track the dependencies for the modules which are overriding RequiredModuleNames. cc_* were those. Fixing this by calling RequiredModuleNames via the Module interface. Bug: 321626681 Test: go test ./... under filesystem Change-Id: I79de616606b88277da0b3e86b21316ee83e0ec71
2024-04-11Change the syntax for arch selecting and add os selecting Cole Faust
This changes the syntax from select(variant("arch"), {...}) to select(arch(), {...}) to make it shorter and to make it clear that we can restrict what variants you can select on. Bug: 323382414 Test: m nothing --no-skip-soong-tests Change-Id: Iafe05b5f455895313a563ed6292f4016b58180b0
2024-04-11Update the ConfigurableEvaluator for typed selects Cole Faust
See the blueprint cl for more information. Also added tests for both multivariable and typed selects. Bug: 323382414 Test: m nothing --no-skip-soong-tests Change-Id: I00c1a3c56d34affb88f4b4d911c318b28ffe7695
2024-04-05fix: required property doesn't track deps to java, apex, ... Jiyong Park
This change fixes a bug that the required property doesn't track dependencies to modules whose arch is common. Bug: 321000103 Bug: 321626681 Test: go test ./... Change-Id: I3d2b3ad8cb2a9f1c5c3d5345bf05402a787f011a
2024-03-30Merge "fix: required deps of phony modules are correctly tracked" into main Jiyong Park
2024-03-29fix: required deps of phony modules are correctly tracked Jiyong Park
ArchType.Multilib of native modules are either lib32 or lib64. Arch-neural modules have "" not "common". Bug: 321626681 Test: go test ./... Change-Id: Ie7e6a5203e9f671487dbf32ea2343ada7407a28f
2024-03-25Implement OtherModulePropertyErrorf proxies Cole Faust
Also move EvaluateConfiguration() to a standalone configurationEvalutor object, which can be constructed from a ModuleBase and a minimial context. This allows us to evaluate configurable properties in scenarios where we don't have much more than the module. Bug: 323382414 Test: m nothing --no-skip-soong-tests Change-Id: I2d1c9f42a469c399f34c759410509aeae095becb
2024-03-25Add the ability to select on arch Cole Faust
Bug: 323382414 Test: go test Change-Id: I0d4cf391a1a625c5160456db1f4f7fa424c2141e
2024-03-20Add required, host_required, and target_required as dependencies Jiyong Park
So far, the installation of required modules were handled by Make. This prevents us from implementing the module installation and packaging entirely in Soong. This CL is the first step towards that goal. Soong now correctly tracks the dependencies and they are correctly returned by TransitivePackagingSpecs(), which is used by packaging modules like android_system_image. Bug: 321626681 Test: build Change-Id: I9192b5333ceaa0b7d1c5c4abeec2af62febcd976
2024-03-07Validate aconfig libs are built with the correct modes. Yu Liu
Bug: 323071835 Test: Unit tests and manual tests. Change-Id: I32de90826c7c8bb4d8495608e959d554820ab9a2
2024-02-05Automatically propagate jarjar rules for aconfig libraries Joe Onorato
Test: treehugger Bug: 310504781 (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:97c03a6dc659102ff40793759fb3f0f18164a85b) Merged-In: I639d12ff33175b7bed7e7d0595a40dd9b0d99367 Change-Id: I639d12ff33175b7bed7e7d0595a40dd9b0d99367
2024-01-24Propagate AconfigFiles in ModuleBase. LaMont Jones
Aconfig file dependencies are module-independent, and properly part of ModuleBase. Bug: b/308625757 Test: manual Change-Id: I38c5907d1671cc69bb198345201316ae781fdc9f
2024-01-24Merge changes from topic "transition-mutator-config" into main Colin Cross
* changes: Add ArchModuleContext to TransitionMutator contexts Split ArchMutatorContext out of BaseMutatorContext
2024-01-24Add ArchModuleContext to TransitionMutator contexts Colin Cross
Converting coverageMutator to a TransitionMutator requires adding the ctx.Device() and ctx.DeviceConfig() methods. Bug: 319288033 Test: builds Change-Id: I697b48eb89bc23800d2d3c62d68358769f0d1075
2024-01-24Split ArchMutatorContext out of BaseMutatorContext Colin Cross
Split the context methods that are useful on anything visiting a module that has arch variants into a separate ArchMutatorContext for reuse by TranstitionMutators. Bug: 319288033 Test: builds Change-Id: Ifdc21983c6c79f22965a49f169812a8cc3ad975b
2024-01-23Merge "Add team property to all modules." into main Ronald Braunstein
2024-01-19Add VisitDirectDepsIgnoreBlueprint LaMont Jones
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-18Add team property to all modules. Ronald Braunstein
This allows vendors (like google) to specify which team owns the test module and code. Team is a commonProperty on modules and points to the designate "team" module. The DepsMutator adds the dependency on the "team" module and "GenerateBuildActions" write the team data to intermediate files. A new singleton rule, all_teams visits all modules and writes out the proto containing the team for each module. If a module doesn't have a team, then it finds the package in the blueprint file and parent directory blueprint files that have a default_team and uses that team. Test: m all_teams Test: go test ./python ./java ./cc ./rust ./android Test: added team to HelloWorldHostTest and built the new asciiproto target Test: added package default_team and checkout output proto. Change-Id: I5c07bf489de460a04fc540f5fff0394f39f574a7
2024-01-09"master" was renamed "main". Elliott Hughes
Test: N/A Change-Id: I86d5578eaac260e55a9583db7ab49812b4ba1f5d
2024-01-02Support generating module_info.json in Soong Colin Cross
Generate module_info.json for some Soong modules in Soong in order to pass fewer properties to Kati, which can prevent Kati reanalysis when some Android.bp changes are made. Soong modules can export a ModuleInfoJSONProvider containing the data that should be included in module-info.json. During the androidmk singleton the providers are collected and written to a single JSON file. Make then merges the Soong modules into its own modules. For now, to keep the result as similar as possible to the module-info.json currently being generated by Make, only modules that are exported to Make are written to the Soong module-info.json. Bug: 309006256 Test: Compare module-info.json Change-Id: I996520eb48e04743d43ac11c9aba0f3ada7745de
2024-01-02Install vintf fragments and init.rc files in Soong Colin Cross
Determine the install location of vintf fragments and init.rc files in Soong so that they are available to Soong-generated module-info.json entries. Collect the vintf fragment and init.rc files requested by all Soong modules, deduplicate the list, and install them in Soong. Bug: 309006256 Test: Compare module-info.json Change-Id: I491dc05a773d1a82e485475834d2669fc95cfa1e
2023-12-18Remove cc.moduleContext override of android.ModuleContext.*Specific Colin Cross
Overriding android.ModuleContext's implementations of *Specific() methods in cc.moduleContext and then passing that back to android.PathForModuleInstall to affect the install path causes problems if android.ModuleBase.GenerateBuildActions also tries to call android.PathForModuleInstall directly with the android.ModuleContext as it gets a different result. Add InstallIn* methods to the android.Module interface, implement default versions in android.ModuleBase, and override them in cc.Module and rust.Module. Use them in android.PathsForModuleInstall to allow the module to customize the behavior directly. Test: TestInstallPartition Change-Id: I7840e07eae34ac4f4d3490b021143d5f33a83626
2023-12-14Convert Provider to generic providers API Colin Cross
Convert all of the callers of Provider/HasProvider to use the type-safe android.ModuleProvider API. Bug: 316410648 Test: builds Change-Id: I73479de1625fa2865b6c73444cd477e50d56dc5a