Commit graph

66853 commits

Author SHA1 Message Date
Sam Delmerico
a588d153c8 support sandboxed rust rules
This commit adds support for compiling rust rules inside the sbox
sandbox. To compile a rust module with sandboxing enabled, the entry
point to the crate must be specified via the `crate_root` property, and
all input sources and compile-time data must be specified via the `srcs`
and `compile_data` properties.

Bug: 286077158
Change-Id: I8c9dc5cf7578037a583b4be2e2f73cf20ffd4408
2023-09-15 22:46:56 +00:00
Sam Delmerico
d96a60685a conditionally escape rule builder command
For rules which use RuleBuilder with Ninja variables (using the
BuildWithUnescapedNinjaVars function) but are not sandboxed, the command
output by RuleBuilder must not be escaped, or else Ninja variables will
not be evaluated until they are run on the command line.

Test: m libnum_traits liboid_registry crosvm droid
Change-Id: I81611368ab1975220f7f517df2f57646deac2af8
2023-09-15 22:41:58 +00:00
Sam Delmerico
0e2d63e4d2 Revert^2 "allow Ninja variables in RuleBuilder API"
7b02d8159e

Change-Id: I9f2031162b019e51b869ea0db151c86db447b23d
2023-09-15 22:41:56 +00:00
Sam Delmerico
60375c4adf Revert^2 "add crate_root property to rust modules"
5162ff14fc

Change-Id: I9a76df938639676ee4aa7bdd2b2902e0e6df08d5
2023-09-15 22:41:51 +00:00
Sam Delmerico
9333ac1249 Revert^2 "add rust_toolchain_rustc_prebuilt module type"
400749d1f0

Change-Id: I63f04e13605c43f800f01f45345e4b3dc61aefb7
2023-09-15 22:40:16 +00:00
Mark Dacek
4eabebec69 Merge "Change symlink_forest to use relative symlinks." into main 2023-09-12 15:47:42 +00:00
Liz Kammer
7ebb91a449 Merge "Sort do not convert for unconverted deps" into main 2023-09-12 14:39:28 +00:00
Romain Jobredeaux
2195f24ec4 Merge "Re-order android_app bp2build converter logic." into main 2023-09-12 13:56:00 +00:00
Liz Kammer
f673c2ea9f Sort do not convert for unconverted deps
Test: n/a
Change-Id: Id86986f17d23fe47e47b303a1828478b8e887513
2023-09-12 09:08:17 -04:00
MarkDacek
b98b3a429f Change symlink_forest to use relative symlinks.
Also add script to remove the Bazel output base.
This will assist with supporting movable checkouts alongside
mixed builds.

Bug: 259191764
Test: m && (move topic and prepare_moved_top.sh) && m
Test: m && prepare_moved_top.sh && m
Test: build/soong/tests/relative_symlinks_test.sh

Change-Id: I0f53da8d99f752fad496cf3ac61b01f001b7296d
2023-09-12 04:02:23 +00:00
Treehugger Robot
0e3da8162c Merge "Allowlist packages instead of modules" into main 2023-09-12 01:53:49 +00:00
Treehugger Robot
7db882793b Merge changes from topic "aidl_interface_hdrs" into main
* changes:
  export SimpleModuleDoNotConvertBp2build for AIDL
  export SetStubsForDynamicDeps for use in AIDL
2023-09-12 01:52:03 +00:00
Jooyung Han
fc7ba26f1c Merge changes from topics "fix-apex-linkerconfig", "fix-apex-vintf" into main
* changes:
  apex: validate vintf fragments in vendor APEX
  apex: invoke `conv_linker_config validate` as validation
2023-09-12 01:39:07 +00:00
Zi Wang
37aa1729b0 Merge "Allowlist libprotobuf-java-full" into main 2023-09-11 22:50:40 +00:00
Treehugger Robot
e79010c7ca Merge "Revert "rustc-1.72.0 Build 10752340"" into main 2023-09-11 22:29:04 +00:00
Vinh Tran
9226051310 Allowlist packages instead of modules
bp2build doesn't support allowlisting fully qualified module names. Hence, when modules such as libui and libbinder have duplicate names with corresponding fdo_profile modules, bp2build yields an error. See b/299663210 for more context.

Test: CI
Bug: 299663210
Change-Id: Ic175f5aea38139d34c5df8b9d02e7d82d9b3fc10
2023-09-11 18:15:35 -04:00
Romain Jobredeaux
d2cc5037c2 Re-order android_app bp2build converter logic.
This change is a no-op but makes it easier to single out framework-res
for conversion in subsequent CL aosp/2720593.

Bug: 276928228
Test: CI
Change-Id: I7c7338add1857697912dec3c34b7c43e06d2d12d
2023-09-11 16:37:50 -04:00
James Farrell
5d4be57cac Revert "rustc-1.72.0 Build 10752340"
Revert submission 2736851-rust-1.72

Reason for revert: Breaks Mac builds

