@@ -490,16 +490,6 @@ func archiveIOS(tmpDir, target, frameworkRoot string, bi *buildInfo) error {
490
490
lipo := exec .Command ("xcrun" , "lipo" , "-o" , exe , "-create" )
491
491
var builds errgroup.Group
492
492
tags := bi .tags
493
- goos := "ios"
494
- supportsIOS , err := supportsGOOS ("ios" )
495
- if err != nil {
496
- return err
497
- }
498
- if ! supportsIOS {
499
- // Go 1.15 and earlier target iOS with GOOS=darwin, tags=ios.
500
- goos = "darwin"
501
- tags = "ios " + tags
502
- }
503
493
for _ , a := range bi .archs {
504
494
clang , cflags , err := iosCompilerFor (target , a , bi .minsdk )
505
495
if err != nil {
@@ -519,7 +509,7 @@ func archiveIOS(tmpDir, target, frameworkRoot string, bi *buildInfo) error {
519
509
cflagsLine := strings .Join (cflags , " " )
520
510
cmd .Env = append (
521
511
os .Environ (),
522
- "GOOS=" + goos ,
512
+ "GOOS=ios" ,
523
513
"GOARCH=" + a ,
524
514
"CGO_ENABLED=1" ,
525
515
"CC=" + clang ,
@@ -537,7 +527,7 @@ func archiveIOS(tmpDir, target, frameworkRoot string, bi *buildInfo) error {
537
527
if _ , err := runCmd (lipo ); err != nil {
538
528
return err
539
529
}
540
- appDir , err := runCmd (exec .Command ("go" , "list" , "-f" , "{{.Dir}}" , "gioui.org/app/" ))
530
+ appDir , err := runCmd (exec .Command ("go" , "list" , "-tags" , tags , "- f" , "{{.Dir}}" , "gioui.org/app/" ))
541
531
if err != nil {
542
532
return err
543
533
}
@@ -555,24 +545,6 @@ func archiveIOS(tmpDir, target, frameworkRoot string, bi *buildInfo) error {
555
545
return ioutil .WriteFile (moduleFile , []byte (module ), 0644 )
556
546
}
557
547
558
- func supportsGOOS (wantGoos string ) (bool , error ) {
559
- geese , err := runCmd (exec .Command ("go" , "tool" , "dist" , "list" ))
560
- if err != nil {
561
- return false , err
562
- }
563
- for _ , pair := range strings .Split (geese , "\n " ) {
564
- s := strings .SplitN (pair , "/" , 2 )
565
- if len (s ) != 2 {
566
- return false , fmt .Errorf ("go tool dist list: invalid GOOS/GOARCH pair: %s" , pair )
567
- }
568
- goos := s [0 ]
569
- if goos == wantGoos {
570
- return true , nil
571
- }
572
- }
573
- return false , nil
574
- }
575
-
576
548
func iosCompilerFor (target , arch string , minsdk int ) (string , []string , error ) {
577
549
var (
578
550
platformSDK string
0 commit comments