Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Won't build for iOS gomobile #98

Closed
birros opened this issue Dec 19, 2021 · 3 comments
Closed

Won't build for iOS gomobile #98

birros opened this issue Dec 19, 2021 · 3 comments

Comments

@birros
Copy link

birros commented Dec 19, 2021

Unable to upgrade to the version v0.3.0 of go-libp2p-connmgr in a gomobile project. The build fails because of an error from the build of this dependency: github.com/elastic/gosigar.

The libproc.h header file seems to be missing in the Xcode iOS SDK.

$ gomobile bind -target ios/arm64 -o BAR.xcframework github.com/FOO/BAR
gomobile: ios/arm64: go build -buildmode=c-archive -o /var/folders/95/316g3tpn3cj_3lfqwgtqwfkr0000gn/T/gomobile-work-1004638070/BAR-ios-arm64.a ./gobind failed: exit status 2
# github.com/elastic/gosigar
/var/folders/95/316g3tpn3cj_3lfqwgtqwfkr0000gn/T/gomobile-work-1004638070/ios/pkg/mod/github.com/elastic/[email protected]/sigar_darwin.go:12:10: fatal error: 'libproc.h' file not found
#include <libproc.h>
         ^~~~~~~~~~~
1 error generated.

Related to #137 and #134

Module Version
os macOS 12.1
go-libp2p-connmgr v0.3.0
go go1.17.5 darwin/amd64
gomobile v0.0.0-20211207041440-4e6c2922fdee
@marten-seemann
Copy link
Contributor

iOS gomobile is not one of the platforms we're targeting.
Feel free to go ahead an file an issue with gosigar and bubble up the change once it's fixed there, but the libp2p team won't actively work on a fix for this.

birros added a commit to birros/gosigar that referenced this issue Dec 19, 2021
@Stebalien
Copy link
Member

@birros note: if upstream doesn't want to take that patch, an alternative is to patch go-watchdog to make the SystemDriven option unavailable on iOS.

@richard-ramos
Copy link

@birros note: if upstream doesn't want to take that patch, an alternative is to patch go-watchdog to make the SystemDriven option unavailable on iOS.

I tested this suggestion in status-im/go-watchdog@9800419 and it seems to work fine when using ios.

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

No branches or pull requests

4 participants