Commit Graph

3227 Commits

Author SHA1 Message Date
Jeff Sharkey 799822d7af Merge changes from topic "may27-sdk" into sc-dev
* changes:
  Hacky workaround for half-finalized builds.
  platform/build/soong - S is now 31
2021-06-02 20:11:14 +00:00
Jeff Sharkey 7412091dcc platform/build/soong - S is now 31
Bug: 171506470
Test: Build
Change-Id: I7b02ab24d12ea07463efd319a7ff059751416990
2021-06-01 06:49:05 -06:00
Colin Cross 3225be468a Make CopyDirectlyInAnyApex match the documentation
CopyDirectlyInAnyApex was documented to copy from child to parent, but
was copying from parent to child.  It is unused, so reverse it to
match the documentation.

Bug: 183759446
Test: next CL
Change-Id: I950c9b5416d66e83d76ca489aeb5e0572e005d5d
Merged-In: I950c9b5416d66e83d76ca489aeb5e0572e005d5d
(cherry picked from commit 4d4f7d6114abff6db05169701c2be98ed79fa95d)
2021-05-27 13:13:17 -07:00
Martin Stjernholm c4f4cedc47 Merge "Drop "prebuilt_" prefixes from names registered in ApexInfo.InApexXxx."
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1719298

Bug: 180325915
Change-Id: I1fd96bad2326612d153fed31308914902f58d3ec
Merged-In: Icbe4e025ce1a4c8dd258ff95d326ca2f27905188
(cherry picked from commit f4c44417a3c769be884ee1c2bdcd95689b5cecb4)
2021-05-27 17:23:16 +00:00
TreeHugger Robot 5ff8e3f567 Merge changes from topic "far-dep-exists" into sc-dev
* changes:
  Check for product variant in addition to core variant.
  Plumb through OtherModuleFarDependencyVariantExists from blueprint.
2021-05-22 12:54:47 +00:00
Martin Stjernholm f7a62e6c73 Merge changes I4e7a7ac5,I0c73361b into sc-dev
* changes:
  Record the actual APEXes that a module is part of.
  Rename InApexes -> InApexVariants
2021-05-21 19:22:15 +00:00
Martin Stjernholm 55d7ed4bbf Merge changes I0c80b546,Ibc673303,I70317eb8 into sc-dev
* changes:
  Skip TestDex2oatToolDeps on Darwin.
  Don't fail if the target module is disabled in dex2oat tool dependencies.
  Use oatdump rather than oatdumpd for boot jar boot.*.oatdump.txt files.
2021-05-21 16:00:02 +00:00
Martin Stjernholm a46656213e Plumb through OtherModuleFarDependencyVariantExists from blueprint.
Test: m nothing
Bug: 188398129
Change-Id: I64147293b6c51b437219e76e9e372fe56b977722
Merged-In: I64147293b6c51b437219e76e9e372fe56b977722
(cherry picked from commit 408ffd8ccadf998a364bfe69aed2faa214853a76)
2021-05-21 11:43:30 +09:00
satayev 95bfbb169f Populate individual classpath_fragments' classpaths.proto configs.
To avoid duplicates on *CLASSPATH environ variables at runtime, remove
split entries from platform-*classpath, i.e. all updatable jars that
have their own classpath fragments should not appear in the
platform-*classpath's classpaths.proto config.

Bug: 180105615
Test: m && launch_cvd; atest CtsClasspathsTestCases
Change-Id: Id2759ab8e106cc183e695bf3509a6ab60ab0ef2a
2021-05-20 19:07:29 +01:00
Jiyong Park 59b9f14173 Record the actual APEXes that a module is part of.
Consider this case:

apex {
    name: "com.android.foo",
    native_libs: ["foo"],
}

override_apex {
    name: "com.mycompany.android.foo",
    base: "com.android.foo",
}

cc_library {
    name: "foo",
}

