xgo icon indicating copy to clipboard operation
xgo copied to clipboard

Revert the mobile support

Open jeronimo13 opened this issue 5 years ago • 7 comments

Hi @techknowlogick thanks for the awesome fork. We are currently using it and it worked well so far

I have a request regarding mobile support: is there any chance that it will be back soon? If no could you please provide some context on why you decided to remove it?

Thanks in advance!

jeronimo13 avatar Feb 05 '20 15:02 jeronimo13

@jeronimo13 We mostly removed support for mobile to reduce the overall complexity of xgo, as we mainly maintain this fork to use it in Gitea for cross-platform builds, which does not uses mobile builds. If I recall correctly, we updated the underlying base image which in turn created problems with the code for mobile support and thus we decided to drop it (since we're not using it).

Just out of curiosity, what is your use case for mobile?

kolaente avatar Feb 06 '20 19:02 kolaente

we updated the underlying base image which in turn created problems with the code for mobile support and thus we decided to drop it (since we're not using it).

Yup this is correct. Although we would be open to accepting PRs that add it back in.

techknowlogick avatar Feb 06 '20 19:02 techknowlogick

@kolaente @techknowlogick thanks for the quick response!

Just out of curiosity, what is your use case for mobile?

A bit of context: We need to release a set of SDKs. The request is to have Java, Ruby, Python, Go, TypeScript etc etc. The nature of our SDK is that it's a bit verbose to write all of them in the native language. Previously, we already had JS and ruby SDK and they quickly started to differ, which is not cool. There are only HTTP requests inside of SDK, the rest is basically the clever data manipulation. I work for the early-stage startup so hiring 15 programmers is not the right move for us right now

Our solution: TS is written from scratch. The rest is basically a Golang SDK, cross-compiled via xgo for win/darwin/Linux and for x86/x64. Then I call native code via JNA(Java) or FFI (ruby/python). The tests are in Azure. It quacks like it's working so I'm happy

Currently, I'm investigating how to cross-compile for Android and iOS, it's a huge market for us. I was able to get a working prototype for Android using https://github.com/karalabe/xgo since it still has mobile support

To the point of PR: my current knowledge in cross-compiling is hardly above zero. But if get a working solution then I would submit a PR since we will open-source our codebase anyway.

jeronimo13 avatar Feb 07 '20 08:02 jeronimo13

@techknowlogick @jeronimo13 @kolaente I tried to re-introduce it in this PR Please it with your code please and let me know if anything is wrong

lruggieri avatar Jun 17 '21 06:06 lruggieri

@kolaente @techknowlogick thanks for the quick response!

Just out of curiosity, what is your use case for mobile?

A bit of context: We need to release a set of SDKs. The request is to have Java, Ruby, Python, Go, TypeScript etc etc. The nature of our SDK is that it's a bit verbose to write all of them in the native language. Previously, we already had JS and ruby SDK and they quickly started to differ, which is not cool. There are only HTTP requests inside of SDK, the rest is basically the clever data manipulation. I work for the early-stage startup so hiring 15 programmers is not the right move for us right now

Our solution: TS is written from scratch. The rest is basically a Golang SDK, cross-compiled via xgo for win/darwin/Linux and for x86/x64. Then I call native code via JNA(Java) or FFI (ruby/python). The tests are in Azure. It quacks like it's working so I'm happy

Currently, I'm investigating how to cross-compile for Android and iOS, it's a huge market for us. I was able to get a working prototype for Android using https://github.com/karalabe/xgo since it still has mobile support

To the point of PR: my current knowledge in cross-compiling is hardly above zero. But if get a working solution then I would submit a PR since we will open-source our codebase anyway.

Hi @jeronimo13 , have you succeeded in cross-compiling for the Android? I'm working on a project that requires cross-compiling go repositories for the Android platform. Please let me know if you have open sourced the cross-compiling tool. Also, I'd like to help with building that tool as I want to learn how to build the cross-compiling tool.

liuyibox avatar Nov 10 '23 00:11 liuyibox

@liuyibox have a look here https://github.com/lruggieri/xgo/tree/feature/mobile

I haven't had time to re-submit a PR, but I was compiling fine for mobile (both android an iOS) with it.

lruggieri avatar Nov 11 '23 09:11 lruggieri

@liuyibox have a look here https://github.com/lruggieri/xgo/tree/feature/mobile

I haven't had time to re-submit a PR, but I was compiling fine for mobile (both android an iOS) with it.

@lruggieri Thanks for your reply. I tried your branch for a while, but it did not work out on my side. I'm not sure how to use your branch correctly. I build a Dockerfile by modifying your Dockerfile in the docker/base folder as shown below. I build a container with it, but I got the following erros when I use this container to cross-compile my go-based repo. How should I debug this or where should I trace this problem?

Screenshot from 2023-11-12 03-09-14

liuyibox avatar Nov 12 '23 09:11 liuyibox