Commit graph

34918 commits

Author SHA1 Message Date
Ulyana Trafimovich
8ef5b4f95f Merge "Split functions for compiling boot jars to allow future code reuse." 2021-03-24 10:48:51 +00:00
Lukacs T. Berki
c99c947c88 Make null builds always be null builds.
Previously, soong.environment.used was written after build.ninja and if
the amount of time that passed between the two was long enough, Ninja
would decide that build.ninja is older than soong.environment.used and
rebuild it.

Test: test_null_build in bootstrap_test.sh in a loop.
Change-Id: I5467da487e8e8f2646644b8a7fb9549b9ff18276
2021-03-24 10:51:05 +01:00
Paul Duffin
9fc9f53423 Group all the preparations needed for testing dexpreopt
Make it easier to test dexpreopt functionality by grouping all the
fixture preparations together.

Bug: 177892522
Test: m nothing
Change-Id: I94f66e3ec82efc4fd791f4fdab678d298565e452
2021-03-24 08:30:27 +00:00
Paul Duffin
3c84eaaa98 Separate methods used for fixture based and legacy tests
The fixture mechanism makes it easy to refactor by splitting up an
existing preparer into separate ones and then combining them back
together. Unfortunately, that becomes slightly more tricky when
preparers and legacy tests use the same functions to register build
components and define default modules.

This change splits the RegisterRequiredBuildComponentsForTest and
GatherRequiredDepsForTest methods into two methods each, with the
existing method used for legacy tests and calling the new method that
is used for the preparer.

At the moment all the functionality is in the new methods but over
time, as functionality is extracted into separate preparers, the
functionality can also be moved from the method that is common to both
legacy and fixture based tests into the legacy only method.

Bug: 177892522
Test: m nothing
Change-Id: I233a4fe1fb072a00292acc2bb20821ec82a9bd67
2021-03-24 08:27:04 +00:00
Paul Duffin
f8e3d8341a Use more inclusive language in dexpreopt/testing.go
Bug: 177892522
Test: m nothing
Change-Id: Idbb37485a573ddd25c4da48ab88f9c559fca5434
2021-03-24 08:26:48 +00:00
Paul Duffin
b6535d329f Merge "Remove javaFixtureFactory" 2021-03-24 08:25:20 +00:00
Paul Duffin
9d33cf237a Merge "Remove unused test methods and buildDir" 2021-03-24 08:23:31 +00:00
Paul Duffin
38e73fcfc0 Merge "Remove uses of buildDir from java/rro_test.go" 2021-03-24 08:22:25 +00:00
Paul Duffin
5916fe6856 Merge "Remove uses of buildDir from java/kotlin_test.go" 2021-03-24 08:00:15 +00:00
Paul Duffin
369c3aae53 Merge "Remove uses of buildDir from java/java_test.go and java/sdk_test.go" 2021-03-24 07:58:43 +00:00
Paul Duffin
700185b1f8 Merge "Remove uses of buildDir from java/app_test.go" 2021-03-24 07:58:28 +00:00
Paul Duffin
86da0448c6 Merge "Remove uses of buildDir from java/app_set_test.go" 2021-03-24 07:58:09 +00:00
Paul Duffin
6567d07f59 Merge "Remove uses of buildDir from java/app_import_test.go" 2021-03-24 07:55:37 +00:00
Paul Duffin
6f59e6a568 Merge "Remove uses of buildDir in java/androidmk_test.go" 2021-03-24 07:54:15 +00:00
Paul Duffin
eed60863d0 Merge "Remove uses of buildDir in java/hiddenapi_singleton_test.go" 2021-03-24 07:53:51 +00:00
Paul Duffin
1b095e5177 Merge "Remove uses of buildDir from java/dexpreopt_bootjars_test.go" 2021-03-24 07:52:12 +00:00
Paul Duffin
5863c2ae65 Merge "Register java_plugin in PrepareForTestWithJavaBuildComponents" 2021-03-24 07:51:51 +00:00
Lukács T. Berki
543d4a5156 Merge "Make GENERATE_BAZEL_FILES=true correct." 2021-03-24 07:01:16 +00:00
Jingwen Chen
12b4c2706d bp2build: add allowlist for package-level conversions.
This CL adds the support for specifying lists of directories in
build/soong/android/bazel.go, which are then written into
out/soong/bp2build/MANIFEST. Using this configuration,
modules/directories can either default to bp2build_available: true or
false, while still retaining the ability to opt-in or out at the module level.

