Commit graph

81668 commits

Author SHA1 Message Date
Ivan Lozano
0a468a4f3b rust: made-to-order rust staticlibs
Whenever any two Rust static libraries are included
as static libraries anywhere in a CC dependency tree, we sometimes
get duplicate symbol errors. To avoid this, we no longer
directly link multiple rust static libs to CC modules.

Instead, we build rust_ffi_rlib modules and produce the actual
static library that gets linked against the CC module based on
that CC module's full list of Rust rlib dependencies.

This introduces a new static_rlibs property for cc modules to
define the rust_ffi_rlib dependencies, which are then used to
generate the module above.

This CL is intended to deprecate rust_ffi_static. It leaves
rust_ffi_static and rust_ffi static variants in place until
the remaining rust_ffi_static declarations and uses can be
removed. In the meantime, rust_ffi_static produces
rust_ffi_rlib variants as well to make the transition easier.

Bug: 254469782
Test: m # with no changes
Test: m libapexsupport # with static_rlibs
Test: m libunwindstack # with static_rlibs
Test: m netsimd # with static_rlibs, no duplicate symbols
Test: m blueprint_tests # New Soong tests

Change-Id: I47e27ac967ef0cad46d398ebf59d8275929ae28a
2024-05-16 13:00:43 -04:00
Ivan Lozano
28ed8f4f83 rust: refactored transformSrctoCrate
Refactor transformSrctoCrate and the functions it calls to not rely
on rust.ModuleContext, preparing it to be callable from soong-cc
context to build a Rust staticlib.

This also refactors out common default flags used when building
libraries, again to prepare for building a Rust staticlib from
a soong-cc context.

Bug: 254469782
Test: m blueprint_tests && m
Change-Id: I678f6fee989c61bb15c340b9887e4d1934991907
2024-05-16 10:32:08 -04:00
Treehugger Robot
08f670ab4a Merge "soong: Use the CpExecutable rule for copying libraries" into main 2024-05-01 18:20:41 +00:00
Treehugger Robot
83ede7c225 Merge "Add RELEASE_APEX_CONTRIBUTIONS_MODULE_METADATA build flag" into main 2024-05-01 18:06:00 +00:00
Ivan Lozano
ec6dc938c9 Merge "rust: Add a default cfg indicating an AOSP build" into main 2024-05-01 17:53:47 +00:00
Treehugger Robot
9a988c4f5b Merge "rust: Don't suppress adding deps for rust-project.json device override" into main 2024-05-01 17:35:44 +00:00
Florian Mayer
39b536260a Merge "Pass -mllvm flags for memtag-stack correctly to linker" into main 2024-05-01 17:29:31 +00:00
Treehugger Robot
cba8307c25 Merge "remove hwasan-use-after-scope=1 which is default now" into main 2024-05-01 16:55:05 +00:00
Treehugger Robot
82e91a602b Merge "Add new storage deps in forced read-only mode" into main 2024-05-01 15:12:51 +00:00
Ivan Lozano
07fd7e32fd rust: Add a default cfg indicating an AOSP build
This adds a cfg flag `android_platform` which can be used
to indicate there's some conditional compilation need specific to
AOSP.

Test: New flag is emitted on builds
Change-Id: I833a7d68db2dad7ab2d32a5eb51d764f0d66b849
2024-05-01 10:41:35 -04:00
Ted Bauer
c3031c5c7b Add new storage deps in forced read-only mode
Bug: 328444881
Test: m
Change-Id: I26d5d5c96414a62f2f83eb4d725e69cea61214da
2024-05-01 13:54:40 +00:00
Adam Wright
0141b4acad Merge changes from topic "revert-3066748-duplicate_entry_fs-CIBDJQYRHU" into main
* changes:
  Revert "Prevent multiple PackagingSpecs having same installation..."
  Revert "Filesystem modules follow the installation semantic"
2024-05-01 09:59:21 +00:00
Jiyong Park
3d65d9cb90 Revert "Prevent multiple PackagingSpecs having same installation..."
Revert submission 3066748-duplicate_entry_fs

Reason for revert: b/338159248

Reverted changes: /q/submissionid:3066748-duplicate_entry_fs

