sh_binary.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  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 sh
  15. import (
  16. "fmt"
  17. "path/filepath"
  18. "sort"
  19. "strings"
  20. "github.com/google/blueprint"
  21. "github.com/google/blueprint/proptools"
  22. "android/soong/android"
  23. "android/soong/bazel"
  24. "android/soong/cc"
  25. "android/soong/snapshot"
  26. "android/soong/tradefed"
  27. )
  28. // sh_binary is for shell scripts (and batch files) that are installed as
  29. // executable files into .../bin/
  30. //
  31. // Do not use them for prebuilt C/C++/etc files. Use cc_prebuilt_binary
  32. // instead.
  33. var pctx = android.NewPackageContext("android/soong/sh")
  34. func init() {
  35. pctx.Import("android/soong/android")
  36. registerShBuildComponents(android.InitRegistrationContext)
  37. }
  38. func registerShBuildComponents(ctx android.RegistrationContext) {
  39. ctx.RegisterModuleType("sh_binary", ShBinaryFactory)
  40. ctx.RegisterModuleType("sh_binary_host", ShBinaryHostFactory)
  41. ctx.RegisterModuleType("sh_test", ShTestFactory)
  42. ctx.RegisterModuleType("sh_test_host", ShTestHostFactory)
  43. }
  44. // Test fixture preparer that will register most sh build components.
  45. //
  46. // Singletons and mutators should only be added here if they are needed for a majority of sh
  47. // module types, otherwise they should be added under a separate preparer to allow them to be
  48. // selected only when needed to reduce test execution time.
  49. //
  50. // Module types do not have much of an overhead unless they are used so this should include as many
  51. // module types as possible. The exceptions are those module types that require mutators and/or
  52. // singletons in order to function in which case they should be kept together in a separate
  53. // preparer.
  54. var PrepareForTestWithShBuildComponents = android.GroupFixturePreparers(
  55. android.FixtureRegisterWithContext(registerShBuildComponents),
  56. )
  57. type shBinaryProperties struct {
  58. // Source file of this prebuilt.
  59. Src *string `android:"path,arch_variant"`
  60. // optional subdirectory under which this file is installed into
  61. Sub_dir *string `android:"arch_variant"`
  62. // optional name for the installed file. If unspecified, name of the module is used as the file name
  63. Filename *string `android:"arch_variant"`
  64. // when set to true, and filename property is not set, the name for the installed file
  65. // is the same as the file name of the source file.
  66. Filename_from_src *bool `android:"arch_variant"`
  67. // Whether this module is directly installable to one of the partitions. Default: true.
  68. Installable *bool
  69. // install symlinks to the binary
  70. Symlinks []string `android:"arch_variant"`
  71. // Make this module available when building for ramdisk.
  72. // On device without a dedicated recovery partition, the module is only
  73. // available after switching root into
  74. // /first_stage_ramdisk. To expose the module before switching root, install
  75. // the recovery variant instead.
  76. Ramdisk_available *bool
  77. // Make this module available when building for vendor ramdisk.
  78. // On device without a dedicated recovery partition, the module is only
  79. // available after switching root into
  80. // /first_stage_ramdisk. To expose the module before switching root, install
  81. // the recovery variant instead.
  82. Vendor_ramdisk_available *bool
  83. // Make this module available when building for recovery.
  84. Recovery_available *bool
  85. }
  86. // Test option struct.
  87. type TestOptions struct {
  88. // If the test is a hostside(no device required) unittest that shall be run during presubmit check.
  89. Unit_test *bool
  90. }
  91. type TestProperties struct {
  92. // list of compatibility suites (for example "cts", "vts") that the module should be
  93. // installed into.
  94. Test_suites []string `android:"arch_variant"`
  95. // the name of the test configuration (for example "AndroidTest.xml") that should be
  96. // installed with the module.
  97. Test_config *string `android:"path,arch_variant"`
  98. // list of files or filegroup modules that provide data that should be installed alongside
  99. // the test.
  100. Data []string `android:"path,arch_variant"`
  101. // Add RootTargetPreparer to auto generated test config. This guarantees the test to run
  102. // with root permission.
  103. Require_root *bool
  104. // the name of the test configuration template (for example "AndroidTestTemplate.xml") that
  105. // should be installed with the module.
  106. Test_config_template *string `android:"path,arch_variant"`
  107. // Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
  108. // doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
  109. // explicitly.
  110. Auto_gen_config *bool
  111. // list of binary modules that should be installed alongside the test
  112. Data_bins []string `android:"path,arch_variant"`
  113. // list of library modules that should be installed alongside the test
  114. Data_libs []string `android:"path,arch_variant"`
  115. // list of device binary modules that should be installed alongside the test.
  116. // Only available for host sh_test modules.
  117. Data_device_bins []string `android:"path,arch_variant"`
  118. // list of device library modules that should be installed alongside the test.
  119. // Only available for host sh_test modules.
  120. Data_device_libs []string `android:"path,arch_variant"`
  121. // Test options.
  122. Test_options TestOptions
  123. }
  124. type ShBinary struct {
  125. android.ModuleBase
  126. android.BazelModuleBase
  127. properties shBinaryProperties
  128. sourceFilePath android.Path
  129. outputFilePath android.OutputPath
  130. installedFile android.InstallPath
  131. }
  132. var _ android.HostToolProvider = (*ShBinary)(nil)
  133. type ShTest struct {
  134. ShBinary
  135. testProperties TestProperties
  136. installDir android.InstallPath
  137. data android.Paths
  138. testConfig android.Path
  139. dataModules map[string]android.Path
  140. }
  141. func (s *ShBinary) HostToolPath() android.OptionalPath {
  142. return android.OptionalPathForPath(s.installedFile)
  143. }
  144. func (s *ShBinary) DepsMutator(ctx android.BottomUpMutatorContext) {
  145. }
  146. func (s *ShBinary) OutputFile() android.OutputPath {
  147. return s.outputFilePath
  148. }
  149. func (s *ShBinary) SubDir() string {
  150. return proptools.String(s.properties.Sub_dir)
  151. }
  152. func (s *ShBinary) RelativeInstallPath() string {
  153. return s.SubDir()
  154. }
  155. func (s *ShBinary) Installable() bool {
  156. return s.properties.Installable == nil || proptools.Bool(s.properties.Installable)
  157. }
  158. func (s *ShBinary) Symlinks() []string {
  159. return s.properties.Symlinks
  160. }
  161. var _ android.ImageInterface = (*ShBinary)(nil)
  162. func (s *ShBinary) ImageMutatorBegin(ctx android.BaseModuleContext) {}
  163. func (s *ShBinary) CoreVariantNeeded(ctx android.BaseModuleContext) bool {
  164. return !s.ModuleBase.InstallInRecovery() && !s.ModuleBase.InstallInRamdisk()
  165. }
  166. func (s *ShBinary) RamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
  167. return proptools.Bool(s.properties.Ramdisk_available) || s.ModuleBase.InstallInRamdisk()
  168. }
  169. func (s *ShBinary) VendorRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
  170. return proptools.Bool(s.properties.Vendor_ramdisk_available) || s.ModuleBase.InstallInVendorRamdisk()
  171. }
  172. func (s *ShBinary) DebugRamdiskVariantNeeded(ctx android.BaseModuleContext) bool {
  173. return false
  174. }
  175. func (s *ShBinary) RecoveryVariantNeeded(ctx android.BaseModuleContext) bool {
  176. return proptools.Bool(s.properties.Recovery_available) || s.ModuleBase.InstallInRecovery()
  177. }
  178. func (s *ShBinary) ExtraImageVariations(ctx android.BaseModuleContext) []string {
  179. return nil
  180. }
  181. func (s *ShBinary) SetImageVariation(ctx android.BaseModuleContext, variation string, module android.Module) {
  182. }
  183. func (s *ShBinary) generateAndroidBuildActions(ctx android.ModuleContext) {
  184. if s.properties.Src == nil {
  185. ctx.PropertyErrorf("src", "missing prebuilt source file")
  186. }
  187. s.sourceFilePath = android.PathForModuleSrc(ctx, proptools.String(s.properties.Src))
  188. filename := proptools.String(s.properties.Filename)
  189. filenameFromSrc := proptools.Bool(s.properties.Filename_from_src)
  190. if filename == "" {
  191. if filenameFromSrc {
  192. filename = s.sourceFilePath.Base()
  193. } else {
  194. filename = ctx.ModuleName()
  195. }
  196. } else if filenameFromSrc {
  197. ctx.PropertyErrorf("filename_from_src", "filename is set. filename_from_src can't be true")
  198. return
  199. }
  200. s.outputFilePath = android.PathForModuleOut(ctx, filename).OutputPath
  201. // This ensures that outputFilePath has the correct name for others to
  202. // use, as the source file may have a different name.
  203. ctx.Build(pctx, android.BuildParams{
  204. Rule: android.CpExecutable,
  205. Output: s.outputFilePath,
  206. Input: s.sourceFilePath,
  207. })
  208. }
  209. func (s *ShBinary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
  210. s.generateAndroidBuildActions(ctx)
  211. installDir := android.PathForModuleInstall(ctx, "bin", proptools.String(s.properties.Sub_dir))
  212. s.installedFile = ctx.InstallExecutable(installDir, s.outputFilePath.Base(), s.outputFilePath)
  213. for _, symlink := range s.Symlinks() {
  214. ctx.InstallSymlink(installDir, symlink, s.installedFile)
  215. }
  216. }
  217. func (s *ShBinary) AndroidMkEntries() []android.AndroidMkEntries {
  218. return []android.AndroidMkEntries{android.AndroidMkEntries{
  219. Class: "EXECUTABLES",
  220. OutputFile: android.OptionalPathForPath(s.outputFilePath),
  221. Include: "$(BUILD_SYSTEM)/soong_cc_rust_prebuilt.mk",
  222. ExtraEntries: []android.AndroidMkExtraEntriesFunc{
  223. func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
  224. s.customAndroidMkEntries(entries)
  225. entries.SetString("LOCAL_MODULE_RELATIVE_PATH", proptools.String(s.properties.Sub_dir))
  226. },
  227. },
  228. }}
  229. }
  230. func (s *ShBinary) customAndroidMkEntries(entries *android.AndroidMkEntries) {
  231. entries.SetString("LOCAL_MODULE_SUFFIX", "")
  232. entries.SetString("LOCAL_MODULE_STEM", s.outputFilePath.Rel())
  233. if len(s.properties.Symlinks) > 0 {
  234. entries.SetString("LOCAL_MODULE_SYMLINKS", strings.Join(s.properties.Symlinks, " "))
  235. }
  236. }
  237. type dependencyTag struct {
  238. blueprint.BaseDependencyTag
  239. name string
  240. }
  241. var (
  242. shTestDataBinsTag = dependencyTag{name: "dataBins"}
  243. shTestDataLibsTag = dependencyTag{name: "dataLibs"}
  244. shTestDataDeviceBinsTag = dependencyTag{name: "dataDeviceBins"}
  245. shTestDataDeviceLibsTag = dependencyTag{name: "dataDeviceLibs"}
  246. )
  247. var sharedLibVariations = []blueprint.Variation{{Mutator: "link", Variation: "shared"}}
  248. func (s *ShTest) DepsMutator(ctx android.BottomUpMutatorContext) {
  249. s.ShBinary.DepsMutator(ctx)
  250. ctx.AddFarVariationDependencies(ctx.Target().Variations(), shTestDataBinsTag, s.testProperties.Data_bins...)
  251. ctx.AddFarVariationDependencies(append(ctx.Target().Variations(), sharedLibVariations...),
  252. shTestDataLibsTag, s.testProperties.Data_libs...)
  253. if (ctx.Target().Os.Class == android.Host || ctx.BazelConversionMode()) && len(ctx.Config().Targets[android.Android]) > 0 {
  254. deviceVariations := ctx.Config().AndroidFirstDeviceTarget.Variations()
  255. ctx.AddFarVariationDependencies(deviceVariations, shTestDataDeviceBinsTag, s.testProperties.Data_device_bins...)
  256. ctx.AddFarVariationDependencies(append(deviceVariations, sharedLibVariations...),
  257. shTestDataDeviceLibsTag, s.testProperties.Data_device_libs...)
  258. } else if ctx.Target().Os.Class != android.Host {
  259. if len(s.testProperties.Data_device_bins) > 0 {
  260. ctx.PropertyErrorf("data_device_bins", "only available for host modules")
  261. }
  262. if len(s.testProperties.Data_device_libs) > 0 {
  263. ctx.PropertyErrorf("data_device_libs", "only available for host modules")
  264. }
  265. }
  266. }
  267. func (s *ShTest) addToDataModules(ctx android.ModuleContext, relPath string, path android.Path) {
  268. if _, exists := s.dataModules[relPath]; exists {
  269. ctx.ModuleErrorf("data modules have a conflicting installation path, %v - %s, %s",
  270. relPath, s.dataModules[relPath].String(), path.String())
  271. return
  272. }
  273. s.dataModules[relPath] = path
  274. }
  275. func (s *ShTest) GenerateAndroidBuildActions(ctx android.ModuleContext) {
  276. s.ShBinary.generateAndroidBuildActions(ctx)
  277. testDir := "nativetest"
  278. if ctx.Target().Arch.ArchType.Multilib == "lib64" {
  279. testDir = "nativetest64"
  280. }
  281. if ctx.Target().NativeBridge == android.NativeBridgeEnabled {
  282. testDir = filepath.Join(testDir, ctx.Target().NativeBridgeRelativePath)
  283. } else if !ctx.Host() && ctx.Config().HasMultilibConflict(ctx.Arch().ArchType) {
  284. testDir = filepath.Join(testDir, ctx.Arch().ArchType.String())
  285. }
  286. if s.SubDir() != "" {
  287. // Don't add the module name to the installation path if sub_dir is specified for backward
  288. // compatibility.
  289. s.installDir = android.PathForModuleInstall(ctx, testDir, s.SubDir())
  290. } else {
  291. s.installDir = android.PathForModuleInstall(ctx, testDir, s.Name())
  292. }
  293. s.installedFile = ctx.InstallExecutable(s.installDir, s.outputFilePath.Base(), s.outputFilePath)
  294. s.data = android.PathsForModuleSrc(ctx, s.testProperties.Data)
  295. var configs []tradefed.Config
  296. if Bool(s.testProperties.Require_root) {
  297. configs = append(configs, tradefed.Object{"target_preparer", "com.android.tradefed.targetprep.RootTargetPreparer", nil})
  298. } else {
  299. options := []tradefed.Option{{Name: "force-root", Value: "false"}}
  300. configs = append(configs, tradefed.Object{"target_preparer", "com.android.tradefed.targetprep.RootTargetPreparer", options})
  301. }
  302. if len(s.testProperties.Data_device_bins) > 0 {
  303. moduleName := s.Name()
  304. remoteDir := "/data/local/tests/unrestricted/" + moduleName + "/"
  305. options := []tradefed.Option{{Name: "cleanup", Value: "true"}}
  306. for _, bin := range s.testProperties.Data_device_bins {
  307. options = append(options, tradefed.Option{Name: "push-file", Key: bin, Value: remoteDir + bin})
  308. }
  309. configs = append(configs, tradefed.Object{"target_preparer", "com.android.tradefed.targetprep.PushFilePreparer", options})
  310. }
  311. s.testConfig = tradefed.AutoGenShellTestConfig(ctx, s.testProperties.Test_config,
  312. s.testProperties.Test_config_template, s.testProperties.Test_suites, configs, s.testProperties.Auto_gen_config, s.outputFilePath.Base())
  313. s.dataModules = make(map[string]android.Path)
  314. ctx.VisitDirectDeps(func(dep android.Module) {
  315. depTag := ctx.OtherModuleDependencyTag(dep)
  316. switch depTag {
  317. case shTestDataBinsTag, shTestDataDeviceBinsTag:
  318. path := android.OutputFileForModule(ctx, dep, "")
  319. s.addToDataModules(ctx, path.Base(), path)
  320. case shTestDataLibsTag, shTestDataDeviceLibsTag:
  321. if cc, isCc := dep.(*cc.Module); isCc {
  322. // Copy to an intermediate output directory to append "lib[64]" to the path,
  323. // so that it's compatible with the default rpath values.
  324. var relPath string
  325. if cc.Arch().ArchType.Multilib == "lib64" {
  326. relPath = filepath.Join("lib64", cc.OutputFile().Path().Base())
  327. } else {
  328. relPath = filepath.Join("lib", cc.OutputFile().Path().Base())
  329. }
  330. if _, exist := s.dataModules[relPath]; exist {
  331. return
  332. }
  333. relocatedLib := android.PathForModuleOut(ctx, "relocated", relPath)
  334. ctx.Build(pctx, android.BuildParams{
  335. Rule: android.Cp,
  336. Input: cc.OutputFile().Path(),
  337. Output: relocatedLib,
  338. })
  339. s.addToDataModules(ctx, relPath, relocatedLib)
  340. return
  341. }
  342. property := "data_libs"
  343. if depTag == shTestDataDeviceBinsTag {
  344. property = "data_device_libs"
  345. }
  346. ctx.PropertyErrorf(property, "%q of type %q is not supported", dep.Name(), ctx.OtherModuleType(dep))
  347. }
  348. })
  349. }
  350. func (s *ShTest) InstallInData() bool {
  351. return true
  352. }
  353. func (s *ShTest) AndroidMkEntries() []android.AndroidMkEntries {
  354. return []android.AndroidMkEntries{android.AndroidMkEntries{
  355. Class: "NATIVE_TESTS",
  356. OutputFile: android.OptionalPathForPath(s.outputFilePath),
  357. Include: "$(BUILD_SYSTEM)/soong_cc_rust_prebuilt.mk",
  358. ExtraEntries: []android.AndroidMkExtraEntriesFunc{
  359. func(ctx android.AndroidMkExtraEntriesContext, entries *android.AndroidMkEntries) {
  360. s.customAndroidMkEntries(entries)
  361. entries.SetPath("LOCAL_MODULE_PATH", s.installDir)
  362. entries.AddCompatibilityTestSuites(s.testProperties.Test_suites...)
  363. if s.testConfig != nil {
  364. entries.SetPath("LOCAL_FULL_TEST_CONFIG", s.testConfig)
  365. }
  366. for _, d := range s.data {
  367. rel := d.Rel()
  368. path := d.String()
  369. if !strings.HasSuffix(path, rel) {
  370. panic(fmt.Errorf("path %q does not end with %q", path, rel))
  371. }
  372. path = strings.TrimSuffix(path, rel)
  373. entries.AddStrings("LOCAL_TEST_DATA", path+":"+rel)
  374. }
  375. relPaths := make([]string, 0)
  376. for relPath, _ := range s.dataModules {
  377. relPaths = append(relPaths, relPath)
  378. }
  379. sort.Strings(relPaths)
  380. for _, relPath := range relPaths {
  381. dir := strings.TrimSuffix(s.dataModules[relPath].String(), relPath)
  382. entries.AddStrings("LOCAL_TEST_DATA", dir+":"+relPath)
  383. }
  384. if Bool(s.testProperties.Test_options.Unit_test) {
  385. entries.SetBool("LOCAL_IS_UNIT_TEST", true)
  386. }
  387. },
  388. },
  389. }}
  390. }
  391. func InitShBinaryModule(s *ShBinary) {
  392. s.AddProperties(&s.properties)
  393. android.InitBazelModule(s)
  394. }
  395. // sh_binary is for a shell script or batch file to be installed as an
  396. // executable binary to <partition>/bin.
  397. func ShBinaryFactory() android.Module {
  398. module := &ShBinary{}
  399. InitShBinaryModule(module)
  400. android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibFirst)
  401. return module
  402. }
  403. // sh_binary_host is for a shell script to be installed as an executable binary
  404. // to $(HOST_OUT)/bin.
  405. func ShBinaryHostFactory() android.Module {
  406. module := &ShBinary{}
  407. InitShBinaryModule(module)
  408. android.InitAndroidArchModule(module, android.HostSupported, android.MultilibFirst)
  409. return module
  410. }
  411. // sh_test defines a shell script based test module.
  412. func ShTestFactory() android.Module {
  413. module := &ShTest{}
  414. InitShBinaryModule(&module.ShBinary)
  415. module.AddProperties(&module.testProperties)
  416. android.InitAndroidArchModule(module, android.HostAndDeviceSupported, android.MultilibFirst)
  417. return module
  418. }
  419. // sh_test_host defines a shell script based test module that runs on a host.
  420. func ShTestHostFactory() android.Module {
  421. module := &ShTest{}
  422. InitShBinaryModule(&module.ShBinary)
  423. module.AddProperties(&module.testProperties)
  424. // Default sh_test_host to unit_tests = true
  425. if module.testProperties.Test_options.Unit_test == nil {
  426. module.testProperties.Test_options.Unit_test = proptools.BoolPtr(true)
  427. }
  428. android.InitAndroidArchModule(module, android.HostSupported, android.MultilibFirst)
  429. return module
  430. }
  431. type bazelShBinaryAttributes struct {
  432. Srcs bazel.LabelListAttribute
  433. Filename string
  434. Sub_dir string
  435. // Bazel also supports the attributes below, but (so far) these are not required for Bionic
  436. // deps
  437. // data
  438. // args
  439. // compatible_with
  440. // deprecation
  441. // distribs
  442. // env
  443. // exec_compatible_with
  444. // exec_properties
  445. // features
  446. // licenses
  447. // output_licenses
  448. // restricted_to
  449. // tags
  450. // target_compatible_with
  451. // testonly
  452. // toolchains
  453. // visibility
  454. }
  455. func (m *ShBinary) ConvertWithBp2build(ctx android.TopDownMutatorContext) {
  456. srcs := bazel.MakeLabelListAttribute(
  457. android.BazelLabelForModuleSrc(ctx, []string{*m.properties.Src}))
  458. var filename string
  459. if m.properties.Filename != nil {
  460. filename = *m.properties.Filename
  461. }
  462. var subDir string
  463. if m.properties.Sub_dir != nil {
  464. subDir = *m.properties.Sub_dir
  465. }
  466. attrs := &bazelShBinaryAttributes{
  467. Srcs: srcs,
  468. Filename: filename,
  469. Sub_dir: subDir,
  470. }
  471. props := bazel.BazelTargetModuleProperties{
  472. Rule_class: "sh_binary",
  473. Bzl_load_location: "//build/bazel/rules:sh_binary.bzl",
  474. }
  475. ctx.CreateBazelTargetModule(props, android.CommonAttributes{Name: m.Name()}, attrs)
  476. }
  477. var Bool = proptools.Bool
  478. var _ snapshot.RelativeInstallPath = (*ShBinary)(nil)