Commit Graph

34498 Commits

Author SHA1 Message Date
Paul Duffin 9f4b3bbb7c Replace AssertPanic with AssertPanicMessageContains
Bug: 182885307
Test: m nothing
Change-Id: Idffa314285c90080796cc3df391de9c314eaa422
2021-03-20 12:08:51 +00:00
Julien Desprez 0387862185 Merge "Migrate manifest_*_test out of test mapping" 2021-03-19 21:47:24 +00:00
Paul Duffin 479605bed7 Merge changes I6b868bac,If75f4718
* changes:
  Migrate android package to a per test build directory
  Convert android/path_properties_test.go to test fixtures
2021-03-19 17:28:38 +00:00
Colin Cross d2db7953a0 Merge changes Iab4e09d9,Icf2f24dd,I15be5ef1,Ic0db9619
* changes:
  Run lint actions in sbox
  Support sbox-in-RBE
  Move android package on top of remotexec
  Support sandboxing inputs in RuleBuilder
2021-03-19 17:25:14 +00:00
Julien Desprez 2dc86b2956 Migrate manifest_*_test out of test mapping
Unit tests do not require an explicit TEST_MAPPING config

Change-Id: Ieccebc78a26b9555803a2278e2962d0b388a6957
Test: presubmit
Bug: 183209529
2021-03-19 17:16:16 +00:00
Yi Kong 00d54280d0 Merge "[strip.sh] Move remaining GNU binutils usage to llvm binutils" 2021-03-19 15:32:49 +00:00
Paul Duffin 54a5e9a467 Merge "Remove javaMockFS()" 2021-03-19 14:18:46 +00:00
Paul Duffin 89fbdb2387 Merge "Fix TestTurbine to work without javaMockFS()" 2021-03-19 11:11:42 +00:00
Paul Duffin 64df56def9 Merge "Fix testDexpreoptBoot to work without javaMockFS()" 2021-03-19 11:09:21 +00:00
Paul Duffin 750f8f3515 Merge "Fix TestClasspath to work without javaMockFS()" 2021-03-19 11:08:35 +00:00
Paul Duffin 903a8a08ab Merge "Convert TestClasspath to test fixtures" 2021-03-19 11:08:17 +00:00
Jingwen Chen b1672af5d2 Merge "bp2build: cc_library_headers converter should only include that module type" 2021-03-19 09:18:15 +00:00
Yi Kong ad50ce8349 [strip.sh] Move remaining GNU binutils usage to llvm binutils
With clang r377782, llvm binutils implements all the necessary
funtionaility for strip.sh. We can finally get rid of all the fallback
GNU binutils usage.

Test: m
Bug: 141010852
Bug: 135627985
Change-Id: I110f6028dab7f599decf59a5cb1b927b35e11857
2021-03-19 12:28:44 +08:00
Inseob Kim fc8e9c7f00 Merge "Add sepolicy related variables" 2021-03-19 00:07:58 +00:00
Justin Yun b1d5479783 Merge "Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__" 2021-03-18 23:33:43 +00:00
Colin Cross 1661aff8be Run lint actions in sbox
Run lint actions in sbox with RuleBuilder.SandboxInputs.  This
copies all input files into the sandbox, which prevents the lint
tool from finding nearby source files that were not presented to it.

Using SandboxInputs requires use of PathForInput or PathForOutput
anywhere a path is used outside of the RuleBuilderCommand methods
that take paths so that they can be translated to the paths that
will be used in the sandbox.

Bug: 181681346
Test: lint_test.go
Test: m lint-check dist
Test: m USE_RBE=true RBE_LINT=true lint-check dist
Test: m USE_RBE=true RBE_LINT=true RBE_LINT_EXEC_STRATEGY=remote lint-check dist
Change-Id: Iab4e09d961891ef182643583d4d456e413bc5e39
2021-03-18 16:17:34 -07:00
Colin Cross ef972743e8 Support sbox-in-RBE
Allow passing a remoteexec.REParams to RuleBuilder to configure it to
run the rule remotely through RBE.  Requires the rule to use
SandboxInputs, which ensures that RuleBuilder is aware of all of the
inputs and outputs of the rule.

Running sbox in RBE initially seems unnecessary, as RBE is already a
good sandbox, but reproxy can execute RBE actions locally when configured
for local execution, local fallback or racing.  Using sbox in RBE ensures
that these local actions are also sandboxed, giving consistent results
between directly executed actions, local RBE actions, and remote RBE
actions.

