Skip to content

Commit

Permalink
Merge pull request #268 from andydotxyz/fix/267
Browse files Browse the repository at this point in the history
Fixing so we don't seek a missing android image for darwin
  • Loading branch information
Bluebugs authored Sep 7, 2024
2 parents 228a7da + 1df19d4 commit 3716efe
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 20 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
go-version: "1.19.x"

- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@latest
run: go install honnef.co/go/tools/cmd/staticcheck@v0.4.7
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest

Expand All @@ -34,7 +34,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# use max/min supported Go versions
go-version: ["1.21.x", "1.17.x"]
go-version: ["1.23.x", "1.19.x"]

steps:
- name: Setup Go environment
Expand All @@ -56,7 +56,7 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
# use max/min supported Go versions
go-version: ["1.18.x"]
go-version: ["1.19.x"]

steps:
- name: Setup Go environment
Expand All @@ -80,7 +80,7 @@ jobs:
fail-fast: false
matrix:
# use max/min supported Go versions
go-version: ["1.21.x", "1.17.x"]
go-version: ["1.23.x", "1.19.x"]
target:
- os: linux
- os: windows
Expand Down Expand Up @@ -160,7 +160,7 @@ jobs:
fail-fast: false
matrix:
# use max/min supported Go versions
go-version: ["1.21.x", "1.17.x"]
go-version: ["1.23.x", "1.19.x"]
target:
- os: linux
- os: windows
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/fyne-io/fyne-cross

go 1.17
go 1.19

require (
github.com/BurntSushi/toml v1.3.2
Expand Down
7 changes: 3 additions & 4 deletions internal/cloud/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand All @@ -20,7 +19,7 @@ import (
"github.com/klauspost/compress/zstd"
"golang.org/x/sync/errgroup"

archiver "github.com/mholt/archiver/v3"
"github.com/mholt/archiver/v3"
)

type AWSSession struct {
Expand Down Expand Up @@ -104,7 +103,7 @@ func (a *AWSSession) UploadFile(localFile string, s3FilePath string) error {
}

func (a *AWSSession) UploadCompressedDirectory(localDirectoy string, s3FilePath string) error {
file, err := ioutil.TempFile("", "fyne-cross-s3")
file, err := os.CreateTemp("", "fyne-cross-s3")
if err != nil {
return err
}
Expand Down Expand Up @@ -255,7 +254,7 @@ func (a *AWSSession) DownloadFile(s3FilePath string, localFile string) error {
}

func (a *AWSSession) DownloadCompressedDirectory(s3FilePath string, localRootDirectory string) error {
file, err := ioutil.TempFile("", "fyne-cross-s3")
file, err := os.CreateTemp("", "fyne-cross-s3")
if err != nil {
return err
}
Expand Down
3 changes: 1 addition & 2 deletions internal/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package command

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -132,7 +131,7 @@ func prepareIcon(ctx Context, image containerImage) error {
}

log.Infof("[!] Default icon not found at %q", ctx.Icon)
err = ioutil.WriteFile(volume.JoinPathHost(ctx.WorkDirHost(), ctx.Icon), icon.FyneLogo, 0644)
err = os.WriteFile(volume.JoinPathHost(ctx.WorkDirHost(), ctx.Icon), icon.FyneLogo, 0644)
if err != nil {
return fmt.Errorf("could not create the temporary icon: %s", err)
}
Expand Down
3 changes: 1 addition & 2 deletions internal/command/darwin_sdk_extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package command
import (
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
Expand Down Expand Up @@ -78,7 +77,7 @@ func (cmd *DarwinSDKExtract) Run() error {
}

// mount the fyne-cross volume
workDir, err := ioutil.TempDir("", cmd.Name())
workDir, err := os.MkdirTemp("", cmd.Name())
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion internal/command/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (i *localContainerImage) cmd(vol volume.Volume, opts options, cmdArgs []str
}

arch := "amd64"
if runtime.GOARCH == "arm64" {
if runtime.GOARCH == "arm64" && (runtime.GOOS != "darwin" || i.os != "android") {
// If we are running on arm64, we should have arm64 image to avoid using emulation
arch = runtime.GOARCH
}
Expand Down
3 changes: 1 addition & 2 deletions internal/metadata/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package metadata

import (
"io"
"io/ioutil"
"os"
"path/filepath"

Expand All @@ -12,7 +11,7 @@ import (
// Load attempts to read a FyneApp metadata from the provided reader.
// If this cannot be done an error will be returned.
func Load(r io.Reader) (*FyneApp, error) {
str, err := ioutil.ReadAll(r)
str, err := io.ReadAll(r)
if err != nil {
return nil, err
}
Expand Down
5 changes: 2 additions & 3 deletions internal/volume/volume.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"archive/zip"
"fmt"
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
Expand All @@ -31,11 +30,11 @@ const (

// Copy copies a resource from src to dest
func Copy(src string, dst string) error {
data, err := ioutil.ReadFile(src)
data, err := os.ReadFile(src)
if err != nil {
return err
}
return ioutil.WriteFile(dst, data, 0644)
return os.WriteFile(dst, data, 0644)
}

// DefaultCacheDirHost returns the default cache dir on the host
Expand Down

0 comments on commit 3716efe

Please sign in to comment.