dexpreopt_bootjars.go 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962
  1. // Copyright 2019 Google Inc. All rights reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package java
  15. import (
  16. "path/filepath"
  17. "strings"
  18. "android/soong/android"
  19. "android/soong/dexpreopt"
  20. "github.com/google/blueprint/proptools"
  21. )
  22. // =================================================================================================
  23. // WIP - see http://b/177892522 for details
  24. //
  25. // The build support for boot images is currently being migrated away from singleton to modules so
  26. // the documentation may not be strictly accurate. Rather than update the documentation at every
  27. // step which will create a lot of churn the changes that have been made will be listed here and the
  28. // documentation will be updated once it is closer to the final result.
  29. //
  30. // Changes:
  31. // 1) dex_bootjars is now a singleton module and not a plain singleton.
  32. // 2) Boot images are now represented by the boot_image module type.
  33. // 3) The art boot image is called "art-boot-image", the framework boot image is called
  34. // "framework-boot-image".
  35. // 4) They are defined in art/build/boot/Android.bp and frameworks/base/boot/Android.bp
  36. // respectively.
  37. // 5) Each boot_image retrieves the appropriate boot image configuration from the map returned by
  38. // genBootImageConfigs() using the image_name specified in the boot_image module.
  39. // =================================================================================================
  40. // This comment describes:
  41. // 1. ART boot images in general (their types, structure, file layout, etc.)
  42. // 2. build system support for boot images
  43. //
  44. // 1. ART boot images
  45. // ------------------
  46. //
  47. // A boot image in ART is a set of files that contain AOT-compiled native code and a heap snapshot
  48. // of AOT-initialized classes for the bootclasspath Java libraries. A boot image is compiled from a
  49. // set of DEX jars by the dex2oat compiler. A boot image is used for two purposes: 1) it is
  50. // installed on device and loaded at runtime, and 2) other Java libraries and apps are compiled
  51. // against it (compilation may take place either on host, known as "dexpreopt", or on device, known
  52. // as "dexopt").
  53. //
  54. // A boot image is not a single file, but a collection of interrelated files. Each boot image has a
  55. // number of components that correspond to the Java libraries that constitute it. For each component
  56. // there are multiple files:
  57. // - *.oat or *.odex file with native code (architecture-specific, one per instruction set)
  58. // - *.art file with pre-initialized Java classes (architecture-specific, one per instruction set)
  59. // - *.vdex file with verification metadata for the DEX bytecode (architecture independent)
  60. //
  61. // *.vdex files for the boot images do not contain the DEX bytecode itself, because the
  62. // bootclasspath DEX files are stored on disk in uncompressed and aligned form. Consequently a boot
  63. // image is not self-contained and cannot be used without its DEX files. To simplify the management
  64. // of boot image files, ART uses a certain naming scheme and associates the following metadata with
  65. // each boot image:
  66. // - A stem, which is a symbolic name that is prepended to boot image file names.
  67. // - A location (on-device path to the boot image files).
  68. // - A list of boot image locations (on-device paths to dependency boot images).
  69. // - A set of DEX locations (on-device paths to the DEX files, one location for one DEX file used
  70. // to compile the boot image).
  71. //
  72. // There are two kinds of boot images:
  73. // - primary boot images
  74. // - boot image extensions
  75. //
  76. // 1.1. Primary boot images
  77. // ------------------------
  78. //
  79. // A primary boot image is compiled for a core subset of bootclasspath Java libraries. It does not
  80. // depend on any other images, and other boot images may depend on it.
  81. //
  82. // For example, assuming that the stem is "boot", the location is /apex/com.android.art/javalib/,
  83. // the set of core bootclasspath libraries is A B C, and the boot image is compiled for ARM targets
  84. // (32 and 64 bits), it will have three components with the following files:
  85. // - /apex/com.android.art/javalib/{arm,arm64}/boot.{art,oat,vdex}
  86. // - /apex/com.android.art/javalib/{arm,arm64}/boot-B.{art,oat,vdex}
  87. // - /apex/com.android.art/javalib/{arm,arm64}/boot-C.{art,oat,vdex}
  88. //
  89. // The files of the first component are special: they do not have the component name appended after
  90. // the stem. This naming convention dates back to the times when the boot image was not split into
  91. // components, and there were just boot.oat and boot.art. The decision to split was motivated by
  92. // licensing reasons for one of the bootclasspath libraries.
  93. //
  94. // As of November 2020 the only primary boot image in Android is the image in the ART APEX
  95. // com.android.art. The primary ART boot image contains the Core libraries that are part of the ART
  96. // module. When the ART module gets updated, the primary boot image will be updated with it, and all
  97. // dependent images will get invalidated (the checksum of the primary image stored in dependent
  98. // images will not match), unless they are updated in sync with the ART module.
  99. //
  100. // 1.2. Boot image extensions
  101. // --------------------------
  102. //
  103. // A boot image extension is compiled for a subset of bootclasspath Java libraries (in particular,
  104. // this subset does not include the Core bootclasspath libraries that go into the primary boot
  105. // image). A boot image extension depends on the primary boot image and optionally some other boot
  106. // image extensions. Other images may depend on it. In other words, boot image extensions can form
  107. // acyclic dependency graphs.
  108. //
  109. // The motivation for boot image extensions comes from the Mainline project. Consider a situation
  110. // when the list of bootclasspath libraries is A B C, and both A and B are parts of the Android
  111. // platform, but C is part of an updatable APEX com.android.C. When the APEX is updated, the Java
  112. // code for C might have changed compared to the code that was used to compile the boot image.
  113. // Consequently, the whole boot image is obsolete and invalidated (even though the code for A and B
  114. // that does not depend on C is up to date). To avoid this, the original monolithic boot image is
  115. // split in two parts: the primary boot image that contains A B, and the boot image extension that
  116. // contains C and depends on the primary boot image (extends it).
  117. //
  118. // For example, assuming that the stem is "boot", the location is /system/framework, the set of
  119. // bootclasspath libraries is D E (where D is part of the platform and is located in
  120. // /system/framework, and E is part of a non-updatable APEX com.android.E and is located in
  121. // /apex/com.android.E/javalib), and the boot image is compiled for ARM targets (32 and 64 bits),
  122. // it will have two components with the following files:
  123. // - /system/framework/{arm,arm64}/boot-D.{art,oat,vdex}
  124. // - /system/framework/{arm,arm64}/boot-E.{art,oat,vdex}
  125. //
  126. // As of November 2020 the only boot image extension in Android is the Framework boot image
  127. // extension. It extends the primary ART boot image and contains Framework libraries and other
  128. // bootclasspath libraries from the platform and non-updatable APEXes that are not included in the
  129. // ART image. The Framework boot image extension is updated together with the platform. In the
  130. // future other boot image extensions may be added for some updatable modules.
  131. //
  132. //
  133. // 2. Build system support for boot images
  134. // ---------------------------------------
  135. //
  136. // The primary ART boot image needs to be compiled with one dex2oat invocation that depends on DEX
  137. // jars for the core libraries. Framework boot image extension needs to be compiled with one dex2oat
  138. // invocation that depends on the primary ART boot image and all bootclasspath DEX jars except the
  139. // core libraries as they are already part of the primary ART boot image.
  140. //
  141. // 2.1. Libraries that go in the boot images
  142. // -----------------------------------------
  143. //
  144. // The contents of each boot image are determined by the PRODUCT variables. The primary ART APEX
  145. // boot image contains libraries listed in the ART_APEX_JARS variable in the AOSP makefiles. The
  146. // Framework boot image extension contains libraries specified in the PRODUCT_BOOT_JARS and
  147. // PRODUCT_BOOT_JARS_EXTRA variables. The AOSP makefiles specify some common Framework libraries,
  148. // but more product-specific libraries can be added in the product makefiles.
  149. //
  150. // Each component of the PRODUCT_BOOT_JARS and PRODUCT_BOOT_JARS_EXTRA variables is a
  151. // colon-separated pair <apex>:<library>, where <apex> is the variant name of a non-updatable APEX,
  152. // "platform" if the library is a part of the platform in the system partition, or "system_ext" if
  153. // it's in the system_ext partition.
  154. //
  155. // In these variables APEXes are identified by their "variant names", i.e. the names they get
  156. // mounted as in /apex on device. In Soong modules that is the name set in the "apex_name"
  157. // properties, which default to the "name" values. For example, many APEXes have both
  158. // com.android.xxx and com.google.android.xxx modules in Soong, but take the same place
  159. // /apex/com.android.xxx at runtime. In these cases the variant name is always com.android.xxx,
  160. // regardless which APEX goes into the product. See also android.ApexInfo.ApexVariationName and
  161. // apex.apexBundleProperties.Apex_name.
  162. //
  163. // A related variable PRODUCT_APEX_BOOT_JARS contains bootclasspath libraries that are in APEXes.
  164. // They are not included in the boot image. The only exception here are ART jars and core-icu4j.jar
  165. // that have been historically part of the boot image and are now in apexes; they are in boot images
  166. // and core-icu4j.jar is generally treated as being part of PRODUCT_BOOT_JARS.
  167. //
  168. // One exception to the above rules are "coverage" builds (a special build flavor which requires
  169. // setting environment variable EMMA_INSTRUMENT_FRAMEWORK=true). In coverage builds the Java code in
  170. // boot image libraries is instrumented, which means that the instrumentation library (jacocoagent)
  171. // needs to be added to the list of bootclasspath DEX jars.
  172. //
  173. // In general, there is a requirement that the source code for a boot image library must be
  174. // available at build time (e.g. it cannot be a stub that has a separate implementation library).
  175. //
  176. // 2.2. Static configs
  177. // -------------------
  178. //
  179. // Because boot images are used to dexpreopt other Java modules, the paths to boot image files must
  180. // be known by the time dexpreopt build rules for the dependent modules are generated. Boot image
  181. // configs are constructed very early during the build, before build rule generation. The configs
  182. // provide predefined paths to boot image files (these paths depend only on static build
  183. // configuration, such as PRODUCT variables, and use hard-coded directory names).
  184. //
  185. // 2.3. Singleton
  186. // --------------
  187. //
  188. // Build rules for the boot images are generated with a Soong singleton. Because a singleton has no
  189. // dependencies on other modules, it has to find the modules for the DEX jars using VisitAllModules.
  190. // Soong loops through all modules and compares each module against a list of bootclasspath library
  191. // names. Then it generates build rules that copy DEX jars from their intermediate module-specific
  192. // locations to the hard-coded locations predefined in the boot image configs.
  193. //
  194. // It would be possible to use a module with proper dependencies instead, but that would require
  195. // changes in the way Soong generates variables for Make: a singleton can use one MakeVars() method
  196. // that writes variables to out/soong/make_vars-*.mk, which is included early by the main makefile,
  197. // but module(s) would have to use out/soong/Android-*.mk which has a group of LOCAL_* variables
  198. // for each module, and is included later.
  199. //
  200. // 2.4. Install rules
  201. // ------------------
  202. //
  203. // The primary boot image and the Framework extension are installed in different ways. The primary
  204. // boot image is part of the ART APEX: it is copied into the APEX intermediate files, packaged
  205. // together with other APEX contents, extracted and mounted on device. The Framework boot image
  206. // extension is installed by the rules defined in makefiles (make/core/dex_preopt_libart.mk). Soong
  207. // writes out a few DEXPREOPT_IMAGE_* variables for Make; these variables contain boot image names,
  208. // paths and so on.
  209. //
  210. var artApexNames = []string{
  211. "com.android.art",
  212. "com.android.art.debug",
  213. "com.android.art.testing",
  214. "com.google.android.art",
  215. "com.google.android.art.debug",
  216. "com.google.android.art.testing",
  217. }
  218. func init() {
  219. RegisterDexpreoptBootJarsComponents(android.InitRegistrationContext)
  220. }
  221. // Target-independent description of a boot image.
  222. type bootImageConfig struct {
  223. // If this image is an extension, the image that it extends.
  224. extends *bootImageConfig
  225. // Image name (used in directory names and ninja rule names).
  226. name string
  227. // Basename of the image: the resulting filenames are <stem>[-<jar>].{art,oat,vdex}.
  228. stem string
  229. // Output directory for the image files.
  230. dir android.OutputPath
  231. // Output directory for the image files with debug symbols.
  232. symbolsDir android.OutputPath
  233. // Subdirectory where the image files are installed.
  234. installDirOnHost string
  235. // Subdirectory where the image files on device are installed.
  236. installDirOnDevice string
  237. // Install path of the boot image profile if it needs to be installed in the APEX, or empty if not
  238. // needed.
  239. profileInstallPathInApex string
  240. // A list of (location, jar) pairs for the Java modules in this image.
  241. modules android.ConfiguredJarList
  242. // File paths to jars.
  243. dexPaths android.WritablePaths // for this image
  244. dexPathsDeps android.WritablePaths // for the dependency images and in this image
  245. // Map from module name (without prebuilt_ prefix) to the predefined build path.
  246. dexPathsByModule map[string]android.WritablePath
  247. // File path to a zip archive with all image files (or nil, if not needed).
  248. zip android.WritablePath
  249. // Rules which should be used in make to install the outputs.
  250. profileInstalls android.RuleBuilderInstalls
  251. // Path to the license metadata file for the module that built the profile.
  252. profileLicenseMetadataFile android.OptionalPath
  253. // Path to the image profile file on host (or empty, if profile is not generated).
  254. profilePathOnHost android.Path
  255. // Target-dependent fields.
  256. variants []*bootImageVariant
  257. // Path of the preloaded classes file.
  258. preloadedClassesFile string
  259. }
  260. // Target-dependent description of a boot image.
  261. type bootImageVariant struct {
  262. *bootImageConfig
  263. // Target for which the image is generated.
  264. target android.Target
  265. // The "locations" of jars.
  266. dexLocations []string // for this image
  267. dexLocationsDeps []string // for the dependency images and in this image
  268. // Paths to image files.
  269. imagePathOnHost android.OutputPath // first image file path on host
  270. imagePathOnDevice string // first image file path on device
  271. // All the files that constitute this image variant, i.e. .art, .oat and .vdex files.
  272. imagesDeps android.OutputPaths
  273. // The path to the primary image variant's imagePathOnHost field, where primary image variant
  274. // means the image variant that this extends.
  275. //
  276. // This is only set for a variant of an image that extends another image.
  277. primaryImages android.OutputPath
  278. // The paths to the primary image variant's imagesDeps field, where primary image variant
  279. // means the image variant that this extends.
  280. //
  281. // This is only set for a variant of an image that extends another image.
  282. primaryImagesDeps android.Paths
  283. // Rules which should be used in make to install the outputs on host.
  284. installs android.RuleBuilderInstalls
  285. vdexInstalls android.RuleBuilderInstalls
  286. unstrippedInstalls android.RuleBuilderInstalls
  287. // Rules which should be used in make to install the outputs on device.
  288. deviceInstalls android.RuleBuilderInstalls
  289. // Path to the license metadata file for the module that built the image.
  290. licenseMetadataFile android.OptionalPath
  291. }
  292. // Get target-specific boot image variant for the given boot image config and target.
  293. func (image bootImageConfig) getVariant(target android.Target) *bootImageVariant {
  294. for _, variant := range image.variants {
  295. if variant.target.Os == target.Os && variant.target.Arch.ArchType == target.Arch.ArchType {
  296. return variant
  297. }
  298. }
  299. return nil
  300. }
  301. // Return any (the first) variant which is for the device (as opposed to for the host).
  302. func (image bootImageConfig) getAnyAndroidVariant() *bootImageVariant {
  303. for _, variant := range image.variants {
  304. if variant.target.Os == android.Android {
  305. return variant
  306. }
  307. }
  308. return nil
  309. }
  310. // Return the name of a boot image module given a boot image config and a component (module) index.
  311. // A module name is a combination of the Java library name, and the boot image stem (that is stored
  312. // in the config).
  313. func (image bootImageConfig) moduleName(ctx android.PathContext, idx int) string {
  314. // The first module of the primary boot image is special: its module name has only the stem, but
  315. // not the library name. All other module names are of the form <stem>-<library name>
  316. m := image.modules.Jar(idx)
  317. name := image.stem
  318. if idx != 0 || image.extends != nil {
  319. name += "-" + android.ModuleStem(m)
  320. }
  321. return name
  322. }
  323. // Return the name of the first boot image module, or stem if the list of modules is empty.
  324. func (image bootImageConfig) firstModuleNameOrStem(ctx android.PathContext) string {
  325. if image.modules.Len() > 0 {
  326. return image.moduleName(ctx, 0)
  327. } else {
  328. return image.stem
  329. }
  330. }
  331. // Return filenames for the given boot image component, given the output directory and a list of
  332. // extensions.
  333. func (image bootImageConfig) moduleFiles(ctx android.PathContext, dir android.OutputPath, exts ...string) android.OutputPaths {
  334. ret := make(android.OutputPaths, 0, image.modules.Len()*len(exts))
  335. for i := 0; i < image.modules.Len(); i++ {
  336. name := image.moduleName(ctx, i)
  337. for _, ext := range exts {
  338. ret = append(ret, dir.Join(ctx, name+ext))
  339. }
  340. }
  341. return ret
  342. }
  343. // apexVariants returns a list of all *bootImageVariant that could be included in an apex.
  344. func (image *bootImageConfig) apexVariants() []*bootImageVariant {
  345. variants := []*bootImageVariant{}
  346. for _, variant := range image.variants {
  347. // We also generate boot images for host (for testing), but we don't need those in the apex.
  348. // TODO(b/177892522) - consider changing this to check Os.OsClass = android.Device
  349. if variant.target.Os == android.Android {
  350. variants = append(variants, variant)
  351. }
  352. }
  353. return variants
  354. }
  355. // Returns true if the boot image should be installed in the APEX.
  356. func (image *bootImageConfig) shouldInstallInApex() bool {
  357. return strings.HasPrefix(image.installDirOnDevice, "apex/")
  358. }
  359. // Return boot image locations (as a list of symbolic paths).
  360. //
  361. // The image "location" is a symbolic path that, with multiarchitecture support, doesn't really
  362. // exist on the device. Typically it is /apex/com.android.art/javalib/boot.art and should be the
  363. // same for all supported architectures on the device. The concrete architecture specific files
  364. // actually end up in architecture-specific sub-directory such as arm, arm64, x86, or x86_64.
  365. //
  366. // For example a physical file /apex/com.android.art/javalib/x86/boot.art has "image location"
  367. // /apex/com.android.art/javalib/boot.art (which is not an actual file).
  368. //
  369. // For a primary boot image the list of locations has a single element.
  370. //
  371. // For a boot image extension the list of locations contains a location for all dependency images
  372. // (including the primary image) and the location of the extension itself. For example, for the
  373. // Framework boot image extension that depends on the primary ART boot image the list contains two
  374. // elements.
  375. //
  376. // The location is passed as an argument to the ART tools like dex2oat instead of the real path.
  377. // ART tools will then reconstruct the architecture-specific real path.
  378. func (image *bootImageVariant) imageLocations() (imageLocationsOnHost []string, imageLocationsOnDevice []string) {
  379. if image.extends != nil {
  380. imageLocationsOnHost, imageLocationsOnDevice = image.extends.getVariant(image.target).imageLocations()
  381. }
  382. return append(imageLocationsOnHost, dexpreopt.PathToLocation(image.imagePathOnHost, image.target.Arch.ArchType)),
  383. append(imageLocationsOnDevice, dexpreopt.PathStringToLocation(image.imagePathOnDevice, image.target.Arch.ArchType))
  384. }
  385. func dexpreoptBootJarsFactory() android.SingletonModule {
  386. m := &dexpreoptBootJars{}
  387. android.InitAndroidModule(m)
  388. return m
  389. }
  390. func RegisterDexpreoptBootJarsComponents(ctx android.RegistrationContext) {
  391. ctx.RegisterSingletonModuleType("dex_bootjars", dexpreoptBootJarsFactory)
  392. }
  393. func SkipDexpreoptBootJars(ctx android.PathContext) bool {
  394. return dexpreopt.GetGlobalConfig(ctx).DisablePreoptBootImages
  395. }
  396. // Singleton module for generating boot image build rules.
  397. type dexpreoptBootJars struct {
  398. android.SingletonModuleBase
  399. // Default boot image config (currently always the Framework boot image extension). It should be
  400. // noted that JIT-Zygote builds use ART APEX image instead of the Framework boot image extension,
  401. // but the switch is handled not here, but in the makefiles (triggered with
  402. // DEXPREOPT_USE_ART_IMAGE=true).
  403. defaultBootImage *bootImageConfig
  404. // Other boot image configs (currently the list contains only the primary ART APEX image. It
  405. // used to contain an experimental JIT-Zygote image (now replaced with the ART APEX image). In
  406. // the future other boot image extensions may be added.
  407. otherImages []*bootImageConfig
  408. // Build path to a config file that Soong writes for Make (to be used in makefiles that install
  409. // the default boot image).
  410. dexpreoptConfigForMake android.WritablePath
  411. }
  412. // Provide paths to boot images for use by modules that depend upon them.
  413. //
  414. // The build rules are created in GenerateSingletonBuildActions().
  415. func (d *dexpreoptBootJars) GenerateAndroidBuildActions(ctx android.ModuleContext) {
  416. // Placeholder for now.
  417. }
  418. // Generate build rules for boot images.
  419. func (d *dexpreoptBootJars) GenerateSingletonBuildActions(ctx android.SingletonContext) {
  420. if SkipDexpreoptBootJars(ctx) {
  421. return
  422. }
  423. if dexpreopt.GetCachedGlobalSoongConfig(ctx) == nil {
  424. // No module has enabled dexpreopting, so we assume there will be no boot image to make.
  425. return
  426. }
  427. d.dexpreoptConfigForMake = android.PathForOutput(ctx, ctx.Config().DeviceName(), "dexpreopt.config")
  428. writeGlobalConfigForMake(ctx, d.dexpreoptConfigForMake)
  429. global := dexpreopt.GetGlobalConfig(ctx)
  430. if !shouldBuildBootImages(ctx.Config(), global) {
  431. return
  432. }
  433. defaultImageConfig := defaultBootImageConfig(ctx)
  434. d.defaultBootImage = defaultImageConfig
  435. artBootImageConfig := artBootImageConfig(ctx)
  436. d.otherImages = []*bootImageConfig{artBootImageConfig}
  437. }
  438. // shouldBuildBootImages determines whether boot images should be built.
  439. func shouldBuildBootImages(config android.Config, global *dexpreopt.GlobalConfig) bool {
  440. // Skip recompiling the boot image for the second sanitization phase. We'll get separate paths
  441. // and invalidate first-stage artifacts which are crucial to SANITIZE_LITE builds.
  442. // Note: this is technically incorrect. Compiled code contains stack checks which may depend
  443. // on ASAN settings.
  444. if len(config.SanitizeDevice()) == 1 && config.SanitizeDevice()[0] == "address" && global.SanitizeLite {
  445. return false
  446. }
  447. return true
  448. }
  449. // copyBootJarsToPredefinedLocations generates commands that will copy boot jars to predefined
  450. // paths in the global config.
  451. func copyBootJarsToPredefinedLocations(ctx android.ModuleContext, srcBootDexJarsByModule bootDexJarByModule, dstBootJarsByModule map[string]android.WritablePath) {
  452. // Create the super set of module names.
  453. names := []string{}
  454. names = append(names, android.SortedStringKeys(srcBootDexJarsByModule)...)
  455. names = append(names, android.SortedStringKeys(dstBootJarsByModule)...)
  456. names = android.SortedUniqueStrings(names)
  457. for _, name := range names {
  458. src := srcBootDexJarsByModule[name]
  459. dst := dstBootJarsByModule[name]
  460. if src == nil {
  461. // A dex boot jar should be provided by the source java module. It needs to be installable or
  462. // have compile_dex=true - cf. assignments to java.Module.dexJarFile.
  463. //
  464. // However, the source java module may be either replaced or overridden (using prefer:true) by
  465. // a prebuilt java module with the same name. In that case the dex boot jar needs to be
  466. // provided by the corresponding prebuilt APEX module. That APEX is the one that refers
  467. // through a exported_(boot|systemserver)classpath_fragments property to a
  468. // prebuilt_(boot|systemserver)classpath_fragment module, which in turn lists the prebuilt
  469. // java module in the contents property. If that chain is broken then this dependency will
  470. // fail.
  471. if !ctx.Config().AllowMissingDependencies() {
  472. ctx.ModuleErrorf("module %s does not provide a dex boot jar (see comment next to this message in Soong for details)", name)
  473. } else {
  474. ctx.AddMissingDependencies([]string{name})
  475. }
  476. } else if dst == nil {
  477. ctx.ModuleErrorf("module %s is not part of the boot configuration", name)
  478. } else {
  479. ctx.Build(pctx, android.BuildParams{
  480. Rule: android.Cp,
  481. Input: src,
  482. Output: dst,
  483. })
  484. }
  485. }
  486. }
  487. // buildBootImageVariantsForAndroidOs generates rules to build the boot image variants for the
  488. // android.Android OsType and returns a map from the architectures to the paths of the generated
  489. // boot image files.
  490. //
  491. // The paths are returned because they are needed elsewhere in Soong, e.g. for populating an APEX.
  492. func buildBootImageVariantsForAndroidOs(ctx android.ModuleContext, image *bootImageConfig, profile android.WritablePath) bootImageFilesByArch {
  493. return buildBootImageForOsType(ctx, image, profile, android.Android)
  494. }
  495. // buildBootImageVariantsForBuildOs generates rules to build the boot image variants for the
  496. // config.BuildOS OsType, i.e. the type of OS on which the build is being running.
  497. //
  498. // The files need to be generated into their predefined location because they are used from there
  499. // both within Soong and outside, e.g. for ART based host side testing and also for use by some
  500. // cloud based tools. However, they are not needed by callers of this function and so the paths do
  501. // not need to be returned from this func, unlike the buildBootImageVariantsForAndroidOs func.
  502. func buildBootImageVariantsForBuildOs(ctx android.ModuleContext, image *bootImageConfig, profile android.WritablePath) {
  503. buildBootImageForOsType(ctx, image, profile, ctx.Config().BuildOS)
  504. }
  505. // buildBootImageForOsType takes a bootImageConfig, a profile file and an android.OsType
  506. // boot image files are required for and it creates rules to build the boot image
  507. // files for all the required architectures for them.
  508. //
  509. // It returns a map from android.ArchType to the predefined paths of the boot image files.
  510. func buildBootImageForOsType(ctx android.ModuleContext, image *bootImageConfig, profile android.WritablePath, requiredOsType android.OsType) bootImageFilesByArch {
  511. filesByArch := bootImageFilesByArch{}
  512. for _, variant := range image.variants {
  513. if variant.target.Os == requiredOsType {
  514. buildBootImageVariant(ctx, variant, profile)
  515. filesByArch[variant.target.Arch.ArchType] = variant.imagesDeps.Paths()
  516. }
  517. }
  518. return filesByArch
  519. }
  520. // buildBootImageZipInPredefinedLocation generates a zip file containing all the boot image files.
  521. //
  522. // The supplied filesByArch is nil when the boot image files have not been generated. Otherwise, it
  523. // is a map from android.ArchType to the predefined locations.
  524. func buildBootImageZipInPredefinedLocation(ctx android.ModuleContext, image *bootImageConfig, filesByArch bootImageFilesByArch) {
  525. if filesByArch == nil {
  526. return
  527. }
  528. // Compute the list of files from all the architectures.
  529. zipFiles := android.Paths{}
  530. for _, archType := range android.ArchTypeList() {
  531. zipFiles = append(zipFiles, filesByArch[archType]...)
  532. }
  533. rule := android.NewRuleBuilder(pctx, ctx)
  534. rule.Command().
  535. BuiltTool("soong_zip").
  536. FlagWithOutput("-o ", image.zip).
  537. FlagWithArg("-C ", image.dir.Join(ctx, android.Android.String()).String()).
  538. FlagWithInputList("-f ", zipFiles, " -f ")
  539. rule.Build("zip_"+image.name, "zip "+image.name+" image")
  540. }
  541. // Generate boot image build rules for a specific target.
  542. func buildBootImageVariant(ctx android.ModuleContext, image *bootImageVariant, profile android.Path) {
  543. globalSoong := dexpreopt.GetGlobalSoongConfig(ctx)
  544. global := dexpreopt.GetGlobalConfig(ctx)
  545. arch := image.target.Arch.ArchType
  546. os := image.target.Os.String() // We need to distinguish host-x86 and device-x86.
  547. symbolsDir := image.symbolsDir.Join(ctx, os, image.installDirOnHost, arch.String())
  548. symbolsFile := symbolsDir.Join(ctx, image.stem+".oat")
  549. outputDir := image.dir.Join(ctx, os, image.installDirOnHost, arch.String())
  550. outputPath := outputDir.Join(ctx, image.stem+".oat")
  551. oatLocation := dexpreopt.PathToLocation(outputPath, arch)
  552. imagePath := outputPath.ReplaceExtension(ctx, "art")
  553. rule := android.NewRuleBuilder(pctx, ctx)
  554. rule.Command().Text("mkdir").Flag("-p").Flag(symbolsDir.String())
  555. rule.Command().Text("rm").Flag("-f").
  556. Flag(symbolsDir.Join(ctx, "*.art").String()).
  557. Flag(symbolsDir.Join(ctx, "*.oat").String()).
  558. Flag(symbolsDir.Join(ctx, "*.invocation").String())
  559. rule.Command().Text("rm").Flag("-f").
  560. Flag(outputDir.Join(ctx, "*.art").String()).
  561. Flag(outputDir.Join(ctx, "*.oat").String()).
  562. Flag(outputDir.Join(ctx, "*.invocation").String())
  563. cmd := rule.Command()
  564. extraFlags := ctx.Config().Getenv("ART_BOOT_IMAGE_EXTRA_ARGS")
  565. if extraFlags == "" {
  566. // Use ANDROID_LOG_TAGS to suppress most logging by default...
  567. cmd.Text(`ANDROID_LOG_TAGS="*:e"`)
  568. } else {
  569. // ...unless the boot image is generated specifically for testing, then allow all logging.
  570. cmd.Text(`ANDROID_LOG_TAGS="*:v"`)
  571. }
  572. invocationPath := outputPath.ReplaceExtension(ctx, "invocation")
  573. cmd.Tool(globalSoong.Dex2oat).
  574. Flag("--avoid-storing-invocation").
  575. FlagWithOutput("--write-invocation-to=", invocationPath).ImplicitOutput(invocationPath).
  576. Flag("--runtime-arg").FlagWithArg("-Xms", global.Dex2oatImageXms).
  577. Flag("--runtime-arg").FlagWithArg("-Xmx", global.Dex2oatImageXmx)
  578. if profile != nil {
  579. cmd.FlagWithInput("--profile-file=", profile)
  580. }
  581. dirtyImageFile := "frameworks/base/config/dirty-image-objects"
  582. dirtyImagePath := android.ExistentPathForSource(ctx, dirtyImageFile)
  583. if dirtyImagePath.Valid() {
  584. cmd.FlagWithInput("--dirty-image-objects=", dirtyImagePath.Path())
  585. }
  586. if image.extends != nil {
  587. // It is a boot image extension, so it needs the boot image it depends on (in this case the
  588. // primary ART APEX image).
  589. artImage := image.primaryImages
  590. cmd.
  591. Flag("--runtime-arg").FlagWithInputList("-Xbootclasspath:", image.dexPathsDeps.Paths(), ":").
  592. Flag("--runtime-arg").FlagWithList("-Xbootclasspath-locations:", image.dexLocationsDeps, ":").
  593. // Add the path to the first file in the boot image with the arch specific directory removed,
  594. // dex2oat will reconstruct the path to the actual file when it needs it. As the actual path
  595. // to the file cannot be passed to the command make sure to add the actual path as an Implicit
  596. // dependency to ensure that it is built before the command runs.
  597. FlagWithArg("--boot-image=", dexpreopt.PathToLocation(artImage, arch)).Implicit(artImage).
  598. // Similarly, the dex2oat tool will automatically find the paths to other files in the base
  599. // boot image so make sure to add them as implicit dependencies to ensure that they are built
  600. // before this command is run.
  601. Implicits(image.primaryImagesDeps)
  602. } else {
  603. // It is a primary image, so it needs a base address.
  604. cmd.FlagWithArg("--base=", ctx.Config().LibartImgDeviceBaseAddress())
  605. }
  606. // We always expect a preloaded classes file to be available. However, if we cannot find it, it's
  607. // OK to not pass the flag to dex2oat.
  608. preloadedClassesPath := android.ExistentPathForSource(ctx, image.preloadedClassesFile)
  609. if preloadedClassesPath.Valid() {
  610. cmd.FlagWithInput("--preloaded-classes=", preloadedClassesPath.Path())
  611. }
  612. cmd.
  613. FlagForEachInput("--dex-file=", image.dexPaths.Paths()).
  614. FlagForEachArg("--dex-location=", image.dexLocations).
  615. Flag("--generate-debug-info").
  616. Flag("--generate-build-id").
  617. Flag("--image-format=lz4hc").
  618. FlagWithArg("--oat-symbols=", symbolsFile.String()).
  619. Flag("--strip").
  620. FlagWithArg("--oat-file=", outputPath.String()).
  621. FlagWithArg("--oat-location=", oatLocation).
  622. FlagWithArg("--image=", imagePath.String()).
  623. FlagWithArg("--instruction-set=", arch.String()).
  624. FlagWithArg("--android-root=", global.EmptyDirectory).
  625. FlagWithArg("--no-inline-from=", "core-oj.jar").
  626. Flag("--force-determinism").
  627. Flag("--abort-on-hard-verifier-error")
  628. // Use the default variant/features for host builds.
  629. // The map below contains only device CPU info (which might be x86 on some devices).
  630. if image.target.Os == android.Android {
  631. cmd.FlagWithArg("--instruction-set-variant=", global.CpuVariant[arch])
  632. cmd.FlagWithArg("--instruction-set-features=", global.InstructionSetFeatures[arch])
  633. }
  634. if global.BootFlags != "" {
  635. cmd.Flag(global.BootFlags)
  636. }
  637. if extraFlags != "" {
  638. cmd.Flag(extraFlags)
  639. }
  640. cmd.Textf(`|| ( echo %s ; false )`, proptools.ShellEscape(failureMessage))
  641. installDir := filepath.Join("/", image.installDirOnHost, arch.String())
  642. var vdexInstalls android.RuleBuilderInstalls
  643. var unstrippedInstalls android.RuleBuilderInstalls
  644. var deviceInstalls android.RuleBuilderInstalls
  645. for _, artOrOat := range image.moduleFiles(ctx, outputDir, ".art", ".oat") {
  646. cmd.ImplicitOutput(artOrOat)
  647. // Install the .oat and .art files
  648. rule.Install(artOrOat, filepath.Join(installDir, artOrOat.Base()))
  649. }
  650. for _, vdex := range image.moduleFiles(ctx, outputDir, ".vdex") {
  651. cmd.ImplicitOutput(vdex)
  652. // Note that the vdex files are identical between architectures.
  653. // Make rules will create symlinks to share them between architectures.
  654. vdexInstalls = append(vdexInstalls,
  655. android.RuleBuilderInstall{vdex, filepath.Join(installDir, vdex.Base())})
  656. }
  657. for _, unstrippedOat := range image.moduleFiles(ctx, symbolsDir, ".oat") {
  658. cmd.ImplicitOutput(unstrippedOat)
  659. // Install the unstripped oat files. The Make rules will put these in $(TARGET_OUT_UNSTRIPPED)
  660. unstrippedInstalls = append(unstrippedInstalls,
  661. android.RuleBuilderInstall{unstrippedOat, filepath.Join(installDir, unstrippedOat.Base())})
  662. }
  663. if image.installDirOnHost != image.installDirOnDevice && !image.shouldInstallInApex() && !ctx.Config().UnbundledBuild() {
  664. installDirOnDevice := filepath.Join("/", image.installDirOnDevice, arch.String())
  665. for _, file := range image.moduleFiles(ctx, outputDir, ".art", ".oat", ".vdex") {
  666. deviceInstalls = append(deviceInstalls,
  667. android.RuleBuilderInstall{file, filepath.Join(installDirOnDevice, file.Base())})
  668. }
  669. }
  670. rule.Build(image.name+"JarsDexpreopt_"+image.target.String(), "dexpreopt "+image.name+" jars "+arch.String())
  671. // save output and installed files for makevars
  672. image.installs = rule.Installs()
  673. image.vdexInstalls = vdexInstalls
  674. image.unstrippedInstalls = unstrippedInstalls
  675. image.deviceInstalls = deviceInstalls
  676. image.licenseMetadataFile = android.OptionalPathForPath(ctx.LicenseMetadataFile())
  677. }
  678. const failureMessage = `ERROR: Dex2oat failed to compile a boot image.
  679. It is likely that the boot classpath is inconsistent.
  680. Rebuild with ART_BOOT_IMAGE_EXTRA_ARGS="--runtime-arg -verbose:verifier" to see verification errors.`
  681. func bootImageProfileRule(ctx android.ModuleContext, image *bootImageConfig) android.WritablePath {
  682. globalSoong := dexpreopt.GetGlobalSoongConfig(ctx)
  683. global := dexpreopt.GetGlobalConfig(ctx)
  684. if global.DisableGenerateProfile {
  685. return nil
  686. }
  687. defaultProfile := "frameworks/base/config/boot-image-profile.txt"
  688. extraProfile := "frameworks/base/config/boot-image-profile-extra.txt"
  689. rule := android.NewRuleBuilder(pctx, ctx)
  690. var profiles android.Paths
  691. if len(global.BootImageProfiles) > 0 {
  692. profiles = append(profiles, global.BootImageProfiles...)
  693. } else if path := android.ExistentPathForSource(ctx, defaultProfile); path.Valid() {
  694. profiles = append(profiles, path.Path())
  695. } else {
  696. // No profile (not even a default one, which is the case on some branches
  697. // like master-art-host that don't have frameworks/base).
  698. // Return nil and continue without profile.
  699. return nil
  700. }
  701. if path := android.ExistentPathForSource(ctx, extraProfile); path.Valid() {
  702. profiles = append(profiles, path.Path())
  703. }
  704. bootImageProfile := image.dir.Join(ctx, "boot-image-profile.txt")
  705. rule.Command().Text("cat").Inputs(profiles).Text(">").Output(bootImageProfile)
  706. profile := image.dir.Join(ctx, "boot.prof")
  707. rule.Command().
  708. Text(`ANDROID_LOG_TAGS="*:e"`).
  709. Tool(globalSoong.Profman).
  710. Flag("--output-profile-type=boot").
  711. FlagWithInput("--create-profile-from=", bootImageProfile).
  712. FlagForEachInput("--apk=", image.dexPathsDeps.Paths()).
  713. FlagForEachArg("--dex-location=", image.getAnyAndroidVariant().dexLocationsDeps).
  714. FlagWithOutput("--reference-profile-file=", profile)
  715. if image == defaultBootImageConfig(ctx) {
  716. rule.Install(profile, "/system/etc/boot-image.prof")
  717. image.profileInstalls = append(image.profileInstalls, rule.Installs()...)
  718. image.profileLicenseMetadataFile = android.OptionalPathForPath(ctx.LicenseMetadataFile())
  719. }
  720. rule.Build("bootJarsProfile", "profile boot jars")
  721. image.profilePathOnHost = profile
  722. return profile
  723. }
  724. // bootFrameworkProfileRule generates the rule to create the boot framework profile and
  725. // returns a path to the generated file.
  726. func bootFrameworkProfileRule(ctx android.ModuleContext, image *bootImageConfig) android.WritablePath {
  727. globalSoong := dexpreopt.GetGlobalSoongConfig(ctx)
  728. global := dexpreopt.GetGlobalConfig(ctx)
  729. if global.DisableGenerateProfile || ctx.Config().UnbundledBuild() {
  730. return nil
  731. }
  732. defaultProfile := "frameworks/base/config/boot-profile.txt"
  733. bootFrameworkProfile := android.PathForSource(ctx, defaultProfile)
  734. profile := image.dir.Join(ctx, "boot.bprof")
  735. rule := android.NewRuleBuilder(pctx, ctx)
  736. rule.Command().
  737. Text(`ANDROID_LOG_TAGS="*:e"`).
  738. Tool(globalSoong.Profman).
  739. Flag("--output-profile-type=bprof").
  740. FlagWithInput("--create-profile-from=", bootFrameworkProfile).
  741. FlagForEachInput("--apk=", image.dexPathsDeps.Paths()).
  742. FlagForEachArg("--dex-location=", image.getAnyAndroidVariant().dexLocationsDeps).
  743. FlagWithOutput("--reference-profile-file=", profile)
  744. rule.Install(profile, "/system/etc/boot-image.bprof")
  745. rule.Build("bootFrameworkProfile", "profile boot framework jars")
  746. image.profileInstalls = append(image.profileInstalls, rule.Installs()...)
  747. image.profileLicenseMetadataFile = android.OptionalPathForPath(ctx.LicenseMetadataFile())
  748. return profile
  749. }
  750. func dumpOatRules(ctx android.ModuleContext, image *bootImageConfig) {
  751. var allPhonies android.Paths
  752. for _, image := range image.variants {
  753. arch := image.target.Arch.ArchType
  754. suffix := arch.String()
  755. // Host and target might both use x86 arch. We need to ensure the names are unique.
  756. if image.target.Os.Class == android.Host {
  757. suffix = "host-" + suffix
  758. }
  759. // Create a rule to call oatdump.
  760. output := android.PathForOutput(ctx, "boot."+suffix+".oatdump.txt")
  761. rule := android.NewRuleBuilder(pctx, ctx)
  762. imageLocationsOnHost, _ := image.imageLocations()
  763. rule.Command().
  764. BuiltTool("oatdump").
  765. FlagWithInputList("--runtime-arg -Xbootclasspath:", image.dexPathsDeps.Paths(), ":").
  766. FlagWithList("--runtime-arg -Xbootclasspath-locations:", image.dexLocationsDeps, ":").
  767. FlagWithArg("--image=", strings.Join(imageLocationsOnHost, ":")).Implicits(image.imagesDeps.Paths()).
  768. FlagWithOutput("--output=", output).
  769. FlagWithArg("--instruction-set=", arch.String())
  770. rule.Build("dump-oat-boot-"+suffix, "dump oat boot "+arch.String())
  771. // Create a phony rule that depends on the output file and prints the path.
  772. phony := android.PathForPhony(ctx, "dump-oat-boot-"+suffix)
  773. rule = android.NewRuleBuilder(pctx, ctx)
  774. rule.Command().
  775. Implicit(output).
  776. ImplicitOutput(phony).
  777. Text("echo").FlagWithArg("Output in ", output.String())
  778. rule.Build("phony-dump-oat-boot-"+suffix, "dump oat boot "+arch.String())
  779. allPhonies = append(allPhonies, phony)
  780. }
  781. phony := android.PathForPhony(ctx, "dump-oat-boot")
  782. ctx.Build(pctx, android.BuildParams{
  783. Rule: android.Phony,
  784. Output: phony,
  785. Inputs: allPhonies,
  786. Description: "dump-oat-boot",
  787. })
  788. }
  789. func writeGlobalConfigForMake(ctx android.SingletonContext, path android.WritablePath) {
  790. data := dexpreopt.GetGlobalConfigRawData(ctx)
  791. android.WriteFileRule(ctx, path, string(data))
  792. }
  793. // Define Make variables for boot image names, paths, etc. These variables are used in makefiles
  794. // (make/core/dex_preopt_libart.mk) to generate install rules that copy boot image files to the
  795. // correct output directories.
  796. func (d *dexpreoptBootJars) MakeVars(ctx android.MakeVarsContext) {
  797. if d.dexpreoptConfigForMake != nil {
  798. ctx.Strict("DEX_PREOPT_CONFIG_FOR_MAKE", d.dexpreoptConfigForMake.String())
  799. ctx.Strict("DEX_PREOPT_SOONG_CONFIG_FOR_MAKE", android.PathForOutput(ctx, "dexpreopt_soong.config").String())
  800. }
  801. image := d.defaultBootImage
  802. if image != nil {
  803. ctx.Strict("DEXPREOPT_IMAGE_PROFILE_BUILT_INSTALLED", image.profileInstalls.String())
  804. if image.profileLicenseMetadataFile.Valid() {
  805. ctx.Strict("DEXPREOPT_IMAGE_PROFILE_LICENSE_METADATA", image.profileLicenseMetadataFile.String())
  806. }
  807. global := dexpreopt.GetGlobalConfig(ctx)
  808. dexPaths, dexLocations := bcpForDexpreopt(ctx, global.PreoptWithUpdatableBcp)
  809. ctx.Strict("DEXPREOPT_BOOTCLASSPATH_DEX_FILES", strings.Join(dexPaths.Strings(), " "))
  810. ctx.Strict("DEXPREOPT_BOOTCLASSPATH_DEX_LOCATIONS", strings.Join(dexLocations, " "))
  811. var imageNames []string
  812. // The primary ART boot image is exposed to Make for testing (gtests) and benchmarking
  813. // (golem) purposes.
  814. for _, current := range append(d.otherImages, image) {
  815. imageNames = append(imageNames, current.name)
  816. for _, variant := range current.variants {
  817. suffix := ""
  818. if variant.target.Os.Class == android.Host {
  819. suffix = "_host"
  820. }
  821. sfx := variant.name + suffix + "_" + variant.target.Arch.ArchType.String()
  822. ctx.Strict("DEXPREOPT_IMAGE_VDEX_BUILT_INSTALLED_"+sfx, variant.vdexInstalls.String())
  823. ctx.Strict("DEXPREOPT_IMAGE_"+sfx, variant.imagePathOnHost.String())
  824. ctx.Strict("DEXPREOPT_IMAGE_DEPS_"+sfx, strings.Join(variant.imagesDeps.Strings(), " "))
  825. ctx.Strict("DEXPREOPT_IMAGE_BUILT_INSTALLED_"+sfx, variant.installs.String())
  826. ctx.Strict("DEXPREOPT_IMAGE_UNSTRIPPED_BUILT_INSTALLED_"+sfx, variant.unstrippedInstalls.String())
  827. if variant.licenseMetadataFile.Valid() {
  828. ctx.Strict("DEXPREOPT_IMAGE_LICENSE_METADATA_"+sfx, variant.licenseMetadataFile.String())
  829. }
  830. }
  831. imageLocationsOnHost, imageLocationsOnDevice := current.getAnyAndroidVariant().imageLocations()
  832. ctx.Strict("DEXPREOPT_IMAGE_LOCATIONS_ON_HOST"+current.name, strings.Join(imageLocationsOnHost, ":"))
  833. ctx.Strict("DEXPREOPT_IMAGE_LOCATIONS_ON_DEVICE"+current.name, strings.Join(imageLocationsOnDevice, ":"))
  834. ctx.Strict("DEXPREOPT_IMAGE_ZIP_"+current.name, current.zip.String())
  835. }
  836. ctx.Strict("DEXPREOPT_IMAGE_NAMES", strings.Join(imageNames, " "))
  837. }
  838. }