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

feat: Android support #19

Merged
merged 2 commits into from
Jun 8, 2022
Merged

feat: Android support #19

merged 2 commits into from
Jun 8, 2022

Conversation

luisdavim
Copy link
Contributor

The gh cli is packaged in the oficial Termux repos so it would make sense to support this platlorm and create binaries for it.

Relates to: dlvhdr/gh-dash#137 (comment)

@dlvhdr
Copy link

dlvhdr commented Jun 7, 2022

@mislav @vilmibm

@mislav mislav merged commit b4c91b0 into cli:trunk Jun 8, 2022
@luisdavim luisdavim deleted the android_support branch June 8, 2022 14:00
@andyfeller
Copy link
Contributor

@luisdavim @dlvhdr : could you share insight into the move from cli/gh-extension-precompile in dlvhdr/gh-dash#139 and the removing android support from gh-dash release process?

I ask because as a extension author myself I wanted to understand whether this use case, which causes local building issues on Mac, should continue to be supported out of the box or removed.

@luisdavim
Copy link
Contributor Author

I'm not sure I understand the question. The use case for android is that some people, like myself, use it with termux.

How does it affect the MacOS builds?

@andyfeller
Copy link
Contributor

andyfeller commented Oct 13, 2023

I'm not sure I understand the question. The use case for android is that some people, like myself, use it with termux.

How does it affect the MacOS builds?

Apologies, let me elaborate.

These changes were merged in and used for a time in dlvhdr/gh-dash#139, however cli/gh-extension-precompile would be replaced by goreleaser/goreleaser-action with no explicit android target in the .goreleaser.yaml:

builds:
  - env:
      - CGO_ENABLED=0
    goos:
      - freebsd
      - linux
      - windows
      - darwin
    goarch:
      - amd64
      - arm64
      - arm
      - "386"
    goarm:
      - 6
      - 7
    ldflags:
      - -s -w
      - -X github.com/dlvhdr/gh-dash/cmd.Version={{.Version}}
      - -X github.com/dlvhdr/gh-dash/cmd.Commit={{.Commit}}
      - -X github.com/dlvhdr/gh-dash/cmd.Date={{.CommitDate}}
      - -X github.com/dlvhdr/gh-dash/cmd.BuiltBy=goreleaser

So my question is trying to understand:

  1. Whether there are use cases for building for android explicitly in cli/gh-extension-precompile?
  2. Is there something that goreleaser does that cli/gh-extension-precompile does not that is worth considering?

I ask because I've been fighting with cross-compile linking issues on MacOS Ventura with android/* on my personal workstation and being unable to figure out how to work around this, making me question whether extension truly need to be built specifically for android or if linux works for Android.

+ GOOS=android
+ GOARCH=amd64
+ CGO_ENABLED=0
+ go build -trimpath '-ldflags=-v -s -w -X .../build.Version=7.7.7 -X .../build.Date=2023-10-13 -X .../build.Sha=3f232f7078d02b078d653066e23b432994788971' -o dist/android-amd64
# github.com/.../...
HEADER = -H5 -T0x401000 -R0x1000
loadinternal: cannot find runtime/cgo
host link: "cc" "-m64" "-s" "-Wl,-z,relro" "-pie" "-o" "/var/folders/xb/svzskj1x77x3qsmwx1d84nqc0000gn/T/go-build3592177814/b001/exe/a.out" "-rdynamic" "-Qunused-arguments" "/var/folders/xb/svzskj1x77x3qsmwx1d84nqc0000gn/T/go-link-1527271618/go.o"
/usr/local/Cellar/go/1.20.7/libexec/pkg/tool/darwin_amd64/link: running cc failed: exit status 1
ld: warning: -s is obsolete
ld: unknown options: -z 
clang: error: linker command failed with exit code 1 (use -v to see invocation)

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 this pull request may close these issues.

4 participants