marcosnils / bin

Effortless binary manager
MIT License
685 stars 46 forks source link

Not working in Termux terminal app on Android #147

Closed edshamis closed 2 years ago

edshamis commented 2 years ago

I wanted to test bin in Termux terminal running on Android device. So I downloaded the latest release for Linux arm64 and got this error:

  • Getting latest release for marcosnils/bin
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5eee18]

goroutine 1 [running]:
github.com/marcosnils/bin/pkg/providers.(*gitHub).Fetch(0x40003f4230, 0x40003f64c0)
    /home/marcos/Projects/bin/pkg/providers/github.go:39 +0x2c8
github.com/marcosnils/bin/cmd.newInstallCmd.func1(0x40000c58c0?, {0x400040a2a0?, 0x1?, 0x1?})
    /home/marcos/Projects/bin/cmd/install.go:65 +0x148
github.com/spf13/cobra.(*Command).execute(0x40000c58c0, {0x400040a280, 0x1, 0x1})
    /home/marcos/Projects/gopath/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:842 +0x4dc
github.com/spf13/cobra.(*Command).ExecuteC(0x40000c5600)
    /home/marcos/Projects/gopath/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x358
github.com/spf13/cobra.(*Command).Execute(...)
    /home/marcos/Projects/gopath/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
github.com/marcosnils/bin/cmd.(*rootCmd).Execute(0x400000d3b0, {0x400001e190, 0x2, 0x400040a0e0?})
    /home/marcos/Projects/bin/cmd/root.go:35 +0x168
github.com/marcosnils/bin/cmd.Execute({0x400007a230, 0x6b}, 0x955e00?, {0x400001e190, 0x2, 0x2})
    /home/marcos/Projects/bin/cmd/root.go:25 +0xd4
main.main()
    /home/marcos/Projects/bin/main.go:21 +0xd0

uname -a output:

Linux localhost 4.14.180-perf-ge2a1322887a5 #1 SMP PREEMPT Mon Mar 28 19:47:44 CST 2022 aarch64 Android

Can you compile for aarch64 Android as well? I thought Linux arm64 would do but probably it doesn't

marcosnils commented 2 years ago

:wave: have you tried compiling to aarch64 manually to see if it'll work before pushing the change upstream?

edshamis commented 2 years ago

Please instruct me and I'll do it. Btw I managed to install bin through go: go install github.com/marcosnils/bin@latest, maybe you'd like to add it to readme

marcosnils commented 2 years ago
edshamis commented 2 years ago

This one worked CGO_ENABLED=0 GOOS=android GOARCH=arm64 go build