Commit graph

353 commits

Author SHA1 Message Date
Treehugger Robot
40b8b16042 Merge "Sandbox libbssl_sys_src_nostd" into main 2023-11-27 10:28:27 +00:00
Treehugger Robot
d766a44530 Merge "Sandbox r8retrace genrules" into main 2023-11-23 00:17:28 +00:00
Cole Faust
1ddb8125d3 Sandbox libbssl_sys_src_nostd
go/roboleaf-busy-beavers-sandboxing

gensrcs should require output_extension to be set, when it's not,
you get some weird filename like `lib.`. Switch to genrules for
simplicity.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py libbssl_sys_src_nostd
Change-Id: I4ec2686c560439c3150b74b14e313ed6b688720c
2023-11-22 15:23:50 -08:00
Cole Faust
954ef637e9 Merge "Sandbox trout genrules" into main 2023-11-22 22:05:42 +00:00
Cole Faust
28e46107cf Sandbox trout genrules
These were fixed in aosp/2838463, aosp/2839595, pa/2668052, and
pa/2668054.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py TracingVMProtoStub_cc TracingVMProtoStub_h VehicleServerProtoStub_cc@default-grpc VehicleServerProtoStub_cc@2.0-grpc-trout VehicleServerProtoStub_h@2.0-grpc-trout VehicleServerProtoStub_h@default-grpc
Change-Id: I9d21d608773e2974f8fca8af4dd16a654e8eb128
2023-11-22 12:09:27 -08:00
Cole Faust
f7474880a1 Sandbox atest_integration_fake_src
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py atest_integration_fake_src
Change-Id: Ib3ae70b877227df794fec5516a754a9c32b06637
2023-11-22 11:07:06 -08:00
Cole Faust
0931c29463 Sandbox tflite-support genrules
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py tflite_support_metadata_schema tflite_support_spm_config tflite_support_spm_encoder_config
Change-Id: Iab64f9f3125977685a5aa1ccffb093a68e4ac68b
2023-11-21 18:00:38 -08:00
Cole Faust
4a0be5cc17 Sandbox MultiDexLegacyTestApp_genrule and android-cts-verifier
These both work with sandboxing already, I'm not sure why they
were added to this list.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py android-cts-verifier MultiDexLegacyTestApp_genrule
Change-Id: Ie5a194fbe202b84a30eb3738d07ffb4ec9061bca
2023-11-21 17:04:24 -08:00
Cole Faust
cf783384d5 Sandbox cronet genrules
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py cronet_aml_base_allocator_buildflags cronet_aml_base_allocator_buildflags__testing cronet_aml_base_allocator_partition_allocator_chromecast_buildflags cronet_aml_base_allocator_partition_allocator_chromecast_buildflags__testing cronet_aml_base_allocator_partition_allocator_chromeos_buildflags cronet_aml_base_allocator_partition_allocator_chromeos_buildflags__testing cronet_aml_base_allocator_partition_allocator_debugging_buildflags cronet_aml_base_allocator_partition_allocator_debugging_buildflags__testing cronet_aml_base_allocator_partition_allocator_logging_buildflags cronet_aml_base_allocator_partition_allocator_logging_buildflags__testing cronet_aml_base_allocator_partition_allocator_partition_alloc_buildflags cronet_aml_base_allocator_partition_allocator_partition_alloc_buildflags__testing cronet_aml_base_anchor_functions_buildflags cronet_aml_base_anchor_functions_buildflags__testing cronet_aml_base_android_runtime_jni_headers cronet_aml_base_android_runtime_jni_headers__testing cronet_aml_base_android_runtime_unchecked_jni_headers cronet_aml_base_android_runtime_unchecked_jni_headers__testing cronet_aml_base_base_android_java_enums_srcjar cronet_aml_base_base_jni_headers cronet_aml_base_base_jni_headers__testing cronet_aml_base_build_date cronet_aml_base_build_date__testing cronet_aml_base_cfi_buildflags cronet_aml_base_cfi_buildflags__testing cronet_aml_base_clang_profiling_buildflags cronet_aml_base_clang_profiling_buildflags__testing cronet_aml_base_debugging_buildflags cronet_aml_base_debugging_buildflags__testing cronet_aml_base_feature_list_buildflags cronet_aml_base_feature_list_buildflags__testing cronet_aml_base_ios_cronet_buildflags cronet_aml_base_ios_cronet_buildflags__testing cronet_aml_base_java_features_srcjar cronet_aml_base_java_switches_srcjar cronet_aml_base_logging_buildflags cronet_aml_base_logging_buildflags__testing cronet_aml_base_message_pump_buildflags cronet_aml_base_message_pump_buildflags__testing cronet_aml_base_orderfile_buildflags cronet_aml_base_orderfile_buildflags__testing cronet_aml_base_power_monitor_buildflags cronet_aml_base_power_monitor_buildflags__testing cronet_aml_base_profiler_buildflags cronet_aml_base_profiler_buildflags__testing cronet_aml_base_rust_buildflags cronet_aml_base_rust_buildflags__testing cronet_aml_base_sanitizer_buildflags cronet_aml_base_sanitizer_buildflags__testing cronet_aml_base_synchronization_buildflags cronet_aml_base_synchronization_buildflags__testing cronet_aml_base_test_base_unittests_jni_headers__testing cronet_aml_base_test_test_support_jni_headers__testing cronet_aml_base_tracing_buildflags cronet_aml_base_tracing_buildflags__testing cronet_aml_build_android_build_config_gen cronet_aml_build_android_build_config_gen_rename cronet_aml_build_android_native_libraries_gen cronet_aml_build_blink_buildflags cronet_aml_build_blink_buildflags__testing cronet_aml_build_branding_buildflags cronet_aml_build_branding_buildflags__testing cronet_aml_build_chromecast_buildflags cronet_aml_build_chromecast_buildflags__testing cronet_aml_build_chromeos_buildflags cronet_aml_build_chromeos_buildflags__testing cronet_aml_build_config_compiler_compiler_buildflags cronet_aml_build_config_compiler_compiler_buildflags__testing cronet_aml_components_cronet_android_buildflags cronet_aml_components_cronet_android_buildflags__testing cronet_aml_components_cronet_android_cronet_jni_headers cronet_aml_components_cronet_android_cronet_jni_headers__testing cronet_aml_components_cronet_android_cronet_jni_registration cronet_aml_components_cronet_android_cronet_jni_registration__java cronet_aml_components_cronet_android_cronet_jni_registration__java__testing cronet_aml_components_cronet_android_cronet_jni_registration__testing cronet_aml_components_cronet_android_cronet_tests_jni_headers__testing cronet_aml_components_cronet_android_http_cache_type_java cronet_aml_components_cronet_android_implementation_api_version cronet_aml_components_cronet_android_integrated_mode_state cronet_aml_components_cronet_android_integrated_mode_state_rename cronet_aml_components_cronet_android_interface_api_version cronet_aml_components_cronet_android_load_states_list cronet_aml_components_cronet_android_load_states_list_rename cronet_aml_components_cronet_android_net_idempotency_java cronet_aml_components_cronet_android_net_request_priority_java cronet_aml_components_cronet_android_network_quality_observation_source_java cronet_aml_components_cronet_android_request_context_config_java_proto__protoc_java cronet_aml_components_cronet_android_request_context_config_proto__testing_gen cronet_aml_components_cronet_android_request_context_config_proto__testing_gen_headers cronet_aml_components_cronet_android_request_context_config_proto_gen cronet_aml_components_cronet_android_request_context_config_proto_gen_headers cronet_aml_components_cronet_android_rtt_throughput_values_java cronet_aml_components_cronet_android_url_request_error_java cronet_aml_components_cronet_cronet_buildflags cronet_aml_components_cronet_cronet_buildflags__testing cronet_aml_components_cronet_cronet_version_header_action cronet_aml_components_cronet_cronet_version_header_action__testing cronet_aml_components_prefs_android_jni_headers cronet_aml_components_prefs_android_jni_headers__testing cronet_aml_crypto_buildflags cronet_aml_crypto_buildflags__testing cronet_aml_net_android_net_android_java_enums_srcjar cronet_aml_net_android_net_errors_java cronet_aml_net_android_net_errors_java_rename cronet_aml_net_base_registry_controlled_domains_lookup_strings_test_sets__testing cronet_aml_net_base_registry_controlled_domains_registry_controlled_domains cronet_aml_net_base_registry_controlled_domains_registry_controlled_domains__testing cronet_aml_net_buildflags cronet_aml_net_buildflags__testing cronet_aml_net_cronet_buildflags cronet_aml_net_cronet_buildflags__testing cronet_aml_net_effective_connection_type_java cronet_aml_net_http_transport_security_state_unittest_data__testing cronet_aml_net_http_transport_security_state_unittest_data_default__testing cronet_aml_net_isolation_info_proto__testing_gen cronet_aml_net_isolation_info_proto__testing_gen_headers cronet_aml_net_isolation_info_proto_gen cronet_aml_net_isolation_info_proto_gen_headers cronet_aml_net_net_jni_headers cronet_aml_net_net_jni_headers__testing cronet_aml_net_net_nqe_proto__testing_gen cronet_aml_net_net_nqe_proto__testing_gen_headers cronet_aml_net_net_nqe_proto_gen cronet_aml_net_net_nqe_proto_gen_headers cronet_aml_net_net_test_jni_headers__testing cronet_aml_net_third_party_quiche_net_quic_proto__testing_gen cronet_aml_net_third_party_quiche_net_quic_proto__testing_gen_headers cronet_aml_net_third_party_quiche_net_quic_proto_gen cronet_aml_net_third_party_quiche_net_quic_proto_gen_headers cronet_aml_net_third_party_quiche_net_quic_test_tools_proto__testing_gen cronet_aml_net_third_party_quiche_net_quic_test_tools_proto__testing_gen_headers cronet_aml_net_third_party_quiche_net_quic_test_tools_proto_gen cronet_aml_net_third_party_quiche_net_quic_test_tools_proto_gen_headers cronet_aml_testing_android_native_test_native_test_jni_headers__testing cronet_aml_third_party_metrics_proto_metrics_proto__testing_gen cronet_aml_third_party_metrics_proto_metrics_proto__testing_gen_headers cronet_aml_third_party_metrics_proto_metrics_proto_gen cronet_aml_third_party_metrics_proto_metrics_proto_gen_headers cronet_aml_third_party_quic_trace_quic_trace_proto__testing_gen cronet_aml_third_party_quic_trace_quic_trace_proto__testing_gen_headers cronet_aml_url_buildflags cronet_aml_url_buildflags__testing cronet_aml_url_url_jni_headers cronet_aml_url_url_jni_headers__testing cronet_tester_app_jni cronet_net_tester_app_jni cronet_java_tests_jni statslog-cronet-java-gen
Change-Id: I9e529684fa80a35981ed784f3bd6d622940dbd28
2023-11-21 16:28:59 -08:00
Cole Faust
852b82e5c2 Merge "Sandbox vndk_abi_dump_zip" into main 2023-11-21 23:53:56 +00:00
Cole Faust
1f6fb9b419 Merge "Sandbox awkgram.tab.h" into main 2023-11-21 23:36:42 +00:00
Treehugger Robot
964a084264 Merge "Sandbox emp_ematch genrules" into main 2023-11-21 23:22:03 +00:00
Treehugger Robot
024adceb24 Merge "Sandbox angle_commit_id" into main 2023-11-21 22:47:23 +00:00
Cole Faust
ae36d6b964 Sandbox awkgram.tab.h
Sandboxing it generates this diff:

  38,39c38,39
  < #ifndef YY_YY_OUT_SOONG_TEMP_SBOX_794A09CEE4E110D9FF38139A8943928FFD7288A5_OUT_AWKGRAM_TAB_H_INCLUDED
  < # define YY_YY_OUT_SOONG_TEMP_SBOX_794A09CEE4E110D9FF38139A8943928FFD7288A5_OUT_AWKGRAM_TAB_H_INCLUDED
  ---
  > #ifndef YY_YY_OUT_AWKGRAM_TAB_H_INCLUDED
  > # define YY_YY_OUT_AWKGRAM_TAB_H_INCLUDED
  280c280
  < #endif /* !YY_YY_OUT_SOONG_TEMP_SBOX_794A09CEE4E110D9FF38139A8943928FFD7288A5_OUT_AWKGRAM_TAB_H_INCLUDED  */
  ---
  > #endif /* !YY_YY_OUT_AWKGRAM_TAB_H_INCLUDED  */