There are two APEXes defined: "com.android.foo" and
"com.mycompany.android.foo" which is a copy of "com.android.foo" with
some properties overridden (e.g. signing keys).

The module "foo" is mutated into two variants by the apex mutator: the
platform variant and the apex variant. The former has the variation name
"" and the later has "apex<min_api_ver>" which usually is "apex10000".

Internally, the apex variant has an alias "com.android.foo".

ApexInfo.InApexVariants() returns only "com.android.foo" when called for
the module "foo".

We can see that the information that "foo" is also part of
"com.mycompany.android.foo" is completely lost. This is causing problem
when we compare the apex membership by their "soong module name", not
the "apex name". In the example above, the two modules have different
soone module names, but have the same apex name: "com.android.foo".

To fix that, this CL introduces a new field `InApexes` to the `ApexInfo`
struct. It has the actual name of the APEXes that the module is part of.
With the example above, `InApexes` is ["com.android.foo",
"com.mycompany.android.foo"].

Cherry-picked from https://r.android.com/1710529.

Bug: 180325915
Test: m nothing
Test: m nothing on non-AOSP targets with ag/13740887 applied.

Change-Id: I4e7a7ac5495d2e622ba92a4358ed967e066c6c2e
Merged-In: I4e7a7ac5495d2e622ba92a4358ed967e066c6c2e
2021-05-20 17:36:22 +01:00
Jiyong Park 712e8b5b1b Rename InApexes -> InApexVariants
.. in preparation for the upcoming change. This change doesn't alter any
behavior.

InApexes is a misleading name. People expects that it has the list of
soong module names of the APEXes that a module is part of. So, for
example, `core-oj` is a part of both `com.android.art` and
`com.google.android.art`. However, in reality, that's not true. The
field has `com.android.art` only. This is because the two APEXes
(android and Google) have the same apex name which is `com.android.art`.
That apex name is used in various places like the `apex_available` and
allows us to keep using the same name regardless of whether the APEX is
overridden or not.

However, this is causing problems in some cases where the exact list of
soong module names is required. The upcoming change will add a new field
to handle the case and the new field actually will get the name
'InApexes'. So, the existing field is renamed to a less misleading name
`InApexVariants`.

Cherry-picked from https://r.android.com/1710528.

Bug: 180325915
Test: m nothing

Change-Id: I0c73361b452eddb812acd5ebef5dcedaab382436
Merged-In: I0c73361b452eddb812acd5ebef5dcedaab382436
2021-05-20 17:36:22 +01:00
Martin Stjernholm cae43e1c16 Don't fail if the target module is disabled in dex2oat tool
dependencies.

dexpreopt.RegisterToolDeps runs late after prebuilt dependencies have
been resolved, and there's special code in dex2oatPathFromDep to
resolve the prebuilt from the source module. However, if the source
module is disabled then the dependencies check in validateAndroidModule
will complain, so we need to disable that check in this particular
situation.

Also add a comment to explain why dexpreopt.RegisterToolDeps needs to
run so late.

Cherry-picked from https://r.android.com/1711292.

Test: m nothing
Bug: 145934348
Bug: 172480615
Change-Id: Ibc673303d0336768fa23261a2068e91a08f46a30
Merged-In: Ibc673303d0336768fa23261a2068e91a08f46a30
2021-05-20 17:36:02 +01:00
Elliott Hughes 0e9cdb04df cc/linker.go: check min_sdk_version.
Checking sdk_version broke mainline code that compiles against a current
API level but needs to be able to run on an older API level.

Bug: http://b/187907243
Test: treehugger
Change-Id: If1192ef2809e39b043f0a384775b6c9e3a8bd619
2021-05-17 17:52:26 +00:00
Liz Kammer c2a739c9df Merge "Define a narrower context for getting arch props" am: 374623f91f am: f315fbeaa5 am: da4b4457b9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1708382

Change-Id: Ia67aa4f7cebba16a3159bb317270bd7a200d163f
2021-05-14 22:15:54 +00:00
Liz Kammer b6dbc87c97 Define a narrower context for getting arch props
go best practices recommend defining an interface where it is used and
limiting the scope

