Open fat-fellow opened 7 hours ago
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
https://github.com/golang/go/issues/70495 It seems to be related.
CC @kolyshkin
Is this being built with -buildmode=c-archive
and linked into a C program? If so the problem may be that we have not installed a Go signal handler for SIGSYS
.
This is the build command we use in ci:
Run GOEXPERIMENT=rangefunc gomobile bind -tags "envproduction nogrpcserver gomobile nowatchdog nosigar nomutexdeadlockdetector timetzdata rasterizesvg" -ldflags "$FLAGS" -v -target=android -androidapi 26 -o lib.aar github.com/anyproto/anytype-heart/clientlibrary/service github.com/anyproto/anytype-heart/core || true
GOEXPERIMENT=rangefunc gomobile bind -tags "envproduction nogrpcserver gomobile nowatchdog nosigar nomutexdeadlockdetector timetzdata rasterizesvg" -ldflags "$FLAGS" -v -target=android -androidapi [2](https://github.com/anyproto/anytype-heart/actions/runs/11962148864/job/33350207129#step:26:2)6 -o lib.aar github.com/anyproto/anytype-heart/clientlibrary/service github.com/anyproto/anytype-heart/core || true
gtar --exclude ".*" -czvf android_lib_${VERSION}.tar.gz lib.aar protobuf json
mv android_lib_${VERSION}.tar.gz .release/
shell: /bin/bash -e {0}
env:
GOPATH: /Users/user1/go
GOBIN: /Users/user1/go/bin
FLAGS: -X github.com/anyproto/anytype-heart/util/vcs.GitSummary=v0.[3](https://github.com/anyproto/anytype-heart/actions/runs/11962148864/job/33350207129#step:26:3)7.2 -X github.com/anyproto/anytype-heart/metrics.DefaultInHouseKey=*** -X github.com/anyproto/anytype-heart/util/unsplash.DefaultToken=***
VERSION: v0.3[7](https://github.com/anyproto/anytype-heart/actions/runs/11962148864/job/33350207129#step:26:7).3
MAVEN_ARTIFACT_VERSION: v0.37.3
GOPRIVATE: github.com/anyproto
This is the local one:
gomobile bind -tags "nogrpcserver gomobile nowatchdog nosigar timetzdata rasterizesvg" -ldflags "-X github.com/anyproto/anytype-heart/util/vcs.BuildDate=2024-11-21T22:19:33Z -X github.com/anyproto/anytype-heart/util/vcs.GitCommit=53d9aa592 -X github.com/anyproto/anytype-heart/util/vcs.GitBranch=github.com/anyproto/anytype-heart/util/vcs2 -X github.com/anyproto/anytype-heart/util/vcs.GitState=dirty -X github.com/anyproto/anytype-heart/util/vcs.GitSummary=v0.37.1-4-g53d9aa592" -target=android -androidapi 26 -o lib.aar github.com/anyproto/anytype-heart/clientlibrary/service github.com/anyproto/anytype-heart/core
We've tested both ways. It doesn't work either
-buildmode=c-archive
We have explicitly enabled this only for desktop builds.
These AAR-packaged native libraries are used later through JNI interaction in this android open-source project. We do not include them in any native library. https://github.com/anyproto/anytype-kotlin/blob/main/gradle/libs.versions.toml#L2
Go version
go version 1.22.9 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
I am attempting to build our project library for the Android team using Go 1.23.3. You can refer to revert of the changes here: Pull Request #1856.
What did you see happen?
I've noticed crashes when running on Android versions below 12. It seems this issue should be resolved here. https://github.com/golang/go/commit/9563300f6e262589ae25c71d778bfcd646d4a750
https://gpages.juszkiewicz.com.pl/syscalls-table/syscalls.html 434 - seems https://www.man7.org/linux/man-pages/man2/pidfd_open.2.html Android log
What did you expect to see?
When I use Go 1.22.9, everything works as expected (see the PR above). TL;DR: The fix for the incorrect syscall in Go 1.23.3 doesn't seem to work.