Commit graph

35003 commits

Author SHA1 Message Date
Paul Duffin
70dbd886a7 Merge "Make TestingBuildParams.RelativeToTop() modify (Writable)Path(s)" am: cf7f2e0a9e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652618

Change-Id: I604ff21243c03fe70ee7ce8097536a6d37d14e47
2021-03-28 22:43:19 +00:00
Paul Duffin
cf7f2e0a9e Merge "Make TestingBuildParams.RelativeToTop() modify (Writable)Path(s)" 2021-03-28 22:00:05 +00:00
Colin Cross
db081efb32 Merge changes I71a83e3a,I66101c0c,Ie387c8c4,Iea742e75 am: 045ed0f684
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652575

Change-Id: I2e3c9d968656092d75bb0a6bd721d8c7f1654410
2021-03-26 15:51:53 +00:00
Colin Cross
045ed0f684 Merge changes I71a83e3a,I66101c0c,Ie387c8c4,Iea742e75
* changes:
  Strengthen metalava sandbox support using sbox
  Move metalava's output files into a subdirectory
  Fix lint warnings in droidstubs.go
  Split droidstubs out of droiddoc.go
2021-03-26 15:14:53 +00:00
Ivan Lozano
f34d6487ae Merge "rust: Add whole_static_libs, revert static_lib" am: 352bdf29b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652928

Change-Id: I1d34ee0df6f7dd7ba36ff5d57fa677748092a566
2021-03-26 13:35:43 +00:00
Ivan Lozano
352bdf29b3 Merge "rust: Add whole_static_libs, revert static_lib" 2021-03-26 13:01:14 +00:00
Treehugger Robot
22d43c0676 Merge changes from topic "min_sdk_version" am: 10906f5cc6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1646949

Change-Id: I1eff11647deade433d49e4c50b07aa2c61e1e9c1
2021-03-26 08:51:33 +00:00
Treehugger Robot
10906f5cc6 Merge changes from topic "min_sdk_version"
* changes:
  Versioned CRT objects are built with correct __ANDROID_API__
  Always respect min_sdk_version
2021-03-26 08:07:28 +00:00
Rupert Shuttleworth
f576ed0a3d Remove lib_dns from bp2build converter denylist (module name typo, should be libc_dns). am: b33f9d87c4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652837

Change-Id: Id9b6ec08294dbd3a5b0998007bdcd8fe96dcff69
2021-03-26 00:19:18 +00:00
Rupert Shuttleworth
1089fb2b36 Don't convert libc_dns using the cc_library_static bp2build converter. am: a9e182440d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652836

Change-Id: I34d0d29102b087d85c4530c87417da387e9d364a
2021-03-25 22:33:29 +00:00
Rupert Shuttleworth
b33f9d87c4 Remove lib_dns from bp2build converter denylist (module name typo, should be libc_dns).
Test: TH.
Change-Id: I636b7d6d09e96f6e25525ca48783281892a1eb02
2021-03-25 22:23:00 +00:00
Rupert Shuttleworth
a9e182440d Don't convert libc_dns using the cc_library_static bp2build converter.
Test: Manually ran bp2build-incremental presubmit in a new AOSP checkout.
Change-Id: I063f6f244c34c4456af77fb25579f95d724e8893
2021-03-25 21:56:15 +00:00
Colin Cross
e9e22b86dd Merge "Use interface for $(location) values in genrules" am: d91c9b1c04
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652572

Change-Id: I15ba550b81defafd2a00d491d993b087e8a834a0
2021-03-25 21:38:54 +00:00
Rupert Shuttleworth
5b5f675f48 Merge "Add bp2build support for cc_library_static." am: 0f256ff07d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652835

Change-Id: I1741bd8bd080566558253740d695218bd6cf3c60
2021-03-25 21:36:45 +00:00
Colin Cross
0b0fcae3ca Merge changes Ie8721dcd,If1827b9d,Iec250a2d,I3f46f611,Idf136919, ... am: ba5fff85a7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1651847

