Commit Graph

8166 Commits

Author SHA1 Message Date
Colin Cross
3b1c6847c4 Make PathForArbitraryOutput return an OutputPath
The only place basePath is used as a Path is when being returned from
PathForArbitraryOutput.  Using it as a Path requires implementing the
RelativeToTop() method on it, which then allowed that method to be
inherited by SourcePath, breaking the contract on RelativeToTop that
specifies that the returned Path is of the same concrete type as the
input Path.

Make PathForArbitraryOutput return an OutputPath, and update OutputPath
to support base paths that are not out/soong.  This also fixes
RelativeToTop, which was previously not working for PathForArbitraryOutput
paths.

Test: all soong tests pass
Flag: EXEMPT refactor
Change-Id: Ie8d8e2290961f35280e97137d2bd641c4d57ab87
2024-07-29 14:00:46 -07:00
Ivan Lozano
e9871abe44 Merge "android: Use slices.DeleteFunc for filtering" into main 2024-07-18 17:27:34 +00:00
Devin Moore
aa4f1c20c2 Merge "Support phony_output as a BuildParam Arg in RuleBuilder" into main 2024-07-18 15:21:12 +00:00
Ivan Lozano
03b717d3f1 android: Use slices.DeleteFunc for filtering
Clean-up two filters in arch.go by using slices.DeleteFunc

Bug: 353739440
Test: m blueprint_tests
Change-Id: I3738bb7961830e2c287257cceb64194f048514d3
2024-07-18 15:13:50 +00:00
Ivan Lozano
a0258d8b3f Merge "android: Add host_cross_supported prop" into main 2024-07-18 14:31:02 +00:00
Ivan Lozano
c7eafa7a41 android: Add host_cross_supported prop
Some modules are only intended to be build for the build host,
e.g. rust_library modules only used in rust_proc_macro or
code generators.

These should not be expected to be built for or supported on non-build
host platforms. Thus, add a host_cross_supported property to disable
the HostCross target.

Test: m blueprint_tests
Test: Modules with host_cross_supported: false don't build for HostCross
Change-Id: Ia15f55776e04d86aee19bb0dd0d27e1b985b2b75
2024-07-18 13:28:27 +00:00
mrziwang
7a47bd3a81 Return error for unsupported context in outputFilesForModuleFromProvider
Test: CI
Change-Id: I42d2341ea2613a28d403615f3ebccd0067d5501f
2024-07-17 11:11:05 -07:00
Treehugger Robot
7d45f55991 Merge "Support more variables for "debuggable"." into main 2024-07-17 01:56:59 +00:00
Devin Moore
b6cc64ffc4 Support phony_output as a BuildParam Arg in RuleBuilder
This allows a build rule to set the phony_output argument to ninja.
It's used to get ninja to ignore output files similar to .PHONY for
make.
It will cause the build rule to be run every time regardless of if or
when the output file was created.

