Commit graph

72412 commits

Author SHA1 Message Date
Cole Faust
a57c8c29bb Improve genrule sandboxing script
Do the sandboxed and non-sandboxed builds in two separate directories.
This allows us to keep the directories around so you can compare diffs
afterwards, and allows us to run the builds in parallel. It also means
that analysis isn't rerun twice every time you run the script.

Bug: 307824623
Test: Using it for the past few genrules I've fixed
Change-Id: Ib3be394f233b383c1bba41d31ada6c9af94e755b
2023-11-15 11:44:12 -08:00
Jihoon Kang
37d679df33 Merge "Add environment variable BUILD_FROM_SOURCE_STUB" into main 2023-11-15 16:29:12 +00:00
Ivan Lozano
5ade28cb31 Merge "rust: Allow no_stdlibs per-target variants." into main 2023-11-15 15:18:29 +00:00
Aditya Choudhary
d97bf36469 Merge "Add proto for Test ownership metadata." into main 2023-11-15 10:30:50 +00:00
Aditya Choudhary
9b59352a82 Add proto for Test ownership metadata.
This Cl adds a new rule to Soong to generate test spec metadata. Also, this CL adds a provider in various test module to provide test spec related data to the Soong rule.
Will add providers and test code to other Module in the future changes.
Provider added for the following test modules in this change: android_robolectric_test, android_test, bootclasspath_fragment_test, java_test, java_test_host, python_test, python_test_host, sh_test,and sh_test_host.

Bug: 296873595

Change-Id: I5f89f72d5874bb7838ae357efdb8c6ca208e18a7
2023-11-15 09:08:02 +00:00
Treehugger Robot
5876a78543 Merge "Sandbox nondeterministic genrules" into main 2023-11-15 04:56:45 +00:00
Jooyung Han
7c22416af4 Merge "Use vendor_file for vendor apex root" into main 2023-11-15 04:36:41 +00:00
Cole Faust
2bfbb850c2 Sandbox nondeterministic genrules
These genrules are nondeterministic even without sandboxing, which
caused genrule_sandbox_test.py to think that they didn't work with
sandboxing.

Bug: 307824623
Test: m aidl_camera_build_version apexer_test_host_tools authfs_test_apk_assets common-profile-text-protos core-tests-smali-dex futility_cmds gen_corrupt_superblock_apex gen_manifest_mismatch_apex_no_hashtree generate_hash_v1 lib-test-profile-text-protos libmojo_jni_headers measure_io_as_jar PackageManagerServiceServerTests_apks_as_resources pandora-python-gen-src sample-profile-text-protos services.core.protologsrc statsd-config-protos temp_layoutlib vm-tests-tf-lib vts_vndk_abi_dump_zip wm_shell_protolog_src wmtests.protologsrc
Change-Id: I289decc2ac85d45b4c0f930171145553e477b1dd
2023-11-14 18:28:46 -08:00
Jihoon Kang
7c1958f0f4 Add environment variable BUILD_FROM_SOURCE_STUB
On top of the soong build flag --build-from-source-stub, the user can
configure build to generate stubs from source Java files by setting the
environment variable BUILD_FROM_SOURCE_STUB=true.

Test: m nothing
Bug: 310279899
Change-Id: I0c5247558455f09b8fc208d988aab3b60bf0ff16
2023-11-15 00:34:43 +00:00
Cole Faust
e492de0430 Sandbox uwb genrules
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py gen_uwb_core_proto uwb_core_artifacts
Change-Id: Ie9070cd589fbd15c72723e8c1c57d69aaf7451d9
2023-11-14 11:58:19 -08:00
Alyssa Ketpreechasawat
378c7a3953 Merge "Skip unknown check in bootclasspath_fragment (source version) if prebuilt version is in use." into main 2023-11-14 19:13:32 +00:00
Treehugger Robot
7dc019e8cb Merge "Sandbox libtextclassifier genrules" into main 2023-11-14 18:55:56 +00:00
Ivan Lozano
c518202e28 rust: Allow no_stdlibs per-target variants.
stdlibs can be set per-target, it makes to sense to allow no_stdlibs to
be set per-target as well.

Bug: 310924208
Test: Android.bp with per-target no_stdlibs builds.
Change-Id: I1c3a458a849367d2c363bd5f65af77b8cce8c0e0
2023-11-14 10:40:08 -05:00
Jooyung Han
fed9cce4b6 Use vendor_file for vendor apex root
It was 'vendor_apex_metadata_file', but root directories can be simply
labelled as 'vendor_file' so that linker can resolve paths in vendor
apexes.