Test: go test soong tests
Change-Id: I96293ba594d37360b1a8910161477133d4aafdd9
2021-05-14 15:14:40 -04:00
Paul Duffin 011d8e670c Merge "Add support for converting OptionalPath to Paths" am: 17ccf26748 am: 1d579e9694 am: 472325bf8d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1706747

Change-Id: I60d5cdc9e77ed68e9c365986057608649eee770b
2021-05-13 20:31:13 +00:00
Paul Duffin 17ccf26748 Merge "Add support for converting OptionalPath to Paths" 2021-05-13 19:33:09 +00:00
Jingwen Chen 8e27e6c226 Merge "bp2build: build //external/scudo/..." am: ccfd7fc939 am: 58344f0391 am: 1c7591cfb9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1704771

Change-Id: I3665975d656141f7919cce5d80eff25ea7edc9d4
2021-05-13 13:23:04 +00:00
Jingwen Chen ccfd7fc939 Merge "bp2build: build //external/scudo/..." 2021-05-13 12:19:43 +00:00
Paul Duffin ef08185951 Add support for converting OptionalPath to Paths
Appending a Path or Paths to a slice of Paths is simple but appending
an OptionalPath requires conditional logic which makes OptionalPaths
harder to use. This change makes it easy to append the embedded Path,
if any, to a slice of Paths.

Bug: 179354495
Test: m nothing
Change-Id: Ibf80a23043c846162e17c3a98b2590bca653b170
2021-05-13 12:40:08 +01:00
Jingwen Chen d17bb43fe1 Merge "bp2build: export some cc toolchain flags into Starlark." am: 1d35a87072 am: 138b60595c am: a7e79646d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1698426

Change-Id: Iac3a24bb6a528b1281465ed4a354c95ea01e4a59
2021-05-13 11:29:09 +00:00
Jingwen Chen 1d35a87072 Merge "bp2build: export some cc toolchain flags into Starlark." 2021-05-13 10:31:54 +00:00
Paul Duffin b964b24a51 Merge "Allow module types to force creation of a default APEX variant" am: 9896b3424b am: 05ca6f6919 am: 5c45498964
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1705263

Change-Id: I4365d9d1dfbfcd8bf9aa3f6381ec9470b7ff9921
2021-05-13 09:06:26 +00:00
Paul Duffin 9896b3424b Merge "Allow module types to force creation of a default APEX variant" 2021-05-13 08:07:19 +00:00
Jingwen Chen 75be1cae8f bp2build: build //external/scudo/...
Test: TH
Fixes: 187158841
Change-Id: I73c1d8fe075d2534c2389973b9381405d9389044
2021-05-13 06:25:49 +00:00
Jingwen Chen bf61afb7f7 bp2build: export some cc toolchain flags into Starlark.
This CL exports common/global/device/host clang/ld/ldd flags
from their Ninja variable initialization locations in
cc/config/global.go and cc/config/clang.go to make Bazel's cc_toolchain
and Soong's cc actions more consistent with each other.

This does not handle env-dependent or arch-specific toolchain flags
yet (logic in compiler.go and linker.go).

Test: TH
Bug: 187086342
Bug: 187084737
Bug: 186628704
Bug: 187857770
Change-Id: Ie403d7cd23f35160897b9dd902c799cbf1bd7f0c
2021-05-13 06:25:47 +00:00
Treehugger Robot 56c46fc32d Merge changes I2729001d,Ife5d2193 am: 015a0afe07 am: 3c11654140 am: 3a13833166
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1702492

Change-Id: I25c4bc3fd4733bd1c4bd36e5f1262a57c60c4b84
2021-05-12 23:10:26 +00:00
Treehugger Robot 015a0afe07 Merge changes I2729001d,Ife5d2193
* changes:
  packaging: install/package deps if not marked IsHideFromMake
  Generate linker config with packaged items.
