Skip to content

Bug: X86-64 systems may accidentally download the ARM64 version of wrapper. #27

Description

@profemberling

If the latest release of WorldObservationLog/wrapper is the arm64 version, then wrapper-manager will download the arm64 version even for x86-64 systems.

wrapper-manager/wrapper.go

Lines 235 to 249 in d40d204

if runtime.GOARCH == "amd64" {
var err error
resp, err = GetHttpClient().Get("https://api.github.com/repos/WorldObservationLog/wrapper/releases/latest")
if err != nil {
panic(err)
}
} else if runtime.GOARCH == "arm64" {
var err error
resp, err = GetHttpClient().Get("https://api.github.com/repos/WorldObservationLog/wrapper/releases/tags/Wrapper.arm64.latest")
if err != nil {
panic(err)
}
} else {
panic("unsupported arch")
}

I noticed this bug when I re-setup wrapper-manager and started getting new errors when attempting to login. I traced the issue back to wrapper-manager downloading the arm64 version of wrapper which my computer could not run. Currently the latest release of wrapper is the arm64 version and so the current code downloads the incorrect version for my system.

The fixed code is below, specifically the URLs used to fetch wrapper.

	if runtime.GOARCH == "amd64" {
		var err error
		resp, err = GetHttpClient().Get("https://api.github.com/repos/WorldObservationLog/wrapper/releases/tags/wrapper.x86_64.latest")
		if err != nil {
			panic(err)
		}
	} else if runtime.GOARCH == "arm64" {
		var err error
		resp, err = GetHttpClient().Get("https://api.github.com/repos/WorldObservationLog/wrapper/releases/tags/wrapper.arm64.latest")
		if err != nil {
			panic(err)
		}
	} else {
		panic("unsupported arch")
	}

Of note, after these changes there were still errors when attempting to login. These were resolved by applying the fix detailed in the open pull request here: #25, 20daf54

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions