Commit graph

81516 commits

Author SHA1 Message Date
Cole Faust
b9ae285b55 Merge changes from topic "import_make_staging_dir" into main
* changes:
  Add include_make_built_files
  Don't use zip files when creating filesystems
2024-03-15 17:34:26 +00:00
David Srbecky
d10d54af71 Merge "Revert^8 "Enable dex container (DEX v41) for the whole system"" into main 2024-03-15 15:42:48 +00:00
Jeongik Cha
8b0192d031 Merge "//visibility:any_partition can be used with another visibility field" into main 2024-03-15 02:51:00 +00:00
Treehugger Robot
f34748af55 Merge "Delete jmod workDir" into main 2024-03-15 02:35:04 +00:00
Jeongik Cha
31be352612 //visibility:any_partition can be used with another visibility field
Bug: 321000103
Test: m nothing
Change-Id: I2f65ff4d51c65f974e2dc79c94dfefe180ddbfe4
2024-03-15 10:19:23 +09:00
Cole Faust
7ef61d76f8 Delete jmod workDir
Files in this directory aren't exposed to the rest of the build, so
deleting them saves some space. The `jmod create` command was also
producing non-deterministic files, which are not relevant because
they're not used anywhere else, but it makes it easier to find
non-determinism that matters if we delete them.

Test: Presubmits
Change-Id: I5d57826b438368f24a7a2a7ab1ccd6c16f240124
2024-03-14 18:15:28 -07:00
Treehugger Robot
f1ffd090e7 Merge "Make select statements work on path properties" into main 2024-03-14 23:52:24 +00:00
Cole Faust
4a2a7c98f6 Add include_make_built_files
If `include_make_built_files` is set to the name of a partition, the
make-built files from that partition will be incorperated into this
soong module. This is to ease the transition to soong built filesystems.

If any files are present in both the soong-built file list and the
make-built one, the soong ones will be preferred.

Bug: 329146343
Test: go test
Change-Id: I456b283e1189116e699ed75357cc056f5d217688
2024-03-14 16:40:42 -07:00
Cole Faust
3b806d3b88 Don't use zip files when creating filesystems
The end result is a directory that's passed to build_image, so zipping
and then unzipping image contents will unnecessarily slow things down.

Bug: 329146343
Test: m microdroid --no-skip-soong-tests
Change-Id: I98223c60e8144d6c707832fcc03ba8fe94467e7b
2024-03-14 16:40:30 -07:00
Cole Faust
bdd8aeeb58 Make select statements work on path properties
Fixes: 329711542
Test: go test
Change-Id: I71f489c26c535174e226e4a9ab449cc2b4bee83a
2024-03-14 15:24:09 -07:00
Treehugger Robot
4e4939665e Merge "Generate info about the selected app variant in platform builds" into main 2024-03-14 22:05:43 +00:00
Treehugger Robot
f11f786571 Merge "Add exports for JDK 21 to Kythe extractor" into main 2024-03-14 18:43:02 +00:00
Yu Liu
f509eba41d Merge "Validate aconfig libs are built with the correct modes." into main 2024-03-14 18:39:12 +00:00
Spandan Das
3490dfd23f Generate info about the selected app variant in platform builds
This is a followup to aosp/2999198 and adds information about apps.

Each app will have an entry in this file with the following properties
- Name, mandatory
- Is_prebuilt, mandatory
- Prebuilt_info_file_path, optional

Implementation details
- Move prebuiltInfoProvider out of build/soong/apex to
  build/soong/android. This allows build/soong/java to use it.
- Introduce a new `prebuilt_info` prop to `android_app_set` and
  `android_app_import`
- All app module types will set a prebuiltInfoProvider in
  GenerateAndroidBuildActions, including the source app module types

Test: m nothing --no-skip-soong-tests
Test: m out/soong/prebuilt_info.json
Test: ls -l out/soong/prebuilt_info.json --human-readable
-rw------- 1 spandandas primarygroup 317K Mar 11 23:46 out/soong/prebuilt_info.json

Test: #modified trunk_staging.locally to select prebuilts of some
mainline apps. Spot-checked that `is_prebuilt` and
`prebuilt_info_file_path` get populated appropriately

