@@ -34,15 +34,14 @@ import (
3434 "sync/atomic"
3535 "time"
3636
37- "github.com/elastic/elastic-agent/dev-tools/mage/otel"
38-
3937 "github.com/jedib0t/go-pretty/v6/table"
40- "github.com/otiai10/copy"
38+ filecopy "github.com/otiai10/copy"
4139
4240 "github.com/elastic/elastic-agent/dev-tools/mage"
4341 devtools "github.com/elastic/elastic-agent/dev-tools/mage"
4442 "github.com/elastic/elastic-agent/dev-tools/mage/downloads"
4543 "github.com/elastic/elastic-agent/dev-tools/mage/manifest"
44+ "github.com/elastic/elastic-agent/dev-tools/mage/otel"
4645 "github.com/elastic/elastic-agent/dev-tools/mage/pkgcommon"
4746 "github.com/elastic/elastic-agent/dev-tools/packaging"
4847 "github.com/elastic/elastic-agent/internal/pkg/agent/application/upgrade/artifact/download"
@@ -421,7 +420,12 @@ func (Build) TestBinaries() error {
421420 }
422421
423422 outputName := filepath .Join (pkg , binary )
424- err := devtools .Run (nil , nil , os .Stderr , "go" , pkg , "build" , "-v" , "-o" , outputName , pkg )
423+
424+ finalArgs := make ([]string , len (args ))
425+ copy (finalArgs , args )
426+ finalArgs = append (finalArgs , "-o" , outputName , filepath .Join (pkg ))
427+
428+ err := RunGo (finalArgs ... )
425429 if err != nil {
426430 return err
427431 }
@@ -1790,8 +1794,8 @@ func useDRAAgentBinaryForPackage(ctx context.Context, manifestURL string, versio
17901794
17911795 log .Printf ("copying %q to %q" , srcBinaryPath , dstBinaryPath )
17921796
1793- err = copy .Copy (srcBinaryPath , dstBinaryPath , copy .Options {
1794- PermissionControl : copy .PerservePermission ,
1797+ err = filecopy .Copy (srcBinaryPath , dstBinaryPath , filecopy .Options {
1798+ PermissionControl : filecopy .PerservePermission ,
17951799 })
17961800 if err != nil {
17971801 return fmt .Errorf ("copying %q to %q: %w" , srcBinaryPath , dstBinaryPath , err )
0 commit comments