Commit Graph

34994 Commits

Author SHA1 Message Date
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
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 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
Paul Duffin d92c7a13ed Merge "Remove config from basePath" am: 618eeff010
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652615

Change-Id: I10dc32d568e6812dd714000fd79bfc4b1e4edf5f
2021-03-25 15:10:08 +00:00
Paul Duffin 000fe1cfe5 Merge changes I12e1854c,I08f7dba4 am: 85484e344a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1652614

Change-Id: I95aba831638f6b195b0e1006f721a4054bebfde5
2021-03-25 15:09:36 +00:00
Jingwen Chen 6400f20430 Merge "bp2build: add a per-module denylist." 2021-03-25 15:02:57 +00:00
Paul Duffin 618eeff010 Merge "Remove config from basePath" 2021-03-25 14:45:43 +00:00
Paul Duffin 85484e344a Merge changes I12e1854c,I08f7dba4
* changes:
  Add buildDir to WritablePath implementations
  Add srcDir to SourcePath
2021-03-25 14:44:51 +00:00
Paul Duffin 4dd6cdb3bc Fix TestDroiddoc's reliance on absolute paths
TestDroiddoc compares the value returned by OutputFiles(""), which will
usually be absolute paths including the temporary buildDir, against
paths returned from TestingBuildParam.RelativeToTop(), which does not
currently change the Path contents and so will include absolute
temporary paths. However, a follow up change to this will make the
TestingBuildParam.RelativeToTop() also change the Path contents at
which point this test would be comparing relative to absolute paths.

So, this change makes sure that they are all converted to relative to
top paths before comparison.

Bug: 183650682
Test: m droid
Change-Id: Ia4478f527af27a920945f5849525e5031cc5b8b6
2021-03-25 13:14:37 +00:00
Paul Duffin 85d8f0dcd9 Add Path.RelativeToTop
Makes Path.RelativeToTop the source of truth as to what `relative to
top` means.

Uses it in PathRelativeToTop so that it will be tested by the existing
tests that use AssertPathRelativeToTop.

Also adds RelativeToTop() to WritablePaths and Paths.

Bug: 183650682
Test: m droid
Change-Id: I88dc56afd1314e51b4e41795a2448cab4ce8a899
2021-03-25 13:14:37 +00:00
Paul Duffin bb9ff5108b Filter duplicate modules in platform_compat_config_singleton
Previously, unpacking a snapshot containing a
prebuilt_platform_compat_config into a source build would cause build
failure because of duplicate ids because the singleton would collate
ids from both prebuilts (versioned and unversioned) and source.

This change filters out versioned prebuilts and only uses prebuilts
that are preferred and source modules that have not been replaced by a
prebuilt.

Bug: 182402754
Test: m nothing
Change-Id: Idacbb34444e5156370df70bf88c6e8a7e2d67890
2021-03-25 12:53:25 +00:00
Paul Duffin db462dd987 Disallow non-existent paths in sdk package
Test behavior was changed a while ago so that tests by default ignore
non-existent source paths (unless they explicitly check for/rely on
them). Prior to that CheckSnapshot() could detect when files were
missing from the snapshot but it no longer can.

This change disallows non-existent source files in all the sdk tests
which means that they are disallowed when processing the snapshots as
they use the same preparers as were used to process the sources.

This caused a test failure which has been temporarily ignored and has
a TODO and bug associated with it.

Bug: 183184375
Test: m nothing
Change-Id: I969d8515d20ef5ae515f2b5f93d8ed4e4f8ede75
2021-03-25 12:53:22 +00:00