Bug: 327480225
Change-Id: I5078e0ec26c9568194550909962b90111a5223f7
2024-03-14 18:12:30 +00:00
Treehugger Robot
119bb1b21d Merge "gen_parsers_and_formatters.rs is no longer generated." into main 2024-03-14 17:40:47 +00:00
Sorin Basca
79b7ca1e7a Add exports for JDK 21 to Kythe extractor
Change-Id: Ie977f08f8aee59ea21dcbfe7c9c07dc0dc535775
Fixes: 328877412
Test: TH
2024-03-14 16:59:49 +00:00
Jooyung Han
ed9005b556 Merge "Clean up LLNDK stubs" into main 2024-03-14 03:58:14 +00:00
Jooyung Han
2b8b2b2064 Merge "ndkstubgen: use llndk=<version> for new llndk stub" into main 2024-03-14 01:48:36 +00:00
Jooyung Han
33eb615eb0 ndkstubgen: use llndk=<version> for new llndk stub
We want LLNDK symbols to be explicitly marked with llndk tag to
handle LLNDK freezing which happens before SDK freezing. If symbols
need to be frozen as LLNDK, those symbols must be marked explicitly with
correct vFRC version.

In the following example,

LIBFOO { # introduced=35
  foo;
  bar;
  bar; # llndk=202404
  baz; # llndk=202404
  qux; # llndk=202505
};

NDK libfoo will have foo and bar while LLNDK libfoo stub will have bar
and baz for 202404.

Bug: 329012338
Test: test_ndkstubgen test_symbolfile
Change-Id: I384f589b240fa047e8871964bf9550f426024dfc
2024-03-14 06:06:26 +09:00
James Farrell
e288cdeda1 rustc-1.76.0 Build 11569723
Bug: https://issuetracker.google.com/issues/327204642
Test: m rust
Change-Id: I3b39a12d1379a9193d348b364897d7df9de16330
2024-03-13 19:47:51 +00:00
David Srbecky
b92a4e1ca9 Revert^8 "Enable dex container (DEX v41) for the whole system"
This reverts commit 43668c6f13.

Reason for revert: Reland

Bug: 317744117
Bug: 329465418
Test: Device boots
Change-Id: I4b0478030c6a4980f33087ec5764018295691bac
2024-03-13 18:49:34 +00:00
Kalesh Singh
9f38694fc3 Merge "soong: ldflags: Add separate-loadable-segments" into main 2024-03-13 18:41:14 +00:00
Yu Liu
ee37914529 Merge "Store the changed_inputs field in build.trace." into main 2024-03-13 15:54:13 +00:00
Treehugger Robot
eb0f771676 Merge "Let header ABI checker load core variants' version scripts" into main 2024-03-13 02:09:59 +00:00
Spandan Das
86cc1e896b Merge "Generate info about the selected apex variant in platform builds" into main 2024-03-13 01:13:21 +00:00
Kalesh Singh
fa1ebf5943 soong: ldflags: Add separate-loadable-segments
To suport >4KB page sizes, the loader may extend LOAD segment mappings
to be contiguous in the virtual address space. This is done in order to
reduce the use of unreclaimable kernel slab memory for the otherwise
necessary gap VMAs (when the runtime-page-size < ELF-segment-p_align).

Such mappings may beyond the end of the backing file when extended;
which breaks the common userspace assumption that file memory maps are
entirely backed by the underlying file.

Existing apps (not yet updated for larger page size support) may
encounter breakages if they parse /proc/self/[s]maps and use the
[start, end] addresses to operate on system libraries that have
crt_pad_segment optimization (VMA extension) [1].

In order to avoid breaking exisiting apps, update the build system to
ensure the platform ELFs' segments are entirely backed by the file
even when the VMA is extended to be contiguous with the subsequent
segment's. This is achieved using the linker flag
-z separate-loadable-segments, which inserts enough padding (zeros)
to also align each segment's offset on file by it's p_align
(max-page-size).

Although laying out the ELF segments on disk to respect the p_align
causes an increase in the file's apparent size (i_size), on Android the
actual disk usage increase is not significant due to most of the padding
being zero blocks which don't get alloacted in the read-only partitions.