Change-Id: I984e8e17f4471ef9cc55ed36c7a319a1420ee5bf
2021-03-25 21:36:09 +00:00
Colin Cross
d91c9b1c04 Merge "Use interface for $(location) values in genrules" 2021-03-25 21:06:55 +00:00
Rupert Shuttleworth
0f256ff07d Merge "Add bp2build support for cc_library_static." 2021-03-25 21:01:29 +00:00
Colin Cross
ba5fff85a7 Merge changes Ie8721dcd,If1827b9d,Iec250a2d,I3f46f611,Idf136919, ...
* changes:
  Replace ANDROID_SDK_HOME with ANDROID_PREFS_ROOT for metalava
  Simplify lint rules using improved RuleBuilder rsp support
  Support multiple rsp files in RuleBuilder
  Pass rsp files into sbox and rewrapper
  Add test for sbox input sandboxing
  Support multiple rsp files in REParams
  Move response file handling to a separate package
2021-03-25 20:55:56 +00:00
Treehugger Robot
96d2fbe9d9 Merge "Remove obsolete comment on PrebuiltPostDepsMutator" am: d411f069ff
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1650858

Change-Id: I583d2c166427e8230e676b95c12aebd03acc6c27
2021-03-25 20:08:50 +00:00
Treehugger Robot
d411f069ff Merge "Remove obsolete comment on PrebuiltPostDepsMutator" 2021-03-25 19:37:51 +00:00
Paul Duffin
8313fb112c Merge "Filter duplicate modules in platform_compat_config_singleton" am: f329307878
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652267

Change-Id: I850c1a2bd54411a6c90d507b050a5466becab111
2021-03-25 18:21:13 +00:00
Paul Duffin
a48aed59ee Merge "Disallow non-existent paths in sdk package" am: 863ecfb7ba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647171

Change-Id: I03a4fa86c9f85fc8f89dc688573450f65f2fcbba
2021-03-25 18:21:04 +00:00
Paul Duffin
0024043b00 Merge "Improve sdk snapshot testing" am: cf0bc53bc3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1647170

Change-Id: I77e0e5501ba6bc510f39b454ba7a71fb24d3cc3d
2021-03-25 18:20:55 +00:00
Paul Duffin
166ae29441 Merge "Fix TestDroiddoc's reliance on absolute paths" am: 6c968b1f0f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652617

Change-Id: I48cd4a6a6d2a50a1b756c59bbdcf4ead8bc2dccf
2021-03-25 18:20:46 +00:00
Paul Duffin
f1cf5308f9 Merge "Add Path.RelativeToTop" am: 301deecd6c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652616

Change-Id: I194fc8c451e39d06bab40db3f0c12f1b1170776b
2021-03-25 18:20:37 +00:00
Pirama Arumuga Nainar
a65c8e8172 Merge "[pgo] Do not explicitly link profile runtime" am: 4c0b11a16e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1651751

Change-Id: Ia3c2d72cf450e1a86671940a198afac669bad45a
2021-03-25 18:20:27 +00:00
Roland Levillain
1cb436ebf0 Merge "Fix a typo in the definition of varApexNames in java/dexpreopt_bootjars.go." am: 737ad608ab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652467

Change-Id: I41c0e1ac6ba7737b8fa237be1c58dca87093003c
2021-03-25 18:19:07 +00:00
Colin Cross
6aa5c40393 Strengthen metalava sandbox support using sbox
Run sandbox metalava rules inside sbox, which copies only the expected
inputs into a separate directory tree.  This ensures it can't read any
extra inputs.

Test: m hwbinder.stubs
Test: TestDroidstubs
Test: TestDroidstubsSandboxed
Change-Id: I71a83e3af6a385cc23f895397c2c883a2ac5fa22
2021-03-25 11:11:36 -07:00
Colin Cross
cb77f75aae Move metalava's output files into a subdirectory
Move all of the output files of the metalava rule into a single
subdirectory to make it compatible with sandboxing in sbox.

