blob: 546abcfb0078276ec8c25376397c33f55c7256b1 [file] [log] [blame]
Dan Willemsen4b7d5de2016-01-12 23:20:28 -08001// Copyright 2016 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
Colin Cross635c3b02016-05-18 15:37:25 -070015package android
Dan Willemsen4b7d5de2016-01-12 23:20:28 -080016
17import (
18 "bytes"
19 "fmt"
Dan Willemsen6a6478d2020-07-17 19:28:53 -070020 "sort"
Colin Cross31656952018-05-24 16:11:20 -070021 "strings"
Dan Willemsen4b7d5de2016-01-12 23:20:28 -080022
Colin Cross65494b92019-02-07 14:25:51 -080023 "github.com/google/blueprint"
Colin Crossc3d87d32020-06-04 13:25:17 -070024 "github.com/google/blueprint/pathtools"
Dan Willemsen4b7d5de2016-01-12 23:20:28 -080025 "github.com/google/blueprint/proptools"
26)
27
Dan Albertf5415d72017-08-17 16:19:59 -070028func init() {
29 RegisterMakeVarsProvider(pctx, androidMakeVarsProvider)
30}
31
32func androidMakeVarsProvider(ctx MakeVarsContext) {
Dan Albert1a246272020-07-06 14:49:35 -070033 ctx.Strict("MIN_SUPPORTED_SDK_VERSION", ctx.Config().MinSupportedSdkVersion().String())
Dan Albertf5415d72017-08-17 16:19:59 -070034}
35
Dan Willemsen4b7d5de2016-01-12 23:20:28 -080036///////////////////////////////////////////////////////////////////////////////
Dan Willemsen6a6478d2020-07-17 19:28:53 -070037
38// BaseMakeVarsContext contains the common functions for other packages to use
39// to declare make variables
40type BaseMakeVarsContext interface {
Dan Willemsen4b7d5de2016-01-12 23:20:28 -080041 Config() Config
Dan Willemsen3fb1fae2018-03-12 15:30:26 -070042 DeviceConfig() DeviceConfig
Colin Cross65494b92019-02-07 14:25:51 -080043 AddNinjaFileDeps(deps ...string)
Colin Cross65494b92019-02-07 14:25:51 -080044
Colin Cross65494b92019-02-07 14:25:51 -080045 Failed() bool
46
Dan Willemsen558e5172016-05-19 16:58:46 -070047 // These are equivalent to Strict and Check, but do not attempt to
48 // evaluate the values before writing them to the Makefile. They can
49 // be used when all ninja variables have already been evaluated through
50 // Eval().
51 StrictRaw(name, value string)
52 CheckRaw(name, value string)
Colin Cross8177ad22019-11-04 10:27:48 -080053
54 // GlobWithDeps returns a list of files that match the specified pattern but do not match any
55 // of the patterns in excludes. It also adds efficient dependencies to rerun the primary
56 // builder whenever a file matching the pattern as added or removed, without rerunning if a
57 // file that does not match the pattern is added to a searched directory.
58 GlobWithDeps(pattern string, excludes []string) ([]string, error)
Colin Crossc3d87d32020-06-04 13:25:17 -070059
60 // Phony creates a phony rule in Make, which will allow additional DistForGoal
61 // dependencies to be added to it. Phony can be called on the same name multiple
62 // times to add additional dependencies.
63 Phony(names string, deps ...Path)
Colin Cross3cda0d82019-09-24 13:40:07 -070064
65 // DistForGoal creates a rule to copy one or more Paths to the artifacts
66 // directory on the build server when the specified goal is built.
67 DistForGoal(goal string, paths ...Path)
68
69 // DistForGoalWithFilename creates a rule to copy a Path to the artifacts
70 // directory on the build server with the given filename when the specified
71 // goal is built.
72 DistForGoalWithFilename(goal string, path Path, filename string)
73
74 // DistForGoals creates a rule to copy one or more Paths to the artifacts
75 // directory on the build server when any of the specified goals are built.
76 DistForGoals(goals []string, paths ...Path)
77
78 // DistForGoalsWithFilename creates a rule to copy a Path to the artifacts
79 // directory on the build server with the given filename when any of the
80 // specified goals are built.
81 DistForGoalsWithFilename(goals []string, path Path, filename string)
Dan Willemsen4b7d5de2016-01-12 23:20:28 -080082}
83
Dan Willemsen6a6478d2020-07-17 19:28:53 -070084// MakeVarsContext contains the set of functions available for MakeVarsProvider
85// and SingletonMakeVarsProvider implementations.
86type MakeVarsContext interface {
87 BaseMakeVarsContext
88
89 ModuleName(module blueprint.Module) string
90 ModuleDir(module blueprint.Module) string
91 ModuleSubDir(module blueprint.Module) string
92 ModuleType(module blueprint.Module) string
Colin Cross127bb8b2020-12-16 16:46:01 -080093 ModuleProvider(module blueprint.Module, key blueprint.ProviderKey) interface{}
Dan Willemsen6a6478d2020-07-17 19:28:53 -070094 BlueprintFile(module blueprint.Module) string
95
96 ModuleErrorf(module blueprint.Module, format string, args ...interface{})
97 Errorf(format string, args ...interface{})
98
99 VisitAllModules(visit func(Module))
100 VisitAllModulesIf(pred func(Module) bool, visit func(Module))
101
102 // Verify the make variable matches the Soong version, fail the build
103 // if it does not. If the make variable is empty, just set it.
104 Strict(name, ninjaStr string)
105 // Check to see if the make variable matches the Soong version, warn if
106 // it does not. If the make variable is empty, just set it.
107 Check(name, ninjaStr string)
108
109 // These are equivalent to the above, but sort the make and soong
110 // variables before comparing them. They also show the unique entries
111 // in each list when displaying the difference, instead of the entire
112 // string.
113 StrictSorted(name, ninjaStr string)
114 CheckSorted(name, ninjaStr string)
115
116 // Evaluates a ninja string and returns the result. Used if more
117 // complicated modification needs to happen before giving it to Make.
118 Eval(ninjaStr string) (string, error)
119}
120
121// MakeVarsModuleContext contains the set of functions available for modules
122// implementing the ModuleMakeVarsProvider interface.
123type MakeVarsModuleContext interface {
124 BaseMakeVarsContext
125}
126
Colin Cross65494b92019-02-07 14:25:51 -0800127var _ PathContext = MakeVarsContext(nil)
128
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800129type MakeVarsProvider func(ctx MakeVarsContext)
130
Colin Cross0875c522017-11-28 17:34:01 -0800131func RegisterMakeVarsProvider(pctx PackageContext, provider MakeVarsProvider) {
Chris Parsonsf3c96ef2020-09-29 02:23:17 -0400132 makeVarsInitProviders = append(makeVarsInitProviders, makeVarsProvider{pctx, provider})
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800133}
134
Colin Crossed023ec2019-02-19 12:38:45 -0800135// SingletonMakeVarsProvider is a Singleton with an extra method to provide extra values to be exported to Make.
136type SingletonMakeVarsProvider interface {
137 Singleton
138
139 // MakeVars uses a MakeVarsContext to provide extra values to be exported to Make.
140 MakeVars(ctx MakeVarsContext)
141}
142
Colin Cross06fa5882020-10-29 18:21:38 -0700143var singletonMakeVarsProvidersKey = NewOnceKey("singletonMakeVarsProvidersKey")
144
145// registerSingletonMakeVarsProvider adds a singleton that implements SingletonMakeVarsProvider to
146// the list of MakeVarsProviders to run.
147func registerSingletonMakeVarsProvider(config Config, singleton SingletonMakeVarsProvider) {
148 // Singletons are registered on the Context and may be different between different Contexts,
149 // for example when running multiple tests. Store the SingletonMakeVarsProviders in the
150 // Config so they are attached to the Context.
151 singletonMakeVarsProviders := config.Once(singletonMakeVarsProvidersKey, func() interface{} {
152 return &[]makeVarsProvider{}
153 }).(*[]makeVarsProvider)
154
155 *singletonMakeVarsProviders = append(*singletonMakeVarsProviders,
156 makeVarsProvider{pctx, singletonMakeVarsProviderAdapter(singleton)})
Colin Crossed023ec2019-02-19 12:38:45 -0800157}
158
Colin Cross06fa5882020-10-29 18:21:38 -0700159// singletonMakeVarsProviderAdapter converts a SingletonMakeVarsProvider to a MakeVarsProvider.
160func singletonMakeVarsProviderAdapter(singleton SingletonMakeVarsProvider) MakeVarsProvider {
Colin Crossed023ec2019-02-19 12:38:45 -0800161 return func(ctx MakeVarsContext) { singleton.MakeVars(ctx) }
162}
163
Dan Willemsen6a6478d2020-07-17 19:28:53 -0700164// ModuleMakeVarsProvider is a Module with an extra method to provide extra values to be exported to Make.
165type ModuleMakeVarsProvider interface {
166 Module
167
168 // MakeVars uses a MakeVarsModuleContext to provide extra values to be exported to Make.
169 MakeVars(ctx MakeVarsModuleContext)
170}
171
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800172///////////////////////////////////////////////////////////////////////////////
173
Colin Cross0875c522017-11-28 17:34:01 -0800174func makeVarsSingletonFunc() Singleton {
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800175 return &makeVarsSingleton{}
176}
177
178type makeVarsSingleton struct{}
179
180type makeVarsProvider struct {
Colin Cross0875c522017-11-28 17:34:01 -0800181 pctx PackageContext
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800182 call MakeVarsProvider
183}
184
Chris Parsonsf3c96ef2020-09-29 02:23:17 -0400185// Collection of makevars providers that are registered in init() methods.
186var makeVarsInitProviders []makeVarsProvider
187
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800188type makeVarsContext struct {
Colin Cross65494b92019-02-07 14:25:51 -0800189 SingletonContext
Colin Crossc3d87d32020-06-04 13:25:17 -0700190 config Config
191 pctx PackageContext
192 vars []makeVarsVariable
193 phonies []phony
Colin Cross3cda0d82019-09-24 13:40:07 -0700194 dists []dist
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800195}
196
197var _ MakeVarsContext = &makeVarsContext{}
198
199type makeVarsVariable struct {
200 name string
201 value string
202 sort bool
203 strict bool
204}
205
Colin Crossc3d87d32020-06-04 13:25:17 -0700206type phony struct {
207 name string
208 deps []string
209}
210
Colin Cross3cda0d82019-09-24 13:40:07 -0700211type dist struct {
212 goals []string
213 paths []string
214}
215
Colin Cross0875c522017-11-28 17:34:01 -0800216func (s *makeVarsSingleton) GenerateBuildActions(ctx SingletonContext) {
Jingwen Chencda22c92020-11-23 00:22:30 -0500217 if !ctx.Config().KatiEnabled() {
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800218 return
219 }
220
Colin Cross988414c2020-01-11 01:11:46 +0000221 outFile := absolutePath(PathForOutput(ctx,
222 "make_vars"+proptools.String(ctx.Config().productVariables.Make_suffix)+".mk").String())
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800223
Colin Crossc3d87d32020-06-04 13:25:17 -0700224 lateOutFile := absolutePath(PathForOutput(ctx,
225 "late"+proptools.String(ctx.Config().productVariables.Make_suffix)+".mk").String())
226
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800227 if ctx.Failed() {
228 return
229 }
230
Colin Cross3cda0d82019-09-24 13:40:07 -0700231 var vars []makeVarsVariable
232 var dists []dist
Colin Crossc3d87d32020-06-04 13:25:17 -0700233 var phonies []phony
Colin Cross06fa5882020-10-29 18:21:38 -0700234
235 providers := append([]makeVarsProvider(nil), makeVarsInitProviders...)
236 providers = append(providers, *ctx.Config().Get(singletonMakeVarsProvidersKey).(*[]makeVarsProvider)...)
237
238 for _, provider := range providers {
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800239 mctx := &makeVarsContext{
Colin Cross65494b92019-02-07 14:25:51 -0800240 SingletonContext: ctx,
241 pctx: provider.pctx,
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800242 }
243
244 provider.call(mctx)
245
246 vars = append(vars, mctx.vars...)
Colin Crossc3d87d32020-06-04 13:25:17 -0700247 phonies = append(phonies, mctx.phonies...)
Colin Cross3cda0d82019-09-24 13:40:07 -0700248 dists = append(dists, mctx.dists...)
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800249 }
250
Dan Willemsen6a6478d2020-07-17 19:28:53 -0700251 ctx.VisitAllModules(func(m Module) {
Jiyong Parkf78531b2020-09-09 17:14:28 +0900252 if provider, ok := m.(ModuleMakeVarsProvider); ok && m.Enabled() {
Dan Willemsen6a6478d2020-07-17 19:28:53 -0700253 mctx := &makeVarsContext{
254 SingletonContext: ctx,
255 }
256
257 provider.MakeVars(mctx)
258
259 vars = append(vars, mctx.vars...)
260 phonies = append(phonies, mctx.phonies...)
261 dists = append(dists, mctx.dists...)
262 }
263 })
264
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800265 if ctx.Failed() {
266 return
267 }
268
Dan Willemsen6a6478d2020-07-17 19:28:53 -0700269 sort.Slice(vars, func(i, j int) bool {
270 return vars[i].name < vars[j].name
271 })
272 sort.Slice(phonies, func(i, j int) bool {
273 return phonies[i].name < phonies[j].name
274 })
275 lessArr := func(a, b []string) bool {
276 if len(a) == len(b) {
277 for i := range a {
278 if a[i] < b[i] {
279 return true
280 }
281 }
282 return false
283 }
284 return len(a) < len(b)
285 }
286 sort.Slice(dists, func(i, j int) bool {
287 return lessArr(dists[i].goals, dists[j].goals) || lessArr(dists[i].paths, dists[j].paths)
288 })
289
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800290 outBytes := s.writeVars(vars)
291
Colin Crossc3d87d32020-06-04 13:25:17 -0700292 if err := pathtools.WriteFileIfChanged(outFile, outBytes, 0666); err != nil {
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800293 ctx.Errorf(err.Error())
294 }
Colin Crossc3d87d32020-06-04 13:25:17 -0700295
Colin Cross3cda0d82019-09-24 13:40:07 -0700296 lateOutBytes := s.writeLate(phonies, dists)
Colin Crossc3d87d32020-06-04 13:25:17 -0700297
298 if err := pathtools.WriteFileIfChanged(lateOutFile, lateOutBytes, 0666); err != nil {
299 ctx.Errorf(err.Error())
300 }
301
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800302}
303
304func (s *makeVarsSingleton) writeVars(vars []makeVarsVariable) []byte {
305 buf := &bytes.Buffer{}
306
Dan Willemsen59339a22018-07-22 21:18:45 -0700307 fmt.Fprint(buf, `# Autogenerated file
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800308
309# Compares SOONG_$(1) against $(1), and warns if they are not equal.
310#
311# If the original variable is empty, then just set it to the SOONG_ version.
312#
313# $(1): Name of the variable to check
314# $(2): If not-empty, sort the values before comparing
315# $(3): Extra snippet to run if it does not match
316define soong-compare-var
317ifneq ($$($(1)),)
Dan Willemsen558e5172016-05-19 16:58:46 -0700318 my_val_make := $$(strip $(if $(2),$$(sort $$($(1))),$$($(1))))
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800319 my_val_soong := $(if $(2),$$(sort $$(SOONG_$(1))),$$(SOONG_$(1)))
320 ifneq ($$(my_val_make),$$(my_val_soong))
321 $$(warning $(1) does not match between Make and Soong:)
322 $(if $(2),$$(warning Make adds: $$(filter-out $$(my_val_soong),$$(my_val_make))),$$(warning Make : $$(my_val_make)))
323 $(if $(2),$$(warning Soong adds: $$(filter-out $$(my_val_make),$$(my_val_soong))),$$(warning Soong: $$(my_val_soong)))
324 $(3)
325 endif
326 my_val_make :=
327 my_val_soong :=
328else
329 $(1) := $$(SOONG_$(1))
330endif
Dan Willemsende18f472016-09-30 10:16:38 -0700331.KATI_READONLY := $(1) SOONG_$(1)
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800332endef
333
334my_check_failed := false
335
336`)
337
338 // Write all the strict checks out first so that if one of them errors,
339 // we get all of the strict errors printed, but not the non-strict
340 // warnings.
341 for _, v := range vars {
342 if !v.strict {
343 continue
344 }
345
346 sort := ""
347 if v.sort {
348 sort = "true"
349 }
350
351 fmt.Fprintf(buf, "SOONG_%s := %s\n", v.name, v.value)
352 fmt.Fprintf(buf, "$(eval $(call soong-compare-var,%s,%s,my_check_failed := true))\n\n", v.name, sort)
353 }
354
Dan Willemsen59339a22018-07-22 21:18:45 -0700355 fmt.Fprint(buf, `
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800356ifneq ($(my_check_failed),false)
357 $(error Soong variable check failed)
358endif
359my_check_failed :=
360
361
362`)
363
364 for _, v := range vars {
365 if v.strict {
366 continue
367 }
368
369 sort := ""
370 if v.sort {
371 sort = "true"
372 }
373
374 fmt.Fprintf(buf, "SOONG_%s := %s\n", v.name, v.value)
375 fmt.Fprintf(buf, "$(eval $(call soong-compare-var,%s,%s))\n\n", v.name, sort)
376 }
377
378 fmt.Fprintln(buf, "\nsoong-compare-var :=")
379
Colin Crossc3d87d32020-06-04 13:25:17 -0700380 fmt.Fprintln(buf)
381
382 return buf.Bytes()
383}
384
Colin Cross3cda0d82019-09-24 13:40:07 -0700385func (s *makeVarsSingleton) writeLate(phonies []phony, dists []dist) []byte {
Colin Crossc3d87d32020-06-04 13:25:17 -0700386 buf := &bytes.Buffer{}
387
388 fmt.Fprint(buf, `# Autogenerated file
389
390# Values written by Soong read after parsing all Android.mk files.
391
392
393`)
394
395 for _, phony := range phonies {
396 fmt.Fprintf(buf, ".PHONY: %s\n", phony.name)
397 fmt.Fprintf(buf, "%s: %s\n", phony.name, strings.Join(phony.deps, "\\\n "))
398 }
399
Colin Cross3cda0d82019-09-24 13:40:07 -0700400 fmt.Fprintln(buf)
401
402 for _, dist := range dists {
403 fmt.Fprintf(buf, "$(call dist-for-goals,%s,%s)\n",
404 strings.Join(dist.goals, " "), strings.Join(dist.paths, " "))
405 }
406
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800407 return buf.Bytes()
408}
409
Dan Willemsen3fb1fae2018-03-12 15:30:26 -0700410func (c *makeVarsContext) DeviceConfig() DeviceConfig {
Colin Cross65494b92019-02-07 14:25:51 -0800411 return DeviceConfig{c.Config().deviceConfig}
Jiyong Park374510b2018-03-19 18:23:01 +0900412}
413
Colin Cross31656952018-05-24 16:11:20 -0700414var ninjaDescaper = strings.NewReplacer("$$", "$")
415
Dan Willemsen558e5172016-05-19 16:58:46 -0700416func (c *makeVarsContext) Eval(ninjaStr string) (string, error) {
Colin Cross65494b92019-02-07 14:25:51 -0800417 s, err := c.SingletonContext.Eval(c.pctx, ninjaStr)
Colin Cross31656952018-05-24 16:11:20 -0700418 if err != nil {
419 return "", err
420 }
421 // SingletonContext.Eval returns an exapnded string that is valid for a ninja file, de-escape $$ to $ for use
422 // in a Makefile
423 return ninjaDescaper.Replace(s), nil
Dan Willemsen558e5172016-05-19 16:58:46 -0700424}
425
426func (c *makeVarsContext) addVariableRaw(name, value string, strict, sort bool) {
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800427 c.vars = append(c.vars, makeVarsVariable{
428 name: name,
429 value: value,
430 strict: strict,
431 sort: sort,
432 })
433}
434
Dan Willemsen558e5172016-05-19 16:58:46 -0700435func (c *makeVarsContext) addVariable(name, ninjaStr string, strict, sort bool) {
436 value, err := c.Eval(ninjaStr)
437 if err != nil {
Colin Cross65494b92019-02-07 14:25:51 -0800438 c.SingletonContext.Errorf(err.Error())
Dan Willemsen558e5172016-05-19 16:58:46 -0700439 }
440 c.addVariableRaw(name, value, strict, sort)
441}
442
Colin Crossc3d87d32020-06-04 13:25:17 -0700443func (c *makeVarsContext) addPhony(name string, deps []string) {
444 c.phonies = append(c.phonies, phony{name, deps})
445}
446
Colin Cross3cda0d82019-09-24 13:40:07 -0700447func (c *makeVarsContext) addDist(goals []string, paths []string) {
448 c.dists = append(c.dists, dist{
449 goals: goals,
450 paths: paths,
451 })
452}
453
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800454func (c *makeVarsContext) Strict(name, ninjaStr string) {
455 c.addVariable(name, ninjaStr, true, false)
456}
457func (c *makeVarsContext) StrictSorted(name, ninjaStr string) {
458 c.addVariable(name, ninjaStr, true, true)
459}
Dan Willemsen558e5172016-05-19 16:58:46 -0700460func (c *makeVarsContext) StrictRaw(name, value string) {
461 c.addVariableRaw(name, value, true, false)
462}
Dan Willemsen4b7d5de2016-01-12 23:20:28 -0800463
464func (c *makeVarsContext) Check(name, ninjaStr string) {
465 c.addVariable(name, ninjaStr, false, false)
466}
467func (c *makeVarsContext) CheckSorted(name, ninjaStr string) {
468 c.addVariable(name, ninjaStr, false, true)
469}
Dan Willemsen558e5172016-05-19 16:58:46 -0700470func (c *makeVarsContext) CheckRaw(name, value string) {
471 c.addVariableRaw(name, value, false, false)
472}
Colin Crossc3d87d32020-06-04 13:25:17 -0700473
474func (c *makeVarsContext) Phony(name string, deps ...Path) {
475 c.addPhony(name, Paths(deps).Strings())
476}
Colin Cross3cda0d82019-09-24 13:40:07 -0700477
478func (c *makeVarsContext) DistForGoal(goal string, paths ...Path) {
479 c.DistForGoals([]string{goal}, paths...)
480}
481
482func (c *makeVarsContext) DistForGoalWithFilename(goal string, path Path, filename string) {
483 c.DistForGoalsWithFilename([]string{goal}, path, filename)
484}
485
486func (c *makeVarsContext) DistForGoals(goals []string, paths ...Path) {
487 c.addDist(goals, Paths(paths).Strings())
488}
489
490func (c *makeVarsContext) DistForGoalsWithFilename(goals []string, path Path, filename string) {
491 c.addDist(goals, []string{path.String() + ":" + filename})
492}