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

Gotify CLI on Termux #26

Open
mskian opened this issue May 20, 2019 · 24 comments
Open

Gotify CLI on Termux #26

mskian opened this issue May 20, 2019 · 24 comments

Comments

@mskian
Copy link

mskian commented May 20, 2019

I am trying to Run Gotify CLI on Termux Terminal Emulator for Android but Endup with this Below Error while init the CLI

Error: Get https://push.example.com/version: dial tcp: lookup google.com on [::1]:53: read udp [::1]:48773->[::1]:53: read: connection refused
@mskian mskian changed the title Gotlify CLI on Termux Gotify CLI on Termux May 20, 2019
@eternal-flame-AD
Copy link
Member

As far as I know, binary built for linux will have name resolving problems on android, and you will need to build the program with GOOS=android and try again

@mskian
Copy link
Author

mskian commented May 20, 2019

How example pls

@eternal-flame-AD
Copy link
Member

Try building with:

CGO_ENABLED=0 GOOS=android GOARCH=amd64 go build

@mskian
Copy link
Author

mskian commented May 20, 2019

we need to Clone the Github Respo and Build the package for android right?

@mskian
Copy link
Author

mskian commented May 20, 2019

Got this error

/tmp/go-link-001157295/go.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status

@eternal-flame-AD
Copy link
Member

eternal-flame-AD commented May 20, 2019

Sorry I specified the wrong GOARCH, you need GOARCH=arm64

If it still does not work, try building on termux directly without any extra environment variable.

@mskian
Copy link
Author

mskian commented May 20, 2019

git clone https://github.com/gotify/cli.git
cd cli
$ CGO_ENABLED=0 GOOS=android GOARCH=arm64 go build

go: finding github.com/go-openapi/errors v0.19.0
go: finding github.com/go-openapi/analysis v0.19.0
go: finding github.com/go-openapi/jsonreference v0.19.0
go: finding github.com/go-openapi/validate v0.19.0
go: finding github.com/go-openapi/strfmt v0.19.0
go: finding github.com/go-openapi/spec v0.19.0
go: finding github.com/go-openapi/runtime v0.19.0
go: finding github.com/go-openapi/jsonpointer v0.19.0
go: finding github.com/go-openapi/loads v0.19.0
go: finding golang.org/x/sys v0.0.0-20190412213103-97732733099d
go: finding golang.org/x/net v0.0.0-20181005035420-146acd28ed58
go: finding github.com/stretchr/testify v1.2.2
go: finding github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb
go: finding github.com/pmezard/go-difflib v1.0.0
go: finding github.com/davecgh/go-spew v1.1.1
go: finding golang.org/x/net v0.0.0-20190320064053-1272bf9dcd53
go: finding golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a
go: finding github.com/PuerkitoBio/purell v1.1.0
go: finding github.com/go-openapi/jsonreference v0.18.0
go: finding github.com/stretchr/testify v1.3.0
go: finding golang.org/x/crypto v0.0.0-20190320223903-b7391e95e576
go: finding github.com/PuerkitoBio/purell v1.1.1
go: finding github.com/go-openapi/validate v0.18.0
go: finding golang.org/x/text v0.3.0
go: finding github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8
go: finding github.com/go-openapi/spec v0.18.0
go: finding github.com/go-openapi/errors v0.17.0
go: finding github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983
go: finding github.com/go-openapi/spec v0.17.0
go: finding github.com/tj/go-spin v1.1.0
go: finding github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf
go: finding github.com/go-openapi/analysis v0.17.0
go: finding gopkg.in/yaml.v2 v2.2.2
go: finding github.com/go-openapi/loads v0.17.0
go: finding github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
go: finding github.com/mitchellh/mapstructure v1.1.2
go: finding github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329
go: finding github.com/kr/pretty v0.1.0
go: finding github.com/go-openapi/strfmt v0.18.0
go: finding github.com/gotify/go-api-client/v2 v2.0.4
go: finding golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54
go: finding github.com/go-openapi/swag v0.18.0
go: finding gopkg.in/yaml.v2 v2.2.1
go: finding github.com/go-openapi/errors v0.18.0
go: finding gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127
go: finding golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e
go: finding gopkg.in/urfave/cli.v1 v1.20.0
go: finding github.com/go-openapi/jsonpointer v0.18.0
go: finding github.com/davecgh/go-spew v1.1.0
go: finding github.com/go-openapi/analysis v0.18.0
go: finding github.com/go-openapi/analysis v0.0.0-20180825180245-b006789cd277
go: finding github.com/stretchr/objx v0.1.0
go: finding golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a
go: finding github.com/go-openapi/jsonpointer v0.17.0
go: finding github.com/pborman/uuid v1.2.0
go: finding golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
go: finding github.com/go-openapi/swag v0.19.0
go: finding github.com/go-openapi/errors v0.17.2
go: finding github.com/docker/go-units v0.3.3
go: finding github.com/go-openapi/loads v0.18.0
go: finding github.com/google/uuid v1.1.1
go: finding github.com/stretchr/objx v0.1.1
go: finding github.com/go-openapi/jsonreference v0.17.0
go: finding github.com/kr/text v0.1.0
go: finding github.com/mailru/easyjson v0.0.0-20190312143242-1de009706dbe
go: finding github.com/go-openapi/swag v0.17.0
go: finding golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3
go: finding github.com/go-openapi/strfmt v0.17.0
go: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: finding github.com/go-openapi/runtime v0.0.0-20180920151709-4f900dc2ade9
go: finding github.com/google/uuid v1.0.0
go: finding github.com/go-openapi/runtime v0.17.2
go: finding github.com/kr/pty v1.1.1
go: finding github.com/go-openapi/validate v0.17.0
go: downloading gopkg.in/urfave/cli.v1 v1.20.0
go: downloading github.com/gotify/go-api-client/v2 v2.0.4
go: extracting gopkg.in/urfave/cli.v1 v1.20.0
go: extracting github.com/gotify/go-api-client/v2 v2.0.4
go: downloading github.com/tj/go-spin v1.1.0
go: downloading github.com/go-openapi/strfmt v0.19.0
go: downloading github.com/go-openapi/swag v0.19.0
go: downloading github.com/go-openapi/runtime v0.19.0
go: downloading golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a
go: extracting github.com/tj/go-spin v1.1.0
go: extracting github.com/go-openapi/strfmt v0.19.0
go: downloading github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf
go: extracting github.com/go-openapi/swag v0.19.0
go: extracting github.com/go-openapi/runtime v0.19.0
go: downloading github.com/go-openapi/errors v0.19.0
go: downloading github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8
go: downloading gopkg.in/yaml.v2 v2.2.2
go: extracting github.com/go-openapi/errors v0.19.0
go: extracting github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf
go: downloading github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983
go: extracting golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a
go: extracting gopkg.in/yaml.v2 v2.2.2
go: extracting github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8
go: downloading github.com/mitchellh/mapstructure v1.1.2
go: extracting github.com/mailru/easyjson v0.0.0-20190403194419-1ea4449da983
go: extracting github.com/mitchellh/mapstructure v1.1.2
go: downloading golang.org/x/sys v0.0.0-20190412213103-97732733099d
go: downloading github.com/go-openapi/loads v0.19.0
go: downloading github.com/go-openapi/analysis v0.19.0
go: downloading github.com/go-openapi/validate v0.19.0
go: downloading github.com/go-openapi/spec v0.19.0
go: extracting github.com/go-openapi/analysis v0.19.0
go: extracting github.com/go-openapi/loads v0.19.0
go: downloading github.com/go-openapi/jsonpointer v0.19.0
go: extracting github.com/go-openapi/jsonpointer v0.19.0
go: extracting github.com/go-openapi/spec v0.19.0
go: downloading github.com/go-openapi/jsonreference v0.19.0
go: extracting github.com/go-openapi/jsonreference v0.19.0
go: downloading github.com/PuerkitoBio/purell v1.1.1
go: extracting golang.org/x/sys v0.0.0-20190412213103-97732733099d
go: extracting github.com/go-openapi/validate v0.19.0
go: extracting github.com/PuerkitoBio/purell v1.1.1
go: downloading golang.org/x/text v0.3.0
go: downloading golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3
go: downloading github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
go: extracting github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578
go: extracting golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3
go: extracting golang.org/x/text v0.3.0
# github.com/gotify/cli/v2
/usr/local/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/usr/bin/ld: /tmp/go-link-961218562/go.o: Relocations in generic ELF (EM: 183)
/tmp/go-link-961218562/go.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status