Bug: 310528686
Test: m blueprint_tests
Change-Id: I689b23efccb7be61980e791e185fcef28a76d9bc
2023-11-14 13:52:51 +09:00
Spandan Das
6f9522e4a8 Merge "Remove redundant baseline apex_available entries" into main 2023-11-13 23:00:03 +00:00
Spandan Das
896e3846a4 Merge "Remove empty baseline apex_available maps" into main 2023-11-13 22:48:38 +00:00
Spandan Das
39e21ee0dd Remove redundant baseline apex_available entries
These soong modules list the relevant apex_available values explicitly
in Android.bp files

Test: m nothing
Bug: 281077552
Change-Id: I7ec8e0f9d7ab7cbfb881d59d3e5d2bb8a2975ff8
2023-11-13 21:36:15 +00:00
Spandan Das
bf6f44167f Remove empty baseline apex_available maps
And com.android.appsearch since the lone entry in the map specifies
com.android.appsearch in its Android.bp file explicitly

Bug: 281077552
Test: m nothing
Change-Id: I0b7e37f0b6ace21d37c8b0077bacf83b49318744
2023-11-13 21:06:16 +00:00
Colin Cross
2f63457354 Avoid conflicts between architectures in prebuilt_renderscript_bitcode
The NDK build has 4 architectures, x86 and arm 32-bit architectures and
x86_64 and arm64 64-bit architectures.  Multilib on its own is not
enough to prevent collisions in install locations.  Detect conflicts
and add the architecture to the path the same way cc/installer.go does.

Bug: 308212344
Test: OUT_DIR=out build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: If7a1b062035dda87f5f8129062778c41c43de17b
2023-11-13 12:12:06 -08:00
Zi Wang
692f54baeb Merge "Add "exported" mode to xx_aconfig_library build rules" into main 2023-11-13 19:23:55 +00:00
Treehugger Robot
fa10b620c1 Merge "Sandbox openwrt genrules" into main 2023-11-13 18:33:19 +00:00
Zi Wang
275f654a2e Add "exported" mode to xx_aconfig_library build rules
Test: added unit tests and CI

Bug: 309990433
Change-Id: Iae1b85265d9780bde7d41ec2ec6e8e441c2b3814
2023-11-13 10:23:55 -08:00
Treehugger Robot
3a35d64915 Merge "Allow Ravenwood to cross variant boundaries" into main 2023-11-13 17:11:30 +00:00
Cole Faust
653f9bacda Sandbox openwrt genrules
These genrules have non-deterministic outputs even without sandboxing.
Though I couldn't easily figure out where the nondeterminism is coming
from.

Bug: 307824623
Test: Presubmits
Change-Id: Ia60c6fae164a1f66cad2e19ccaab7d178905f2a4
2023-11-10 17:42:31 -08:00
Cole Faust
a215c8bdb9 Sandbox pdl genrules
Like in aosp/2825629, these genrules right the command used to
generate their files to the files themselves, which differs between
sandboxed/non-sandboxed invocations and caused genrule_sandbox_test.py
to think that sandboxing caused meaningful differences.

Bug: 307824623
Test: Presubmits
Change-Id: I248de8a45ab03a498297a026250d6f0b7c838e25
2023-11-10 16:28:27 -08:00
Makoto Onuki
b66bba3a3c Allow Ravenwood to cross variant boundaries
Bug: 310268946
Bug: 292141694
Test: atest RavenwoodMockitoTest
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:43b648195bcf62f62cae5547f73b247c278e1883)
Merged-In: Ia395d32bad57007ec477a6410dcc4201853c8790
Change-Id: Ia395d32bad57007ec477a6410dcc4201853c8790
2023-11-11 00:13:14 +00:00
Treehugger Robot
064bbf77fe Merge "Sandbox bluetooth genrules" into main 2023-11-11 00:03:55 +00:00
Cole Faust
632408fb5d Sandbox bluetooth genrules
These genrules work with sandboxing already, they just had
non-determinism that lead genrule_sandboxing.py to think that they
didn't.

Non-determinism sources include:
 - HeadlessBuildTimestamp literally just generates a header file with
   a timestamp, not much we can do here other than re-architect their
   code.
 - Pdlc has a non-determinism issue I sent out a cl to fix:
   https://github.com/google/pdl/pull/85
 - Python tools write the command they were ran with to generated files,
   and non-embedded-launcher python scripts have non-deterministic
   paths. Switched to embedded_launcher: true: aosp/2825231
     - In addition, the path to the genrule sandbox is not
       non-deterministic, but it is a hash of the inputs to the sandbox.
       When running genrule_sandbox.py, it compares a "partial" sandbox
       (which only sandboxes tools) to a "full" sandbox, and these two
       runs have different sandbox hashes.

Bug: 307824623
Test: Presubmits
Change-Id: Ib966262dc1aac99a0798f26d8a03966cc97fe1bf
2023-11-10 15:05:28 -08:00
Greg Kaiser
13596d20af Merge "ndk: Hard-code the TARGET_RELEASE" into main 2023-11-10 19:59:07 +00:00
Juan Yescas
cd34701399 Merge changes from topic "16k-emulator-x86-64" into main
* changes:
  16k: soong: Add the C flag -D__BIONIC_NO_PAGE_SIZE_MACRO flag to x86-64
  16k: soong: Add linker flag -Wl,-z,max-page-size for x86-84 to align binaries and .so
2023-11-10 19:29:18 +00:00
Treehugger Robot
34778a9301 Merge "Change OnlyPreoptBootImageAndSystemServer to OnlyPreoptArtBootImage." into main 2023-11-10 18:47:19 +00:00
Jihoon Kang
8c4387e478 Merge "Revert^2 "Default from-text stub generation in build"" into main 2023-11-10 04:10:24 +00:00
Jooyung Han
5d9fb52087 Merge "Deprecate 'contributions' field from linkerconfig" into main 2023-11-10 03:55:49 +00:00
Seungjae Yoo
54c63ac015 Merge "Add security_patch avb property for android_filesystem" into main 2023-11-10 01:03:55 +00:00
Juan Yescas
a74b22e8e6 16k: soong: Add the C flag -D__BIONIC_NO_PAGE_SIZE_MACRO flag to x86-64
To simulate 16k page size in x86-64 cuttefish, it is necessary
to compile the shared libraries and binaries with max-page-size greater
than 4096.

Bug: 309816695
Test: source build/envsetup.sh
      lunch aosp_cf_x86_64_phone_pgagnostic-trunk-userdebug
      m
Change-Id: I32670ef2c25fdcefec11bd07ba41cd0ea96c92bd
2023-11-09 16:58:29 -08:00
Cole Faust
ec8f0ca86c Merge "Sandbox hidl genrules" into main 2023-11-09 22:05:49 +00:00
Juan Yescas
3db51d2500 16k: soong: Add linker flag -Wl,-z,max-page-size for x86-84 to align binaries and .so
To simulate 16k page size in x86-64 cuttefish, it is necessary
to compile the shared libraries and binaries with max-page-size greater
than 4096.

Bug: 309816695
Test: source build/envsetup.sh
      lunch aosp_cf_x86_64_phone_pgagnostic-trunk-userdebug
      m
      readelf -l out/target/product/vsoc_x86_64_only/system/bin/toybox
Change-Id: I38e4449a7826a2eca0c1a1cccc916af21f0b3a93
2023-11-09 13:29:22 -08:00
Treehugger Robot
05dafa1772 Merge "Sandbox CompilationTestCases_package-dex-usage" into main 2023-11-09 20:41:30 +00:00
Dennis Shen
10b38c4957 Merge "Add dependency of liblazy_static" into main 2023-11-09 20:03:41 +00:00
Greg Kaiser
a0b356f6b0 ndk: Hard-code the TARGET_RELEASE
Trunk stable builds require a TARGET_RELEASE to be set, but this
variable doesn't have a real meaning for NDK builds.  So we
hard-core it here so individual build setups don't need to
configure it.

Bug: 309900087
Test: Treehugger
Change-Id: I17a2e463db0b561aea57417bc2b469070ba2062d
2023-11-09 12:43:38 -07:00
Colin Cross
4ade19fe94 Merge changes I4d0b27ba,Ic48e9cf2 into main
* changes:
  Fix soong_ui file rlimits for go 1.21
  Fix TestReverseSlice for go 1.21
2023-11-09 18:47:40 +00:00
Jiakai Zhang
2398442ec0 Change OnlyPreoptBootImageAndSystemServer to OnlyPreoptArtBootImage.
OnlyPreoptBootImageAndSystemServer was for making the eng build faster.
This change makes it even faster.

Bug: 309011617
Test: Presubmit
Change-Id: If9001e99593b57deafa7b56f0ca6b3d4d80f56d3
2023-11-09 16:50:58 +00:00
Dennis Shen
ba6ed2d62a Add dependency of liblazy_static
Bug: b/307336730
Change-Id: I2c89b0f73787649408e2a23f3f308b3e0eb0c9ea
2023-11-09 15:07:04 +00:00
Alyssa Ketpreechasawat
a0cf0a4a66 Skip unknown check in bootclasspath_fragment (source version) if prebuilt version is in use.
Following aosp/2822531, when MediaProvider prebuilt is enabled, framework-pdf (new jar) will be removed from PRODUCT_APEX_BOOT_JARS. Subsequently there will be an error around the inconsistency (unknown) between bootclasspath_fragment (source version of MP with framework-pdf in its content) and PRODUCT_APEX_BOOT_JARS (framework-pdf removed). Since the source version of bootclasspath_fragment is not in use, we should ignore this check. See more detail in go/stale-mainline-prebuilts (issue from changes in framework/service jars in existing apexes).

