Commit graph

34708 commits

Author SHA1 Message Date
Ulyana Trafimovich
f682410cbf Merge "Don't enforce <uses-library> checks if dexpreopt for apps is disabled." 2021-03-29 16:21:24 +00:00
Ulya Trafimovich
39dd0a4b87 Don't enforce <uses-library> checks if dexpreopt for apps is disabled.
Otherwise the check fails, as it depend on non-existent dexpreopt.config
files. This CL fixes broken build cf_x86_phone-userdebug_coverage.

Bug: 183931403
Bug: 132357300
Test: forrest build for cf_x86_phone-userdebug_coverage.
Change-Id: Id3ffeb742c1b82c677795fa701a7b5a867eabbbd
2021-03-29 14:57:34 +01:00
Paul Duffin
755b10fe53 Merge "Add bootclasspath_fragment as an alias for boot_image" 2021-03-29 13:37:18 +00:00
Paul Duffin
60fbea0ec6 Merge "Convert java/boot_image_test.go to test fixtures" 2021-03-29 12:17:57 +00:00
Paul Duffin
63782aba78 Merge "Change type of Image_name from string to *string" 2021-03-29 12:17:42 +00:00
Paul Duffin
1b3d4923c1 Merge "Make apex/boot_image_test.go more realistic" 2021-03-29 12:10:48 +00:00
Paul Duffin
30231da694 Merge "Convert linkerconfig package to use test fixtures" 2021-03-29 10:34:46 +00:00
Paul Duffin
4b64ba05b6 Add bootclasspath_fragment as an alias for boot_image
This is part of the work to rename boot_image to bootclasspath_fragment
which is being done for two reasons:
1. To avoid clashing with the bootimg module type.
2. To better reflect what this represents.

While a bootclasspath_fragment can create what ART calls a boot image
(which is different to what the bootimg module type represents) it does
not have to do so.

Bug: 177892522
Test: m nothing
Change-Id: Ib45604be7adc790ded9e27a2ac812dd7522ca8db
2021-03-29 11:05:55 +01:00
Paul Duffin
837486d308 Convert java/boot_image_test.go to test fixtures
Bug: 177892522
Test: m nothing
Change-Id: I91d2bd2eabe5916fd158501bd0d4fdb608919019
2021-03-29 11:05:55 +01:00
Paul Duffin
64be7bb32f Change type of Image_name from string to *string
Bug: 177892522
Test: m nothing
Change-Id: Id72b6079f11c28df6248e71998fb97851cfc5be9
2021-03-29 11:05:55 +01:00
Paul Duffin
9ea71c0f4f Make apex/boot_image_test.go more realistic
Previously it was unrealistic because the "boot" image cannot be added
to an apex (because it references modules from multiple different
apexes). Only the "art" image can be added to an apex. So, this change
switches to use the "art" image which requires the apex name is changed
to "com.android.art".

This change also adds an equivalent test for prebuilt_boot_image as
well as a check of the module dependencies for the mybootimage module.

Bug: 177892522
Test: m nothing
Change-Id: I20089b02c80bedc072dbb950dce09bc4e8397f3a
2021-03-29 11:05:55 +01:00
Jingwen Chen
cb745601b9 Merge "Remove comment about gitignore for BUILD files." 2021-03-29 09:49:02 +00:00
Ulyana Trafimovich
a8f6db972f Merge changes I1f0ab4af,Iea3be0fc
* changes:
  Fix AAPT path in dexpreopt.
  Allow modules that don't run verify_uses_libraries to have nonempty CLC.
2021-03-29 09:24:00 +00:00
Paul Duffin
0839101430 Merge "Prune test preparers in apex/boot_image_test.go" 2021-03-29 08:51:03 +00:00
Paul Duffin
fed8df3424 Merge "Prevent apex from using preferred prebuilt_boot_image" 2021-03-29 08:50:37 +00:00
Paul Duffin
acde8e7fed Merge "Convert kernel package to use test fixtures" 2021-03-29 08:50:05 +00:00
Jingwen Chen
2288f3155b Remove comment about gitignore for BUILD files.
Change-Id: Ic1c795d9d961b309d269b1bc4bccb7522f288e9b
Rationale: we haven't modified any gitignore file. lberki has a new proposal to steer this in a new direction, so let's reflect the comment to the current reality.
2021-03-29 08:31:28 +00:00
Thiébaud Weksteen
785f378f7d Merge "rust: Add features list to rust_project.json" 2021-03-29 07:58:08 +00:00
Paul Duffin
e5ac250ab4 Convert kernel package to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: Ibd3cc62feec1b911d74451d53cea81607d3bec36
2021-03-29 01:25:26 +01:00
Paul Duffin
2a2fb66d6c Convert linkerconfig package to use test fixtures
Bug: 181070625
Test: m nothing
Change-Id: Ic85e353ad8fa2aa324cd75d5bca8a1e31fd977a8
2021-03-29 01:17:03 +01:00
Paul Duffin
52bfaa43f9 Prune test preparers in apex/boot_image_test.go
Cut down the preparers to only those needed by these tests.

Bug: 177892522
Test: m nothing
Change-Id: I811977b0331dd38c25623aa96e09e85ba5cf7c57
2021-03-28 23:02:18 +01:00
Paul Duffin
396229f7cf Prevent apex from using preferred prebuilt_boot_image
Bug: 177892522
Test: m nothing
Change-Id: I8530ffa4c5123f6055a6ca25421c17bb6fc037f0
2021-03-28 23:02:18 +01:00
Paul Duffin
cf7f2e0a9e Merge "Make TestingBuildParams.RelativeToTop() modify (Writable)Path(s)" 2021-03-28 22:00:05 +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
352bdf29b3 Merge "rust: Add whole_static_libs, revert static_lib" 2021-03-26 13:01:14 +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
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
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
d411f069ff Merge "Remove obsolete comment on PrebuiltPostDepsMutator" 2021-03-25 19:37:51 +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