Change-Id: I89906e160f62f1bf84eb65a1b99940f139626786
2024-05-01 05:25:41 +00:00
Jiyong Park
54351867fa Revert "Filesystem modules follow the installation semantic"
Revert submission 3066748-duplicate_entry_fs

Reason for revert: b/338159248

Reverted changes: /q/submissionid:3066748-duplicate_entry_fs

Change-Id: I8aacdb36efce8343c3713542eee209e71bde660b
2024-05-01 05:25:42 +00:00
Treehugger Robot
543d4f3b7d Merge changes from topic "duplicate_entry_fs" into main
* changes:
  Filesystem modules follow the installation semantic
  Prevent multiple PackagingSpecs having same installation path
2024-05-01 02:43:23 +00:00
Florian Mayer
99addb1802 remove hwasan-use-after-scope=1 which is default now
This is part of Android LLVM toolchain:

https://cs.android.com/android/platform/superproject/main/+/main:prebuilts/clang/host/linux-x86/clang-r510928/BUILD_INFO;l=79

477610d4d0/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp (135)

Change-Id: I2812fac89584a8324126d15525b6ee78f5494a50
2024-05-01 00:56:22 +00:00
Florian Mayer
ab97e28bf6 Pass -mllvm flags for memtag-stack correctly to linker
Bug: 309446520
Change-Id: I08519db0323a754c66acaa0ace5c41d962809ac6
2024-05-01 00:36:06 +00:00
Treehugger Robot
6ab1b1fd03 Merge changes I4c38860c,I2bdc8876 into main
* changes:
  release_config: various cleanup
  Support release configs with only aconfig flags
2024-05-01 00:14:44 +00:00
Matthew Maurer
c1e0cb695b rust: Don't suppress adding deps for rust-project.json device override
When switching from an initially found host module to a later found
device module, we passed `cInfo.Deps` through. This actually suppresses
addition of some modules, which was not the intention.

Bug: 336695421
Test: SOONG_GEN_RUST_PROJECT=1 m blueprint_tests
Test: check rust-projects.json manually afterwards for deps
Change-Id: Ib90f9c755e07f88e85a3b3cbd9bc698cce8af038
2024-04-30 23:26:29 +00:00
LaMont Jones
ff387eaacb release_config: various cleanup
- Allow scl and textproto data to coexist for now
- Print warnings to stderr instead of stdout.
- Improve formatting of output
- Set displays the new value for all configs, and what file changed.
- Use prettier error messages for better UX
- put build-flag on the path.

Bug: 328495189
Test: manual
Change-Id: I4c38860c2fb24db5111e0cecf790660a4ff2b8b2
2024-04-30 16:12:50 -07:00
LaMont Jones
dc86819307 Support release configs with only aconfig flags
Release configs with `aconfig_flags_only: true` can inherit build flag
values, but cannot set them.

Bug: 328495189
Test: manual
Change-Id: I2bdc88761d61fb20f10dc734f2ba87114f51b859
2024-04-30 15:38:11 -07:00
Treehugger Robot
2f5d35347b Merge "Move coverage builds prebuilt special case to make" into main 2024-04-30 20:04:44 +00:00
Treehugger Robot
d58ac5358d Merge "Remove incorrect strict test for test-suites for test_module_config" into main 2024-04-30 19:57:23 +00:00
Jiyong Park
742f54c4bc Filesystem modules follow the installation semantic
With this change, filesystem modules (android_filesystem,
android_system_image, etc.) follow the installation semantic which means
output from modules which don't produce installable files (i.e. modules
that return false on IsSkipInstall()) are not included in the filesystem
module.

Note that this bug has been there since the beginning but didn't trigger
an error due to another bug (b/335506668) which allowed multiple
packaging specs to contribute to the same path. That bug prevented the
non-installable variant of a module (e.g. stub) from being installed
simply because because it was "luckly" clobbered by the installable
variant of the same module (e.g. impl lib).