2021-05-12 22:08:54 +00:00
Paul Duffin 94c97c1fe3 Merge "Add license modules to the sdk" am: 62fb7438b1 am: f5dae016bb am: 7079601939
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699191

Change-Id: I1807f6d0a0118eb0b96d494c2b52c2e2b4a3c7a1
2021-05-12 15:27:20 +00:00
Paul Duffin 3c8f7522bd Merge "Switch Effective_license_text from []string to Paths" am: fffd98fd16 am: 814d3fffaa am: 18f6703cd7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1702369

Change-Id: Ifab3e0717b65fa16e87a6e2197bbe756db64529f
2021-05-12 15:27:15 +00:00
Paul Duffin 1e4f9077a2 Merge "Move license module processing to GenerateAndroidBuildActions" am: 12f5d04859 am: d2dea2f249 am: a25390436b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699190

Change-Id: Id01bb9e37bf6375f80cff1967fec49c43829d53c
2021-05-12 15:27:00 +00:00
Paul Duffin f46c6f158a Merge "Add baseline test for license with sdk" am: 0d62615468 am: 9fbe8bb506 am: 88a0a1da57
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699189

Change-Id: I6c034823489c9f7f97a019c0f3696e5854d53299
2021-05-12 15:26:41 +00:00
Paul Duffin b5769c15a3 Allow module types to force creation of a default APEX variant
Bug: 187910671
Test: m droid
Change-Id: I797d4ab60d15b526744fe6e4df1b55c8b75b0310
2021-05-12 16:16:51 +01:00
Paul Duffin 62fb7438b1 Merge "Add license modules to the sdk" 2021-05-12 13:28:45 +00:00
Paul Duffin fffd98fd16 Merge "Switch Effective_license_text from []string to Paths" 2021-05-12 13:28:05 +00:00
Paul Duffin 12f5d04859 Merge "Move license module processing to GenerateAndroidBuildActions" 2021-05-12 13:27:15 +00:00
Paul Duffin 0d62615468 Merge "Add baseline test for license with sdk" 2021-05-12 13:27:08 +00:00
Jingwen Chen 0bf1dcc16a bp2build: remove libc_tzcode from denylist. am: 3950cd6ed4 am: 2700ace254 am: 19c563ed78
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1704770

Change-Id: I2c0f87fb73c124d54db0e4a36c9c8e7b8841ee88
2021-05-12 13:18:56 +00:00
Jingwen Chen 3950cd6ed4 bp2build: remove libc_tzcode from denylist.
This now works with --features no_copts_tokenization. With tokenization,
the escaped empty string '\"\"' became an actual empty string '' on the
command line, setting -DWILDABBR to the wrong value.

