Commit graph

2767 commits

Author SHA1 Message Date
Paul Duffin
b00c7ed2e8 Merge "Convert TestApexPermittedPackagesRules to use test fixtures" 2021-03-31 21:40:09 +00:00
Liz Kammer
acacbc1166 Merge "Handle product_variable asflag for cc_object." 2021-03-31 18:43:55 +00:00
Liz Kammer
7dfaa3a732 Merge "Don't use custom mixed build logic for cc_object" 2021-03-31 18:43:55 +00:00
Paul Duffin
301099e451 Merge "Remove varargs from Fixture(t *testing.T)" 2021-03-31 17:18:58 +00:00
Paul Duffin
5086512524 Merge "Remove varargs from RunTest(t *testing.T)" 2021-03-31 17:18:14 +00:00
Chris Parsons
b164b381b2 Register bp2build module types even outside generation
Without this fix, mixed builds are silently disabled, as a recent change
disabled mixed builds for all module types which are not listed in this
map. This map should be populated for both bp2build generation and for
mixed builds.

Test: lunch aosp_flame && USE_BAZEL_ANALYSIS=1 m libc
Change-Id: Ib2a3fb2de2e7a5204ef01355522ae569e0424dc7
2021-03-31 12:26:01 -04:00
Paul Duffin
45338f05e3 Convert TestApexPermittedPackagesRules to use test fixtures
Adds PrepareForTestWithNeverallowRules to make it easy to test
neverallow rules. Avoid exporting any unnecessary neverallow related
methods from the android package.

Bug: 181070625
Test: m nothing
Change-Id: Idfc6955cb23f1a4d1790be7879388154b03f3980
2021-03-31 16:16:18 +01:00
Paul Duffin
34a7fff9e0 Remove varargs from Fixture(t *testing.T)
Bug: 182885307
Test: m nothing
Change-Id: I71c3cf47ba1dc8d29d1533789c4c991cb825bd88
2021-03-31 16:04:07 +01:00
Paul Duffin
55e740e9a6 Remove varargs from RunTest(t *testing.T)
Use GroupFixturePreparers instead.

Bug: 182885307
Test: m nothing
Change-Id: Iaedb0ddc9d6a704f4d41363e705f3025a1291dc8
2021-03-31 16:03:59 +01:00
Paul Duffin
32eccae1ac Merge "Rename OptionalPath.RelativeToPath -> RelativeToTop" 2021-03-31 08:57:43 +00:00
Paul Duffin
dff50dffbc Merge "Remove extraneous calls to TestingBuildParams.RelativeToTop()" 2021-03-30 23:09:52 +00:00
Rupert Shuttleworth
02adc14203 Merge "Store the bp2build module opt-out list as a list instead of a map." 2021-03-30 22:04:21 +00:00
Christopher Parsons
209feec9e3 Merge "Refactor cquery processing to generalize transitions" 2021-03-30 21:52:13 +00:00
Liz Kammer
a060c4521e Handle product_variable asflag for cc_object.
cc_object crtbrand sets product_variable.platform_sdk_version.asflag
and will not compile correctly within mixed builds without it.

Only handles product_variables that expand product variables.

Bug: 181794963
Test: ~/aosp/build/bazel/scripts/milestone-2/demo.sh full
Change-Id: I293fcb18032aa51f63bb7b3de94abd6d1ec38180
2021-03-30 15:16:43 -04:00
Paul Duffin
afdd4061ee Rename OptionalPath.RelativeToPath -> RelativeToTop
Bug: 183650682
Test: m nothing
Change-Id: I95239c2273e715e8c4c15a4a02967e01f6913234
2021-03-30 20:06:22 +01:00
Paul Duffin
a71a67a4f5 Remove extraneous calls to TestingBuildParams.RelativeToTop()
Deprecated the method to try and prevent any other uses being added.

Bug: 183650682
Test: m nothing
Change-Id: Ia6f43851e5a00c9d96af780e3bd21e03175e1a2f
2021-03-30 20:03:22 +01:00
Paul Duffin
e8366da1f6 Automatically call TestingBuildParams.RelativeToTop()
Fixes the few tests that break due to this and which cannot easily be
separated into their own changes.

Bug: 183650682
Test: m nothing
Change-Id: Ia2f31213a1f114a78e66a81d89279ecde9f4c465
2021-03-30 19:35:35 +01:00
Paul Duffin
b2786a3fdc Merge "Add TestingModule.Outputs" 2021-03-30 16:55:41 +00:00
Paul Duffin
03d56c7743 Merge "Add StringsRelativeToTop" 2021-03-30 16:43:35 +00:00
Paul Duffin
544c368d2e Merge "Add OptionalPath.RelativeToTop" 2021-03-30 16:43:23 +00:00
Paul Duffin
35b7e1cf23 Merge "Add StringRelativeToTop" 2021-03-30 16:29:34 +00:00
Treehugger Robot
afd4c68106 Merge "queryview: fix depfile and incrementality." 2021-03-30 16:19:56 +00:00
Rupert Shuttleworth
4f43fe96bd Store the bp2build module opt-out list as a list instead of a map.
Test: bp2build-sync.py write; bazel build //bionic/...
Change-Id: I3f68f4c62446841aa795bb84161d1fa82510ae9d
2021-03-30 14:13:16 +00:00
Jingwen Chen
0702791a99 bp2build: arch-configurable selects for label list attrs.
This CL adds the configurable LabelListAttribute support to bp2build.