Test: TestDroidstubs
Change-Id: I66101c0c224dee702c8175e61c12cc9cd1aa8b93
2021-03-25 11:11:36 -07:00
Colin Cross
0d5324165a Fix lint warnings in droidstubs.go
Test: none
Change-Id: Ie387c8c4feddad7bd134604e442fd326e606cd2f
2021-03-25 11:11:36 -07:00
Colin Cross
2207f87756 Split droidstubs out of droiddoc.go
Split part of droiddoc.go into droidstubs.go.  Also split droiddoc_test.go
and droidstubs_test.go out of java_test.go.

Test: go test ./java
Change-Id: Iea742e75b6925b135016f7bbf3a168c696a6c433
2021-03-25 11:11:34 -07:00
Paul Duffin
f329307878 Merge "Filter duplicate modules in platform_compat_config_singleton" 2021-03-25 18:09:38 +00:00
Paul Duffin
863ecfb7ba Merge "Disallow non-existent paths in sdk package" 2021-03-25 18:09:06 +00:00
Paul Duffin
cf0bc53bc3 Merge "Improve sdk snapshot testing" 2021-03-25 18:08:26 +00:00
Colin Cross
d11cf62ec7 Use interface for $(location) values in genrules
Use an interface instead of a string to retrieve the value for
$(location) or $(locations) expansions in genrules to allow
delaying the evaluation until the RuleBuilderCommand is available.
This allows using helpers like RuleBuilderCommand.PathForInputs
to properly rewrite the values for sandboxing.

Also remove the standalone SboxPathFor* methods that don't operate
on a specific RuleBuilderCommand that are now unnecessary.

Test: genrule_test.go
Change-Id: I8bb2647332ef118204a216cead23d062517e2b8c
2021-03-25 11:06:45 -07:00
Colin Cross
7ee54ffd70 Replace ANDROID_SDK_HOME with ANDROID_PREFS_ROOT for metalava
Fixes warnings:
Warning: Using ANDROID_SDK_HOME for the location of the '.android' preferences location is deprecated, please use ANDROID_PREFS_ROOT instead.
Support for ANDROID_SDK_HOME is deprecated and will be removed in 6.0

Test: m android_stubs_current
Change-Id: Ie8721dcda0578c670dfc796675ba43cda16883f6
2021-03-25 11:06:45 -07:00
Colin Cross
5bedfa2d45 Simplify lint rules using improved RuleBuilder rsp support
With the improved RuleBuilder rsp support a manual resources.list
file is not necessary, use FlagWithRspFileInputList instead.

The switch to RBE support in RuleBuilder in
Iab4e09d961891ef182643583d4d456e413bc5e39 obsoleted tracking remoteInputs
and remoteRSPInputs, remove them.

writeLintProjectXML was written to allow it to be applied to a separate
rule than the one that ran lint, but it is not used that way.  Using
the same rule for both means that manual tracking of the input
dependencies described by the project.xml rule but read by the lint
rule is not necessary, just treat them as inputs to the single rule.

Test: m lint-check
Test: m USE_RBE=true RBE_LINT=true RBE_LINT_EXEC_STRATEGY=remote lint-check
Change-Id: If1827b9dede3ebcd0792b6b4b8114d3199f6570b
2021-03-25 11:06:45 -07:00
Colin Cross
ce3a51dc96 Support multiple rsp files in RuleBuilder
The lint rule is manually creating a second rsp file because Ninja
only supports on per rule.  Move the support into RuleBuilder so
that it can apply the same rewrites that it does to the primary
one.

Test: TestRuleBuilder_Build
Change-Id: Iec250a2d60e74ccf1b4ad085a960fec6867ea559
2021-03-25 11:06:45 -07:00
Colin Cross
e55bd423df Pass rsp files into sbox and rewrapper
The current implementation causes inputs listed in an rsp file used with
sbox to be duplicated 3 times in the build.ninja file; once as a
dependency of the rule, once in the rspfile_content field of the rule
with the paths rewritten to be relative to the sandbox, and once in the
rule to write the sbox manifest.  When RBE is enabled it also gets a
fourth copy in the list of files to be treated as inputs by rewrapper.

Reduce this to a single copy by using "$in" for the rspfile_content so
that the files only have to be listed in the input dependencies of the
rule, and then add support to sbox to rewrite the rsp file while copying
it into the sandbox, and pass it to rewrapper as well.

Test: m lint-check
Change-Id: I3f46f61119508d39a8bb231c99fc130153fb6f04
2021-03-25 11:06:45 -07:00
Colin Cross
045bfd9640 Add test for sbox input sandboxing
Add a test that was dropped in Ic0db961961b186e4ed9b76246881e3f04971825c.

Test: rule_builder_test.go
Change-Id: Idf136919939ad28eb5260dd8d686abe6948f47c7
2021-03-25 11:06:45 -07:00
Colin Cross
a4eafddc41 Support multiple rsp files in REParams
rewrapper supports a comma separate list of rsp files, replace
REParams.RSPFile with REParmas.RSPFiles.

Test: remoteexec_test.go
Change-Id: I7850c071c23d368d6fad4480dd527d146c13c6d3
2021-03-25 11:06:45 -07:00
Colin Cross
fd708b5651 Move response file handling to a separate package
sbox is going to need to read and write response files, move ReadRspFile
to its own package.

Test: response_test.go
Change-Id: Iecb5486b4aaeb2531828743ad8ef784df675e18e
2021-03-25 11:06:45 -07:00
Paul Duffin
bbb0f8fae4 Make TestingBuildParams.RelativeToTop() modify (Writable)Path(s)
Bug: 183650682
Test: m droid
Change-Id: I5cb150aa28cf1a06c353b67443fd2128aff4bb5d
2021-03-25 18:03:00 +00:00
Paul Duffin
6c968b1f0f Merge "Fix TestDroiddoc's reliance on absolute paths" 2021-03-25 18:02:26 +00:00
Paul Duffin
301deecd6c Merge "Add Path.RelativeToTop" 2021-03-25 18:01:31 +00:00
Pirama Arumuga Nainar
4c0b11a16e Merge "[pgo] Do not explicitly link profile runtime" 2021-03-25 17:57:49 +00:00
Ivan Lozano
63bb7680c9 rust: Add whole_static_libs, revert static_lib
Revert the static_lib behavior to the previous behavior (pass static
libs to the linker rather than via to rustc using `-lstatic=<lib>`). To
bundle static libraries into libraries, provide the whole_static_libs
property which retains the current static_libs behavior.

Passing all static libraries via -lstatic was resulting in odd bloat
where in some cases static symbols were duplicated in binaries and
libraries. This split makes it possible to be explicit about when static
libraries should be bundled.

Bug: 183182230
Test: mma system/bt; mma system/security/keystore2; mma external/rust

Change-Id: Ic2dde5d1542dca5ce145aa3a3fbd9ea54440d991
2021-03-25 13:50:17 -04:00
Roland Levillain
737ad608ab Merge "Fix a typo in the definition of varApexNames in java/dexpreopt_bootjars.go." 2021-03-25 17:25:44 +00:00
Rupert Shuttleworth
095081c6d7 Add bp2build support for cc_library_static.
Also refactor bp2build-related code for cc_library_headers.

(Retry of previous CL after the presubmit failed to detect a merge conflict)

Test: Added unit test.

Test: bp2build-sync.py write; bazel build //bionic/... still works (but bp2build is disabled for most cc_library_static targets for other reasons)
Change-Id: I2f4405c2fea305623bbc6daaaf62808b0c074216
2021-03-25 15:16:11 +00:00
Jingwen Chen
3b8237f945 Merge "bp2build: add a per-module denylist." am: 6400f20430
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652238

Change-Id: I659b327ff1f4eed86b9151dfcda94a9d93ef34e1
2021-03-25 15:10:18 +00:00