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

x/mobile: load of a Go static library in iOS project result in swift api behavior change #64029

Open
Gaal123 opened this issue Nov 9, 2023 · 4 comments
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@Gaal123
Copy link

Gaal123 commented Nov 9, 2023

What version of Go are you using (go version)?

$ go version
1.21

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH=arm64
GOOS=ios

What did you do?

I was add capacitor support to my mobile SDK, while testing on iOS the application stop working, searching around bring me to this issue where they even create a complete example. In the end the analysis result in this comment where they report that loading a static GO library will result in standard swift behavior change:

without the GO dependencies this will print the path as reported by Apple documentation

let fileUrl = URL(fileURLWithPath: "")
print("fileUrl:'(fileUrl.absoluteString)'")
fileUrl:'file:///'

If a go library is loaded this snippet will print:
fileUrl:'file:///private/var/containers/Bundle/Application/[guid value]/testApp.app/'

Note capacitor is not needed for this behavior change, I've tested with a native swift app and I was able to reproduce the same behavior

What did you expect to see?

The print should always be the same

What did you see instead?

The print change

@gopherbot gopherbot added the mobile Android, iOS, and x/mobile label Nov 9, 2023
@gopherbot gopherbot added this to the Unreleased milestone Nov 9, 2023
@heschi
Copy link
Contributor

heschi commented Nov 9, 2023

cc @hyangah

@heschi heschi added NeedsFix The path to resolution is known, but the work has not been done. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed NeedsFix The path to resolution is known, but the work has not been done. labels Nov 9, 2023
@MakDon
Copy link
Contributor

MakDon commented Nov 14, 2023

It seems that it's not an issue of golang but an issue of Foundation according to the comment mentioned aboved.

@Gaal123
Copy link
Author

Gaal123 commented Nov 14, 2023

Hello @MakDon, the comment you posted also say "Presumably the initialisation of the Go runtime has this as side effect". I would like to exclude the possibility that the GO runtime do something that can be done differently that provoke this behavior change.

@Gaal123
Copy link
Author

Gaal123 commented Nov 22, 2023

Hello, does someone have any update on this?

@seankhliao seankhliao changed the title x/mobile: load of a GO static library in iOS project result in swift api behavior change x/mobile: load of a Go static library in iOS project result in swift api behavior change Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Android, iOS, and x/mobile NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants