Commit graph

62502 commits

Author SHA1 Message Date
Cole Faust
a905aba595 Remove cflag_artifacts.go
The artifacts it produces are no longer used.

Bug: 262629589
Test: m nothing
Change-Id: Ie9a23310bd6468cfc0b692424f43bf5c16577aee
2023-01-17 15:35:42 -08:00
Cole Faust
57f70c03cd Merge "Use WriteFileRule in cflag_artifacts" 2023-01-17 23:28:21 +00:00
Cole Faust
bbe929c31e Merge "Replace RuleBuilder usages with static rules in app_import.go" 2023-01-17 23:13:12 +00:00
Alix Espino
915577bce6 Merge "support libs for java_plugin -> *" 2023-01-17 20:25:04 +00:00
Treehugger Robot
a413e4d28a Merge "Fix config file fetching" 2023-01-17 19:29:03 +00:00
Alix
53fae383d6 support libs for java_plugin -> *
Test: bp2build tests
Bug: 244210934
Change-Id: I7dbc820b23c4129485b0991aefb41e00e434d94e
2023-01-17 14:57:57 +00:00
Alix Espino
f02c7d882e Merge "libs support for android_app->* edge" 2023-01-17 14:31:18 +00:00
Kousik Kumar
c881833bda Fix config file fetching
1. Make config file fetching run in background again if a file already
   exists - this behavior was changed in
   https://android-review.git.corp.google.com/c/platform/build/soong/+/2059887
   by accident.
2. Always try to load a config file even if fetching a config file fails
   - this behavior was changed in
     https://android-review.git.corp.google.com/c/platform/build/soong/+/2380792
     iiuc.

Bug: b/207551843
Test: Ran builds with no config file present, with config file present
and confirmed that config file fetching happens in the background now.

Change-Id: I6321684a0e17df3371f3f415602e7fa33cfba454
2023-01-16 17:20:19 +00:00
Cole Faust
4ec178c5db Replace RuleBuilder usages with static rules in app_import.go
RuleBuilder creates a new rule in the ninja file every time
it's used, but in this case the rules were all exactly the same
except that the input/output file paths were different.

This can be converted to a single static rule instead.

Bug: 262629589
Test: m nothing
Change-Id: Iaa887c66a757da13293a3614c000d3be02a2a1b0
2023-01-13 17:45:17 -08:00
Usta (Tsering) Shrestha
ee37e8e8ed Merge "for consistency symlink_tree failure = os.Exit(1)" 2023-01-13 23:44:34 +00:00
Cole Faust
baa24a2077 Use WriteFileRule in cflag_artifacts
Most of the complexity in cflag_artifacts can be avoided
by using WriteFileRule.

Bug: 262629589
Test: m out/soong/cflags/module_cflags-Wall.txt
Change-Id: I5b0a678c24609f7b187c9fb8e5fcae7f89adf59c
2023-01-13 15:16:19 -08:00
Usta Shrestha
071f6c29a3 for consistency symlink_tree failure = os.Exit(1)
Brings down time taken to fail from 18s to 13s (on aosp branch)

Test: temporarily coded random failure
Bug: N/A
Change-Id: Ib694eec977293f4dd7054e779d1b82b8cace93f6
2023-01-13 14:07:10 -05:00
Yi Kong
df456b5f33 Suppress misc-use-anonymous-namespace clang-tidy warning
This is a new warning introduced in clang-r484482.

Test: presubmit
Bug: 265438407
Change-Id: Ic31e0dac5aee3214e21bad41f2e6e3505daabe2c
2023-01-13 18:07:37 +00:00
Usta (Tsering) Shrestha
5c1b0ba692 Merge "metrics: count symlink/mkdir in symlink forest" 2023-01-13 04:01:55 +00:00
Treehugger Robot
002254731f Merge "Make LLVM_NEXT extra cflags no override" 2023-01-13 01:00:17 +00:00
Colin Cross
4a25e78f52 Merge "Use the same rpaths for tests and binaries and cc and rust" 2023-01-12 23:14:46 +00:00
Alexander Smundak
7438462e3e Merge "Sort canned fs_config lines to facilitate comparison with Bazel-built APEXes" 2023-01-12 23:00:11 +00:00
Treehugger Robot
a458ac0ede Merge "Optimize isAncestor" 2023-01-12 22:14:46 +00:00
Usta Shrestha
da15c61add metrics: count symlink/mkdir in symlink forest
Bug: 260029212
Test: inspect out/bp2build_metrics.pb
Change-Id: Ia84c095a8d7b129cca629256b6c626c726cbfab1
2023-01-12 14:52:56 -05:00
Yi Kong
60a2010415 Make LLVM_NEXT extra cflags no override
Test: m nothing
Change-Id: I2cf7ab1dcc9cb23298c45b6bf38f8ecc2a9d951e
2023-01-13 04:40:18 +09:00
Treehugger Robot
26248cf580 Merge changes I48426a8e,Ic991e3ae,I9768241f
* changes:
  bp2build apex min_sdk_version w/ soong config var
  Handle soong config vars for string attrs
  bp2build correctly handle empty soong_config_var