Bug: 304719212
Test: lunch cf_x86_phone-next-userdebug & m
Test: lunch cf_x86_phone-trunk-userdebug & m
Change-Id: I0f62277a9e65522bf5a4ea1ae33c166f996c37d5
2023-11-09 12:54:09 +00:00
Colin Cross
611a2fbdd7 Fix soong_ui file rlimits for go 1.21
Go 1.21 modifies the file limit but restores the original when
execing subprocesses if it hasn't be overridden.  Call Setrlimit
even if it doesn't appear to be necessary so that the syscall package
considers it set.

Bug: 309895579
Test: m nothing
Change-Id: I4d0b27bac90a2a88bfc68a8491d54dc106e1ec13
2023-11-08 22:11:28 -08:00
Colin Cross
f2fab8347d Fix TestReverseSlice for go 1.21
Go 1.21 does a better job using the same empty allocation for empty
slices, check for cap > 0 before requiring slices to have different
backing arrays.

Bug: 309895579
Test: TestReverseSlice
Change-Id: Ic48e9cf2c95ea0b810a11cdc4a794a70c02a0a61
2023-11-08 22:11:24 -08:00
Seungjae Yoo
a30e450ba0 Add security_patch avb property for android_filesystem
If android_filesystem module is used with use_avb, defined
security_patch for the rollback protection.

Bug: 285855436
Test: m
Test: avbtool info_image --image <IMAGE>
Change-Id: I32c6108bb1aca398ced5e46b615d937685e261a7
2023-11-09 14:55:44 +09:00
Cole Faust
98f2f2c771 Sandbox hidl genrules
go/roboleaf-busy-beavers-sandboxing

Most of these genrules work out of the box with sandboxing, I'm not sure why they were added.
However hidl_hash_test_gen needs a fix, and hidl2aidl_translate_cpp_test_gen_src produces
nondeterministic results even without sandboxing.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py hidl2aidl_test_gen_aidl hidl2aidl_translate_cpp_test_gen_headers hidl2aidl_translate_cpp_test_gen_src hidl2aidl_translate_java_test_gen_src hidl2aidl_translate_ndk_test_gen_headers hidl2aidl_translate_ndk_test_gen_src hidl_cpp_impl_test_gen-headers hidl_cpp_impl_test_gen-sources hidl_error_test_gen hidl_export_test_gen-headers hidl_format_test_diff hidl_hash_test_gen hidl_hash_version_gen hidl_java_impl_test_gen
Change-Id: Ia865ba3ed9b1ede21b440c3b640fcdb5d7661c9d
2023-11-09 04:44:33 +00:00
Spandan Das
c31b24977e Merge changes from topic "apex_contributions_build_flags" into main
* changes:
  Special-case java_sdk_library in source vs prebuilt selection
  Use `all_apex_contributions` for source/prebuilts selection
  Create a singleton all_apex_contributions module type
2023-11-09 01:31:57 +00:00
Cole Faust
7ec1a57d09 Sandbox libtextclassifier genrules
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py libtextclassifier_fbgen_actions_actions-entity-data libtextclassifier_fbgen_actions_actions_model libtextclassifier_fbgen_annotator_datetime_datetime libtextclassifier_fbgen_annotator_entity-data libtextclassifier_fbgen_annotator_experimental_experimental libtextclassifier_fbgen_annotator_model libtextclassifier_fbgen_annotator_person_name_person_name_model libtextclassifier_fbgen_lang_id_common_flatbuffers_embedding-network libtextclassifier_fbgen_lang_id_common_flatbuffers_model libtextclassifier_fbgen_utils_codepoint-range libtextclassifier_fbgen_utils_container_bit-vector libtextclassifier_fbgen_utils_flatbuffers_flatbuffers libtextclassifier_fbgen_utils_flatbuffers_flatbuffers_test libtextclassifier_fbgen_utils_grammar_rules libtextclassifier_fbgen_utils_grammar_semantics_expression libtextclassifier_fbgen_utils_grammar_testing_value libtextclassifier_fbgen_utils_i18n_language-tag libtextclassifier_fbgen_utils_intents_intent-config libtextclassifier_fbgen_utils_lua_utils_tests libtextclassifier_fbgen_utils_normalization libtextclassifier_fbgen_utils_resources libtextclassifier_fbgen_utils_tflite_text_encoder_config libtextclassifier_fbgen_utils_tokenizer libtextclassifier_fbgen_utils_zlib_buffer
Change-Id: I663384df9b36ea5e7d62278c2d0b3331634e1b4e
2023-11-08 15:44:54 -08:00