python.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. // Copyright 2017 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 python
  15. // This file contains the "Base" module type for building Python program.
  16. import (
  17. "fmt"
  18. "path/filepath"
  19. "regexp"
  20. "strings"
  21. "github.com/google/blueprint"
  22. "github.com/google/blueprint/proptools"
  23. "android/soong/android"
  24. )
  25. func init() {
  26. registerPythonMutators(android.InitRegistrationContext)
  27. }
  28. func registerPythonMutators(ctx android.RegistrationContext) {
  29. ctx.PreDepsMutators(RegisterPythonPreDepsMutators)
  30. }
  31. // Exported to support other packages using Python modules in tests.
  32. func RegisterPythonPreDepsMutators(ctx android.RegisterMutatorsContext) {
  33. ctx.BottomUp("python_version", versionSplitMutator()).Parallel()
  34. }
  35. // the version-specific properties that apply to python modules.
  36. type VersionProperties struct {
  37. // whether the module is required to be built with this version.
  38. // Defaults to true for Python 3, and false otherwise.
  39. Enabled *bool
  40. // list of source files specific to this Python version.
  41. // Using the syntax ":module", srcs may reference the outputs of other modules that produce source files,
  42. // e.g. genrule or filegroup.
  43. Srcs []string `android:"path,arch_variant"`
  44. // list of source files that should not be used to build the Python module for this version.
  45. // This is most useful to remove files that are not common to all Python versions.
  46. Exclude_srcs []string `android:"path,arch_variant"`
  47. // list of the Python libraries used only for this Python version.
  48. Libs []string `android:"arch_variant"`
  49. // whether the binary is required to be built with embedded launcher for this version, defaults to false.
  50. Embedded_launcher *bool // TODO(b/174041232): Remove this property
  51. }
  52. // properties that apply to all python modules
  53. type BaseProperties struct {
  54. // the package path prefix within the output artifact at which to place the source/data
  55. // files of the current module.
  56. // eg. Pkg_path = "a/b/c"; Other packages can reference this module by using
  57. // (from a.b.c import ...) statement.
  58. // if left unspecified, all the source/data files path is unchanged within zip file.
  59. Pkg_path *string
  60. // true, if the Python module is used internally, eg, Python std libs.
  61. Is_internal *bool
  62. // list of source (.py) files compatible both with Python2 and Python3 used to compile the
  63. // Python module.
  64. // srcs may reference the outputs of other modules that produce source files like genrule
  65. // or filegroup using the syntax ":module".
  66. // Srcs has to be non-empty.
  67. Srcs []string `android:"path,arch_variant"`
  68. // list of source files that should not be used to build the C/C++ module.
  69. // This is most useful in the arch/multilib variants to remove non-common files
  70. Exclude_srcs []string `android:"path,arch_variant"`
  71. // list of files or filegroup modules that provide data that should be installed alongside
  72. // the test. the file extension can be arbitrary except for (.py).
  73. Data []string `android:"path,arch_variant"`
  74. // list of java modules that provide data that should be installed alongside the test.
  75. Java_data []string
  76. // list of the Python libraries compatible both with Python2 and Python3.
  77. Libs []string `android:"arch_variant"`
  78. Version struct {
  79. // Python2-specific properties, including whether Python2 is supported for this module
  80. // and version-specific sources, exclusions and dependencies.
  81. Py2 VersionProperties `android:"arch_variant"`
  82. // Python3-specific properties, including whether Python3 is supported for this module
  83. // and version-specific sources, exclusions and dependencies.
  84. Py3 VersionProperties `android:"arch_variant"`
  85. } `android:"arch_variant"`
  86. // the actual version each module uses after variations created.
  87. // this property name is hidden from users' perspectives, and soong will populate it during
  88. // runtime.
  89. Actual_version string `blueprint:"mutated"`
  90. // whether the module is required to be built with actual_version.
  91. // this is set by the python version mutator based on version-specific properties
  92. Enabled *bool `blueprint:"mutated"`
  93. // whether the binary is required to be built with embedded launcher for this actual_version.
  94. // this is set by the python version mutator based on version-specific properties
  95. Embedded_launcher *bool `blueprint:"mutated"`
  96. }
  97. // Used to store files of current module after expanding dependencies
  98. type pathMapping struct {
  99. dest string
  100. src android.Path
  101. }
  102. type PythonLibraryModule struct {
  103. android.ModuleBase
  104. android.DefaultableModuleBase
  105. android.BazelModuleBase
  106. properties BaseProperties
  107. protoProperties android.ProtoProperties
  108. // initialize before calling Init
  109. hod android.HostOrDeviceSupported
  110. multilib android.Multilib
  111. // the Python files of current module after expanding source dependencies.
  112. // pathMapping: <dest: runfile_path, src: source_path>
  113. srcsPathMappings []pathMapping
  114. // the data files of current module after expanding source dependencies.
  115. // pathMapping: <dest: runfile_path, src: source_path>
  116. dataPathMappings []pathMapping
  117. // the zip filepath for zipping current module source/data files.
  118. srcsZip android.Path
  119. }
  120. // newModule generates new Python base module
  121. func newModule(hod android.HostOrDeviceSupported, multilib android.Multilib) *PythonLibraryModule {
  122. return &PythonLibraryModule{
  123. hod: hod,
  124. multilib: multilib,
  125. }
  126. }
  127. // interface implemented by Python modules to provide source and data mappings and zip to python
  128. // modules that depend on it
  129. type pythonDependency interface {
  130. getSrcsPathMappings() []pathMapping
  131. getDataPathMappings() []pathMapping
  132. getSrcsZip() android.Path
  133. }
  134. // getSrcsPathMappings gets this module's path mapping of src source path : runfiles destination
  135. func (p *PythonLibraryModule) getSrcsPathMappings() []pathMapping {
  136. return p.srcsPathMappings
  137. }
  138. // getSrcsPathMappings gets this module's path mapping of data source path : runfiles destination
  139. func (p *PythonLibraryModule) getDataPathMappings() []pathMapping {
  140. return p.dataPathMappings
  141. }
  142. // getSrcsZip returns the filepath where the current module's source/data files are zipped.
  143. func (p *PythonLibraryModule) getSrcsZip() android.Path {
  144. return p.srcsZip
  145. }
  146. func (p *PythonLibraryModule) getBaseProperties() *BaseProperties {
  147. return &p.properties
  148. }
  149. var _ pythonDependency = (*PythonLibraryModule)(nil)
  150. func (p *PythonLibraryModule) init() android.Module {
  151. p.AddProperties(&p.properties, &p.protoProperties)
  152. android.InitAndroidArchModule(p, p.hod, p.multilib)
  153. android.InitDefaultableModule(p)
  154. android.InitBazelModule(p)
  155. return p
  156. }
  157. // Python-specific tag to transfer information on the purpose of a dependency.
  158. // This is used when adding a dependency on a module, which can later be accessed when visiting
  159. // dependencies.
  160. type dependencyTag struct {
  161. blueprint.BaseDependencyTag
  162. name string
  163. }
  164. // Python-specific tag that indicates that installed files of this module should depend on installed
  165. // files of the dependency
  166. type installDependencyTag struct {
  167. blueprint.BaseDependencyTag
  168. // embedding this struct provides the installation dependency requirement
  169. android.InstallAlwaysNeededDependencyTag
  170. name string
  171. }
  172. var (
  173. pythonLibTag = dependencyTag{name: "pythonLib"}
  174. javaDataTag = dependencyTag{name: "javaData"}
  175. launcherTag = dependencyTag{name: "launcher"}
  176. launcherSharedLibTag = installDependencyTag{name: "launcherSharedLib"}
  177. pathComponentRegexp = regexp.MustCompile(`^[a-zA-Z_][a-zA-Z0-9_-]*$`)
  178. pyExt = ".py"
  179. protoExt = ".proto"
  180. pyVersion2 = "PY2"
  181. pyVersion3 = "PY3"
  182. internalPath = "internal"
  183. )
  184. type basePropertiesProvider interface {
  185. getBaseProperties() *BaseProperties
  186. }
  187. // versionSplitMutator creates version variants for modules and appends the version-specific
  188. // properties for a given variant to the properties in the variant module
  189. func versionSplitMutator() func(android.BottomUpMutatorContext) {
  190. return func(mctx android.BottomUpMutatorContext) {
  191. if base, ok := mctx.Module().(basePropertiesProvider); ok {
  192. props := base.getBaseProperties()
  193. var versionNames []string
  194. // collect version specific properties, so that we can merge version-specific properties
  195. // into the module's overall properties
  196. var versionProps []VersionProperties
  197. // PY3 is first so that we alias the PY3 variant rather than PY2 if both
  198. // are available
  199. if proptools.BoolDefault(props.Version.Py3.Enabled, true) {
  200. versionNames = append(versionNames, pyVersion3)
  201. versionProps = append(versionProps, props.Version.Py3)
  202. }
  203. if proptools.BoolDefault(props.Version.Py2.Enabled, false) {
  204. versionNames = append(versionNames, pyVersion2)
  205. versionProps = append(versionProps, props.Version.Py2)
  206. }
  207. modules := mctx.CreateLocalVariations(versionNames...)
  208. // Alias module to the first variant
  209. if len(versionNames) > 0 {
  210. mctx.AliasVariation(versionNames[0])
  211. }
  212. for i, v := range versionNames {
  213. // set the actual version for Python module.
  214. newProps := modules[i].(basePropertiesProvider).getBaseProperties()
  215. newProps.Actual_version = v
  216. // append versioned properties for the Python module to the overall properties
  217. err := proptools.AppendMatchingProperties([]interface{}{newProps}, &versionProps[i], nil)
  218. if err != nil {
  219. panic(err)
  220. }
  221. }
  222. }
  223. }
  224. }
  225. func anyHasExt(paths []string, ext string) bool {
  226. for _, p := range paths {
  227. if filepath.Ext(p) == ext {
  228. return true
  229. }
  230. }
  231. return false
  232. }
  233. func (p *PythonLibraryModule) anySrcHasExt(ctx android.BottomUpMutatorContext, ext string) bool {
  234. return anyHasExt(p.properties.Srcs, ext)
  235. }
  236. // DepsMutator mutates dependencies for this module:
  237. // - handles proto dependencies,
  238. // - if required, specifies launcher and adds launcher dependencies,
  239. // - applies python version mutations to Python dependencies
  240. func (p *PythonLibraryModule) DepsMutator(ctx android.BottomUpMutatorContext) {
  241. android.ProtoDeps(ctx, &p.protoProperties)
  242. versionVariation := []blueprint.Variation{
  243. {"python_version", p.properties.Actual_version},
  244. }
  245. // If sources contain a proto file, add dependency on libprotobuf-python
  246. if p.anySrcHasExt(ctx, protoExt) && p.Name() != "libprotobuf-python" {
  247. ctx.AddVariationDependencies(versionVariation, pythonLibTag, "libprotobuf-python")
  248. }
  249. // Add python library dependencies for this python version variation
  250. ctx.AddVariationDependencies(versionVariation, pythonLibTag, android.LastUniqueStrings(p.properties.Libs)...)
  251. // Emulate the data property for java_data but with the arch variation overridden to "common"
  252. // so that it can point to java modules.
  253. javaDataVariation := []blueprint.Variation{{"arch", android.Common.String()}}
  254. ctx.AddVariationDependencies(javaDataVariation, javaDataTag, p.properties.Java_data...)
  255. }
  256. // GenerateAndroidBuildActions performs build actions common to all Python modules
  257. func (p *PythonLibraryModule) GenerateAndroidBuildActions(ctx android.ModuleContext) {
  258. expandedSrcs := android.PathsForModuleSrcExcludes(ctx, p.properties.Srcs, p.properties.Exclude_srcs)
  259. // expand data files from "data" property.
  260. expandedData := android.PathsForModuleSrc(ctx, p.properties.Data)
  261. // Emulate the data property for java_data dependencies.
  262. for _, javaData := range ctx.GetDirectDepsWithTag(javaDataTag) {
  263. expandedData = append(expandedData, android.OutputFilesForModule(ctx, javaData, "")...)
  264. }
  265. // Validate pkg_path property
  266. pkgPath := String(p.properties.Pkg_path)
  267. if pkgPath != "" {
  268. // TODO: export validation from android/paths.go handling to replace this duplicated functionality
  269. pkgPath = filepath.Clean(String(p.properties.Pkg_path))
  270. if pkgPath == ".." || strings.HasPrefix(pkgPath, "../") ||
  271. strings.HasPrefix(pkgPath, "/") {
  272. ctx.PropertyErrorf("pkg_path",
  273. "%q must be a relative path contained in par file.",
  274. String(p.properties.Pkg_path))
  275. return
  276. }
  277. }
  278. // If property Is_internal is set, prepend pkgPath with internalPath
  279. if proptools.BoolDefault(p.properties.Is_internal, false) {
  280. pkgPath = filepath.Join(internalPath, pkgPath)
  281. }
  282. // generate src:destination path mappings for this module
  283. p.genModulePathMappings(ctx, pkgPath, expandedSrcs, expandedData)
  284. // generate the zipfile of all source and data files
  285. p.srcsZip = p.createSrcsZip(ctx, pkgPath)
  286. }
  287. func isValidPythonPath(path string) error {
  288. identifiers := strings.Split(strings.TrimSuffix(path, filepath.Ext(path)), "/")
  289. for _, token := range identifiers {
  290. if !pathComponentRegexp.MatchString(token) {
  291. return fmt.Errorf("the path %q contains invalid subpath %q. "+
  292. "Subpaths must be at least one character long. "+
  293. "The first character must an underscore or letter. "+
  294. "Following characters may be any of: letter, digit, underscore, hyphen.",
  295. path, token)
  296. }
  297. }
  298. return nil
  299. }
  300. // For this module, generate unique pathMappings: <dest: runfiles_path, src: source_path>
  301. // for python/data files expanded from properties.
  302. func (p *PythonLibraryModule) genModulePathMappings(ctx android.ModuleContext, pkgPath string,
  303. expandedSrcs, expandedData android.Paths) {
  304. // fetch <runfiles_path, source_path> pairs from "src" and "data" properties to
  305. // check current module duplicates.
  306. destToPySrcs := make(map[string]string)
  307. destToPyData := make(map[string]string)
  308. for _, s := range expandedSrcs {
  309. if s.Ext() != pyExt && s.Ext() != protoExt {
  310. ctx.PropertyErrorf("srcs", "found non (.py|.proto) file: %q!", s.String())
  311. continue
  312. }
  313. runfilesPath := filepath.Join(pkgPath, s.Rel())
  314. if err := isValidPythonPath(runfilesPath); err != nil {
  315. ctx.PropertyErrorf("srcs", err.Error())
  316. }
  317. if !checkForDuplicateOutputPath(ctx, destToPySrcs, runfilesPath, s.String(), p.Name(), p.Name()) {
  318. p.srcsPathMappings = append(p.srcsPathMappings, pathMapping{dest: runfilesPath, src: s})
  319. }
  320. }
  321. for _, d := range expandedData {
  322. if d.Ext() == pyExt || d.Ext() == protoExt {
  323. ctx.PropertyErrorf("data", "found (.py|.proto) file: %q!", d.String())
  324. continue
  325. }
  326. runfilesPath := filepath.Join(pkgPath, d.Rel())
  327. if !checkForDuplicateOutputPath(ctx, destToPyData, runfilesPath, d.String(), p.Name(), p.Name()) {
  328. p.dataPathMappings = append(p.dataPathMappings,
  329. pathMapping{dest: runfilesPath, src: d})
  330. }
  331. }
  332. }
  333. // createSrcsZip registers build actions to zip current module's sources and data.
  334. func (p *PythonLibraryModule) createSrcsZip(ctx android.ModuleContext, pkgPath string) android.Path {
  335. relativeRootMap := make(map[string]android.Paths)
  336. pathMappings := append(p.srcsPathMappings, p.dataPathMappings...)
  337. var protoSrcs android.Paths
  338. // "srcs" or "data" properties may contain filegroup so it might happen that
  339. // the root directory for each source path is different.
  340. for _, path := range pathMappings {
  341. // handle proto sources separately
  342. if path.src.Ext() == protoExt {
  343. protoSrcs = append(protoSrcs, path.src)
  344. } else {
  345. relativeRoot := strings.TrimSuffix(path.src.String(), path.src.Rel())
  346. relativeRootMap[relativeRoot] = append(relativeRootMap[relativeRoot], path.src)
  347. }
  348. }
  349. var zips android.Paths
  350. if len(protoSrcs) > 0 {
  351. protoFlags := android.GetProtoFlags(ctx, &p.protoProperties)
  352. protoFlags.OutTypeFlag = "--python_out"
  353. if pkgPath != "" {
  354. pkgPathStagingDir := android.PathForModuleGen(ctx, "protos_staged_for_pkg_path")
  355. rule := android.NewRuleBuilder(pctx, ctx)
  356. var stagedProtoSrcs android.Paths
  357. for _, srcFile := range protoSrcs {
  358. stagedProtoSrc := pkgPathStagingDir.Join(ctx, pkgPath, srcFile.Rel())
  359. rule.Command().Text("mkdir -p").Flag(filepath.Base(stagedProtoSrc.String()))
  360. rule.Command().Text("cp -f").Input(srcFile).Output(stagedProtoSrc)
  361. stagedProtoSrcs = append(stagedProtoSrcs, stagedProtoSrc)
  362. }
  363. rule.Build("stage_protos_for_pkg_path", "Stage protos for pkg_path")
  364. protoSrcs = stagedProtoSrcs
  365. }
  366. for _, srcFile := range protoSrcs {
  367. zip := genProto(ctx, srcFile, protoFlags)
  368. zips = append(zips, zip)
  369. }
  370. }
  371. if len(relativeRootMap) > 0 {
  372. // in order to keep stable order of soong_zip params, we sort the keys here.
  373. roots := android.SortedStringKeys(relativeRootMap)
  374. // Use -symlinks=false so that the symlinks in the bazel output directory are followed
  375. parArgs := []string{"-symlinks=false"}
  376. if pkgPath != "" {
  377. // use package path as path prefix
  378. parArgs = append(parArgs, `-P `+pkgPath)
  379. }
  380. paths := android.Paths{}
  381. for _, root := range roots {
  382. // specify relative root of file in following -f arguments
  383. parArgs = append(parArgs, `-C `+root)
  384. for _, path := range relativeRootMap[root] {
  385. parArgs = append(parArgs, `-f `+path.String())
  386. paths = append(paths, path)
  387. }
  388. }
  389. origSrcsZip := android.PathForModuleOut(ctx, ctx.ModuleName()+".py.srcszip")
  390. ctx.Build(pctx, android.BuildParams{
  391. Rule: zip,
  392. Description: "python library archive",
  393. Output: origSrcsZip,
  394. // as zip rule does not use $in, there is no real need to distinguish between Inputs and Implicits
  395. Implicits: paths,
  396. Args: map[string]string{
  397. "args": strings.Join(parArgs, " "),
  398. },
  399. })
  400. zips = append(zips, origSrcsZip)
  401. }
  402. // we may have multiple zips due to separate handling of proto source files
  403. if len(zips) == 1 {
  404. return zips[0]
  405. } else {
  406. combinedSrcsZip := android.PathForModuleOut(ctx, ctx.ModuleName()+".srcszip")
  407. ctx.Build(pctx, android.BuildParams{
  408. Rule: combineZip,
  409. Description: "combine python library archive",
  410. Output: combinedSrcsZip,
  411. Inputs: zips,
  412. })
  413. return combinedSrcsZip
  414. }
  415. }
  416. // isPythonLibModule returns whether the given module is a Python library PythonLibraryModule or not
  417. func isPythonLibModule(module blueprint.Module) bool {
  418. if _, ok := module.(*PythonLibraryModule); ok {
  419. if _, ok := module.(*PythonBinaryModule); !ok {
  420. return true
  421. }
  422. }
  423. return false
  424. }
  425. // collectPathsFromTransitiveDeps checks for source/data files for duplicate paths
  426. // for module and its transitive dependencies and collects list of data/source file
  427. // zips for transitive dependencies.
  428. func (p *PythonLibraryModule) collectPathsFromTransitiveDeps(ctx android.ModuleContext) android.Paths {
  429. // fetch <runfiles_path, source_path> pairs from "src" and "data" properties to
  430. // check duplicates.
  431. destToPySrcs := make(map[string]string)
  432. destToPyData := make(map[string]string)
  433. for _, path := range p.srcsPathMappings {
  434. destToPySrcs[path.dest] = path.src.String()
  435. }
  436. for _, path := range p.dataPathMappings {
  437. destToPyData[path.dest] = path.src.String()
  438. }
  439. seen := make(map[android.Module]bool)
  440. var result android.Paths
  441. // visit all its dependencies in depth first.
  442. ctx.WalkDeps(func(child, parent android.Module) bool {
  443. // we only collect dependencies tagged as python library deps
  444. if ctx.OtherModuleDependencyTag(child) != pythonLibTag {
  445. return false
  446. }
  447. if seen[child] {
  448. return false
  449. }
  450. seen[child] = true
  451. // Python modules only can depend on Python libraries.
  452. if !isPythonLibModule(child) {
  453. ctx.PropertyErrorf("libs",
  454. "the dependency %q of module %q is not Python library!",
  455. ctx.OtherModuleName(child), ctx.ModuleName())
  456. }
  457. // collect source and data paths, checking that there are no duplicate output file conflicts
  458. if dep, ok := child.(pythonDependency); ok {
  459. srcs := dep.getSrcsPathMappings()
  460. for _, path := range srcs {
  461. checkForDuplicateOutputPath(ctx, destToPySrcs,
  462. path.dest, path.src.String(), ctx.ModuleName(), ctx.OtherModuleName(child))
  463. }
  464. data := dep.getDataPathMappings()
  465. for _, path := range data {
  466. checkForDuplicateOutputPath(ctx, destToPyData,
  467. path.dest, path.src.String(), ctx.ModuleName(), ctx.OtherModuleName(child))
  468. }
  469. result = append(result, dep.getSrcsZip())
  470. }
  471. return true
  472. })
  473. return result
  474. }
  475. // chckForDuplicateOutputPath checks whether outputPath has already been included in map m, which
  476. // would result in two files being placed in the same location.
  477. // If there is a duplicate path, an error is thrown and true is returned
  478. // Otherwise, outputPath: srcPath is added to m and returns false
  479. func checkForDuplicateOutputPath(ctx android.ModuleContext, m map[string]string, outputPath, srcPath, curModule, otherModule string) bool {
  480. if oldSrcPath, found := m[outputPath]; found {
  481. ctx.ModuleErrorf("found two files to be placed at the same location within zip %q."+
  482. " First file: in module %s at path %q."+
  483. " Second file: in module %s at path %q.",
  484. outputPath, curModule, oldSrcPath, otherModule, srcPath)
  485. return true
  486. }
  487. m[outputPath] = srcPath
  488. return false
  489. }
  490. // InstallInData returns true as Python is not supported in the system partition
  491. func (p *PythonLibraryModule) InstallInData() bool {
  492. return true
  493. }
  494. var Bool = proptools.Bool
  495. var BoolDefault = proptools.BoolDefault
  496. var String = proptools.String