2023-01-12 19:11:27 +00:00
Cole Faust
3ac7db80f1 Optimize isAncestor
Remove string copies.

Test: go test (there are existing visibility tests)
Change-Id: I575dcd8497527da03f88003ff0805f3d1271983e
2023-01-12 11:00:40 -08:00
Jihoon Kang
cd08ae402b Merge "Add java_api_library properties to java_defaults" 2023-01-12 18:57:41 +00:00
Romain Jobredeaux
3095d8e7bc Merge "Use centralized rules.bzl file for android rules in bp2build." 2023-01-12 18:46:48 +00:00
Cole Faust
2b4bc2fddb Merge "Increase ram usage estimate in multiproduct_kati" 2023-01-12 17:33:57 +00:00
Alix
6c087cf01a libs support for android_app->* edge
Test: bp2build tests
Bug: 258688914
Change-Id: I2e24c484019c994b43509f350b3c090a40c3ba6a
2023-01-12 15:19:55 +00:00
Alix Espino
ed2491cf20 Merge "java_binary with kotlin sources" 2023-01-12 14:40:46 +00:00
Treehugger Robot
7def86db45 Merge "Update app tests to set Unbundled_build" 2023-01-12 14:12:10 +00:00
Jooyung Han
680de18f34 Merge "conv_linker_config proto supports multiple input json files" 2023-01-12 06:46:39 +00:00
Sasha Smundak
d6322939f7 Sort canned fs_config lines to facilitate comparison with Bazel-built APEXes
Bug: 237037156
Test: mixed builds regression testing
Change-Id: Ifc9a7b4231c947fe85e77c56ffeb30a2d53df6c4
2023-01-11 22:01:01 -08:00
Liz Kammer
b83b7b024e bp2build apex min_sdk_version w/ soong config var
Previously min_sdk_version did not handle soong config vars

Test: m bp2build and verify com.android.adbd
Change-Id: I48426a8e6e03b61234b77ce7d7ec07b1cab36b7b
2023-01-11 22:01:01 -08:00
Liz Kammer
9d2d41065c Handle soong config vars for string attrs
Previously if there was a value set outside of product variables and one
inside a conditions default soong config var, we would ignore the
conditions default. Now, we maintain the conditions default and use
the root value in cases where there is not a value for a product
variable.

Test: go test soong tests
Change-Id: Ic991e3aebe5bb6039353f4e3d25625e7c5190f96
2023-01-11 22:01:01 -08:00
Liz Kammer
f3963f8b9c bp2build correctly handle empty soong_config_var
Previously in cases where a variable value was set but empty in a bp
file we ignored the value in bp2build; however, the correct behavior is
to take the empty value for each case. The tests for soong config vars
with empty_prop_for_string_var and unused_string_var:
https://cs.android.com/android/platform/superproject/+/master:build/soong/android/soong_config_modules_test.go;l=243-283;drc=72beb34609217f3c98623fb6795b6417c7f0fc65
highlight the difference in when conditions default should be used or
not.

Test: go test bp2build tests
Change-Id: I9768241f013a1a1bc8fa23657a066b5b3f52f09b
2023-01-11 22:01:01 -08:00
Treehugger Robot
0ddd60fc1d Merge "Reference deapexer directly in bazel-bin" 2023-01-12 01:01:24 +00:00
Sasha Smundak
39a301c963 Clean up mixed builds module names filtering
* Remove `Bp2buildCcLibraryStaticOnlyList` it is never set
* Remove the rest of the sutff related to it
* Streamline MixedBuildsEnabled
* Rename BazelContext.BazelAllowlisted to BazelContext.NameFilter
  to reflect its action
* Rename bazelContext to mixedBuildBazelContext
* Fix minor warnings from Go static analyzer

Test: treehugger
Change-Id: Ie245c992f94bbfd5c7c23dd06917026200a28263
2023-01-12 00:32:45 +00:00
Colin Cross
225a37a7f0 Use the same rpaths for tests and binaries and cc and rust
Rust and cc binaries currently use $ORIGIN/lib64:$ORIGIN/../lib64 as the
rpath, and cc tests add $ORIGIN/../../lib64:$ORIGIN/../../../$ORIGIN:$ORIGIN.
This causes problems when a binary is included as test data in
out/host/linux-x86/testcases/<test dir>/<CPU>/<test>, as the
binaries can't find the libraries in out/host/linux-x86/lib64.

Use the same rpath for test and binaries, and for cc and rust.

Bug: 264604160
Test: m USE_HOST_MUSL=true out/host/linux-x86/testcases/acpi_tables_test_src_lib/x86_64/acpi_tables_test_src_lib && out/host/linux-x86/testcases/acpi_tables_test_src_lib/x86_64/acpi_tables_test_src_lib
Test: m USE_HOST_MUSL=true out/host/linux-x86/testcases/gen_sdk_test/x86_64/gen_sdk_test && out/host/linux-x86/testcases/gen_sdk_test/x86_64/toybox
Change-Id: I10fe5dc0de01d1f3c6aea8dbabbf60edab5989c3
2023-01-11 16:04:19 -08:00
Treehugger Robot
bf51151bd4 Merge "Fix go.mod, add go.work to use local versions of the dependent modules." 2023-01-11 23:32:53 +00:00
Cole Faust
36b259f1e9 Increase ram usage estimate in multiproduct_kati
multiproduct_kati assumed each build would take ~30GB of RAM,
but it seems it's closer to 40GB now.

The current build_test builds use 7 jobs, so this would bring
us down to 5, which should still keep us under the 6 hour
build time limit as currently these tests are at ~3 hours.

Bug: 262629589
Test: Presubmits
Change-Id: I51af364cc602a3bf7ba85fd8f92c4dd57585abbd
2023-01-11 15:06:50 -08:00
Spandan Das
df01030ab5 Merge changes I78639a2d,Iddb0aa1a
* changes:
  Create a smoke test for api_bp2build workspace
  Add a new CreateSoongInjectionDirFiles function
2023-01-11 22:37:27 +00:00
Chris Parsons
41eff2e4b6 Reference deapexer directly in bazel-bin
This keeps this test compatible with a Bazel release change which
affects which files are present in `bazel cquery --output=files` for
py_binary targets. Since the executable will be present in a predictable
location under bazel-bin, we can hardcode that, instead.

We could have alternatively used --output_groups=python_zip_file for
'hermetic' python, but the bp2build-built deapexer target is missing
some dependencies on protobuf.

Bug: 265176532
Test: Manual runs of apex_comparison_tests.sh with the new Bazel release
Change-Id: Ib7021e7e81d1a7bf5ff4d222e2a7947a06d16791
2023-01-11 17:30:55 -05:00
Romain Jobredeaux
5ccb460c42 Use centralized rules.bzl file for android rules in bp2build.
Change-Id: I6e4837d8b6715960337d0db9b36f8137efb5673e
2023-01-11 16:29:12 -05:00
Jason Wu
c69b26311b Merge "Delete the noisy error message" 2023-01-11 21:21:32 +00:00
Treehugger Robot
4bf6a9ee50 Merge "Fix ALLOW_MISSING_DEPENDENCIES builds for prebuilt JNI libraries" 2023-01-11 21:09:30 +00:00
Harshit Mahajan
18845d0f7a Update app tests to set Unbundled_build
Based on the description for UnbundledBuildApps(), UnbundledBuild()
should always be true when UnbundledBuildApps() is true.
Updating the test to match this condition.
More details: https://android-review.git.corp.google.com/c/platform/build/soong/+/2380693/comment/54f172b4_2eee54fa/


Bug: b/227460469
Test: m nothing
Change-Id: I3a93edb781522da5af201f6864e157e7bab2195a
2023-01-11 18:44:53 +00:00
Sasha Smundak
8756ae3702 Fix go.mod, add go.work to use local versions of the dependent modules.
Test: treehugger, (cd build/soong && go build ./...)
Change-Id: I22fd664b5dcc9f4691c5182fdf0dfe53abc0c584
2023-01-11 18:41:41 +00:00
Treehugger Robot
e0598a1cbd Merge "Consider only preferred modules for jdeps" 2023-01-11 08:42:35 +00:00
Inseob Kim
48aa22380e Consider only preferred modules for jdeps
Bug: 263327259
Test: run atest and see modules to be built
Change-Id: I208a07e2453b924f8af25db340d970ec039c5f32
2023-01-11 13:26:04 +09:00
Spandan Das
255648c6d5 Create a smoke test for api_bp2build workspace
This test builds an "empty" filegroup. Running it can be useful to
verify that the api_bp2build workspace has been setup correctly.

Test: TH
Change-Id: I78639a2dcdeb659b2d6fdf6abc85d85c4fb697bf
2023-01-11 03:21:18 +00:00
Spandan Das
83e787e837 Add a new CreateSoongInjectionDirFiles function
- This is a wrapper function for all files in soong_injection directory.
This should prevent an error in the workspace generated for
api_bp2build.
- Rename the existing CreateSoongInjectionFiles fn and make it package
  private to prevent confusion

(The subsequent CL in this stack should contain a smoke test for
api_bp2build)

Test: b build //:empty --config=api_bp2build --config=android
Test: TH
Change-Id: Iddb0aa1aff2f709826edd587aa99fccddf80f08f
2023-01-11 03:21:00 +00:00
Wei Li
8555ed864d Merge "Add integration test for testing the arch variant passed to cc modules included in APEXES." 2023-01-11 02:14:40 +00:00