However, no_copts_tokenization unveiled other problems with Android.bp
flags, such as spaces in existing cflags like
https://cs.android.com/android/platform/superproject/+/master:bionic/libc/Android.bp;l=288;drc=a0a4a6c2967b5b3c02c951ea1145f32ed5564ab9
- this trips up Bazel's copts when generated literally, so the
fix (other than splitting on space and making Soong accept strings that
don't start with dashes as cflags) is to make bp2build split cflags on
spaces before generating them as copts.

Test: bp2build, build bionic/...
Fixes: 186822591
Change-Id: Icf10bd20f6fb81db0b719ca0555fc70c75b91a79
2021-05-12 10:46:15 +00:00
Lukács T. Berki 8da487f9e1 Merge "Make @soong_injection usable in standalone builds." am: b9ebb7dfd8 am: 8178b454a3 am: 3114ff6f5a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1703387

Change-Id: Ia5a5510274a97d7528eb7ada81a4ae56a06f25f5
2021-05-12 07:34:54 +00:00
Lukács T. Berki b9ebb7dfd8 Merge "Make @soong_injection usable in standalone builds." 2021-05-12 06:26:31 +00:00
Jooyung Han 77f7c44246 packaging: install/package deps if not marked IsHideFromMake
TransitivePackagingSpecs() gathers transitive "install/package"
dependencies.

Previously, IsInstallDepNeeded(depTag) was checked. But, in this way,
some stub libraries which are marked as "HideFromMake()" to avoid
install/package can be gathered.

For example, libdexfile is not installed even if it is one of
libdexfile_support's runtime_libs because it is a stub library and the
impl is provided by "art" apex.

So when gathering transitive deps "IsHideFromMake()" is checked and if
the dep is hidden (so, not supposed to be installed) then the dep
(and its deps) is ignored.

Bug: 187686926
Test: m nothing
Test: m microdroid (libdexfile shouldn't be included in system/lib)
Test: m hosttar (no changes)
Change-Id: I2729001d4c64985cf0f2b37440c2082fe912e6c5
2021-05-11 19:03:25 +00:00
Lukacs T. Berki 3069dd9d71 Make @soong_injection usable in standalone builds.
Test: Presubmits.
Change-Id: I942e627f9f7b7428834258ef3ccefb7f1f5c7606
2021-05-11 16:54:29 +02:00
Treehugger Robot ddcf758f8c Merge "Generate empty classpaths.proto for bootclasspath_fragment.go." am: a556647c50 am: 3e51be492f am: 613e4c502a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1699193

Change-Id: Ia92df6204946e3e28341cd27a75d108b657754cc
2021-05-11 13:44:08 +00:00
Treehugger Robot a556647c50 Merge "Generate empty classpaths.proto for bootclasspath_fragment.go." 2021-05-11 12:53:23 +00:00
Paul Duffin b0f46ea0b5 Merge "Add support for name-less modules and property comments" am: 05f86890ee am: b999da770a am: ad98b0248b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1702368

Change-Id: Ic27fc064cf63077f4b572c1327e4fa1f8c5189c9
2021-05-11 10:47:28 +00:00
Paul Duffin 0b6c806c19 Merge "Allow an sdk member type not to provide a bp property" am: bea70fb54e am: a5b2055183 am: 2565f3253b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1702367

Change-Id: Ibf136b5989921a1975fff44359e561145ab3cf2c
2021-05-11 10:47:24 +00:00
Paul Duffin a6b712cae4 Merge "Allow sdk snapshot to contain source module type" am: f08e7c444c am: 5a0a87eb16 am: b212748ee6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1702366

Change-Id: I05f85743062ac39549d9a730b93f30da0f467f34
2021-05-11 10:47:20 +00:00
satayev 3db3547d1f Generate empty classpaths.proto for bootclasspath_fragment.go.
- Adds all required details for bootclasspath_fragment to implement
  classpath_fragment.
- Keeps the actual boot jars in platform-bootclasspath to begin with.
- Makes sure to put the file in apex/etc/classpath on device. Note that
  for platform versions of classpath fragment AndroidMkEntries perform
  the installation, while for APEXes it must be plumbed via apex.go.

Bug: 180105615
Test: m && launch_cvd; atest CtsClasspathsTestCases
Change-Id: I6101ebdf5b8bcbe95c0b7ce21f3f67a2685aef50
2021-05-11 10:34:47 +01:00
Paul Duffin b0bb376efa Add license modules to the sdk
Adds initial support for adding license modules to the sdk, along with
any referenced license text files. There is a number of minor
improvements to be made but the core of the support is there and it
works for ART sdks.

Basically, this change will automatically add license modules
referenced from any sdk member module as an internal sdk member. An
internal module has an sdk snapshot specific name that will not
conflict with the source module and which cannot be referenced from
outside the sdk snapshot.

Bug: 181569894
Test: m art-module-sdk art-module-host-exports art-module-test-exports
      - diff output before and after this change
        made sure that every prebuilt had a licenses field
        and that the license modules were added
Change-Id: I0c5ccabf58f4ef487e42ef8e61a5b2a74c0e81af
2021-05-11 08:28:49 +01:00