blob: 720f79e2868406c6b2f27456ab19d1e7bf853859 [file] [log] [blame]
Colin Cross43f08db2018-11-12 10:13:39 -08001// Copyright 2018 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
15package dexpreopt
16
17import (
18 "encoding/json"
Colin Cross69f59a32019-02-15 10:39:37 -080019 "strings"
Colin Cross74ba9622019-02-11 15:11:14 -080020
21 "android/soong/android"
Colin Cross43f08db2018-11-12 10:13:39 -080022)
23
Martin Stjernholmc52aaf12020-01-06 23:11:37 +000024// GlobalConfig stores the configuration for dex preopting. The fields are set
Hans Boehme4b53422020-01-25 01:44:30 +000025// from product variables via dex_preopt_config.mk, except for SoongConfig
26// which come from CreateGlobalSoongConfig.
Colin Cross43f08db2018-11-12 10:13:39 -080027type GlobalConfig struct {
Colin Cross69f59a32019-02-15 10:39:37 -080028 DisablePreopt bool // disable preopt for all modules
Colin Cross43f08db2018-11-12 10:13:39 -080029 DisablePreoptModules []string // modules with preopt disabled by product-specific config
30
31 OnlyPreoptBootImageAndSystemServer bool // only preopt jars in the boot image or system server
32
Vladimir Marko40139d62020-02-06 15:14:29 +000033 UseArtImage bool // use the art image (use other boot class path dex files without image)
34
Nicolas Geoffray72892f12019-02-22 15:34:40 +000035 GenerateApexImage bool // generate an extra boot image only containing jars from the runtime apex
Nicolas Geoffray25c0e032019-04-04 18:45:20 +010036 UseApexImage bool // use the apex image by default
Nicolas Geoffray72892f12019-02-22 15:34:40 +000037
Colin Cross43f08db2018-11-12 10:13:39 -080038 HasSystemOther bool // store odex files that match PatternsOnSystemOther on the system_other partition
39 PatternsOnSystemOther []string // patterns (using '%' to denote a prefix match) to put odex on the system_other partition
40
Colin Cross69f59a32019-02-15 10:39:37 -080041 DisableGenerateProfile bool // don't generate profiles
42 ProfileDir string // directory to find profiles in
Colin Cross43f08db2018-11-12 10:13:39 -080043
Roshan Piusccc26ef2019-11-27 09:37:46 -080044 BootJars []string // modules for jars that form the boot class path
45 UpdatableBootJars []string // jars within apex that form the boot class path
Vladimir Markod2ee5322018-12-19 17:57:57 +000046
Ulya Trafimovich4d2eeed2019-11-08 10:54:21 +000047 ArtApexJars []string // modules for jars that are in the ART APEX
Colin Cross800fe132019-02-11 14:21:24 -080048
Roshan Pius9b51a402019-11-21 12:36:53 -080049 SystemServerJars []string // jars that form the system server
50 SystemServerApps []string // apps that are loaded into system server
51 UpdatableSystemServerJars []string // jars within apex that are loaded into system server
52 SpeedApps []string // apps that should be speed optimized
Colin Cross43f08db2018-11-12 10:13:39 -080053
54 PreoptFlags []string // global dex2oat flags that should be used if no module-specific dex2oat flags are specified
55
56 DefaultCompilerFilter string // default compiler filter to pass to dex2oat, overridden by --compiler-filter= in module-specific dex2oat flags
57 SystemServerCompilerFilter string // default compiler filter to pass to dex2oat for system server jars
58
Nicolas Geoffrayc1bf7242019-10-18 14:51:38 +010059 GenerateDMFiles bool // generate Dex Metadata files
Colin Cross43f08db2018-11-12 10:13:39 -080060
61 NoDebugInfo bool // don't generate debug info by default
Mathieu Chartier3f7ddbb2019-04-29 09:33:50 -070062 DontResolveStartupStrings bool // don't resolve string literals loaded during application startup.
Colin Cross43f08db2018-11-12 10:13:39 -080063 AlwaysSystemServerDebugInfo bool // always generate mini debug info for system server modules (overrides NoDebugInfo=true)
64 NeverSystemServerDebugInfo bool // never generate mini debug info for system server modules (overrides NoDebugInfo=false)
65 AlwaysOtherDebugInfo bool // always generate mini debug info for non-system server modules (overrides NoDebugInfo=true)
66 NeverOtherDebugInfo bool // never generate mini debug info for non-system server modules (overrides NoDebugInfo=true)
67
Colin Cross43f08db2018-11-12 10:13:39 -080068 IsEng bool // build is a eng variant
69 SanitizeLite bool // build is the second phase of a SANITIZE_LITE build
70
71 DefaultAppImages bool // build app images (TODO: .art files?) by default
72
Colin Cross800fe132019-02-11 14:21:24 -080073 Dex2oatXmx string // max heap size for dex2oat
74 Dex2oatXms string // initial heap size for dex2oat
Colin Cross43f08db2018-11-12 10:13:39 -080075
76 EmptyDirectory string // path to an empty directory
77
Colin Cross74ba9622019-02-11 15:11:14 -080078 CpuVariant map[android.ArchType]string // cpu variant for each architecture
79 InstructionSetFeatures map[android.ArchType]string // instruction set for each architecture
Colin Cross43f08db2018-11-12 10:13:39 -080080
Colin Cross800fe132019-02-11 14:21:24 -080081 // Only used for boot image
Mathieu Chartier6adeee12019-06-26 10:01:36 -070082 DirtyImageObjects android.OptionalPath // path to a dirty-image-objects file
83 BootImageProfiles android.Paths // path to a boot-image-profile.txt file
84 BootFlags string // extra flags to pass to dex2oat for the boot image
85 Dex2oatImageXmx string // max heap size for dex2oat for the boot image
86 Dex2oatImageXms string // initial heap size for dex2oat for the boot image
Hans Boehme4b53422020-01-25 01:44:30 +000087
88 SoongConfig GlobalSoongConfig // settings read from dexpreopt_soong.config
Colin Cross43f08db2018-11-12 10:13:39 -080089}
90
Martin Stjernholmc52aaf12020-01-06 23:11:37 +000091// GlobalSoongConfig contains the global config that is generated from Soong,
92// stored in dexpreopt_soong.config.
93type GlobalSoongConfig struct {
94 // Paths to tools possibly used by the generated commands.
95 Profman android.Path
96 Dex2oat android.Path
97 Aapt android.Path
98 SoongZip android.Path
99 Zip2zip android.Path
100 ManifestCheck android.Path
Colin Cross38b96852019-05-22 10:21:09 -0700101 ConstructContext android.Path
Colin Cross43f08db2018-11-12 10:13:39 -0800102}
103
104type ModuleConfig struct {
Victor Hsiehd181c8b2019-01-29 13:00:33 -0800105 Name string
106 DexLocation string // dex location on device
Colin Cross69f59a32019-02-15 10:39:37 -0800107 BuildPath android.OutputPath
108 DexPath android.Path
Colin Cross38b96852019-05-22 10:21:09 -0700109 ManifestPath android.Path
Victor Hsiehd181c8b2019-01-29 13:00:33 -0800110 UncompressedDex bool
111 HasApkLibraries bool
112 PreoptFlags []string
Colin Cross43f08db2018-11-12 10:13:39 -0800113
Colin Cross69f59a32019-02-15 10:39:37 -0800114 ProfileClassListing android.OptionalPath
Colin Cross43f08db2018-11-12 10:13:39 -0800115 ProfileIsTextListing bool
Nicolas Geoffraye7102422019-07-24 13:19:29 +0100116 ProfileBootListing android.OptionalPath
Colin Cross43f08db2018-11-12 10:13:39 -0800117
Colin Cross50ddcc42019-05-16 12:28:22 -0700118 EnforceUsesLibraries bool
119 PresentOptionalUsesLibraries []string
120 UsesLibraries []string
121 LibraryPaths map[string]android.Path
Colin Cross43f08db2018-11-12 10:13:39 -0800122
Ulya Trafimovich4d2eeed2019-11-08 10:54:21 +0000123 Archs []android.ArchType
124 DexPreoptImages []android.Path
125 DexPreoptImagesDeps []android.OutputPaths
126 DexPreoptImageLocations []string
Colin Cross43f08db2018-11-12 10:13:39 -0800127
Colin Cross69f59a32019-02-15 10:39:37 -0800128 PreoptBootClassPathDexFiles android.Paths // file paths of boot class path files
129 PreoptBootClassPathDexLocations []string // virtual locations of boot class path files
Colin Cross800fe132019-02-11 14:21:24 -0800130
Colin Cross43f08db2018-11-12 10:13:39 -0800131 PreoptExtractedApk bool // Overrides OnlyPreoptModules
132
133 NoCreateAppImage bool
134 ForceCreateAppImage bool
135
136 PresignedPrebuilt bool
Colin Cross43f08db2018-11-12 10:13:39 -0800137}
138
Martin Stjernholmc52aaf12020-01-06 23:11:37 +0000139type globalSoongConfigSingleton struct{}
140
141var pctx = android.NewPackageContext("android/soong/dexpreopt")
142
143func init() {
144 pctx.Import("android/soong/android")
145 android.RegisterSingletonType("dexpreopt-soong-config", func() android.Singleton {
146 return &globalSoongConfigSingleton{}
147 })
148}
149
Colin Cross69f59a32019-02-15 10:39:37 -0800150func constructPath(ctx android.PathContext, path string) android.Path {
151 buildDirPrefix := ctx.Config().BuildDir() + "/"
152 if path == "" {
153 return nil
154 } else if strings.HasPrefix(path, buildDirPrefix) {
155 return android.PathForOutput(ctx, strings.TrimPrefix(path, buildDirPrefix))
156 } else {
157 return android.PathForSource(ctx, path)
158 }
Colin Cross43f08db2018-11-12 10:13:39 -0800159}
160
Colin Cross69f59a32019-02-15 10:39:37 -0800161func constructPaths(ctx android.PathContext, paths []string) android.Paths {
162 var ret android.Paths
163 for _, path := range paths {
164 ret = append(ret, constructPath(ctx, path))
165 }
166 return ret
Colin Cross43f08db2018-11-12 10:13:39 -0800167}
168
Colin Cross69f59a32019-02-15 10:39:37 -0800169func constructPathMap(ctx android.PathContext, paths map[string]string) map[string]android.Path {
170 ret := map[string]android.Path{}
171 for key, path := range paths {
172 ret[key] = constructPath(ctx, path)
173 }
174 return ret
175}
176
177func constructWritablePath(ctx android.PathContext, path string) android.WritablePath {
178 if path == "" {
179 return nil
180 }
181 return constructPath(ctx, path).(android.WritablePath)
182}
183
Hans Boehm453bf092020-01-25 01:44:30 +0000184// LoadGlobalConfig reads the global dexpreopt.config file into a GlobalConfig
Hans Boehme4b53422020-01-25 01:44:30 +0000185// struct, except the SoongConfig field which is set from the provided
186// soongConfig argument. LoadGlobalConfig is used directly in Soong and in
187// dexpreopt_gen called from Make to read the $OUT/dexpreopt.config written by
188// Make.
189func LoadGlobalConfig(ctx android.PathContext, data []byte, soongConfig GlobalSoongConfig) (GlobalConfig, error) {
Colin Cross69f59a32019-02-15 10:39:37 -0800190 type GlobalJSONConfig struct {
191 GlobalConfig
192
193 // Copies of entries in GlobalConfig that are not constructable without extra parameters. They will be
194 // used to construct the real value manually below.
195 DirtyImageObjects string
Colin Cross69f59a32019-02-15 10:39:37 -0800196 BootImageProfiles []string
Colin Cross69f59a32019-02-15 10:39:37 -0800197 }
198
199 config := GlobalJSONConfig{}
Colin Cross988414c2020-01-11 01:11:46 +0000200 err := json.Unmarshal(data, &config)
Colin Cross69f59a32019-02-15 10:39:37 -0800201 if err != nil {
Colin Cross988414c2020-01-11 01:11:46 +0000202 return config.GlobalConfig, err
Colin Cross69f59a32019-02-15 10:39:37 -0800203 }
204
205 // Construct paths that require a PathContext.
206 config.GlobalConfig.DirtyImageObjects = android.OptionalPathForPath(constructPath(ctx, config.DirtyImageObjects))
Colin Cross69f59a32019-02-15 10:39:37 -0800207 config.GlobalConfig.BootImageProfiles = constructPaths(ctx, config.BootImageProfiles)
208
Hans Boehme4b53422020-01-25 01:44:30 +0000209 // Set this here to force the caller to provide a value for this struct (from
210 // either CreateGlobalSoongConfig or LoadGlobalSoongConfig).
211 config.GlobalConfig.SoongConfig = soongConfig
212
Colin Cross988414c2020-01-11 01:11:46 +0000213 return config.GlobalConfig, nil
Colin Cross69f59a32019-02-15 10:39:37 -0800214}
215
Hans Boehm453bf092020-01-25 01:44:30 +0000216// LoadModuleConfig reads a per-module dexpreopt.config file into a ModuleConfig struct. It is not used in Soong, which
217// receives a ModuleConfig struct directly from java/dexpreopt.go. It is used in dexpreopt_gen called from oMake to
218// read the module dexpreopt.config written by Make.
219func LoadModuleConfig(ctx android.PathContext, data []byte) (ModuleConfig, error) {
Colin Cross69f59a32019-02-15 10:39:37 -0800220 type ModuleJSONConfig struct {
221 ModuleConfig
222
223 // Copies of entries in ModuleConfig that are not constructable without extra parameters. They will be
224 // used to construct the real value manually below.
225 BuildPath string
226 DexPath string
Colin Cross38b96852019-05-22 10:21:09 -0700227 ManifestPath string
Colin Cross69f59a32019-02-15 10:39:37 -0800228 ProfileClassListing string
229 LibraryPaths map[string]string
230 DexPreoptImages []string
Ulya Trafimovich4d2eeed2019-11-08 10:54:21 +0000231 DexPreoptImageLocations []string
Colin Cross69f59a32019-02-15 10:39:37 -0800232 PreoptBootClassPathDexFiles []string
Colin Cross69f59a32019-02-15 10:39:37 -0800233 }
234
235 config := ModuleJSONConfig{}
236
Colin Cross988414c2020-01-11 01:11:46 +0000237 err := json.Unmarshal(data, &config)
Colin Cross69f59a32019-02-15 10:39:37 -0800238 if err != nil {
239 return config.ModuleConfig, err
240 }
241
242 // Construct paths that require a PathContext.
243 config.ModuleConfig.BuildPath = constructPath(ctx, config.BuildPath).(android.OutputPath)
244 config.ModuleConfig.DexPath = constructPath(ctx, config.DexPath)
Colin Cross38b96852019-05-22 10:21:09 -0700245 config.ModuleConfig.ManifestPath = constructPath(ctx, config.ManifestPath)
Colin Cross69f59a32019-02-15 10:39:37 -0800246 config.ModuleConfig.ProfileClassListing = android.OptionalPathForPath(constructPath(ctx, config.ProfileClassListing))
247 config.ModuleConfig.LibraryPaths = constructPathMap(ctx, config.LibraryPaths)
248 config.ModuleConfig.DexPreoptImages = constructPaths(ctx, config.DexPreoptImages)
Ulya Trafimovich4d2eeed2019-11-08 10:54:21 +0000249 config.ModuleConfig.DexPreoptImageLocations = config.DexPreoptImageLocations
Colin Cross69f59a32019-02-15 10:39:37 -0800250 config.ModuleConfig.PreoptBootClassPathDexFiles = constructPaths(ctx, config.PreoptBootClassPathDexFiles)
Colin Cross69f59a32019-02-15 10:39:37 -0800251
Dan Willemsen0f416782019-06-13 21:44:53 +0000252 // This needs to exist, but dependencies are already handled in Make, so we don't need to pass them through JSON.
Ulya Trafimovich4d2eeed2019-11-08 10:54:21 +0000253 config.ModuleConfig.DexPreoptImagesDeps = make([]android.OutputPaths, len(config.ModuleConfig.DexPreoptImages))
Dan Willemsen0f416782019-06-13 21:44:53 +0000254
Colin Cross69f59a32019-02-15 10:39:37 -0800255 return config.ModuleConfig, nil
256}
257
Hans Boehme4b53422020-01-25 01:44:30 +0000258// CreateGlobalSoongConfig creates a GlobalSoongConfig from the current context.
Martin Stjernholmc52aaf12020-01-06 23:11:37 +0000259// Should not be used in dexpreopt_gen.
Hans Boehme4b53422020-01-25 01:44:30 +0000260func CreateGlobalSoongConfig(ctx android.PathContext) GlobalSoongConfig {
Hans Boehm7b2e6f32020-01-25 01:44:30 +0000261 // Default to debug version to help find bugs.
262 // Set USE_DEX2OAT_DEBUG to false for only building non-debug versions.
263 var dex2oatBinary string
264 if ctx.Config().Getenv("USE_DEX2OAT_DEBUG") == "false" {
265 dex2oatBinary = "dex2oat"
266 } else {
267 dex2oatBinary = "dex2oatd"
268 }
269
Martin Stjernholmc52aaf12020-01-06 23:11:37 +0000270 return GlobalSoongConfig{
271 Profman: ctx.Config().HostToolPath(ctx, "profman"),
Hans Boehm7b2e6f32020-01-25 01:44:30 +0000272 Dex2oat: ctx.Config().HostToolPath(ctx, dex2oatBinary),
Martin Stjernholmc52aaf12020-01-06 23:11:37 +0000273 Aapt: ctx.Config().HostToolPath(ctx, "aapt"),
274 SoongZip: ctx.Config().HostToolPath(ctx, "soong_zip"),
275 Zip2zip: ctx.Config().HostToolPath(ctx, "zip2zip"),
276 ManifestCheck: ctx.Config().HostToolPath(ctx, "manifest_check"),
277 ConstructContext: android.PathForSource(ctx, "build/make/core/construct_context.sh"),
278 }
279}
280
281type globalJsonSoongConfig struct {
282 Profman string
283 Dex2oat string
284 Aapt string
285 SoongZip string
286 Zip2zip string
287 ManifestCheck string
288 ConstructContext string
289}
290
Hans Boehm453bf092020-01-25 01:44:30 +0000291// LoadGlobalSoongConfig reads the dexpreopt_soong.config file into a
292// GlobalSoongConfig struct. It is only used in dexpreopt_gen.
293func LoadGlobalSoongConfig(ctx android.PathContext, data []byte) (GlobalSoongConfig, error) {
Martin Stjernholmc52aaf12020-01-06 23:11:37 +0000294 var jc globalJsonSoongConfig
295
Colin Cross988414c2020-01-11 01:11:46 +0000296 err := json.Unmarshal(data, &jc)
Martin Stjernholmc52aaf12020-01-06 23:11:37 +0000297 if err != nil {
298 return GlobalSoongConfig{}, err
299 }
300
301 config := GlobalSoongConfig{
302 Profman: constructPath(ctx, jc.Profman),
303 Dex2oat: constructPath(ctx, jc.Dex2oat),
304 Aapt: constructPath(ctx, jc.Aapt),
305 SoongZip: constructPath(ctx, jc.SoongZip),
306 Zip2zip: constructPath(ctx, jc.Zip2zip),
307 ManifestCheck: constructPath(ctx, jc.ManifestCheck),
308 ConstructContext: constructPath(ctx, jc.ConstructContext),
309 }
310
311 return config, nil
312}
313
314func (s *globalSoongConfigSingleton) GenerateBuildActions(ctx android.SingletonContext) {
Hans Boehme4b53422020-01-25 01:44:30 +0000315 config := CreateGlobalSoongConfig(ctx)
Martin Stjernholmc52aaf12020-01-06 23:11:37 +0000316 jc := globalJsonSoongConfig{
317 Profman: config.Profman.String(),
318 Dex2oat: config.Dex2oat.String(),
319 Aapt: config.Aapt.String(),
320 SoongZip: config.SoongZip.String(),
321 Zip2zip: config.Zip2zip.String(),
322 ManifestCheck: config.ManifestCheck.String(),
323 ConstructContext: config.ConstructContext.String(),
324 }
325
326 data, err := json.Marshal(jc)
327 if err != nil {
328 ctx.Errorf("failed to JSON marshal GlobalSoongConfig: %v", err)
329 return
330 }
331
332 ctx.Build(pctx, android.BuildParams{
333 Rule: android.WriteFile,
334 Output: android.PathForOutput(ctx, "dexpreopt_soong.config"),
335 Args: map[string]string{
336 "content": string(data),
337 },
338 })
339}
340
341func (s *globalSoongConfigSingleton) MakeVars(ctx android.MakeVarsContext) {
Hans Boehme4b53422020-01-25 01:44:30 +0000342 config := CreateGlobalSoongConfig(ctx)
Martin Stjernholmc52aaf12020-01-06 23:11:37 +0000343
344 ctx.Strict("DEX2OAT", config.Dex2oat.String())
345 ctx.Strict("DEXPREOPT_GEN_DEPS", strings.Join([]string{
346 config.Profman.String(),
347 config.Dex2oat.String(),
348 config.Aapt.String(),
349 config.SoongZip.String(),
350 config.Zip2zip.String(),
351 config.ManifestCheck.String(),
352 config.ConstructContext.String(),
353 }, " "))
354}
355
Colin Cross69f59a32019-02-15 10:39:37 -0800356func GlobalConfigForTests(ctx android.PathContext) GlobalConfig {
357 return GlobalConfig{
Colin Cross69f59a32019-02-15 10:39:37 -0800358 DisablePreopt: false,
359 DisablePreoptModules: nil,
360 OnlyPreoptBootImageAndSystemServer: false,
361 HasSystemOther: false,
362 PatternsOnSystemOther: nil,
363 DisableGenerateProfile: false,
364 ProfileDir: "",
365 BootJars: nil,
Roshan Piusccc26ef2019-11-27 09:37:46 -0800366 UpdatableBootJars: nil,
Martin Stjernholmcc4b0ad2019-07-05 22:38:25 +0100367 ArtApexJars: nil,
Colin Cross69f59a32019-02-15 10:39:37 -0800368 SystemServerJars: nil,
369 SystemServerApps: nil,
Roshan Pius9b51a402019-11-21 12:36:53 -0800370 UpdatableSystemServerJars: nil,
Colin Cross69f59a32019-02-15 10:39:37 -0800371 SpeedApps: nil,
372 PreoptFlags: nil,
373 DefaultCompilerFilter: "",
374 SystemServerCompilerFilter: "",
375 GenerateDMFiles: false,
Colin Cross69f59a32019-02-15 10:39:37 -0800376 NoDebugInfo: false,
Mathieu Chartier3f7ddbb2019-04-29 09:33:50 -0700377 DontResolveStartupStrings: false,
Colin Cross69f59a32019-02-15 10:39:37 -0800378 AlwaysSystemServerDebugInfo: false,
379 NeverSystemServerDebugInfo: false,
380 AlwaysOtherDebugInfo: false,
381 NeverOtherDebugInfo: false,
Colin Cross69f59a32019-02-15 10:39:37 -0800382 IsEng: false,
383 SanitizeLite: false,
384 DefaultAppImages: false,
385 Dex2oatXmx: "",
386 Dex2oatXms: "",
387 EmptyDirectory: "empty_dir",
388 CpuVariant: nil,
389 InstructionSetFeatures: nil,
390 DirtyImageObjects: android.OptionalPath{},
Colin Cross69f59a32019-02-15 10:39:37 -0800391 BootImageProfiles: nil,
Colin Cross69f59a32019-02-15 10:39:37 -0800392 BootFlags: "",
393 Dex2oatImageXmx: "",
394 Dex2oatImageXms: "",
Hans Boehme4b53422020-01-25 01:44:30 +0000395 SoongConfig: GlobalSoongConfig{
Colin Cross38b96852019-05-22 10:21:09 -0700396 Profman: android.PathForTesting("profman"),
397 Dex2oat: android.PathForTesting("dex2oat"),
398 Aapt: android.PathForTesting("aapt"),
399 SoongZip: android.PathForTesting("soong_zip"),
400 Zip2zip: android.PathForTesting("zip2zip"),
401 ManifestCheck: android.PathForTesting("manifest_check"),
402 ConstructContext: android.PathForTesting("construct_context.sh"),
Hans Boehme4b53422020-01-25 01:44:30 +0000403 },
404 }
Colin Cross69f59a32019-02-15 10:39:37 -0800405}