Change-Id: I94a30e61f9f717ad135fbef7ec7241730f583110
2023-09-11 20:01:49 +00:00
Treehugger Robot
d15dcb7158 Merge "rustc-1.72.0 Build 10752340" into main 2023-09-11 18:20:20 +00:00
Treehugger Robot
3d4e1eaa3f Merge "Remove link to internal doc in Soong AOSP README." into main 2023-09-11 17:41:21 +00:00
Cole Faust
7a05d1392a Merge "Allow actions to read BUILD_BROKEN_INCORRECT_PARTITION_IMAGES" into main 2023-09-11 17:25:18 +00:00
Jingwen Chen
fcf8a46385 Remove link to internal doc in Soong AOSP README.
Test: n/a
Change-Id: Ic0a997938a5dc4fbb46f401daa3cb3f6e8c2c54b
2023-09-11 08:24:23 +00:00
Sam Delmerico
130d75b6b3 export SimpleModuleDoNotConvertBp2build for AIDL
Bug: 298246873
Change-Id: I06ed7bb8fc1139731a2b48440a91aeb7f383efff
2023-09-10 19:05:54 +00:00
Sam Delmerico
dd6caa739d export SetStubsForDynamicDeps for use in AIDL
Bug: 298249725
Change-Id: Ia93b320783eccf04fef167a26e2efb401c0e4236
2023-09-10 18:15:45 +00:00
Treehugger Robot
edbf854aa5 Merge "Re-enable partition test" into main 2023-09-08 23:16:58 +00:00
Cole Faust
ded796030b Allow actions to read BUILD_BROKEN_INCORRECT_PARTITION_IMAGES
To maintain good backwards compatibility with the legacy partition
building behavior, allow actions to read
BUILD_BROKEN_INCORRECT_PARTITION_IMAGES so that we don't have to rerun
analysis.

Bug: 205632228
Test: Presubmits
Change-Id: I2b55c0143cbdaf010e6b5fd0c3d51d6930a94eff
2023-09-08 15:58:13 -07:00
Sam Delmerico
1d3740a274 Merge changes from topic "revert-2605644-rulebuilder-ninja-vars-OAAWYCDDLT" into main
* changes:
  Revert "add rust_toolchain_rustc_prebuilt module type"
  Revert "add crate_root property to rust modules"
  Revert "allow Ninja variables in RuleBuilder API"
2023-09-08 20:46:55 +00:00
Cole Faust
9a6fa98cd3 Re-enable partition test
Due to the series of recent reverts, it's working now.

Bug: 297269187
Test: m bazel_sandwich
Change-Id: I010a942918467713e08b900aec06c7011c40c3be
2023-09-08 12:00:39 -07:00
Cole Faust
096b7e83bc Merge "Don't allow tree artifacts in mixed builds" into main 2023-09-08 18:02:29 +00:00
Spandan Das
ff8fb5c6cc Merge "Write the list of ndk libraries to cc_toolchain/ndk_libs.bzl" into main 2023-09-08 17:11:06 +00:00
Sam Delmerico
400749d1f0 Revert "add rust_toolchain_rustc_prebuilt module type"
Revert submission 2605644-rulebuilder-ninja-vars

Reason for revert: b/299568218

Reverted changes: /q/submissionid:2605644-rulebuilder-ninja-vars

Change-Id: Ic3d1ba7e8a61427b52f31cc3f187c9d5a7d9a7bb
2023-09-08 16:10:47 +00:00
Sam Delmerico
5162ff14fc Revert "add crate_root property to rust modules"
Revert submission 2605644-rulebuilder-ninja-vars

Reason for revert: b/299568218

Reverted changes: /q/submissionid:2605644-rulebuilder-ninja-vars

Change-Id: I17645fcff117909c09a016157235805f0974340b
2023-09-08 16:10:47 +00:00
Sam Delmerico
7b02d8159e Revert "allow Ninja variables in RuleBuilder API"
Revert submission 2605644-rulebuilder-ninja-vars

Reason for revert: b/299568218

Reverted changes: /q/submissionid:2605644-rulebuilder-ninja-vars

Change-Id: Ia738c100b8431dea6151939a800b992f877b5bb8
2023-09-08 16:10:54 +00:00
Treehugger Robot
3fb2002c9e Merge changes I86f30b99,I2769c0d5 into main
* changes:
  Do not convert resource dirs without resources
  Do not convert java libraries with core_platform
2023-09-08 16:04:45 +00:00
Treehugger Robot
b091d3b688 Merge "Add all of hardware/interfaces/media to allowlist" into main 2023-09-08 16:04:44 +00:00
Liz Kammer
33dddf5a7e Do not convert resource dirs without resources
Previously we would convert to java_resources when there were no
resources and get an error.

Test: b build //external/libphonenumber/... --config=android
Change-Id: I86f30b993a3ffdb20000f6a4c5261e2c4c74263c
2023-09-08 09:44:00 -04:00
Liz Kammer
65942c8467 Do not convert java libraries with core_platform
Test: go bp2build tests
Change-Id: I2769c0d589c304caeb24a8ecba38a4a5ee6c63e5
2023-09-08 09:43:57 -04:00
Liz Kammer
4fd2edb638 Add all of hardware/interfaces/media to allowlist
Test: b build //hardware/interfaces/media/... //system/tools/hidl/... \
    --config=android