Which is acceptable, the ifdef is based on the path to the file and
just there to prevent duplicate imports.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py awkgram.tab.h
Change-Id: I85c5e0f65e97d18f1aa8b36fa6b19402d2da6c8c
2023-11-21 14:18:27 -08:00
Cole Faust
b12a98651d Merge "Sandbox c2hal_test_genc++[_headers]" into main 2023-11-21 22:08:31 +00:00
Cole Faust
763710ca78 Sandbox vndk_abi_dump_zip
Sandboxing it generates this diff in it's output zip file:

  1,4c1,2
  < Archive:  out_not_sandboxed/soong/.intermediates/prebuilts/abi-dumps/vndk/vndk_abi_dump_zip/gen/vndk_abi_dump.zip
  < Zip file size: 319522663 bytes, number of entries: 7462
  < -rw-r--r--  2.0 unx     1055 bl      612 defN 08-Jan-01 00:00 Android.bp
  < -rw-r--r--  2.0 unx      143 bl       99 defN 08-Jan-01 00:00 OWNERS
  ---
  > Archive:  out/soong/.intermediates/prebuilts/abi-dumps/vndk/vndk_abi_dump_zip/gen/vndk_abi_dump.zip
  > Zip file size: 319519888 bytes, number of entries: 7454
  6810d6807
  < -rw-r--r--  2.0 unx      722 bl      142 defN 08-Jan-01 00:00 34/64/arm/source-based/config.json
  6926d6922
  < -rw-r--r--  2.0 unx      722 bl      142 defN 08-Jan-01 00:00 34/64/arm64/source-based/config.json
  7042d7037
  < -rw-r--r--  2.0 unx      722 bl      142 defN 08-Jan-01 00:00 34/64/arm_arm64/source-based/config.json
  7158d7152
  < -rw-r--r--  2.0 unx      722 bl      142 defN 08-Jan-01 00:00 34/64/x86/source-based/config.json
  7274d7267
  < -rw-r--r--  2.0 unx      722 bl      142 defN 08-Jan-01 00:00 34/64/x86_64/source-based/config.json
  7390d7382
  < -rw-r--r--  2.0 unx      722 bl      142 defN 08-Jan-01 00:00 34/64/x86_x86_64/source-based/config.json
  7465c7457
  < 7462 files, 5412913325 bytes uncompressed, 317891705 bytes compressed:  94.1%
  ---
  > 7454 files, 5412907795 bytes uncompressed, 317890142 bytes compressed:  94.1%

So sandboxing removes some files from the zip. It appears that the
intention of this zip file was to include a bunch of .lsdump files,
and these files that were removed were extraneous.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py vndk_abi_dump_zip
Change-Id: I15df4a4b54df362c30e2b231f6fed586cf0a267f
2023-11-21 14:04:52 -08:00
Treehugger Robot
23abfe7291 Merge "Sandbox libchrome genrules" into main 2023-11-21 22:04:03 +00:00
Cole Faust
babb750cdf Sandbox angle_commit_id
Sandboxing it generates this diff:

  1c1
  < #define ANGLE_COMMIT_HASH "1f7a2ce0bf57"
  ---
  > #define ANGLE_COMMIT_HASH "unknown hash"
  3,4c3,4
  < #define ANGLE_COMMIT_DATE "2023-11-17 17:33:59 +0000"
  < #define ANGLE_COMMIT_POSITION 26027
  ---
  > #define ANGLE_COMMIT_DATE "unknown date"
  > #define ANGLE_COMMIT_POSITION 0

These constants appear to be unused, and we don't really want the build
to inspect the git history, so just let them be unkown.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py angle_commit_id
Change-Id: I3e35af14d13142927ded9477e975576d7324c6b7
2023-11-21 13:56:27 -08:00
Cole Faust
8d99fa4d9d Sandbox emp_ematch genrules
These genrules already work with sandboxing, but bison emits #line
directives that reference filepaths. These paths differ between
sandboxed and non-sandboxed builds, which caused
genrule_sandboxing_test.py to think that they didn't work with
sandboxing.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py emp_ematch.yacc.c emp_ematch.yacc.h
Change-Id: I85ed0f80dee7997af6b08a37b12e9c0ad0bd8386
2023-11-21 13:28:42 -08:00
Cole Faust
e5d9c8d5f7 Sandbox c2hal_test_genc++[_headers]
These genrules already work with sandboxing, I'm not sure why they
were added to the list.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py c2hal_test_genc++_headers c2hal_test_genc++
Change-Id: I697c9cff1db0bf71b3608684fde73535a72f71b2
2023-11-21 12:50:57 -08:00
Cole Faust
6753118f49 Sandbox libchrome genrules
These genrules already work with sandboxing, but they write the path
to a tool into a comment in their outputs, which differs between
sandboxing and non-sandboxing builds. This made genrule_sandbox_test.py
think that they didn't work with sandboxing.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py libchrome-include libchrome-crypto-include
Change-Id: Ibcad839e9d374a2f992d051805548c58303cf7ef
2023-11-21 12:40:34 -08:00
Treehugger Robot
c9affafb72 Merge "Remove multidex version genrules" into main 2023-11-21 08:00:40 +00:00
Cole Faust
5f61e0572f Sandbox r8retrace genrules
r8retrace-run-retrace appears to already work with sandboxing.

