Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for MacOS universal brinaries #37

Open
jryannel opened this issue Aug 22, 2023 · 2 comments · May be fixed by #41
Open

Support for MacOS universal brinaries #37

jryannel opened this issue Aug 22, 2023 · 2 comments · May be fixed by #41

Comments

@jryannel
Copy link

MacOS supports universal binaries. These are binraries which have the amd64 and arm64 target in one binary. How would this be supported by this library.

I saw there is some code to detect the go os and arch version. In case of darwin amd64|arm64 host system the release should also try to detect a "_darwin_universal" file I guess.

Currently we work around this by creating an universal binary and copying it as amd64 and arm64 target.

@creativeprojects
Copy link
Owner

That's possible assuming there's a way to detect the type of binary it's currently running (so it can update to a similar one). I suppose it shouldn't be too difficult.

@creativeprojects creativeprojects linked a pull request Jun 16, 2024 that will close this issue
@creativeprojects
Copy link
Owner

Would that work for you?

Proposal

I'm proposing adding a new field in the configuration where you can set the Arch of the universal binary:

updater, err := selfupdate.NewUpdater(selfupdate.Config{
    UniversalArch: "universal",
})
if err != nil {
    log.Fatal(err)
}
release, found, err := updater.DetectLatest(context.Background(), selfupdate.NewRepositorySlug("owner", "cli-tool"))
if err != nil {
    log.Fatal(err)
}

Default

The default value is empty (which is the current behaviour)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants