Commit Graph

1160 Commits

Author SHA1 Message Date
Cole Faust
151d0aa950 Make include_dirs and local_include_dirs configurable
Requested by a user.

Fixes: 377540448
Test: m nothing --no-skip-soong-tests
Change-Id: I59e49c68e1d47ee0914677714cedcddf624903e6
2025-02-11 22:38:24 +08:00
Krzysztof Kosiński
877a59e2eb Merge "Add ARMv9.2-A support for Rust." into main 2024-09-20 19:06:43 +00:00
Cole Faust
16d227a725 Add default_visibility for soong modules
So that we don't get surprise usages.

Bug: 348717861
Test: m nothing
Change-Id: I47319a727092c1bd936cca88f5713ee977a48b48
2024-09-18 17:41:30 -07:00
Krzysztof Kosiński
9aa9838004 Add ARMv9.2-A support for Rust.
Bug: 364383722
Test: presubmit, internal build for relevant device
Change-Id: I6e9db98fa2b31349484f83baef612527fbe7c15a
2024-09-19 00:08:16 +00:00
Yifeng Zeng
d141912806 Enable Rust host coverage.
Bug: 297082598
Bug: 330591720
Test: atest logger_host_unit_tests --experimental-coverage
Change-Id: Iec6db35b88e2812d3af69863e74b0acf138b04df
2024-09-14 05:21:18 +00:00
Chris Wailes
abc17eac1a Add SOONG_DISABLE_CLIPPY environment variable
This environment variable will be used for testing the Rust toolchain
for correctness before updating the Android codebase to resolve new
lints.

Test: Introduce lint
Test: SOONG_DISABLE_CLIPPY=true m out/soong/.intermediates/frameworks/minikin/rust/libminikin_rust_ffi/android_arm_armv8-a_rlib_rlib-std/libminikin_rust_ffi.rlib.clippy
Change-Id: If7236c7f16a3e0a0b27a90577211549f2dc1a344
2024-09-12 15:37:34 -07:00
Charisee Chiw
3cee551577 Merge "rustc-1.81.0 Build 12349086" into main 2024-09-12 15:36:28 +00:00
Spandan Das
ff66518da2 Delete multitree api imports code
The mutltiree workflow has not been in use for a while. This CL cleans
up the code that was added to support multitree.

Details
- Delete cc_api_library, cc_api_headers, cc_api_variant module types.
  These module types contain build rules for prebuilt stub .so and .h
files
- Update the DepsMutator of cc.Module to not create a dependency on a
  sibling cc_api_* module if it exists. e.g. do not create a dependency
on libfoo.apiimports if libfoo is listed in `shared_libs`.
- Remove cc_api_library from the stub/impl selection logic for cc
  modules

Test: m nothing --no-skip-soong-tests
Test: presbumits
Change-Id: Ie194157fb3bbc630f384cdd9b694b0fba6786ded
2024-09-11 19:19:33 +00:00
Charisee
037e1297d9 rustc-1.81.0 Build 12349086
Test: m rust
Change-Id: I036a8f459055343533c651f461cda1d71a921757
2024-09-11 16:45:49 +00:00
Colin Cross
a6182ab2fa Move checkbuild targets of Soong modules into Soong
Pass the name of Soong's checkbuild target for each module to
Make so that it can depend on it from the main checkbuild rule.
This will give better control over which files get built, allowing
checkbuild to skip the jar combining step when transitive classpath
jars are enabled.  The per-module checkbuild targets are passed to
make instead of added directly as a dependency of checkbuild in order
to maintain the existing behavior of only building modules exposed
to make in checkbuild.

Also tweak the existing calls to CheckbuildFile and add
InstallFileWithoutCheckbuild to match the files that are
in the Make-based checkbuild.

Bug: 308016794
Test: m checkbuild
Change-Id: Ic5140819381d58f4d00f23a7a12447950c4cf268
2024-09-03 14:52:19 -07:00
Treehugger Robot
a5762dd78b Merge "Add a property to rust_ffi targets to exclude them from APEXes." into main 2024-08-27 20:13:19 +00:00
Ashutosh Agarwal
46e4fad202 Add a property to rust_ffi targets to exclude them from APEXes.
This is a temporary measure until stubs are properly supported by rust_ffi targets.