Test: m android.hardware.bluetooth.audio-update-api &&
      git restore bluetooth/audio/aidl/aidl_api/* &&
      m android.hardware.bluetooth.audio-update-api
Bug: 353287999

Change-Id: I47b0b9e3ce2d8cb637b0102031193c81de24a680
2024-07-16 17:23:42 +00:00
Zi Wang
03b228e725 Merge "Remove OutputFileProducer" into main 2024-07-16 15:58:46 +00:00
Herbert Xue
38178329e5 Support more variables for "debuggable".
Enhance bp feature to support
"product_variables.debuggable.exclude_static_libs" and
"product_variables.debuggable.jni_libs".

Bug: 325857852
Test: lunch akita-trunk_staging-userdebug && m ConnectivityMonitor
Change-Id: Iae843af2d41ec7754812a0b89a7ebc791c58e099
2024-07-16 17:29:27 +08:00
Inseob Kim
0c71fa987f Merge changes from topic "cf_system_root_files" into main
* changes:
  Add support installing to root of filesystem image
  Add install_in_root to prebuilt_root module
2024-07-16 04:52:08 +00:00
Treehugger Robot
9678733731 Merge changes I861a60e1,I01bf99fa,I9d16dfec into main
* changes:
  Add util method HasIntersection(...)
  Implement InstallableModule for Java modules
  Collect container informations
2024-07-16 00:43:04 +00:00
Jihoon Kang
b7e1a48376 Add util method HasIntersection(...)
Introduces a util method `HasIntersection(...)`, which returns true if
the two input lists have non-empty intersection.

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: I861a60e1973c92a773c127dfc595ad7514d7972f
2024-07-15 23:46:45 +00:00
Jihoon Kang
c3d4e115af Collect container informations
This change introduces a method to collect the information of what
containers (i.e. api domain, partition, or any custom defined boundaries
of interest) the module belongs to. The method is called in
`ModuleBase.GenerateBuildActions`.

Each container objects defines the following:
- name of the container
- list of "restrictions", which are the containers that a module that
  belongs to this container is not allowed to depend on. Each
  "restrictions" also defines custom rules which allow bypassing the
  restricted dependency. Each rules are an enum that are mapped to a
  function, given that functions are not hashable and thus cannot be set
  as a value in a provider.

Note that this change is a no-op, as the container information is only
collected for modules that implement the "InstallableModule" interface,
which is not implemented by any other module types in this change. This
will be utilized in the follow-up changes.

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: I9d16dfec0dcf06da464aa49ee7b23f46f1da236a
2024-07-15 23:43:36 +00:00
mrziwang
d38e63d474 Remove OutputFileProducer
All the module types that were using OutputFileProducer
are using OutputFilesProvider now. This CL removes the
remaining OutputFileProducer code.

Test: CI
Bug: 339477385
Change-Id: I3c29785a59b907117b16ca2d0e56ef846adfb228
2024-07-15 13:50:18 -07:00
Inseob Kim
33f95a959d Add support installing to root of filesystem image
If the partition of a spec is "root", that spec will be installed to
root instead. Normally that spec will be from prebuilt_root module with
install_in_root property.

Bug: 351258461
Test: USE_SOONG_DEFINED_SYSTEM_IMAGE=true m && cvd start
Change-Id: Iaaa9c2fb8a81fe0ba4710c641e1b65c5b71ad4a4
2024-07-15 17:39:44 +09:00
Inseob Kim
be6a66d54b Add install_in_root to prebuilt_root module
This is to support installing to real root "/", not a root of partition
(e.g. "/system/").

Bug: 351258461
Test: build
Change-Id: I56993aceddfd988d2d10040f50f838b89c9bdc67
2024-07-15 17:39:09 +09:00
Zi Wang
2dbf71fed8 Merge "Use OutputFilesProvider in module_test" into main 2024-07-12 20:39:09 +00:00
mrziwang
1ea01e3c59 Use OutputFilesProvider in module_test
In the context of incremental soong, the output files
inter-module-communication will be through OutputFilesProvider.
The OutputFileProducer interface will be deprecated.

Test: CI
Bug: 339477385
Change-Id: Iaf0b039b17d34e1a696f2c87df2f0db39307fc6d
2024-07-12 12:26:34 -07:00
Colin Cross
77c5e9f9d4 Don't forward apex dependencies to platform when they are added later
IncomingApexTransition normally returns "" for modules that have
no apex variation so that apex variations can depend on non-apex
variations, for example for NDK libraries.

addDependencyOntoApexModulePair uses OtherModuleDependencyVariantExists
to decide whether to add a dependency on a module in an apex.  If
IncomingApexTransition returns "" then OtherModuleDependencyVariantExists
will always return true.  Return the incoming variation when addding
dependencies after the apex transition mutator has already run.

Bug: 319288033
Flag: EXEMPT bugfix
Test: all soong tests pass with later patches applied
Change-Id: Iec40c3be2ed04dca16a9fa6fa0a1c31056b536a8
2024-07-11 16:59:34 -07:00
Colin Cross
e1a8555581 Add IsAddingDependency to IncomingTransitionContext
Add an IsAddingDependency method to IncomingTransitionContext that
returns true if IncomingTransition is called after the transition
has already won while adding a new dependency.  This will be used
as part of the transition mutators to support an apex use case where
incoming dependencies during the initial apex mutator need to be
rewritten onto the platform variant for modules that don't support
the apex, but a later call to OtherModuleDependencyVariantExists
must not rewrite the requested apex variation onto the platform
variant.

This should be used sparingly, all uses will have to be removed in
order to support creating variants on demand.

Bug: 319288033
Test: TestIsAddingDependency
Flag: EXEMPT refactor
Change-Id: Ib8e419d35ff8f7cbff9667c1cd40d05ccfacab8b
2024-07-11 16:59:34 -07:00
Zi Wang
5ab1eb8822 Merge "Update the way to get output files in license_metadata" into main 2024-07-11 18:50:22 +00:00
mrziwang
01201ed2ed Update the way to get output files in license_metadata
The output files from a module is obtained from OutputFilesProvider
instead of from OutputFileProducer, which is going to be
deprecated.

Test: CI
Bug: 339477385
Change-Id: I2a5488653d9ba05c7ebd5a0b452e75fcc676c893
2024-07-11 10:21:57 -07:00
mrziwang
68b2594524 Fix typo in outputFilesForModule error message
Test: CI
Change-Id: I41f28a0412613458a0dad132006adfbc9fbbce2c
2024-07-11 09:58:30 -07:00
Zi Wang
256772f02c Merge "Use OutputFilesProvider on java modules" into main 2024-07-11 01:24:10 +00:00
mrziwang
9f7b9f4a9a Use OutputFilesProvider on java modules
In the context of incremental soong, the output files
inter-module-communication will be through OutputFilesProvider.
The OutputFileProducer interface will be deprecated.

Test: CI
Bug: 339477385
Change-Id: I3c9f0b766325dd490bc903dc65259c3953d34606
2024-07-10 12:18:06 -07:00
Roopesh Nataraja
826912e7d4 Add oryon to arm64 cpu variants
Bug: 350058746
Test: builds
Change-Id: I717e035165a7529629061cbfcb076b168dc031d6
2024-07-10 10:24:04 -07:00
Alyssa Ketpreechasawat
07bceec1fd Merge "Add "strip: {none: true}" for cc_prebuilt_library_shared in sdk snapshot." into main 2024-07-08 20:39:59 +00:00
Alyssa Ketpreechasawat
59ec0fac0a Add "strip: {none: true}" for cc_prebuilt_library_shared in sdk snapshot.
Prebuilt cannot be stripped in older platform. Therefore, we set
stripper to none to skip the call to strip.sh.

Bug: 350050115
Test: SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE=Tiramisu m art-module-sdk
Test: Create module sdk from this and drop into tm-dev
Change-Id: I911ce24ca18435f95395c43fc5e73110a50b3067
2024-07-05 16:12:17 +00:00
Justin Yun
635e788274 Define otacerts_zip module in soong
To move the otacerts module from make to soong, define a new module
type otacerts_zip module. This module collects key files from
PRODUCT_DEFAULT_DEV_CERTIFICATE and PRODUCT_EXTRA_OTA_KEYS
(PRODUCT_EXTRA_RECOVERY_KEYS for recovery) to install the zipped file
in etc.
otacerts_zip module is available to recovery to install the
otacerts.zip file in the recovery partition.

Bug: 335364209
Test: Define "PRODUCT_DEFAULT_DEV_CERTIFICATE := \
                 build/make/target/product/security/testkey" and
      m aosp_cf_system_x86_64
Change-Id: Ib5b671e9caef0403c6d9d69bfab29be248d7086c
2024-07-04 15:56:36 +09:00
Zi Wang
5aec0afe5e Merge "Use OutputFilesProvider on some android test modules" into main 2024-07-02 18:50:45 +00:00
mrziwang
01715cac38 Use OutputFilesProvider on some android test modules
In the context of incremental soong, the output files
inter-module-communication will be through OutputFilesProvider.
The OutputFileProducer interface will be deprecated.

Test: CI
Bug: 339477385
Change-Id: I036323d390ec0a60911deba271a79f37c9c51fda
2024-07-01 11:50:18 -07:00
mrziwang
9429e03996 Use OutputFilesProvider on buildinfo_prop
In the context of incremental soong, the output files
inter-module-communication will be through OutputFilesProvider.
The OutputFileProducer interface will be deprecated.

Test: CI
Bug: 339477385
Change-Id: I0875ed4be72954187722276b10949a2ad4e66dcf
2024-07-01 11:42:28 -07:00
Treehugger Robot
6a66b08bad Merge "Revert "Cleanup old code"" into main 2024-06-28 16:09:47 +00:00
LaMont Jones
d4a6cc6d52 Revert "Cleanup old code"
This reverts commit 51ab5b6d50.

Reason for revert: Revert while investigating b/349713034

Bug: 349713034
Change-Id: I4e0304225364c7c535a04108b65953a32742c1da
2024-06-28 14:31:35 +00:00
Treehugger Robot
ab352c516a Merge "Add tests for selects with bindings" into main 2024-06-28 06:12:36 +00:00
Cole Faust
b7bd9a17ec Merge "Update selects_test for selects with deferred expressions" into main 2024-06-27 22:33:08 +00:00
Zi Wang
9b21596db4 Revert "Use OutputFilesProvider on buildinfo_prop and some android test modules"
This reverts commit 89e4ff60d3.

Reason for revert: build breakage on aosp-main/mainline_modules_sdks-trunk_staging-userdebug

Change-Id: I5ddac59f66a0e7a96fab39647d406499e3875f6a
2024-06-27 21:51:33 +00:00
mrziwang
89e4ff60d3 Use OutputFilesProvider on buildinfo_prop and some android test modules
In the context of incremental soong, the output files
inter-module-communication will be through OutputFilesProvider.
The OutputFileProducer interface will be deprecated.

Test: CI
Bug: 339477385
Change-Id: Ic0c1217f3651b14ae3ac58a0ce4a25e8ab8d4dda
2024-06-27 12:53:08 -07:00
Cole Faust
165a05b234 Add tests for selects with bindings
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I43f10ce21d777e94839c695cb7ca8dcbb968d1c3
2024-06-27 11:02:35 -07:00
Cole Faust
ba48366969 Update selects_test for selects with deferred expressions
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I18257ff586fb31d4e0b012a249726a925832cdac
2024-06-27 11:01:56 -07:00
Inseob Kim
f58d7efa29 Merge "Revert "Use hashed subdir for soong_config modules"" into main 2024-06-27 04:30:30 +00:00
LaMont Jones
51ab5b6d50 Cleanup old code
This code is no longer needed.

Bug: 349410287
Bug: 311155208
Bug: 308625757
Test: manual, TH
Change-Id: Ib3121e5aaeb2d41de5fa89262a36d69803355c50
2024-06-26 14:34:50 -07:00
mrziwang
abdb293492 Update outputFilesForModuleFromProvider
This CL includes following changes:
1. Added the ability to differentiate the cases that module never
   sets OutputFilesProvider and that module sets the provider with
   a nil value.
2. Updated GenerateTaggedDistFiles to use outputFilesForModuleFromProvider.
3. Updated on cc module to use OutputFilesProvider.

Test: CI
Bug: 339477385
Change-Id: Ib5663a947315f6a90a81b7f073cf8dd22fbb1e05
2024-06-25 15:37:09 -07:00
Treehugger Robot
51fc67bd20 Merge "Cleanup more bazel code" into main 2024-06-25 19:24:12 +00:00
Cole Faust
487b144fe0 Cleanup more bazel code
Bug: 315353489
Test: m nothing --no-skip-soong-tests
Change-Id: I6c6b4fcd559f4a45b1a96c70cbb5d6d1a615ccff
2024-06-25 11:02:38 -07:00
Inseob Kim
b7e9f5f035 Revert "Use hashed subdir for soong_config modules"
This reverts commit 81b00a8db7.

Reason for revert:
* select() will supersede Soong config modules.
* A tiny change can make hundreds of gigabytes rebuilt.
* Hashed out/ directories are not cleaned.
* Even without this trace, AB build time is fast enough, thanks to
  product-specific ninja files and so on.

Bug: 348548855
Test: m --no-skip-soong-tests
Change-Id: If9a97df1e161a9ef0fb1b801f9e129b71b11d1ac
2024-06-25 17:39:52 +09:00
Wei Li
a1aa297518 Export Soong modules and build a database from metadata from Make and Soong.
Bug: 324465531
Test: CIs
Test: m compliance-metadata.db
Change-Id: Ia1c9ab0ae874dd47969555ddbfb93405b57a651f
2024-06-24 17:20:59 -07:00
Zi Wang
b651aaaf9e Merge "Add OutputFilesProvider support for singleton" into main 2024-06-24 22:13:42 +00:00