My System INFO - Ubuntu 18.04 LTS Golang version - go version go1.12.5 linux/amd64

@jmattheis
Copy link
Member

Here it is recommended to compile the go program in your termux environment termux/termux-app#210 (comment)

@mskian
Copy link
Author

mskian commented May 20, 2019

Gotify CLI having any specific file to build the complete package?

@jmattheis
Copy link
Member

go build should be enough, there are no extra steps.

@mskian
Copy link
Author

mskian commented May 20, 2019

Let me try and Update

@jmattheis
Copy link
Member

Dns lookup works if the cli is compiled on termux.
image

@mskian
Copy link
Author

mskian commented May 20, 2019

Got this Error

$ go build

photo_2019-05-20_22-19-14

@mskian
Copy link
Author

mskian commented May 20, 2019

@jmattheis Share your steps how you achieve in Termux

@jmattheis
Copy link
Member

I just did:

pkg install golang git
git clone https://github.com/gotify/cli
cd cli
go build
./cli init

@mskian
Copy link
Author

mskian commented May 20, 2019

For me, it's not Building I am facing error check above screenshot

@jmattheis
Copy link
Member

Could you try a system upgrade (pkg upgrade) and try again. If it still doesn't work, could you paste the outputs of the following commands:

go env
go version
gcc --version

With android version do you have?

@mskian
Copy link
Author

mskian commented May 20, 2019

photo_2019-05-20_23-24-55

Android Version - 8.1.0

@jmattheis
Copy link
Member

I've android 9.

I'm out of ideas now, could be a Go bug.

@mskian
Copy link
Author

mskian commented May 20, 2019

@jmattheis yes may be
4 hours no proper solution for this issue

@mskian
Copy link
Author

mskian commented May 21, 2019

This Method works well

pkg install golang
go get github.com/gotify/cli

Binary File Stored in Home /go/bin/cli

cd $HOME
cd go
cd bin
cp cli $HOME
cd $HOME
mv cli gotify
## Setup Gotify
./gotify init
mv gotify $PREFIX/bin
## test Gotify
gotify config

My issue ticket in Termux Respo termux/termux-app#1138

@mskian
Copy link
Author

mskian commented May 21, 2019

Why these all three are unknown?

$ gotify version
version: unknown
commit: unknown
BuildDate: unknow

@eternal-flame-AD
Copy link
Member

These information are replaced on link time with a linker flag. You can refer to Makefile to see how we did that.

@mskian
Copy link
Author

mskian commented May 21, 2019

Now got it Thanks
Kindly Release binary compiled for Android too (For Termux)

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

No branches or pull requests

3 participants