It also ensures that ConvertWithBp2Build returns true iff the module
type has a registered bp2build converter.

Test: go tests
Test: demo.sh full
Test: TreeHugger presubmits for bp2build and mixed builds.

Change-Id: I0e0f6f4b1b2ec045f2f1c338f7084defc5d23a55
2021-03-24 02:27:19 -04:00
Inseob Kim
eb120bd741 Merge "Add WithDexpreopt soong variable" 2021-03-24 06:20:03 +00:00
Ryo Hashimoto
5818b9344f Enable safe ICF for all devices
--icf=safe has been enabled for arm and arm64.
Do the same thing for all devices.

On bertha_x86_64, this CL makes system.raw.img 4.4MB smaller.

Bug: 182446785
Test: build

Change-Id: Ifd597cd8496c49b55df269f22e01b1c50dc8f6e8
2021-03-24 13:00:32 +09:00
Treehugger Robot
7b1debfcbc Merge "Fix genrule depending on disabled module with ALLOW_MISSING_DEPENDENCIES=true" 2021-03-24 03:59:44 +00:00
Kousik Kumar
9008ca3005 Merge "Print the output from RBE bootstrap shutdown" 2021-03-24 02:24:37 +00:00
Pirama Arumuga Nainar
bedca74471 [pgo] Do not explicitly link profile runtime
Bug: http://b/181740505

Explicitly adding dependency to profile runtime causes apex dependency
errors.  We're already passing -fprofile-instr-generate to the linker so
depending on the profile runtimes is unnecessary.

Test: pgo-coral-config1 on internal release branch and run tests on
      APCT.
Change-Id: Ie54785726c7ac044e5a5a2299073d02d45d5e0a7
2021-03-23 18:07:30 -07:00
Paul Duffin
71ae59412b Remove javaFixtureFactory
Replaces uses of javaFixtureFactory with prepareForJavaTest and removes
the unused javaFixtureFactory.

Bug: 182885307
Test: m nothing
Change-Id: I809772d14af2af211b9e15ad676fbdc06b07cd46
2021-03-24 01:07:12 +00:00
Paul Duffin
d6339af0b6 Remove unused test methods and buildDir
Bug: 182885307
Test: m nothing
Change-Id: I251145a82479428a82f19cbde6b415d149acd619
2021-03-24 01:07:12 +00:00
Paul Duffin
0342dc9c35 Remove uses of buildDir from java/rro_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: Id0e5710f1f121aec9c5f744a7bc7df82d95484f6
2021-03-24 01:07:12 +00:00
Paul Duffin
b148a49319 Remove uses of buildDir from java/kotlin_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: Id1d449d55fe992ebc3d7bad38a76bb1652844f52
2021-03-24 01:07:12 +00:00
Paul Duffin
414ea5eb73 Remove uses of buildDir from java/java_test.go and java/sdk_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: I4d9dc39d3b1e5c37ba1f9e72da94048949c0fd17
2021-03-24 01:07:12 +00:00
Paul Duffin
fb0fe9f5cb Remove uses of buildDir from java/app_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: Ia8f835a8250934ef328cad02b272e6b94b13c459
2021-03-24 01:07:02 +00:00
Paul Duffin
f71e4ed326 Remove uses of buildDir from java/app_set_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: I64b13dcb310e0a0a2049b5e3b0ea0115e7e9c2f5
2021-03-24 00:01:15 +00:00
Paul Duffin
fb8bc95199 Remove uses of buildDir from java/app_import_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: I700a3cafaa427243212aab1eb903d1871327483c
2021-03-24 00:01:15 +00:00
Paul Duffin
f04311cbc1 Remove uses of buildDir in java/androidmk_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: Ibb9520d1500fcef9a4348570926a07b5bb54bf8c
2021-03-24 00:01:15 +00:00
Paul Duffin
2f9e71e5ad Remove uses of buildDir in java/hiddenapi_singleton_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: I664465808cd4edf1fef611c07ae05a32683dc976
2021-03-24 00:01:15 +00:00
Paul Duffin
67d485e9d4 Remove uses of buildDir from java/dexpreopt_bootjars_test.go
Remove any uses, either direct (or indirect via testJavaConfig or
similar methods), of the package level buildDir variable from this
file.