Bug: 335506668
Test: go test ./...
Change-Id: I2a42d178701d74bf6ccc5f33ba33918f8c608d40
2024-04-30 19:02:57 +00:00
Jiyong Park
a51c4ce10e Prevent multiple PackagingSpecs having same installation path
This fixes a bug that different PackagingSpecs having the same
installation path were silently allowed. Previously, a PackagingSpec
that comes the first for the given installation path won, effectively
eclipsing other PackagingSpecs destined for the same installation path.

Bug: 335506668
Test: go test ./...
Change-Id: Ia36f656e8364f95c4be78fff6e9dc16966307526
2024-04-30 18:50:06 +00:00
Ronald Braunstein
b4a4ef9d23 Remove incorrect strict test for test-suites for test_module_config
I misunderstood our desire to eventually migrate all
`test_module_config` modules -> "general-tests" for the requirement that
it must be used now.

While working on converting these modules to use symlinks rather than
copies of data files, I noticed a problem if the derived test was in
"general-tests", but the base test was in "device-tests". The symlink
would not have a base to point to in general-tests.zip.

Allow the derived tests to be in other suites for now.

Test: go test ./tradefed_modules/
Test: m blueprint_tests
Change-Id: I9524d6c3964db6de38fc3c4cb4c5bc493dadc0db
2024-04-30 18:44:49 +00:00
Spandan Das
dab69e1001 Add RELEASE_APEX_CONTRIBUTIONS_MODULE_METADATA build flag
This can be used to select a specific prebuilt ModuleMetaData prebuilt

Test: go build ./android
Bug: 338003071
Change-Id: Ia96ba102107161021c78ad3f87a938f8a788e932
2024-04-30 18:14:49 +00:00
Jiyong Park
4152b192e0 Distinguish the intent of PackagingSpec
A PackagingSpec actually means either of two: an installation of a file
(i.e. putting the file on a filesystem image), or a simple gathering.
However, so far, the two different intents was not visible in
PackagingSpecs returns from TransitivePackagingSpecs().

With this change, the two different intents are recorded in
PackagingSpec. A PackagingSpec has a boolean field which records the
value of the SkipInstall() of the module where the PackagingSpec was
created from.

This could be used by a module like android_system_image which wants to
follow the "installation" semantic. For example, the module type doesn't
want to include a stub variant of a shared lib.

This change doesn't make use of the new field, yet.

Bug: 335506668
Test: go test ./...
Change-Id: If0106642a11ba804630df79b4c5ebd608a77a6b1
2024-04-30 22:35:20 +09:00
Jiyong Park
5c3c3274fe Remove an unnecessary test in filesystem
TestFileSystemShouldInstalCoreVariantIfTargetBuildAppIsSet is removed.
The test was originally introduced with aosp/2445946, but the change was
effectively reverted by aosp/2562192. The test however has been green as
a side effect of a bug (b/335506668) which will be fixed soon.

Bug: 335506668
Bug: 268582372
Test: N/A
Change-Id: I62f4746c605eba0b2f0037089a53d65922d65ef3
2024-04-30 22:35:14 +09:00
LaMont Jones
0dd436cd0a Merge "release_config: better default map paths" into main 2024-04-30 01:52:19 +00:00
Treehugger Robot
3210194259 Merge "Compress precompiled python zips" into main 2024-04-30 01:30:15 +00:00
Treehugger Robot
29067ccade Merge changes from topics "fix_selects_appending", "refactor_selects" into main
* changes:
  Update accesses to ConfigurableCondition
  Add test for configurable defaults applied to multiple modules
2024-04-30 01:15:42 +00:00
Cole Faust
baae083e60 Compress precompiled python zips
When making this script deterministic we accidentally changed it so that
none of the entries in the output zip file were compressed. Re-add
the compression.

Adding the compression makes atest go from 67M to 34M, at the cost of
0.33s startup time instead of 0.28s.

Test: Presubmits
Change-Id: I4e58eb76235ddabf0195694cdd3644f26b7e84ec
2024-04-29 16:47:36 -07:00
Spandan Das
36c329ce77 Move coverage builds prebuilt special case to make
Having this in make has the following advantages
- allows this to be used in other places in make that are sensitive to
  prebuilt selection, e.g. apex boot jars that are present in source but
  not in prebuilt apexes
- collocates the various prebuilt special edge cases