Test: go test
Change-Id: I2ef9e385d9cf1b1845988128eca1d8cda1ecb5e8
2021-03-30 13:22:48 +00:00
Jingwen Chen
e8a8296bc6 queryview: fix depfile and incrementality.
A previous change caused the depfile construction to be incorrect.

Test: run m queryview twice, second run is a no-op.
Fixes: 184026544

Change-Id: Ibaaa97d6a09956e1ca9c48643b0ffad75e44f051
2021-03-30 12:22:12 +00:00
Martin Stjernholm
38e9f0b82f Merge changes Iaa6411b5,I2118b8a2,Ibbdd3cbd,I2d1bbda2
* changes:
  Make test_for arch variant.
  Don't use APEX stubs between internal libs in the same APEX when building test_for modules.
  Add FilterListPred.
  Don't panic on "go test" invocations from the command line.
2021-03-30 09:26:36 +00:00
Chris Parsons
ad0b5ba42c Refactor cquery processing to generalize transitions
This is a step in the right direction to allow generalized specification
of variant information in the form of configuration transitions, such
that not all transitions must be specified manually. This allows for
much more reasonable addition of new variations in mixed builds.

Test: lunch aosp_flame && USE_BAZEL_ANALYSIS=1 m libc
Change-Id: I95898da06af6d0e3e1f7c073aaf8ec0ebe26c951
2021-03-29 21:14:57 -04:00
Paul Duffin
962783a660 Add TestingModule.Outputs
Needed for some follow up changes.

Bug: 183650682
Test: m nothing
Change-Id: I326e6be6d397f3300be68c1fe069fc72aa736cee
2021-03-29 17:29:30 +01:00
Paul Duffin
0aafcbfd2d Add StringsRelativeToTop
Needed for some follow up changes.

Bug: 183650682
Test: m nothing
Change-Id: Ic14cb4f4592d887dd897989482d540e12065c0fe
2021-03-29 17:29:30 +01:00
Paul Duffin
a5b8135bdf Add OptionalPath.RelativeToTop
Needed for some follow up changes.

Bug: 183650682
Test: m nothing
Change-Id: If38dfe8e919094a7365bcee6cb71bfd0409f4454
2021-03-29 17:29:30 +01:00
Paul Duffin
f53555da2f Add StringRelativeToTop
Needed for some follow up changes.

Bug: 182885307
Test: m nothing
Change-Id: I15992cc11e9c4c0e07af879192220ef1848dd09c
2021-03-29 17:29:30 +01:00
Paul Duffin
cf7f2e0a9e Merge "Make TestingBuildParams.RelativeToTop() modify (Writable)Path(s)" 2021-03-28 22:00:05 +00:00
Martin Stjernholm
4e6c269de5 Don't use APEX stubs between internal libs in the same APEX when
building test_for modules.

This extends the current approach where test modules always depend on
the platform variants of the APEX libs, and only skips the stubs on
them. It still has the limitation that the internal libs must have the
exact same apex_available lists.

Also some improvement of the test accuracy in TestTestFor.

Test: m libartagent-target
  with http://r.android.com/q/topic:libdexfile-noext applied
Bug: 183217299
Change-Id: I2118b8a22c887077867a3ddbbe73437b4a29a6ad
2021-03-28 22:06:34 +01:00
Martin Stjernholm
1461c4dbca Add FilterListPred.
Test: cd build/soong; go test ./android
Change-Id: Ibbdd3cbdb822bd2e843096a22cdd08c827b70526
2021-03-28 22:06:33 +01:00
Martin Stjernholm
32312eb75a Don't panic on "go test" invocations from the command line.
Test: cd build/soong; go test ./android
Bug: 183650682
Change-Id: I2d1bbda21cb262eafc7f7d329206720809399985
2021-03-28 22:06:33 +01: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
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
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
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
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
301deecd6c Merge "Add Path.RelativeToTop" 2021-03-25 18:01:31 +00:00
Liz Kammer
8206d4ff98 Don't use custom mixed build logic for cc_object
Starlark implementation of cc_object now performs partial linking, which
better matches Soong's implementation of cc_object.

Bug: 181794963
Test: generate build files with bp2build, mixed build droid
Change-Id: I5a325aa1c608981deaee3671ac28c6014e6cbf08
2021-03-25 12:00:30 -04:00
Jingwen Chen
6400f20430 Merge "bp2build: add a per-module denylist." 2021-03-25 15:02:57 +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