@@ -37,7 +37,7 @@ import (
3737 "github.com/elastic/elastic-agent/dev-tools/mage/otel"
3838
3939 "github.com/jedib0t/go-pretty/v6/table"
40- "github.com/otiai10/copy"
40+ filecopy "github.com/otiai10/copy"
4141
4242 "github.com/elastic/elastic-agent/dev-tools/devmachine"
4343 "github.com/elastic/elastic-agent/dev-tools/mage"
@@ -434,7 +434,11 @@ func (Build) TestBinaries() error {
434434 }
435435
436436 outputName := filepath .Join (pkg , binary )
437- err := devtools .Run (nil , nil , os .Stderr , "go" , pkg , "build" , "-v" , "-o" , outputName , pkg )
437+ finalArgs := make ([]string , len (args ))
438+ copy (finalArgs , args )
439+ finalArgs = append (finalArgs , "-o" , outputName , filepath .Join (pkg ))
440+
441+ err := RunGo (finalArgs ... )
438442 if err != nil {
439443 return err
440444 }
@@ -1812,8 +1816,8 @@ func useDRAAgentBinaryForPackage(ctx context.Context, manifestURL string, versio
18121816
18131817 log .Printf ("copying %q to %q" , srcBinaryPath , dstBinaryPath )
18141818
1815- err = copy .Copy (srcBinaryPath , dstBinaryPath , copy .Options {
1816- PermissionControl : copy .PerservePermission ,
1819+ err = filecopy .Copy (srcBinaryPath , dstBinaryPath , filecopy .Options {
1820+ PermissionControl : filecopy .PerservePermission ,
18171821 })
18181822 if err != nil {
18191823 return fmt .Errorf ("copying %q to %q: %w" , srcBinaryPath , dstBinaryPath , err )
0 commit comments