Bug: 182885307
Test: m nothing
Change-Id: I852dbb5ad2e1aa58df103679c5e9de14cf64abc3
2021-03-24 00:01:15 +00:00
Paul Duffin
c029c43c99 Register java_plugin in PrepareForTestWithJavaBuildComponents
Bug: 182885307
Test: m nothing
Change-Id: I550d39ba46c548b6b099d8dc6a9c458ca931b2fa
2021-03-24 00:01:15 +00:00
Paul Duffin
c5993b2c9d Merge "Support test fixtures in rust package" 2021-03-24 00:00:19 +00:00
Colin Cross
fa65cee27f Fix genrule depending on disabled module with ALLOW_MISSING_DEPENDENCIES=true
If a genrule depends on a module that is disabled, in this case because
it is a device module in a host-only build, it can cause panics when
getPathsFromModuleDep retrieves a nil Path from the disabled module.
Treat disabled modules as missing dependencies.

Test: TestGenruleAllowMissingDependencies
Change-Id: I3c689c6b5505b21eaf7ae7cb93c00f96f438ac17
2021-03-23 16:17:37 -07:00
Jaewoong Jung
6158dfeb95 Remove obsolete comment on PrebuiltPostDepsMutator
Test: N/A
Change-Id: If01139ed361dd16022b50c503349d1d05282052b
2021-03-23 14:08:29 -07:00
Paul Duffin
2c4ca8d73f Support test fixtures in rust package
Replaces the rust specific rustTestCtx mechanism with the general test
fixtures mechanism as converting it to use preparers was not possible.

Also, removes usages of the buildDir variable and removes it as it is
no longer needed.

Bug: 181070625
Test: m nothing
Change-Id: I0176a7b6fb2d390ae23693f1e198da5124b4be63
2021-03-23 18:47:15 +00:00
Treehugger Robot
dca349a782 Merge "Handle include_build_directory prop in bp2build" 2021-03-23 14:39:19 +00:00
Lukacs T. Berki
f0b3b94bb3 Make GENERATE_BAZEL_FILES=true correct.
This is achieved by writing soong.environment.used in Main() instead of
as a side effect of a singleton. This makes a difference because build
actions are not generated when GENERATE_BAZEL_FILES=true is set,
therefore the side effect did not happen.

Arguably, Main() is made worse by this change, but I don't want to
tackle the problem of readably determining which mode soong_build is
running in in this change.

Test: Presubmits + the additional test.
Change-Id: I66af2429aedf008762173eaaa55b828b4cf4328b
2021-03-23 15:18:22 +01:00
Thiébaud Weksteen
f1ff54a10b rust: Drop libgcc dependency
Rustc unstable option "link-native-libraries" is used to prevent the
linkage of other libraries via the #[link] directive. Add a dependency
to libclang_rt.builtins, similarly to cc.

Bug: 141331117
Test: lunch aosp_crosshatch-userdebug; m
Change-Id: I5c232291a5dd08a99e6a12a1295e30bb8e4fcaf1
2021-03-23 13:55:40 +01:00
Inseob Kim
7b85eeb41e Add WithDexpreopt soong variable
Test: m selinux_policy on sc-arc
Change-Id: I9e8ba5746e4648a04fe4d8fbe5d3403ba06b5914
2021-03-23 20:52:24 +09:00
Paul Duffin
7ee6e8fa0f Merge "Add platform_compat_config to sdk" 2021-03-23 11:17:06 +00:00
Paul Duffin
e835389123 Merge "Add TestBasicSdkWithBootImage" 2021-03-23 11:13:12 +00:00
Paul Duffin
713b501017 Merge "Register the propagateRROEnforcementMutator" 2021-03-23 10:46:49 +00:00
Treehugger Robot
c29088b727 Merge "Remove .rustc ELF section from mini-debug-info." 2021-03-23 09:13:53 +00:00
Paul Duffin
e0998ab561 Merge "Add preparer for overlay pre-singleton registration" 2021-03-23 07:21:30 +00:00
Paul Duffin
010bb3c5b3 Merge "Add TestingModule.VariablesForTestsRelativeToTop" 2021-03-23 07:21:01 +00:00