@@ -51,9 +51,9 @@ func NewMakeCommands() *cobra.Command {
51
51
envflags = append (envflags , "GOOS=" + OS )
52
52
}
53
53
if len (envflags ) > 0 {
54
- executeEnv (envflags , "go" , "build" , "-ldflags" , "-extldflags -static" , tagFlags (), buildFlags (), DelveMainPackagePath )
54
+ executeEnv (envflags , "go" , "build" , "-ldflags" , "-extldflags -static" , tagFlags (false ), buildFlags (), DelveMainPackagePath )
55
55
} else {
56
- execute ("go" , "build" , "-ldflags" , "-extldflags -static" , tagFlags (), buildFlags (), DelveMainPackagePath )
56
+ execute ("go" , "build" , "-ldflags" , "-extldflags -static" , tagFlags (false ), buildFlags (), DelveMainPackagePath )
57
57
}
58
58
if runtime .GOOS == "darwin" && os .Getenv ("CERT" ) != "" && canMacnative () && ! isCodesigned ("./dlv" ) {
59
59
codesign ("./dlv" )
@@ -70,7 +70,7 @@ func NewMakeCommands() *cobra.Command {
70
70
Use : "install" ,
71
71
Short : "Installs delve" ,
72
72
Run : func (cmd * cobra.Command , args []string ) {
73
- execute ("go" , "install" , tagFlags (), buildFlags (), DelveMainPackagePath )
73
+ execute ("go" , "install" , tagFlags (false ), buildFlags (), DelveMainPackagePath )
74
74
if runtime .GOOS == "darwin" && os .Getenv ("CERT" ) != "" && canMacnative () && ! isCodesigned (installedExecutablePath ()) {
75
75
codesign (installedExecutablePath ())
76
76
}
@@ -293,16 +293,21 @@ func prepareMacnative() string {
293
293
return "macnative"
294
294
}
295
295
296
- func tagFlags () string {
296
+ func tagFlags (isTest bool ) string {
297
297
var tags []string
298
298
if mactags := prepareMacnative (); mactags != "" {
299
299
tags = append (tags , mactags )
300
300
}
301
- if runtime .GOOS == "windows" && runtime .GOARCH == "arm64" {
302
- tags = append (tags , "exp.winarm64" )
303
- }
304
- if runtime .GOOS == "linux" && runtime .GOARCH == "ppc64le" {
305
- tags = append (tags , "exp.linuxppc64le" )
301
+ if isTest {
302
+ if runtime .GOOS == "windows" && runtime .GOARCH == "arm64" {
303
+ tags = append (tags , "exp.winarm64" )
304
+ }
305
+ if runtime .GOOS == "linux" && runtime .GOARCH == "ppc64le" {
306
+ tags = append (tags , "exp.linuxppc64le" )
307
+ }
308
+ if runtime .GOOS == "linux" && runtime .GOARCH == "riscv64" {
309
+ tags = append (tags , "exp.linuxriscv64" )
310
+ }
306
311
}
307
312
if Tags != nil && len (* Tags ) > 0 {
308
313
tags = append (tags , * Tags ... )
@@ -462,11 +467,11 @@ func testCmdIntl(testSet, testRegex, testBackend, testBuildMode string) {
462
467
}
463
468
464
469
if len (testPackages ) > 3 {
465
- executeq (env , "go" , "test" , testFlags (), buildFlags (), tagFlags (), testPackages , backendFlag , buildModeFlag )
470
+ executeq (env , "go" , "test" , testFlags (), buildFlags (), tagFlags (true ), testPackages , backendFlag , buildModeFlag )
466
471
} else if testRegex != "" {
467
- executeq (env , "go" , "test" , testFlags (), buildFlags (), tagFlags (), testPackages , "-run=" + testRegex , backendFlag , buildModeFlag )
472
+ executeq (env , "go" , "test" , testFlags (), buildFlags (), tagFlags (true ), testPackages , "-run=" + testRegex , backendFlag , buildModeFlag )
468
473
} else {
469
- executeq (env , "go" , "test" , testFlags (), buildFlags (), tagFlags (), testPackages , backendFlag , buildModeFlag )
474
+ executeq (env , "go" , "test" , testFlags (), buildFlags (), tagFlags (true ), testPackages , backendFlag , buildModeFlag )
470
475
}
471
476
}
472
477
@@ -505,7 +510,7 @@ func inpath(exe string) bool {
505
510
506
511
func allPackages () []string {
507
512
r := []string {}
508
- for _ , dir := range strings .Split (getoutput ("go" , "list" , "-mod=vendor" , tagFlags (), "./..." ), "\n " ) {
513
+ for _ , dir := range strings .Split (getoutput ("go" , "list" , "-mod=vendor" , tagFlags (true ), "./..." ), "\n " ) {
509
514
dir = strings .TrimSpace (dir )
510
515
if dir == "" || strings .Contains (dir , "/vendor/" ) || strings .Contains (dir , "/_scripts" ) {
511
516
continue
0 commit comments