The following results were obtained on an ARM64 device on a recent
git_main build:

 No Separate     Separate     Delta         Delta %   Partition
   Loadable      Loadable
   Segments      Segments

   4208.90MB    4214.6MB       5.70MB       0.14%     All RO Partitions

Note: The overhead of -z separate-loadable-segments is minimized by the
fact that ARM64 android already builds with -z separate-code. [2]

[1] https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/arch-common/bionic/crt_pad_segment.S
[2] 733198152d:build/soong/cc/config/arm64_device.go;l=53

Bug: 328797737
Test: Manually test previously crashing application
Change-Id: Icb14ad10b5c9282855d54c7945b065b7b4184163
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
2024-03-12 17:04:50 -07:00
Treehugger Robot
66e8a75700 Merge "Add defaults support for apex_contributions module type" into main 2024-03-12 20:35:12 +00:00
Spandan Das
a747d2ec48 Generate info about the selected apex variant in platform builds
out/soong/prebuilt_info.json will contain information about whether
source or prebuilt of an apex was used. If prebuilt is used, it will
print the path to its prebuilt_info file. This file will be
used to pick a matching set of MTS test prebuilts.

Each apex will have an entry in this file with the following properties
- Name, mandatory
- Is_prebuilt, mandatory
- Prebuilt_info_file_path, optional

Implementation details
- Introduce a new `prebuilt_info` prop to `apex_set` and `prebuilt_apex`
- All apex module types will set a prebuiltInfoProvider in
  GenerateAndroidBuildActions, including the source apex module types
- Create a `apex_prebuiltinfo_singleton` that visits all apex modules.
  It uses `IsHideFromMake` to filter out the unselected variants of a
  specific apex. This new singleton will create prebuilt_info.json
- Dist prebuilt_info.json for droidcore

Test: m nothing --no-skip-soong-tests
Test: m out/soong/prebuilt_info.json
Test: ls -l out/soong/prebuilt_info.json --human-readable
-rw------- 1 spandandas primarygroup 25K Mar 11 23:46 out/soong/prebuilt_info.json

Test: #modified trunk_staging.locally to select prebuilts of some
mainline modules. Spot-checked that `is_prebuilt` and
`prebuilt_info_file_path` get populated appropriately

Bug: 327480225

Change-Id: I65c73010142b034ad1d2b3d05ef493be034e8d74
2024-03-12 18:04:55 +00:00
Andrew Walbran
d3f500da5b gen_parsers_and_formatters.rs is no longer generated.
Bug: 270547306
Test: m out/soong/.intermediates/system/libsysprop/srcs/platformproperties_rust_gen/gen/ApkVerityProperties/src/lib.rs
Change-Id: I9d8ead1a7c846d7bfcdafcd68f44763364dae368
2024-03-12 15:55:26 +00:00
Andus Yu
2b8928444d Merge "Make sure RBE socket address is under character limit" into main 2024-03-12 13:45:51 +00:00
Jooyung Han
5e8994e5ed Clean up LLNDK stubs
So far we created {"", "current"} stubs for LLNDK modules. But we don't
need "current" because "" itself is a stub.

This change only removes unused LLNDK stub modules with "current"
version, which aren't used at all.

Bug: 329183083
Test: m blueprint_tests
Change-Id: Ib8e880b6d88952b489657ea1ac557a48afe562a4
2024-03-12 16:26:18 +09:00
Hsin-Yi Chen
f1f276c904 Let header ABI checker load core variants' version scripts
Header ABI checker dumps the ABI from core variants and filters it by
version scripts. Ideally it should load different version scripts for
LLNDK, NDK, APEX, etc, but the build rules have not been completed. The
current solution is to load core variants' version scripts. It works
for every existing library because a library's variants share one
version script.

Test: make
Bug: 329078703
Change-Id: I4e26275e24daf93c7d3bb7e70b542a1197ae2129
2024-03-12 04:40:59 +00:00
Treehugger Robot
64342427b8 Merge "Revert "Include all_aconfig_declarations in docs dist"" into main 2024-03-12 02:58:18 +00:00
Treehugger Robot
9e11c2ed14 Merge "Make syspropRustGenRule work with absolute paths" into main 2024-03-12 02:05:31 +00:00
Treehugger Robot
fd3921f6bb Merge "Use uncompressed dex for all preopted system targets" into main 2024-03-12 01:43:32 +00:00
LaMont Jones
60d4307605 Revert "Include all_aconfig_declarations in docs dist"
This reverts commit 90c2af97ed.