Bug: 182612695
Test: manual
Change-Id: Icf2f24dde8dee833eb680ba22566a8e1c0143b15
2021-03-18 16:17:34 -07:00
Colin Cross 77cdcfdeaf Move android package on top of remotexec
Remove the references to the android package in remotexec so that
the android package can reference the remoteexec package.  This
will allow RuleBuilder to integrate directly with remoteexec.

Bug: 182612695
Test: m checkbuild
Change-Id: I15be5ef126d8aacbd605518638f341daf6f31bb3
2021-03-18 16:17:34 -07:00
Colin Cross ab020a7333 Support sandboxing inputs in RuleBuilder
When RuleBuilder.SandboxInputs() is called configure sbox to copy
all the input files into the sandbox directory and then change the
working directory there when running the command.

Copying input files into the sandbox directory gets tricky when
the input file is the output file from another rule, and could
be at an arbitrary, possibly absolute path based on the value
of OUT_DIR.  They will need to be copied to a directory in the
sandbox using the path relative to OUT_DIR.

RSP files need special handling, they need to both be copied into
the sandbox as an input, rewritten to contain paths as seen in the
sandbox, and references to them on the command line need to use
sandbox paths.

Bug: 182612695
Test: rule_builder_test.go
Change-Id: Ic0db961961b186e4ed9b76246881e3f04971825c
2021-03-18 16:17:32 -07:00
Jingwen Chen c5a0089ac4 Merge "bp2build: genrule converter only supports "genrule"." 2021-03-18 22:41:52 +00:00
Jingwen Chen c7846f38fa bp2build: cc_library_headers converter should only include that module type
Test: bp2build; bazel build //bionic/...
Change-Id: I34768b51098c5b801e7c6d9b3a95ec0f37c3bb09
2021-03-18 18:35:39 -04:00
Colin Cross a5d09762a6 Merge changes Idcbe2046,I09616402,Ide2f1ed9
* changes:
  Fix sbox in chdir mode
  Check RuleBuilder temporaries for path errors
  Fix WriteFileRule escaping
2021-03-18 22:28:11 +00:00
Tri Vo 0e3758caea Merge "Remove "-C link-dead-code=y" flag" 2021-03-18 21:27:54 +00:00
Treehugger Robot d19b824e7f Merge "Check for frameworks/base/Android.bp instead of frameworks/base" 2021-03-18 20:56:54 +00:00
Kousik Kumar 47665870d7 Merge "Allowlist RBE_num_retries_if_mismatched variable" 2021-03-18 19:13:29 +00:00
Paul Duffin 813bfcb252 Merge "Convert android/packaging_test.go to test fixtures" 2021-03-18 18:38:34 +00:00
Paul Duffin 387f4ce1ee Merge changes Iccba8caf,I1eb49f25,Id77575f8,I5679cb51,I7f9f3eb6, ...
* changes:
  Convert android/ninja_deps_test.go to test fixtures
  Add NinjaDeps to TestResult
  Convert android/singleton_module_test.go to test fixtures
  Convert android/neverallow_test.go to test fixtures
  Convert android/singleton_module_test.go to test fixtures
  Convert android/variable_test.go to test fixtures
  Convert android/soong_config_modules_test.go to test fixtures
  Convert android/mutator_test.go to test fixtures
  Convert android/deptag_test.go to test fixtures
2021-03-18 18:18:38 +00:00
Paul Duffin 000ae662fa Merge changes I2e69e7b5,I3c9c36e7
* changes:
  Convert sysprop package to fixtures
  Add preparers for sysprop
2021-03-18 18:17:20 +00:00
Paul Duffin ebcb37bab1 Merge "Migrate sdk package to a per test build directory" 2021-03-18 17:05:11 +00:00
Paul Duffin c3f89bece1 Merge "Clean up java package use of python build components" 2021-03-18 17:02:44 +00:00
Paul Duffin e410711cd5 Merge "Convert python package to fixtures" 2021-03-18 17:02:19 +00:00
Paul Duffin b72dd403de Merge "Prevent ApexInfoMutator from creating unnecessary variants" 2021-03-18 15:13:39 +00:00
Paul Duffin b01125f92b Merge changes I9aad3e4e,I150889a0
* changes:
  Convert xml package to fixtures
  Add preparers for xml