Test: presubmits
Test: in internal, lunch cf_x86_64_phone-next-userdebug
Test: EMMA_INSTRUMENT_FRAMEWORK=true get_build_var PRODUCT_BUILD_IGNORE_APEX_CONTRIBUTION_CONTENTS
true

Bug: 308188056
Change-Id: Iea92311759f3bfe0ece7cb45fdb239c8a4db1dde
Merged-In: Iea92311759f3bfe0ece7cb45fdb239c8a4db1dde
2024-04-29 22:04:02 +00:00
LaMont Jones
e41ea1e33e release_config: better default map paths
- Automatically determine the top of the workspace.
- build-flag defaults to using `get_build_var` to get product specific
  release config maps.
- release-config defaults to using PRODUCT_RELEASE_CONFIG_MAPS but does
  not use `get_build_var` unless the argument is given.

Bug: 328495189
Test: manual
Change-Id: I4ba3c5dfab43c4ebc3eeda13318f42e886dada4e
2024-04-29 14:43:09 -07:00
Ted Bauer
10fff94e2e Drive instrumentation with build flag for C/C++
Bug: 328444881
Test: m
Change-Id: I20c92c61f855adb772d6aa173e85a6d8092460d7
2024-04-29 19:53:43 +00:00
Paul Duffin
6f581637c1 Merge "Pass API surface specific extension jars to Metalava" into main 2024-04-29 19:19:16 +00:00
LaMont Jones
f6aa6754a2 Merge "release_config: container is a repeated string field" into main 2024-04-29 17:25:03 +00:00
Ted Bauer
84835f48ea Merge "Switch libbase to shared" into main 2024-04-29 16:47:45 +00:00
Ted Bauer
6c69edfbf1 Switch libbase to shared
Test: m
Bug: 328444881
Change-Id: Ia232859bcc6591e26eb244d8c3f15336204a460e
2024-04-29 15:05:57 +00:00
Hsin-Yi Chen
d32e3dff8d Merge "Let header-abi-linker filter llndk, apex, and systemapi symbols" into main 2024-04-29 07:43:57 +00:00
Cole Faust
8afc514ebb Update accesses to ConfigurableCondition
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-26 16:30:19 -07:00
LaMont Jones
db600990a5 release_config: container is a repeated string field
Container is a string, and a flag can be in more than one container.

Bug: 328495189
Test: manual
Change-Id: I5a2a9855532027584d2b67f63f1b9584fce3d8d9
2024-04-26 14:56:58 -07:00
Cole Faust
693494682f Add test for configurable defaults applied to multiple modules
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I510472a81ae682e5a55171ec4a9aec420d577307
2024-04-26 12:37:57 -07:00
LaMont Jones
2d5e7579d4 Merge changes I708c37f9,I577e7fb0 into main
* changes:
  Write per-partition build_flags.json
  release_config: various cleanup
2024-04-26 18:53:41 +00:00
Jeff DeCew
996c883b65 Merge "Ensure aconfig generated CustomFeatureFlags is renamed by JarJar" into main 2024-04-26 18:39:43 +00:00
LaMont Jones
f4cc08e114 Write per-partition build_flags.json
Create build_flags_{partition}-{TARGET_PRODUCT}-{TARGET_RELEASE}.json
in {OUT_DIR}/soong/release-config.

Bug: 328495189
Test: manual
Change-Id: I708c37f9b1216b4283886c98cacaf66bfcd28143
2024-04-26 09:24:47 -07:00
LaMont Jones
15788829b2 release_config: various cleanup
- Parse release_config_map.textproto files only once
- Fix inheritance
- Sort flag artifacts by flag name
- Add --all_make option for testing
- Fix value() parsing in crunch_flags

Bug: 328495189
Test: manual
Change-Id: I577e7fb07171bea9a53d61eaf77ec728b60d7a26
2024-04-26 08:28:39 -07:00
Ted Bauer
8e4060abc5 Merge "Switch to static deps" into main 2024-04-26 15:09:20 +00:00
Ted Bauer
1e96f8c622 Switch to static deps
Bug: 328444881
Test: m
Change-Id: I53ad95ca281031ec98d5df66ada0ed69749da312
2024-04-26 13:46:09 +00:00