Reason for revert: Includes too many flags.  The on-device copy of aconfig declarations must be **only** those that are used by code on the device.  `all_aconfig_declarations` is every aconfig flag in the source tree, and cannot be placed on the device.

Change-Id: Id7ac61c0805825b4ca27fffe84a48f95e3c682b2
2024-03-11 20:35:14 +00:00
Treehugger Robot
d69b79e295 Merge "Include all_aconfig_declarations in docs dist" into main 2024-03-11 19:28:50 +00:00
Sorin Basca
7f4fa82732 Merge "Revert^2 "Switch to JDK 21"" into main 2024-03-11 18:40:04 +00:00
Sorin Basca
5dfa238f22 Revert^2 "Switch to JDK 21"
This reverts commit b832ae19d8.

Reason for revert: Reland Switch to JDK 21 when related issues are resolved.

Bug: 313924276
Change-Id: Ibb5031d9892d1ddc5bc4d2af9885c3192b8ac8ad
Test: TH
2024-03-11 17:23:06 +00:00
Sam Saccone
bfa20d7e15 Merge "Revert "Switch to JDK 21"" into main 2024-03-11 17:05:56 +00:00
Aleksei Vetrov
f4775ca238 Make syspropRustGenRule work with absolute paths
This rule should be able to work with OUT_DIR set as absolute path,
which is used in "development/tools/ndk/update_ndk_abi.sh".

The problem appears if sysprop file itself is generated and
"syspropFile.String()" returns an absolute path, which is not accepted
as path component for "PathForModuleGen".

The fix is to use "android.GenPathWithExt" like in "syspropJavaGenRule".

Fixes: 328506541
Test: TreeHugger
Test: development/tools/ndk/update_ndk_abi.sh
Change-Id: Ia1e9a0ad51ebd957be97c48f5e1cf0e06a0da0ee
2024-03-11 14:02:08 +00:00
Mårten Kongstad
90c2af97ed Include all_aconfig_declarations in docs dist
Include all_aconfig_declarations in the docs dist directory, in both
binary protobuf (for machine consumption) and text protobuf (for human
consumption) format.

Bug: 324281288
Test: m docs dist && test -e out/dist/flags.pb && test -e out/dist/flags.textproto
Change-Id: I5756b913aeb44ee4f3f9ab64ae5038fc64557b5f
2024-03-11 14:07:21 +01:00
Treehugger Robot
b952c84841 Merge "Allow PrevVendorApiLevel to be less than 34" into main 2024-03-11 04:56:59 +00:00
Cole Faust
8c36631fa0 Remove unused code in update.go
Test: m nothing
Change-Id: Idae97a203bfcf451456766c0b6eb5430959c0ade
2024-03-08 10:58:32 -08:00
Cole Faust
f3fcc952f2 Merge "Replace generatedFile with android.WriteFileRule" into main 2024-03-08 18:49:59 +00:00
Treehugger Robot
385138a836 Merge "Remove starlark_import" into main 2024-03-08 18:32:09 +00:00
Treehugger Robot
181a27986c Merge "Optimize buildPropFile()" into main 2024-03-08 10:24:50 +00:00
Jihoon Kang
48872f5443 Merge "Fix missing credential error message" into main 2024-03-08 06:34:50 +00:00
Cole Faust
ed158f4d1c Replace generatedFile with android.WriteFileRule
Fewer lines of code and more performant.

Test: Presubmits
Change-Id: If09dae6aba67c19106d4cbf058a60bbbc27f78d2
2024-03-07 16:41:27 -08:00
Jihoon Kang
70de2c04a7 Fix missing credential error message
LOAS credential enforcement is already taking effect, not in the future.
Update the warning message accordingly.

Test: gcertdestroy && m and inspect error message
Bug: 318506452
Change-Id: I857f44b265c454beaffb9e662bd318aeb29f6cdb
2024-03-08 00:11:20 +00:00