2021-03-18 14:16:31 +00:00
Paul Duffin d5065cfc66 Merge "Add prebuilt_platform_compat_config" 2021-03-18 12:28:00 +00:00
Paul Duffin 1afa515929 Migrate android package to a per test build directory
Bug: 182885307
Test: m nothing
Change-Id: I6b868bacc36be1f6768fbb2fb1d7ed4ad6e4118c
2021-03-18 12:18:09 +00:00
Paul Duffin c3bdd310bd Convert android/packaging_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: Ic2384bfe3f1edb8d252053fda7df66d49c46fd0f
2021-03-18 12:18:09 +00:00
Paul Duffin d9ec7d2694 Convert android/ninja_deps_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: Iccba8caffc7e5a82ff13d93a032edcf3f748fc40
2021-03-18 12:18:09 +00:00
Paul Duffin d518b7e2f2 Convert android/path_properties_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: If75f471885b5e4022b406e267e04b7a20e0be080
2021-03-18 12:18:09 +00:00
Paul Duffin 78c36216a8 Add NinjaDeps to TestResult
Bug: 182885307
Test: m nothing
Change-Id: I1eb49f2514b13f52f367cd8f57e5cb0ab3336bd7
2021-03-18 12:18:09 +00:00
Paul Duffin a9237b6eeb Convert android/singleton_module_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: Id77575f8ceda43545e2fad97fa1bd6b612c967b4
2021-03-18 12:18:09 +00:00
Paul Duffin 3c6a4ea24a Convert android/neverallow_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: I5679cb517151ceaf468f2fe2e0ccab718cc7b4a3
2021-03-18 12:18:09 +00:00
Paul Duffin d65970072d Convert android/singleton_module_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: I7f9f3eb66279fe5a2447aefa9b636144c32ce92a
2021-03-18 12:18:05 +00:00
Paul Duffin 4bb2b219d6 Convert android/variable_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: I51d3651244b110bf41cb0e4c331ac663bf816f84
2021-03-18 12:17:05 +00:00
Paul Duffin 791302b412 Convert android/soong_config_modules_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: I53231b820154447e359e48afa47cdf76f0ec6c47
2021-03-18 12:17:05 +00:00
Paul Duffin e8a4ac49fe Convert android/mutator_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: Id7eb915af21ccde5acf1d4a0ec339e0672bc3d57
2021-03-18 12:17:05 +00:00
Paul Duffin 485079130d Convert android/deptag_test.go to test fixtures
Bug: 182885307
Test: m nothing
Change-Id: I837c7b9944a9adbe9019ae8a4e69ff3b7086ca5c
2021-03-18 12:17:01 +00:00
Paul Duffin 4b9bb5c057 Merge "Convert android/namespace_test.go to test fixtures" 2021-03-18 12:14:01 +00:00
Paul Duffin cb460c91f1 Merge "Add FixtureIgnoreErrors" 2021-03-18 12:13:36 +00:00
Paul Duffin 50eb3829f9 Merge "Convert android/rule_builder_test.go to test fixtures" 2021-03-18 12:13:12 +00:00
Paul Duffin 573989d821 Prevent ApexInfoMutator from creating unnecessary variants
Adds the AlwaysRequireApexVariantTag interface to enable
ApexInfoMutator to differentiate between a tag that is excluded from
apex contents but still requires an apex variant and a tag that is
excluded from apex contents and does not require an apex variant.

That is needed to support the sdkMemberVersionedDepTag which excludes
the target from being added to the APEX but requires an APEX variant.
A more detailed explanation is in the comments.

The AlwaysRequireApexVariant() method follows the pattern used in
ReplaceSourceWithPrebuilt of having a method that returns a bool to
trigger the behavior and not say ExcludeFromApexContentsTag that simply
relies on the tag implementing an interface to trigger. That is because
the former is more flexible and allows a tag type to parameterize the
behavior if necessary.

The tags that this will exclude from creating an apex variant are:
* PrebuiltDepTag - by the time the apex variant has been created any
  preferred prebuilts will have replaced the sources so there is no
  need to create an APEX variant if the only dependency path from the
  APEX to the prebuilt is via this tag.
* hiddenApiAnnotationsDependencyTag - the target of which is a purely
  build time artifect and MUST NEVER end up in the APEX.

It will also stop calling DepIsInSameApex for any dependency created
by the sdkMemberVersionedDepTag. Which will fix the issue reported in
the bug.

Bug: 182992071
Test: m nothing
Change-Id: I9569e488d6446ca45d3ea8f32a9b74524eb865df
2021-03-18 09:05:28 +00:00