Test: b build //hardware/interfaces/media/... //system/tools/hidl/... -k
Change-Id: Icc0f8ebb87b269c93e1b3b37e8c162772a2384ec
2023-09-08 09:39:37 -04:00
Jooyung Han
e615441832 apex: validate vintf fragments in vendor APEX
In Make, vintf fragments are checked with assemble_vintf. Since vendor
APEXes can have vintf fragments, perform the same check with vintf
fragments in APEX.

Bug: 299034304
Test: m test.bad2.com.android.hardware.wifi
  (should fail if its module type is `apex`)
Change-Id: I2f9ed50066b9b499b3562bfa51214c1e375d5747
2023-09-08 21:36:00 +09:00
Jooyung Han
4bc102672a apex: invoke conv_linker_config validate as validation
`conv_linker_config validate` command is used to validate the linker
configuration embedded in APEX to detect common mistakes.

For example, when used in APEX, linker configuration can't set
provideLibs/requireLibs. For APEX, there are
provideSharedLibs/requireSharedLibs in APEX manifest for that purpose.

One might make mistake by setting provideLibs in linker config.
Now, when these unsupported properties are set, there'll be build-time
error like:

 // set provideLibs key in com.android.art's linker config.
 $ m com.android.art
   ...image.apex/etc/linker.config.pb: provideLibs is set. Use provideSharedLibs in apex_manifest

Bug: 264341796
Test: m com.android.art (see above)
Change-Id: Ibaf7322616ad333569e6d721680f3d72243402a2
2023-09-08 15:40:12 +09:00
Kiyoung Kim
86b9b13607 Merge "Temporarily link Vendor APEX with vendor libbinder when VNDK deprecated" into main 2023-09-08 04:21:17 +00:00
Firman Prayoga
e2e3172dba Merge "Revert "Allow actions to read BUILD_BROKEN_INCORRECT_PARTITION_I..."" into main 2023-09-08 04:06:57 +00:00
Firman Prayoga
20ae294850 Merge "Revert "Re-enable the partition test"" into main 2023-09-08 04:02:58 +00:00
Cole Faust
5abc4bfb6e Revert "Re-enable the partition test"
Revert submission 2745814-bazel_staging_dir_file_list

Reason for revert: So we can revert the staging directories change

Reverted changes: /q/submissionid:2745814-bazel_staging_dir_file_list

Change-Id: I3e997f29efcaf68ef102d33595609dd709f43d7d
2023-09-08 03:15:32 +00:00
Firman Prayoga
098b237f5e Revert "Allow actions to read BUILD_BROKEN_INCORRECT_PARTITION_I..."
Revert submission 2736954-proper_installclean

Reason for revert: Potential culprit for build breakage b/299545346

Reverted changes: /q/submissionid:2736954-proper_installclean

Change-Id: I96ef912c23f99b7335eeb27c2c09949d655e8fa7
2023-09-08 01:24:39 +00:00
Treehugger Robot
9abcf649a7 Merge changes from topics "rulebuilder-ninja-vars", "rustc_prebuilt_build_tool" into main
* changes:
  allow Ninja variables in RuleBuilder API
  add crate_root property to rust modules
  add rust_toolchain_rustc_prebuilt module type
2023-09-08 00:10:18 +00:00
Cole Faust
509ca8dfaf Merge "Re-enable the partition test" into main 2023-09-07 23:35:01 +00:00
Spandan Das
3645a62f53 Write the list of ndk libraries to cc_toolchain/ndk_libs.bzl
Soong adds "--no-ndk" to cc stubs for apexes if the library is not an
NDK library. In order to port this logic, emit the list to a .bzl file.

We cannot use the exportedVars.Export* soong_injection api for this
since we need to visit all modules to get this list.

Test: m nothing
Bug: 299501496
Change-Id: If8487db85e08b32b9b40aef3371d9f3f7d5a77e0
2023-09-07 22:37:29 +00:00
Cole Faust
bdee8f91f3 Don't allow tree artifacts in mixed builds
Tree artifacts aren't fully correct in incremental builds with ninja,
so add a check that we don't write rules using them.

Bug: 293609369
Test: m nothing
Change-Id: I2e49cb6ec24124baf00adb0860f3c1f1f80178bb
2023-09-07 14:28:51 -07:00
Sam Delmerico
1f9bb26656 allow Ninja variables in RuleBuilder API
The RuleBuilder API would not expand Ninja variables because the
variables would be written verbatim to the sandbox manifest file. This
commit allows a rule to specify that the manifest file should be written
in an un-escaped format so that Ninja variables are expanded before
writing the manifest file.

Bug: 286077158
Test: rust sandboxing topic + go test
Change-Id: I1915431f6e24d04d343dacc213c9079674ec8251
2023-09-07 20:56:02 +00:00