From 511761b1ab368feeca38af8e9047df1be38f40fc Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Fri, 4 Oct 2024 09:57:22 -0400 Subject: [PATCH] Do not use effect.NewExecutor use CommandExecutor instead When running `syft`, do not use effect.NewExecutor which runs the command with a tty. This seems to cause an issue with syft (or possibly with our tty library pty), and in either case you end up with stray formatting characters even though we tell syft to be quiet. Using CommandExecutor is basically the same, but it doesn't run with a tty. Signed-off-by: Daniel Mikusa --- native/build.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/build.go b/native/build.go index 3a168d9..676a119 100644 --- a/native/build.go +++ b/native/build.go @@ -125,7 +125,7 @@ func (b Build) Build(context libcnb.BuildContext) (libcnb.BuildResult, error) { ) if b.SBOMScanner == nil { - b.SBOMScanner = sbom.NewSyftCLISBOMScanner(context.Layers, effect.NewExecutor(), b.Logger) + b.SBOMScanner = sbom.NewSyftCLISBOMScanner(context.Layers, effect.CommandExecutor{}, b.Logger) } if err := b.SBOMScanner.ScanLaunch(context.Application.Path, libcnb.SyftJSON, libcnb.CycloneDXJSON); err != nil { return libcnb.BuildResult{}, fmt.Errorf("unable to create Build SBoM \n%w", err)