r8retrace-dexdump-sample-app gets a diff in the output files due to
differing paths in sandboxed/non-sandboxed environments, but the
meaningful content is still the same.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py r8retrace-dexdump-sample-app r8retrace-run-retrace
Change-Id: Ice0eeb762d35a4b32e8fb6d480ecf6d38959d0cc
2023-11-20 16:01:37 -08:00
Cole Faust
c11ccb9178 Remove multidex version genrules
These version files appear to be unused, and we don't really want
to support having the build access the git history.

Bug: 307824623
Test: Presubmits
Change-Id: Id5700bf4a56955bdf6edd4c50ceefa4184f54555
2023-11-20 15:43:54 -08:00
Cole Faust
4a36b9e529 Sandbox fdt genrules
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: m fdt_test_tree_empty_memory_range_dtb fdt_test_tree_multiple_memory_ranges_dtb fdt_test_tree_one_memory_range_dtb
Change-Id: Id79e30957b60a27f5929698c499f788014708197
2023-11-20 15:11:44 -08:00
Cole Faust
d6446f37f4 Sandbox libxml2 genrules
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py libxml2_schema_fuzz_corpus libxml2_xml_fuzz_corpus
Change-Id: I4c58761dfb435c866acf68f725cd1cd1618a6ffe
2023-11-17 15:23:57 -08:00
Treehugger Robot
9b23241530 Merge "Sandbox pixel stats atoms genrules" into main 2023-11-17 21:41:46 +00:00
Cole Faust
78fe856b79 Sandbox renderscript genrules
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py ImageProcessing-rscript ImageProcessing2-rscript ImageProcessingJB-rscript RSTest-rscript RSTest_v11-rscript RSTest_v14-rscript RSTest_v16-rscript Refocus-rscript RsBalls-rscript
Change-Id: I424e82dc36087fff5e98e63fbb30fca3e1efe7ca
2023-11-16 15:07:08 -08:00
Treehugger Robot
bc1d0d8ce8 Merge "Sandbox netsim genrules" into main 2023-11-16 18:06:09 +00:00
Cole Faust
28f8ee4cb2 Sandbox pixel stats atoms genrules
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py pixelatoms_defs.h pixelstatsatoms.cpp pixelstatsatoms.h
Change-Id: I2dfee3b5d724b0feaba47c7257c708abe74db396
2023-11-15 14:05:59 -08:00
Colin Cross
d7812415c3 Merge "Stop collecting path entry for module_bp_java_deps.json from each module type" into main 2023-11-15 21:01:38 +00:00
Treehugger Robot
9cb8fcbe06 Merge "Sandbox ControlEnvProxyServerProto" into main 2023-11-15 20:44:43 +00:00
Cole Faust
a4bb034fee Sandbox netsim genrules
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py FrontendStub_cc FrontendStub_h PacketStreamerStub_cc PacketStreamerStub_h
Change-Id: Icfb4830a6deb7fe403407d99a39d4bac99ee290d
2023-11-15 12:03:02 -08:00
Colin Cross
a644c263dd Stop collecting path entry for module_bp_java_deps.json from each module type
The jdepsGeneratorSingleton can get the module path directly, it doesn't
need to be collected by each module type that implements IDEInfo.  Fixes
module types (like android_library) that didn't reach the code that
collected the path.

Bug: 309835196
Test: out/soong/module_bp_java_deps.json contains path for ExtServices.core
Change-Id: If8cb81b4f708e0367f156ade164bee253bf53492
2023-11-15 11:40:48 -08:00
Cole Faust
9233d67c60 Sandbox ControlEnvProxyServerProto
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py ControlEnvProxyServerProto_cc ControlEnvProxyServerProto_h
Change-Id: Ie603894cf39112e641a23dad5d7d52fef96755da
2023-11-15 11:31:02 -08:00
Cole Faust
9844817148 Sandbox opengl genrules
These work fine with sandboxing, I'm not sure why they were added
to the list.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py egl_extensions_functions_hdr egl_functions_hdr gles1_core_functions_hdr gles1_extensions_functions_hdr gles2_core_functions_hdr gles2_extensions_functions_hdr gles31_only_functions_hdr gles3_only_functions_hdr
Change-Id: Ib179322f5b828dc85fccf9c0d1bacaad3fd359bf
2023-11-15 11:15:20 -08: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
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
Treehugger Robot
7dc019e8cb Merge "Sandbox libtextclassifier genrules" into main 2023-11-14 18:55:56 +00:00
Treehugger Robot
fa10b620c1 Merge "Sandbox openwrt genrules" into main 2023-11-13 18:33:19 +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
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
Cole Faust
ec8f0ca86c Merge "Sandbox hidl genrules" into main 2023-11-09 22:05:49 +00: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
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
Cole Faust
4c5b4cd2e8 Sandbox CompilationTestCases_package-dex-usage
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py CompilationTestCases_package-dex-usage
Change-Id: I8cfc445bb10dfe8344e8dd4e7085f474004314af
2023-11-08 10:38:15 -08:00
Cole Faust
9f9921cbc3 Sandbox nos genrules
go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: m nos_app_avb_service_genc++ nos_app_avb_service_genc++_headers nos_app_avb_service_genc++_mock nos_app_identity_service_genc++ nos_app_identity_service_genc++_headers nos_app_identity_service_genc++_mock nos_app_keymaster_service_genc++ nos_app_keymaster_service_genc++_headers nos_app_keymaster_service_genc++_mock nos_app_weaver_service_genc++ nos_app_weaver_service_genc++_headers nos_app_weaver_service_genc++_mock nos_generator_test_service_genc++ nos_generator_test_service_genc++_headers nos_generator_test_service_genc++_mock
Change-Id: Ic2c6ff1bbc0037c59b692fd76c9050521812989e
2023-11-03 16:29:21 -07:00
Cole Faust
74639be8a7 Merge "Sandbox LTP genrules" into main 2023-11-03 20:16:00 +00:00
Cole Faust
9cae593d97 Sandbox LTP genrules
gen_ltp_config used to read files from the source tree,
but this cl refactors it to package all the files it
needs into the tool itself, so it's more hermetic and
all the genrules don't need to explicitly list the files
the tool needs.

go/roboleaf-busy-beavers-sandboxing

Bug: 307824623
Test: diff'd the files produced by the ltp_config_* genrules before/after this change
Change-Id: Ia72084965dcb8659394068b7c6877adb1c882dc2
2023-11-02 22:23:01 -07:00
Treehugger Robot
66135a79f4 Merge "Sandbox test apex genrules" into main 2023-11-03 02:11:36 +00:00
Cole Faust
06e73446de Sandbox test apex genrules
With the other cls in this topic, the modules build with sandboxing.
They still fail the genrule_sandobox_test.py because their builds are
non-deterministic though. I wasn't able to find the cause of the
non-determinism, so relying on presubmits to make sure nothing breaks.

Bug: 307824623
Test: m com.android.apex.test.bar_stripped com.android.apex.test.baz_stripped com.android.apex.test.foo_stripped com.android.apex.test.pony_stripped com.android.apex.test.sharedlibs_generated com.android.apex.test.sharedlibs_secondary_generated with sandboxing enabled
Change-Id: I4006732bf1ba08e846dee2e18d89dbf45f2cd7ba
2023-11-02 18:08:20 -07:00
Cole Faust
f45290a496 Remove UpdatableSystemFontTest modules from sandboxing denylist
These modules actually work fine with sandboxing, they were just added
to the list because they have non-deterministic outputs, which caused
the genrule sandboxing script to think that sandboxing affected their
outputs.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py UpdatableSystemFontTest_NotoColorEmojiV0.sig UpdatableSystemFontTest_NotoColorEmojiV0.ttf UpdatableSystemFontTest_NotoColorEmojiVPlus1.sig UpdatableSystemFontTest_NotoColorEmojiVPlus1.ttf UpdatableSystemFontTest_NotoColorEmojiVPlus2.sig UpdatableSystemFontTest_NotoColorEmojiVPlus2.ttf with aosp/2816385
Change-Id: I07b1df779c8d47ad875a4fc2d3af5e46945cff83
2023-11-02 17:15:23 -07:00
Cole Faust
0605687dd6 Remove AudioFocusControlProtoStub_cc/h from denylist
Test: m AudioFocusControlProtoStub_cc AudioFocusControlProtoStub_h
Change-Id: I7743f1d7d05caa9c14c7257fb117d07d02b7edaf
2023-10-31 13:07:40 -07:00
Cole Faust
6100a84dd1 Merge "Remove certificate genrules from denylist" into main 2023-10-26 23:18:40 +00:00
Cole Faust
d86a9094a2 Remove bluetooth genrules from denylist
Bug: 307824623
Test: m all of them
Change-Id: I7d0af72c7ed1fd190854c1953dc93808e3cb3958
2023-10-25 17:33:56 -07:00
Cole Faust
831f2bfbe5 Remove certificate genrules from denylist
The denylist was built by running `genrule_sandbox_test.py` on all
modules in the tree. `genrule_sandbox_test.py` checks that the sandboxed
genrules build, but also that they get the same results as the
unsandboxed version.

In this case, the genrule actually builds with sandboxing just fine,
but they have non-deterministic results, which caused
`genrule_sandbox_test.py` to think that they didn't work with
sandboxing.