Bug: 361441210
Bug: 362509506
Change-Id: Ieabd4e3abf442de660f39ec6c5776f5832b25e14
Test: manual
2024-08-27 17:13:12 +00:00
Chris Wailes
aa60bb44d4 rustc-1.80.1 Build 12274397
Bug: https://issuetracker.google.com/issues/361370910
Test: m rust
Change-Id: Ie1585c9b7f429310ec8b8cdddc6c5ce7c8bff001
2024-08-25 17:03:32 -07:00
Stephen Hines
09c2389063 Merge "rustc-1.79.0 Build 12250333" into main 2024-08-22 02:45:29 +00:00
Yu Liu
51c2231eab Access output files thru providers in Soong tests.
The outputFiles field on ModuleBase will be removed next.

Bug: 358425833
Test: CI
Change-Id: I6d665ac13134d9278e5908f64c454366bc6bca5e
2024-08-21 00:03:50 +00:00
Stephen Hines
8b0c77138b rustc-1.79.0 Build 12250333
Bug: https://issuetracker.google.com/issues/346588808
Test: m rust
Change-Id: Ibf30ea3075cdebb9487c5414ad35ab0e6ab8811b
2024-08-20 01:08:20 -07:00
Cole Faust
f0006e7137 Make the WholeStatic/Static/Shared libs properties configurable
So that you can use selects with them.

Bug: 342006386
Bug: 358377461
Test: m nothing --no-skip-soong-tests
Change-Id: I5a8350f670d51b7da411ad5c3cdbf5f2d6cdd63b
2024-08-19 14:39:19 -07:00
Ivan Lozano
d8f64ec810 rust: Add dylib variants for bindgen modules.
Provide dylib variants for bindgen modules. This avoids issues where
bindgen modules being rlib-only results in a dependency tree
containing the same crate with two different linkages.

Bug: 294698705
Test: Example with binder and fmq crates builds.
Change-Id: Ia72f573db3c232c97276038e4315134d90033e10
2024-08-06 14:22:20 +00:00
Yu Liu
8975548e9c Merge "Only add darwin specific rules/variables when building on mac." into main 2024-07-30 22:18:01 +00:00
Yu Liu
2c0327695c Only add darwin specific rules/variables when building on mac.
To support skipping ninja file writing during incremental build, we
add all the global rules/variable/pools from static sources because
when we restore from cache we don't have the build defs available to
build the globals. This means all the global rules and variables are
added blindly, so we need to exclude these darwin specific ones since
they will fail due to they depends on the tool that only exists on MAC.

Bug: 335718784
Test: local tests and CI
Change-Id: Ife835545f0f76ffaec77e48bdd89ab7384a1b995
2024-07-30 18:22:43 +00:00
Aleks Todorov
0384c97337 cc: Enable select syntax for cppflags
Bug: 325444956
Test: m
Test: m [custom build target with select in cppflags]
Change-Id: I7d27096526ce5b37afe447f900613a6fbb639986
2024-07-26 17:20:23 +01:00
Yabin Cui
aca752647e Update Bindgen clang to clang-r530567
Bug: 342023558
Test: presubmit
Change-Id: I9ff1ee32f99728a982f4982121f86e94d4d98f91
2024-07-22 13:45:46 -07:00
Colin Cross
ea1b3b78b8 Merge changes from topic "elide_empty_variants" into main
* changes:
  Convert sdk mutator to TransitionMutator
  Convert link mutator to TransitionMutator
  Convert version mutator to TransitionMutator
  Convert python_version mutator to TransitionMutator
  Convert rust_libraries and rust_stdlinkage mutators to TransitionMutators
2024-07-18 17:37:38 +00:00
Colin Cross
8a49a3dd76 Convert rust_libraries and rust_stdlinkage mutators to TransitionMutators
Replace rust.LibraryMutator and rust.LibstdMutator with
TransitionMutators.

Bug: 319288033
Flag: EXEMPT refactor
Test: all soong tests pass
Test: no change to build.ninja
Change-Id: Ia24a582119d39889279d7b93bac9259685153619
2024-07-17 15:50:36 -07:00
Nikita Putikhin
5f23bc98ed Switch rust test install base to /data/local/tmp for consistency with cc
Previously this code was not doing anything because the template used
for rust did not use the template string that gets replaced with the
folder coming from this code. So all tests were getting deployed into
/data/local/tmp regardless of being vendor tests.

The other change in the chain adds the template string, so this code
starts working and system and vendor tests start being deployed into
different folders.

We want to keep the system test folder as before to avoid potential
problems with tests (see b/350479879#comment9).

Bug: 347370677
Test: presubmit
Change-Id: I93d5a8db3470d1603e26f9cf5d12249f29141a19
2024-07-16 13:29:31 +02:00
Colin Cross
17f9dc5f76 Remove obsolete rust VariantIsStatic
Rust modules no longer have static variants after
I2925f67f6dc9329dae3dcccafb8560900ac8a6fc, remove the VariantIsStatic
field.

Bug: 254469782
Test: m
Test: m blueprint_tests
Change-Id: Ic63412a27c3a09dec43c4a9064a3e1f4181147db
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
Treehugger Robot
e7485b871a Merge "Pass the --cfg soong flag when building rustdoc" into main 2024-07-11 22:19:19 +00:00
Colin Cross
088123934b Merge "Remove test_per_src" into main 2024-07-11 20:32:23 +00:00
Chris Wailes
3d211a0567 Pass the --cfg soong flag when building rustdoc
This CL modifies Soong to pass the `--cfg soong` flag to the rustdoc
tool.

Test: m rustdoc
Bug: 303116432
Change-Id: I089edebe3c0450b9f9d4f97404bafb7e90ed1f8a
2024-07-11 11:33:11 -07:00
Ivan Lozano
b31d8e8067 Disable dsymutil usage on Darwin host
dsymutil is not available during builds. This is disabled by turning off
split-debuginfo.

Bug: 349612831
Bug: 351760165
Test: Pre/post submit
Change-Id: Idd6f00519e303fe02b35ec8c18682afa799f4df4
2024-07-08 14:56:44 +00:00
Colin Cross
3a02c7ba1a Remove test_per_src
Remove test_per_src, it never worked well and is incompatible
with all of the test infrastructure.  Uses in the platform have
been removed, generally by replacing them with individual cc_test
modules.

Test: builds
Flag: TEST_ONLY
Change-Id: I257c035da35ca8358ae9423b46453878f54efeb1
2024-06-28 10:31:05 -07:00
Ivan Lozano
fd47b1ab6a cc/rust: Alias ffi rlib variant for static_libs
Alias the rlib variant to "link: static". This allows declaring
rust_ffi_rlib modules in static_libs. This effectively removes any
distinction between rust_ffi_static and rust_ffi_rlib. Removing the
functionality for building Rust staticlib modules will be cleaned up in
a follow-on CL.

This should have the effect of changing the default linkage for all rust
modules in static_libs from linking individual staticlibs to building a
single staticlib that includes all rust_ffi rlib dependencies.

This removes the static_rlibs property, as we're now handling
the choice dynamically. This also makes rlibs only propagate through
cc_library_static modules if the rlib is included in
whole_static_lib. This both mirrors the expected behavior of
cc libraries and helps control which version of a crate ends up in the
final link (e.g. libdoh_ffi vs libdoh_ffi_for_test).

Bug: 254469782
Test: m
Test: m blueprint_tests
Change-Id: I2925f67f6dc9329dae3dcccafb8560900ac8a6fc
2024-06-26 01:35:41 +00: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
mrziwang
0cbd3b0e79 Add OutputFilesProvider support for singleton
This CL also changes to use OutputFilesProvider on rust module, which
has singleton involved.

Test: CI
Bug: 339477385
Bug: 348494466
Change-Id: Idc5c0fb9f8425f09184d5b73531ee3052e5a076c
2024-06-24 11:55:47 -07:00
Jihoon Kang
79b0eef5a1 Merge "Move vendor and product variant generation logic from cc package to android package" into main 2024-06-21 18:16:31 +00:00
Jihoon Kang
47e918450f Move vendor and product variant generation logic from cc package to android package
Although image variation generation logic has moved out of cc package to
the android package, the vendor and product partition variants
generation logic is still specific to cc package. Therefore, in order to
create a product or vendor variant, they have to specified in
`ExtraImageVariants`. In order to avoid such confusing behaviors and
enforce modules to specify product and vendor installation rules, this
change moves the vendor and product variant generation logic to
android.ImageInterface.

Test: m nothing --no-skip-soong-tests && diff contents of out/soong/Android-{product}.mk
Change-Id: I9e14f3739d9dea94167ee6a91e92b2f942055aba
2024-06-21 07:45:09 +00:00
Treehugger Robot
d3b519fc30 Merge "Update Bindgen Clang to clang-r522817" into main 2024-06-19 03:14:00 +00:00
Treehugger Robot
d3ba5a3f6e Merge "Cleanup ImageInterface.SetImageVariation" into main am: 77858402e4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3131759

Change-Id: I4504623d0978356eb7f3b526d01ffb99abd0da12
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-14 04:29:12 +00:00
Treehugger Robot
77858402e4 Merge "Cleanup ImageInterface.SetImageVariation" into main 2024-06-14 04:26:52 +00:00
Cole Faust
0f81d85278 Merge "Make the cflags property configurable" into main am: 1b0d92919d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3131289

Change-Id: I56760a2763d6d41d82696d0286085c95d09dfa8d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-14 03:08:08 +00:00
Jihoon Kang
7583e835f7 Cleanup ImageInterface.SetImageVariation
This change modifies the interface method of
ImageInterface.SetImageVariation so that the image variation is set
directly at the caller image variation module, instead of passing the
pointer to set the image variation.

Test: m nothing
Change-Id: I8eadb5149365530243e19a8cd37eb49d335fbeef
2024-06-13 21:56:23 +00:00
Cole Faust
e96c16a806 Make the cflags property configurable
So that you can use select statements on it. The current modivation
is to convert a module from make to bp with minimal soong config
variable boilerplate.

Bug: 342006386
Bug: 346922064
Test: m nothing --no-skip-soong-tests
Change-Id: I48d5a11ad3aa65c24cc199458634a5fdbeab2f64
2024-06-13 14:51:14 -07:00
Yi Kong
fb0fb891df Update Bindgen Clang to clang-r522817
Test: presubmit
Bug: 322868540
Change-Id: I98d614cc8b594d53a028780a1ab8160307179f37
2024-06-12 02:53:52 +09:00
Pirama Arumuga Nainar
812d8de86c Merge "Revert^2 "rustc-1.78.0 Build 11910258"" into main am: 44755fa745
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3122592

Change-Id: I2e327e174f5265c20217e77cb9a5e9a67e80f71f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-11 16:27:18 +00:00
Chris Wailes
c8a44e32cf Revert^2 "rustc-1.78.0 Build 11910258"
This reverts commit 8517b8cd87.

Reason for revert: Re-land the Rust 1.78.0 and Clang r522817 updates

Change-Id: Icd3f4554b0e27ed8543a7c1b0301d4dd8ed4a82b
2024-06-10 18:06:27 +00:00
Dmitrii Ishcheikin
8517b8cd87 Revert "rustc-1.78.0 Build 11910258"
Revert submission 3108411-rust-update-prebuilts-1.78.0

Reason for revert: b/345708905

Reverted changes: /q/submissionid:3108411-rust-update-prebuilts-1.78.0

Change-Id: I66b95447ddfcb3d35e5f4305a6d9feb2896fbdf7
2024-06-07 13:06:19 +00:00
Kiyoung Kim
9f26fcf88c Remove VNDK related code from Soong
As VNDK definition is fully removed from Android.bp, VNDK related code
can be removed from Soong. This change removes VNDK related code except
VNDK prebuilt which is required to build former versions of VNDK APEX
with prebuilts.

Bug: 330100430
Test: AOSP CF build succeeded
Ignore-AOSP-First: Resolve Conflict
Change-Id: Id9c8993343221c8464c97296bde0ff40b14b9b0b
2024-06-05 01:22:58 +00:00
Chris Wailes
adb4cb0ca1 rustc-1.78.0 Build 11910258
Bug: https://issuetracker.google.com/issues/333887339
Test: m rust
Change-Id: Ia90ba0d805e2319b3142a16d69914d9ee036810c
2024-05-31 00:10:03 -07:00