Test: m com.android.apex.apkrollback.test.pem com.android.apex.apkrollback.test.pubkey com.android.apex.cts.shim.debug.pem com.android.apex.cts.shim.debug.pubkey com.android.apex.cts.shim.pem com.android.apex.cts.shim.pubkey com.android.apex.cts.shim.v2_no_pb com.android.apex.cts.shim.v2_signed_bob com.android.apex.cts.shim.v2_signed_bob_rot com.android.apex.cts.shim.v2_signed_bob_rot_rollback com.android.apex.cts.shim.v2_unsigned_apk_container com.android.apex.cts.shim.v3_signed_bob com.android.apex.cts.shim.v3_signed_bob_rot com.android.apex.cts.shim_not_pre_installed.pem com.android.apex.cts.shim_not_pre_installed.pubkey com.android.apex.rotation.key.bob.pem com.android.apex.rotation.key.bob.pk8 com.android.apex.rotation.key.bob.rot com.android.apex.rotation.key.bob.rot.rollback com.android.apex.rotation.key.bob.x509.pem com.android.overlaytest.overlaid.pem com.android.overlaytest.overlaid.pubkey com.android.overlaytest.overlay.pem com.android.overlaytest.overlay.pubkey
Change-Id: I950767449025163d8c71bb5a7b2e2f15a1ce4a84
2023-10-25 15:10:38 -07:00
Spandan Das
db6a189a41 Turn on sandboxing for external/perfetto
Contingent on aosp/2788322

Test: GENRULE_SANDBOXING=true m libperfetto_client_experimental # bit
identical

Change-Id: I885f420850a165f042b94685e7cf1215d5620716
2023-10-18 18:04:11 +00:00
Cole Faust
3af559c9ce Denylist CompilationTestCases_package-dex-usage
I'm not sure how this was missed earlier.

Bug: 290816499
Test: build/soong/tests/genrule_sandbox_test.py -t sdk_phone_x86_64 all with aosp/2666142
Change-Id: I8d21a34e3b13ac568fa6153a31c43ba3e4d516bd
2023-10-12 09:54:53 -07:00
Cole Faust
dc3c1454fa Sort genrule allowlists
To avoid merge conflicts.

Bug: 290816499
Test: Presubmits
Change-Id: I8f8ba5112ae87c21dd95513ee1cf0d3d16bccf3f
2023-10-11 12:37:25 -07:00
Cole Faust
10b31340a6 Denylist genrules that fail to build with sandboxing
These were added with the android 14 release.

Bug: 290816499
Test: run genrule_sandbox_test.py with a local change to check all genrules in the tree
Change-Id: Icf3627c245638ab3f73b83e24ef04c916d7ab58b
2023-10-06 12:01:02 -07:00
Cole Faust
8a25345b7d Denylist genrules that fail to build with sandboxing
Bug: 290816499
Test: run genrule_sandbox_test.py with a local change to check all genrules in the tree
Change-Id: Id18b801c2306dd59b5b593b004b513b578ce3705
2023-10-06 05:12:07 +00:00
Christopher Parsons
c331812a59 Merge "Have ConvertWBp2build use Bp2buildMutatorContext" into main 2023-09-20 17:56:24 +00:00
Chris Parsons
637458d326 Have ConvertWBp2build use Bp2buildMutatorContext
This no-op refactoring facilitates some upcoming functional changes for
"bp2build allowlist v2". The work requires that the bp2build conversion
mutator be changed from a TopDown mutator to a BottomUp mutator.
Refactoring all bp2build-related methods so that they use Bp2buildMutatorContext
makes it easier to make this functional change without touching tens of
files and multiple projects.

Bug: 285631638
Test: m bp2build
Change-Id: I3d1ef3064146e959c6f0dc315350fc9764bf2bd2
2023-09-20 14:49:35 +00:00
Liz Kammer
9e2a5a7d6d Don't panic for unhandled product vars
Instead, we return an error. This allows us to access some product
variable information earlier when it will not be used as an attribute
without panicing

Test: m nothing
Change-Id: Id094b2b9e1364a8d174d99b3824fa149fb235b3e
2023-09-19 15:58:22 -04:00
Romain Jobredeaux
9973ace1c7 Bp2build support for app R8-related fields
Bug: 293304784
Test: CI
Change-Id: I0aefa57f968cb41e50d7c1d29b2d8a1480655355
2023-08-31 01:35:44 -04:00
Sam Delmerico
f877563735 update docs for genrule tool_files prop
According to go/roboleaf-busy-beavers-sandboxing, this field should just take in any data files needed by the tool. The existing description makes it sound like this property should only contain a single file that will be used as the tool itself.

Change-Id: I3ef3b8ceb52f7a7e6de9e0a897d5cc05c9c2d336
2023-08-14 23:54:55 +00:00
Cole Faust
f0d4d4f9f2 Bp2build genrule commands as configurable properties
So that users can use soong config variables / product variables
to adjust a genrule's command.

Bug: 295910468
Test: m nothing
Change-Id: I9fedf8d5d52e515c3fdb913411ce1b3fecb7ba81
2023-08-14 11:58:20 -07:00
Spandan Das
a99348dca4 cc Bp2build support for genrules that generate .proto file
If `srcs` contains a gensrcs/genrule module, the current bp2build module
will put it in the catch-all `srcs` attribute. This is reserved for .cpp
sources, so if the genrule produces a .proto/.aidl/... file, this will
fail.

This handles genrules that produce .proto files. To implement this, this
creates an additional partition that detects if the other module is a
genrule/gensrc that produces .proto files. If true, it will append it to
the proto partition.

This CL does not handle
- genrule that produce .c/.aidl/.yacc/.... files. They will continue to
  be partitioned into the catch-all partition
- java modules

Test: unit tests
Test: TH
Bug: 293205700
Change-Id: Ib720fdf3a053ff5dd256e6faa632e3fa7776966d
2023-08-03 18:56:05 +00:00
Liz Kammer
0db0e34c68 Gen a header library when genrules export includes
Embedding multiple includes from a genrule may be difficult to read,
instead we generate a header library that contains the headers and all
include dirs that Soong generates.

Test: go test bp2build tests
Change-Id: I590c74c133f015f27cccf5a2fd916153ad9c125e
2023-07-24 13:57:17 -04:00
Cole Faust
d95158ef1a Merge "Denylist genrules that fail to build with sandboxing" into main 2023-07-21 18:20:06 +00:00
Liz Kammer
d07cb48c6f Merge "Make genrule export_include_dirs more consistent" into main 2023-07-21 13:41:23 +00:00
Cole Faust
edbabc6075 Denylist genrules that fail to build with sandboxing
Bug: 290816499
Test: run genrule_sandobx_test.py with a local change to check all genrules in the tree
Change-Id: I258fe11640c71d532ef48ed88270dec72bd69814
2023-07-20 15:39:04 -07:00
Liz Kammer
d38c87c035 Make genrule export_include_dirs more consistent
Previously, genrule export_include_dirs always added ModuleDir to
exported include dirs when export_include_dirs is set but not when
export_include_dirs is not set. Now when export_include_dirs is set, we
also export the directory without the additional ModuleDir subdir.

Test: genrule go tests
Test: set export_include_dirs and test
Change-Id: I46e860b2c20c1a96bddd14367d7fa737d901994d
2023-07-17 09:58:50 -04:00
Justin Yun
4da4ccc203 Add write_if_changed property to genrule
When "write_if_changed: true" is set, it will call restat for ninja.
With this option the output file will be copied only if it is changed.

Bug: 290130959
Test: ninja rule include "--write-if-changed"
Change-Id: I8bd77b43b22eb0115e0bdc73718b2d6997d92652
2023-07-17 20:35:13 +09:00
Igor Foox
ae2e23a4ba Merge "Remove openwrt modules from genrule denylist." into main 2023-07-13 13:29:13 +00:00
Liz Kammer
796921d211 Ensure data is passed to all generation actions
Test: go test genrule tests
Test: build/soong/tests/genrule_sandbox_test.py \
      framework-cppstream-protos framework-javastream-protos
Change-Id: I16fa939280c7ff0f230a0a8cf18af5e55f16eb03
2023-07-11 08:27:51 -04:00
Igor Foox
24739676c7 Remove openwrt modules from genrule denylist.
With the other change in this topic,
`OpenwrtControlServerProto_h` and
`OpenwrtControlServerProto_cc` both successfully build with sandboxing
on.

Test: build/soong/tests/genrule_sandbox_test.py --show-diff OpenwrtControlServerProto_h OpenwrtControlServerProto_cc
Test: GENRULE_SANDBOXING=true m OpenwrtControlServerProto_h OpenwrtControlServerProto_cc
Test: GENRULE_SANDBOXING=true m droid
Change-Id: Id56824ed935e1d16d2333e5a1aeac248cdfcaeb6
2023-07-10 23:15:43 -04:00
Igor Foox
04ff5f90ae Update genrule denylist to make m droid build.
Test: lunch aosp_cf_x86_phone && GENRULE_SANDBOXING=true m droid
Change-Id: I9092df9a407ffe9a7f1c12f18fb0ce1c5fa027a1
2023-07-10 14:58:51 -04:00
Jason Macnak
4ae9c14557 Merge "Remove FrontendStub_[cc|h] from SandboxingDenyModuleList" into main 2023-07-07 19:16:14 +00:00
Cole Faust
32ce0049d0 Remove cts renderscript modules from sandboxing denylist
Test: build/soong/tests/genrule_sandbox_test.py CtsRsBlasTestCases-rscript CtsRenderscriptTestCases-rscript
Change-Id: I4d1d883c387f7cc4b62784c98b0b7f5d938d0a83
2023-06-23 16:43:57 -07:00
Jason Macnak
5146d553ea Remove FrontendStub_[cc|h] from SandboxingDenyModuleList
Bug: b/288170603
Test: GENRULE_SANDBOXING=true m FrontendStub_cc
Test: GENRULE_SANDBOXING=true m FrontendStub_h
Test: build/soong/tests/genrule_sandbox_test.py FrontendStub_cc
Test: build/soong/tests/genrule_sandbox_test.py FrontendStub_h
Change-Id: I863d65ce921a98b91e1aa4c5eebfcf94178f633d
2023-06-20 23:52:47 +00:00
Christopher Parsons
bf1b88dd35 Merge "Add -gen suffix to genrule targets with conflicts" 2023-06-20 16:32:18 +00:00
Chris Parsons
b7950a93df Add -gen suffix to genrule targets with conflicts
Fixes: 224580460
Test: m nothing
Change-Id: I3af3eb0fb7f65216087482eb620484229ac7d674
2023-06-16 17:41:42 +00:00
Jason Macnak
be29dc3d4f Remove WmediumdServerProto_[cc|h] from SandboxingDenyModuleList
Bug: b/287470077
Test: GENRULE_SANDBOXING=true m WmediumdServerProto_cc
Test: GENRULE_SANDBOXING=true m WmediumdServerProto_h
Test: build/soong/tests/genrule_sandbox_test.py WmediumdServerProto_cc
Test: build/soong/tests/genrule_sandbox_test.py WmediumdServerProto_h
Change-Id: I38079eb7b4bfb60f1b4c3adf6c774f207d7ec55e
2023-06-15 10:58:55 -07:00
David Duarte
cb991cf1ae Merge "Remove pandora-python-gen-src from SandboxingDenyModuleList" 2023-06-14 16:51:56 +00:00
Yu Liu
accbd555a7 Merge "Fix a race problem in sandboxing genrule logic." 2023-06-14 04:38:55 +00:00
David Duarte
ff833a95e8 Remove pandora-python-gen-src from SandboxingDenyModuleList
Test: Manual diff, see linked commit
Change-Id: Icec1edd6a4420377dd79fc736bea77910daad1b9
2023-06-14 00:08:41 +00:00
Yu Liu
e7f7cbfad2 Fix a race problem in sandboxing genrule logic.
Bug: 286978650
Test: locally build
Change-Id: I4fab03f74f5634666d22f7ed6e18ee69f780d6ca
2023-06-13 19:04:24 +00:00
David Duarte
795f7fd531 Remove pandora_experimental-python-gen-src from SandboxingDenyModuleList
Test: build/soong/tests/genrule_sandbox_test.py pandora_experimental-python-gen-src
Change-Id: Ica01cd2f582702825d2f7dcc1cd4b02704e0540a
2023-06-13 17:18:36 +00:00
Liz Kammer
8bd92429e5 bp2build data property -> data attr in gensrcs
Test: go test bp2build tests
Change-Id: I2192cf9846a5783385397337d40cca85a1ef73e7
2023-06-09 15:37:45 -04:00
Liz Kammer
81fec18a5e Add property data to gensrcs for additional inputs
This enables sandboxing for inputs that are necessary but do not need to
have a source file generated.

Test: GENRULE_SANDBOXING=true m framework-javastream-protos \
      framework-cppstream-protos
Change-Id: Id5ca1dab5799c25fa96b564a7d2008c2e7b5382b
2023-06-09 15:29:32 -04:00
Yu Liu
45d6af544a Refactor the genrule allowlists code to support internal allowlists
Bug: 281067655
Test: build locally
Change-Id: Iedac64c3d59fc48f1b5a1b461c53d00e92b653b5
2023-05-31 21:40:47 +00:00
Yu Liu
6a7940cc99 Support sandboxing genrule
Bug: 281067655
Test: local build
Change-Id: I123b5e51eaf1476d1215e5208331b6540d45fd98
2023-05-22 15:02:36 -07:00
Spandan Das
39b6cc5336 Ignore test apexes from bp2build generated tags
Soong does not enforce apex_available on the contents of test apex. To
prevent special-casing test apexes in the apex validation aspect in
Bazel, drop the test apexes from the tags altogether.

( The core problem I am trying to solve is making sure that stub
libraries in Bazel have a single apex available. apex validation happens
to be a nice side benefit)

Bug: 277651159
Test: go test ./bp2build
Change-Id: Ibb3cfedb5c0f2cda0464bf3758c70b67cb5885d1
2023-04-27 23:24:49 +00:00
Sam Delmerico
eddd3c0ba4 add APEX transitive dependency validation
Bug: 218419109
Test: b build //packages/modules/adb/apex:com.android.adbd
Change-Id: I93b0c99d6521e419e52c63271646448f6d708c22
2022-12-13 14:32:19 -05:00
Yu Liu
d6201013eb Make cc_genrule.srcs configurable.
Also disallow arch variant of genrule.out.

This is to be consistent with bazel where we are migrating to.

Bug: 254114674
Test: Manual
Change-Id: I685a2e64102b7bb68128b39931f0bc85878bc6de
2022-10-19 12:35:26 -07:00
Vinh Tran
370e08c1af Add more Soong unit test coverage for gensrcs
When gensrcs's srcs prop is set with filegroup from external package and especially when gensrcs generates cpp headers, it's not trivial to know what the output paths and their correponding include paths look like.

In mixed build, there are a few bugs in gensrcs's include paths for cpp headers (b/248555356 and b/248554581) that we'll eventually need to fix. These tests serve as an documentation of the existing behavior when gensrcs generate cpp headers.

Test: go test
Bug: 248555356
Change-Id: I10168dd4229be8f110a31955d214ef792c8050de
2022-09-25 20:21:17 -04:00
Vinh Tran
32a98a5d55 Convert genDir to RULEDIR in gensrcs's cmd
Test: CI
Change-Id: I5ecc19dc73559bb518871080737b28a649edc162
2022-09-23 14:18:20 -04:00
Vinh Tran
f19b658803 bp2build to convert $(genDir) to $(RULEDIR) in genrule's cmd
`statslog.cpp` with cmd `"$(location stats-log-api-gen) --cpp $(genDir)/statslog.cpp"` produces `out/.intermediates/frameworks/proto_logging/stats/stats_log_api_gen/statslog.cpp/gen/statslog.cpp`. Hence, $(genDir) is equivalent to `<package-dir>/<module-name>/gen`.

Currently, bp2buld converts `$(genDir)` to `$(GENDIR)`. In Bazel, `$(GENDIR)` is only the base of the generated code (e.g. `bazel-bin`).

```
genrule(
    name = "statslog.cpp",
    cmd = "$(location :stats-log-api-gen) --cpp $(GENDIR)/statslog.cpp",
    outs = ["statslog.cpp"],
    tools = [":stats-log-api-gen"],
)
```
produces `bazel-bin/statslog.cpp` but expects to have `bazel-bin/frameworks/proto_logging/stats/stats_log_api_gen/statslog.cpp`.

By converting to `$(RULEDIR)` which is `bazel-bin/frameworks/proto_logging/stats/stats_log_api_gen`.

There had not been any genrule module allowlisted with genDir
yet. So this should not cause any issue with modules converted before
this CL.

Bug: 247536535
Test: go tests
Test: presubmit builds and tests
Change-Id: I65c6aafadab6b180b7ef700427e041547ae7e98a
2022-09-22 08:57:14 -04:00