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

Build an ios/macos xcframework #94

Open
paillardf opened this issue Sep 16, 2024 · 5 comments
Open

Build an ios/macos xcframework #94

paillardf opened this issue Sep 16, 2024 · 5 comments

Comments

@paillardf
Copy link

paillardf commented Sep 16, 2024

Hi,
I'm trying to use the lib to build an iOS/MacOS NEPacketTunnelProvider to setup a local DNS filtering VPN.
To do so it seems that I need to build a intra version of the lib but I don't manage to compile.
The iOS side of the library doesn't seem to be maintain anymore but I would be glad to help as much as I can. I just need a bit of support to get started with it.

You will find attached the logs I have so far: trying to build it
export MACOSX_DEPLOYMENT_TARGET=17.5; /Users/f.paillard/projects/firestack/bin/gomobile bind -v -a -x -iosversion=17.5 -target=ios,iossimulator,macos -o /Users/f.paillard/projects/firestack/build/apple-intra/Tun2socks.xcframework -ldflags '-s -w' -bundleid org.outline.tun2socks github.com/celzero/firestack/intra github.com/celzero/firestack/intra/backend github.com/celzero/firestack/intra/rnet github.com/celzero/firestack/intra/settings
GOMOBILE=/Users/f.paillard/go/pkg/gomobile
WORK=/var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/gomobile-work-154784127
rm -r -f "/Users/f.paillard/projects/firestack/build/apple-intra/Tun2socks.xcframework"
GOOS=ios CGO_ENABLED=1 $GOPATH/bin/gobind -lang=go,objc -outdir=$WORK/ios -tags=ios github.com/celzero/firestack/intra github.com/celzero/firestack/intra/backend github.com/celzero/firestack/intra/rnet github.com/celzero/firestack/intra/settings
GOOS=darwin CGO_ENABLED=1 $GOPATH/bin/gobind -lang=go,objc -outdir=$WORK/macos -tags=macos github.com/celzero/firestack/intra github.com/celzero/firestack/intra/backend github.com/celzero/firestack/intra/rnet github.com/celzero/firestack/intra/settings
GOOS=ios CGO_ENABLED=1 $GOPATH/bin/gobind -lang=go,objc -outdir=$WORK/iossimulator -tags=ios github.com/celzero/firestack/intra github.com/celzero/firestack/intra/backend github.com/celzero/firestack/intra/rnet github.com/celzero/firestack/intra/settings
write /var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/gomobile-work-154784127/iossimulator/src-amd64/go.mod
write /var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/gomobile-work-154784127/iossimulator/src-arm64/go.mod
write /var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/gomobile-work-154784127/macos/src-arm64/go.mod
write /var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/gomobile-work-154784127/macos/src-amd64/go.mod
write /var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/gomobile-work-154784127/ios/src-arm64/go.mod
mkdir -p $WORK/iossimulator/src-arm64
mkdir -p $WORK/iossimulator/src-amd64
mkdir -p $WORK/macos/src-arm64
mkdir -p $WORK/macos/src-amd64
mkdir -p $WORK/ios/src-arm64
PWD=$WORK/ios/src-arm64 GOMODCACHE=$GOPATH/pkg/mod GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk -miphoneos-version-min=17.5 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk -miphoneos-version-min=17.5 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk -miphoneos-version-min=17.5 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphoneos GOPATH=$WORK/ios:$GOPATH go mod tidy -v
PWD=$WORK/macos/src-amd64 GOMODCACHE=$GOPATH/pkg/mod GOOS=darwin GOARCH=amd64 GOFLAGS=-tags=macos CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -arch x86_64 CGO_CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -arch x86_64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -arch x86_64 CGO_ENABLED=1 DARWIN_SDK=macosx GOPATH=$WORK/macos:$GOPATH go mod tidy -v
PWD=$WORK/iossimulator/src-arm64 GOMODCACHE=$GOPATH/pkg/mod GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -mios-simulator-version-min=17.5 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -mios-simulator-version-min=17.5 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -mios-simulator-version-min=17.5 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphonesimulator GOPATH=$WORK/iossimulator:$GOPATH go mod tidy -v
PWD=$WORK/macos/src-arm64 GOMODCACHE=$GOPATH/pkg/mod GOOS=darwin GOARCH=arm64 GOFLAGS=-tags=macos CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=macosx GOPATH=$WORK/macos:$GOPATH go mod tidy -v
PWD=$WORK/iossimulator/src-amd64 GOMODCACHE=$GOPATH/pkg/mod GOOS=ios GOARCH=amd64 GOFLAGS=-tags=ios CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -mios-simulator-version-min=17.5 -fembed-bitcode -arch x86_64 CGO_CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -mios-simulator-version-min=17.5 -fembed-bitcode -arch x86_64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -mios-simulator-version-min=17.5 -fembed-bitcode -arch x86_64 CGO_ENABLED=1 DARWIN_SDK=iphonesimulator GOPATH=$WORK/iossimulator:$GOPATH go mod tidy -v
go: found github.com/celzero/firestack/intra in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/backend in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/rnet in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/settings in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/backend in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/rnet in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/settings in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/backend in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/rnet in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/settings in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
unused github.com/BurntSushi/toml
unused github.com/Microsoft/go-winio
unused github.com/Microsoft/hcsshim
unused github.com/bazelbuild/rules_go
unused github.com/bwesterb/go-ristretto
unused github.com/cenkalti/backoff
unused github.com/cilium/ebpf
unused github.com/containerd/cgroups
unused github.com/containerd/console
unused github.com/containerd/containerd
unused github.com/containerd/continuity
unused github.com/containerd/fifo
unused github.com/containerd/go-runc
unused github.com/containerd/ttrpc
unused github.com/containerd/typeurl
unused github.com/coreos/go-systemd/v22
unused github.com/crazy-max/xgo
unused github.com/davecgh/go-spew
unused github.com/docker/go-units
unused github.com/elazarl/goproxy/ext
unused github.com/gin-contrib/sse
unused github.com/gin-gonic/gin
unused github.com/go-logr/logr
unused github.com/go-playground/assert/v2
unused github.com/go-playground/locales
unused github.com/go-playground/universal-translator
unused github.com/go-playground/validator/v10
unused github.com/gobwas/httphead
unused github.com/gobwas/pool
unused github.com/gobwas/ws
unused github.com/godbus/dbus/v5
unused github.com/gofrs/flock
unused github.com/gogo/protobuf
unused github.com/golang/groupcache
unused github.com/golang/mock
unused github.com/golang/protobuf
unused github.com/google/go-cmp
unused github.com/google/go-github/v56
unused github.com/google/gofuzz
unused github.com/google/subcommands
unused github.com/googleapis/gnostic
unused github.com/gorilla/websocket
unused github.com/hanwen/go-fuse/v2
unused github.com/hashicorp/errwrap
unused github.com/hashicorp/go-multierror
unused github.com/json-iterator/go
unused github.com/kr/pty
unused github.com/leodido/go-urn
unused github.com/mattbaird/jsonpatch
unused github.com/mattn/go-isatty
unused github.com/modern-go/concurrent
unused github.com/modern-go/reflect2
unused github.com/mohae/deepcopy
unused github.com/opencontainers/go-digest
unused github.com/opencontainers/runtime-spec
unused github.com/pkg/errors
unused github.com/pmezard/go-difflib
unused github.com/rogpeppe/go-charset
unused github.com/sirupsen/logrus
unused github.com/stretchr/objx
unused github.com/syndtr/gocapability
unused github.com/ugorji/go
unused github.com/ugorji/go/codec
unused github.com/vishvananda/netlink
unused github.com/vishvananda/netns
unused github.com/yuin/goldmark
unused go.opencensus.io
unused golang.org/x/exp
unused golang.org/x/exp/shiny
unused golang.org/x/image
unused golang.org/x/oauth2
unused golang.org/x/telemetry
unused golang.org/x/term
unused golang.org/x/xerrors
unused google.golang.org/appengine
unused google.golang.org/genproto
unused google.golang.org/grpc
unused google.golang.org/grpc/cmd/protoc-gen-go-grpc
unused google.golang.org/protobuf
unused gopkg.in/check.v1
unused gopkg.in/inf.v0
unused gopkg.in/tomb.v1
unused gopkg.in/yaml.v2
unused gopkg.in/yaml.v3
unused gotest.tools/v3
unused honnef.co/go/tools
unused k8s.io/api
unused k8s.io/apimachinery
unused k8s.io/client-go
unused k8s.io/klog/v2
unused k8s.io/kube-openapi
unused k8s.io/utils
unused sigs.k8s.io/json
unused sigs.k8s.io/structured-merge-diff/v4
unused sigs.k8s.io/yaml
go: found github.com/celzero/firestack/intra in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/backend in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/rnet in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/settings in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/backend in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/rnet in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
go: found github.com/celzero/firestack/intra/settings in github.com/celzero/firestack v0.0.0-00010101000000-000000000000
PWD=$WORK/ios/src-arm64 GOMODCACHE=$GOPATH/pkg/mod GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk -miphoneos-version-min=17.5 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk -miphoneos-version-min=17.5 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk -miphoneos-version-min=17.5 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphoneos GOPATH=$WORK/ios:$GOPATH go build -v -x -ldflags -s -w -buildmode=c-archive -o $WORK/Tun2socks-ios-arm64.a ./gobind
unused github.com/BurntSushi/toml
unused github.com/Microsoft/go-winio
unused github.com/Microsoft/hcsshim
unused github.com/bazelbuild/rules_go
unused github.com/bwesterb/go-ristretto
unused github.com/cenkalti/backoff
unused github.com/cilium/ebpf
unused github.com/containerd/cgroups
unused github.com/containerd/console
unused github.com/containerd/containerd
unused github.com/containerd/continuity
unused github.com/containerd/fifo
unused github.com/containerd/go-runc
unused github.com/containerd/ttrpc
unused github.com/containerd/typeurl
unused github.com/coreos/go-systemd/v22
unused github.com/crazy-max/xgo
unused github.com/davecgh/go-spew
unused github.com/docker/go-units
unused github.com/elazarl/goproxy/ext
unused github.com/gin-contrib/sse
unused github.com/gin-gonic/gin
unused github.com/go-logr/logr
unused github.com/go-playground/assert/v2
unused github.com/go-playground/locales
unused github.com/go-playground/universal-translator
unused github.com/go-playground/validator/v10
unused github.com/gobwas/httphead
unused github.com/gobwas/pool
unused github.com/gobwas/ws
unused github.com/godbus/dbus/v5
unused github.com/gofrs/flock
unused github.com/gogo/protobuf
unused github.com/golang/groupcache
unused github.com/golang/mock
unused github.com/golang/protobuf
unused github.com/google/go-cmp
unused github.com/google/go-github/v56
unused github.com/google/gofuzz
unused github.com/google/subcommands
unused github.com/googleapis/gnostic
unused github.com/gorilla/websocket
unused github.com/hanwen/go-fuse/v2
unused github.com/hashicorp/errwrap
unused github.com/hashicorp/go-multierror
unused github.com/json-iterator/go
unused github.com/kr/pty
unused github.com/leodido/go-urn
unused github.com/mattbaird/jsonpatch
unused github.com/mattn/go-isatty
unused github.com/modern-go/concurrent
unused github.com/modern-go/reflect2
unused github.com/mohae/deepcopy
unused github.com/opencontainers/go-digest
unused github.com/opencontainers/runtime-spec
unused github.com/pkg/errors
unused github.com/pmezard/go-difflib
unused github.com/rogpeppe/go-charset
unused github.com/sirupsen/logrus
unused github.com/stretchr/objx
unused github.com/syndtr/gocapability
unused github.com/ugorji/go
unused github.com/ugorji/go/codec
unused github.com/vishvananda/netlink
unused github.com/vishvananda/netns
unused github.com/yuin/goldmark
unused go.opencensus.io
unused golang.org/x/exp
unused golang.org/x/exp/shiny
unused golang.org/x/image
unused golang.org/x/oauth2
unused golang.org/x/telemetry
unused golang.org/x/term
unused golang.org/x/xerrors
unused google.golang.org/appengine
unused google.golang.org/genproto
unused google.golang.org/grpc
unused google.golang.org/grpc/cmd/protoc-gen-go-grpc
unused google.golang.org/protobuf
unused gopkg.in/check.v1
unused gopkg.in/inf.v0
unused gopkg.in/tomb.v1
unused gopkg.in/yaml.v2
unused gopkg.in/yaml.v3
unused gotest.tools/v3
unused honnef.co/go/tools
unused k8s.io/api
unused k8s.io/apimachinery
unused k8s.io/client-go
unused k8s.io/klog/v2
unused k8s.io/kube-openapi
unused k8s.io/utils
unused sigs.k8s.io/json
unused sigs.k8s.io/structured-merge-diff/v4
unused sigs.k8s.io/yaml
unused github.com/BurntSushi/toml
unused github.com/Microsoft/go-winio
unused github.com/Microsoft/hcsshim
unused github.com/bazelbuild/rules_go
unused github.com/bwesterb/go-ristretto
unused github.com/cenkalti/backoff
unused github.com/cilium/ebpf
unused github.com/containerd/cgroups
unused github.com/containerd/console
unused github.com/containerd/containerd
unused github.com/containerd/continuity
unused github.com/containerd/fifo
unused github.com/containerd/go-runc
unused github.com/containerd/ttrpc
unused github.com/containerd/typeurl
unused github.com/coreos/go-systemd/v22
unused github.com/crazy-max/xgo
unused github.com/davecgh/go-spew
unused github.com/docker/go-units
unused github.com/elazarl/goproxy/ext
unused github.com/gin-contrib/sse
unused github.com/gin-gonic/gin
unused github.com/go-logr/logr
unused github.com/go-playground/assert/v2
unused github.com/go-playground/locales
unused github.com/go-playground/universal-translator
unused github.com/go-playground/validator/v10
unused github.com/gobwas/httphead
unused github.com/gobwas/pool
unused github.com/gobwas/ws
unused github.com/godbus/dbus/v5
unused github.com/gofrs/flock
unused github.com/gogo/protobuf
unused github.com/golang/groupcache
unused github.com/golang/mock
unused github.com/golang/protobuf
unused github.com/google/go-cmp
unused github.com/google/go-github/v56
unused github.com/google/gofuzz
unused github.com/google/subcommands
unused github.com/googleapis/gnostic
unused github.com/gorilla/websocket
unused github.com/hanwen/go-fuse/v2
unused github.com/hashicorp/errwrap
unused github.com/hashicorp/go-multierror
unused github.com/json-iterator/go
unused github.com/kr/pty
unused github.com/leodido/go-urn
unused github.com/mattbaird/jsonpatch
unused github.com/mattn/go-isatty
unused github.com/modern-go/concurrent
unused github.com/modern-go/reflect2
unused github.com/mohae/deepcopy
unused github.com/opencontainers/go-digest
unused github.com/opencontainers/runtime-spec
unused github.com/pkg/errors
unused github.com/pmezard/go-difflib
unused github.com/rogpeppe/go-charset
unused github.com/sirupsen/logrus
unused github.com/stretchr/objx
unused github.com/syndtr/gocapability
unused github.com/ugorji/go
unused github.com/ugorji/go/codec
unused github.com/vishvananda/netlink
unused github.com/vishvananda/netns
unused github.com/yuin/goldmark
unused go.opencensus.io
unused golang.org/x/exp
unused golang.org/x/exp/shiny
unused golang.org/x/image
unused golang.org/x/oauth2
unused golang.org/x/telemetry
unused golang.org/x/term
unused golang.org/x/xerrors
unused google.golang.org/appengine
unused google.golang.org/genproto
unused google.golang.org/grpc
unused google.golang.org/grpc/cmd/protoc-gen-go-grpc
unused google.golang.org/protobuf
unused gopkg.in/check.v1
unused gopkg.in/inf.v0
unused gopkg.in/tomb.v1
unused gopkg.in/yaml.v2
unused gopkg.in/yaml.v3
unused gotest.tools/v3
unused honnef.co/go/tools
unused k8s.io/api
unused k8s.io/apimachinery
unused k8s.io/client-go
unused k8s.io/klog/v2
unused k8s.io/kube-openapi
unused k8s.io/utils
unused sigs.k8s.io/json
unused sigs.k8s.io/structured-merge-diff/v4
unused sigs.k8s.io/yaml
WORK=/var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/go-build2825726856
unused github.com/BurntSushi/toml
unused github.com/Microsoft/go-winio
unused github.com/Microsoft/hcsshim
unused github.com/bazelbuild/rules_go
unused github.com/bwesterb/go-ristretto
unused github.com/cenkalti/backoff
unused github.com/cilium/ebpf
unused github.com/containerd/cgroups
unused github.com/containerd/console
unused github.com/containerd/containerd
unused github.com/containerd/continuity
unused github.com/containerd/fifo
unused github.com/containerd/go-runc
unused github.com/containerd/ttrpc
unused github.com/containerd/typeurl
unused github.com/coreos/go-systemd/v22
unused github.com/crazy-max/xgo
unused github.com/davecgh/go-spew
unused github.com/docker/go-units
unused github.com/elazarl/goproxy/ext
unused github.com/gin-contrib/sse
unused github.com/gin-gonic/gin
unused github.com/go-logr/logr
unused github.com/go-playground/assert/v2
unused github.com/go-playground/locales
unused github.com/go-playground/universal-translator
unused github.com/go-playground/validator/v10
unused github.com/gobwas/httphead
unused github.com/gobwas/pool
unused github.com/gobwas/ws
unused github.com/godbus/dbus/v5
unused github.com/gofrs/flock
unused github.com/gogo/protobuf
unused github.com/golang/groupcache
unused github.com/golang/mock
unused github.com/golang/protobuf
unused github.com/google/go-cmp
unused github.com/google/go-github/v56
unused github.com/google/gofuzz
unused github.com/google/subcommands
unused github.com/googleapis/gnostic
unused github.com/gorilla/websocket
unused github.com/hanwen/go-fuse/v2
unused github.com/hashicorp/errwrap
unused github.com/hashicorp/go-multierror
unused github.com/json-iterator/go
unused github.com/kr/pty
unused github.com/leodido/go-urn
unused github.com/mattbaird/jsonpatch
unused github.com/mattn/go-isatty
unused github.com/modern-go/concurrent
unused github.com/modern-go/reflect2
unused github.com/mohae/deepcopy
unused github.com/opencontainers/go-digest
unused github.com/opencontainers/runtime-spec
unused github.com/pkg/errors
unused github.com/pmezard/go-difflib
unused github.com/rogpeppe/go-charset
unused github.com/sirupsen/logrus
unused github.com/stretchr/objx
unused github.com/syndtr/gocapability
unused github.com/ugorji/go
unused github.com/ugorji/go/codec
unused github.com/vishvananda/netlink
unused github.com/vishvananda/netns
unused github.com/yuin/goldmark
unused go.opencensus.io
unused golang.org/x/exp
unused golang.org/x/exp/shiny
unused golang.org/x/image
unused golang.org/x/oauth2
unused golang.org/x/telemetry
unused golang.org/x/term
unused golang.org/x/xerrors
unused google.golang.org/appengine
unused google.golang.org/genproto
unused google.golang.org/grpc
unused google.golang.org/grpc/cmd/protoc-gen-go-grpc
unused google.golang.org/protobuf
unused gopkg.in/check.v1
unused gopkg.in/inf.v0
unused gopkg.in/tomb.v1
unused gopkg.in/yaml.v2
unused gopkg.in/yaml.v3
unused gotest.tools/v3
unused honnef.co/go/tools
unused k8s.io/api
unused k8s.io/apimachinery
unused k8s.io/client-go
unused k8s.io/klog/v2
unused k8s.io/kube-openapi
unused k8s.io/utils
unused sigs.k8s.io/json
unused sigs.k8s.io/structured-merge-diff/v4
unused sigs.k8s.io/yaml
unused github.com/BurntSushi/toml
unused github.com/Microsoft/go-winio
unused github.com/Microsoft/hcsshim
unused github.com/bazelbuild/rules_go
unused github.com/bwesterb/go-ristretto
unused github.com/cenkalti/backoff
unused github.com/cilium/ebpf
unused github.com/containerd/cgroups
unused github.com/containerd/console
unused github.com/containerd/containerd
unused github.com/containerd/continuity
unused github.com/containerd/fifo
unused github.com/containerd/go-runc
unused github.com/containerd/ttrpc
unused github.com/containerd/typeurl
unused github.com/coreos/go-systemd/v22
unused github.com/crazy-max/xgo
unused github.com/davecgh/go-spew
unused github.com/docker/go-units
unused github.com/elazarl/goproxy/ext
unused github.com/gin-contrib/sse
unused github.com/gin-gonic/gin
unused github.com/go-logr/logr
unused github.com/go-playground/assert/v2
unused github.com/go-playground/locales
unused github.com/go-playground/universal-translator
unused github.com/go-playground/validator/v10
unused github.com/gobwas/httphead
unused github.com/gobwas/pool
unused github.com/gobwas/ws
unused github.com/godbus/dbus/v5
unused github.com/gofrs/flock
unused github.com/gogo/protobuf
unused github.com/golang/groupcache
unused github.com/golang/mock
unused github.com/golang/protobuf
unused github.com/google/go-cmp
unused github.com/google/go-github/v56
unused github.com/google/gofuzz
unused github.com/google/subcommands
unused github.com/googleapis/gnostic
unused github.com/gorilla/websocket
unused github.com/hanwen/go-fuse/v2
unused github.com/hashicorp/errwrap
unused github.com/hashicorp/go-multierror
unused github.com/json-iterator/go
unused github.com/kr/pty
unused github.com/leodido/go-urn
unused github.com/mattbaird/jsonpatch
unused github.com/mattn/go-isatty
unused github.com/modern-go/concurrent
unused github.com/modern-go/reflect2
unused github.com/mohae/deepcopy
unused github.com/opencontainers/go-digest
unused github.com/opencontainers/runtime-spec
unused github.com/pkg/errors
unused github.com/pmezard/go-difflib
unused github.com/rogpeppe/go-charset
unused github.com/sirupsen/logrus
unused github.com/stretchr/objx
unused github.com/syndtr/gocapability
unused github.com/ugorji/go
unused github.com/ugorji/go/codec
unused github.com/vishvananda/netlink
unused github.com/vishvananda/netns
unused github.com/yuin/goldmark
unused go.opencensus.io
unused golang.org/x/exp
unused golang.org/x/exp/shiny
unused golang.org/x/image
unused golang.org/x/oauth2
unused golang.org/x/telemetry
unused golang.org/x/term
unused golang.org/x/xerrors
unused google.golang.org/appengine
unused google.golang.org/genproto
unused google.golang.org/grpc
unused google.golang.org/grpc/cmd/protoc-gen-go-grpc
unused google.golang.org/protobuf
unused gopkg.in/check.v1
unused gopkg.in/inf.v0
unused gopkg.in/tomb.v1
unused gopkg.in/yaml.v2
unused gopkg.in/yaml.v3
unused gotest.tools/v3
unused honnef.co/go/tools
unused k8s.io/api
unused k8s.io/apimachinery
unused k8s.io/client-go
unused k8s.io/klog/v2
unused k8s.io/kube-openapi
unused k8s.io/utils
unused sigs.k8s.io/json
unused sigs.k8s.io/structured-merge-diff/v4
unused sigs.k8s.io/yaml
PWD=$WORK/iossimulator/src-arm64 GOMODCACHE=$GOPATH/pkg/mod GOOS=ios GOARCH=arm64 GOFLAGS=-tags=ios CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -mios-simulator-version-min=17.5 -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -mios-simulator-version-min=17.5 -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -mios-simulator-version-min=17.5 -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=iphonesimulator GOPATH=$WORK/iossimulator:$GOPATH go build -v -x -ldflags -s -w -buildmode=c-archive -o $WORK/Tun2socks-iossimulator-arm64.a ./gobind
PWD=$WORK/macos/src-amd64 GOMODCACHE=$GOPATH/pkg/mod GOOS=darwin GOARCH=amd64 GOFLAGS=-tags=macos CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -arch x86_64 CGO_CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -arch x86_64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -arch x86_64 CGO_ENABLED=1 DARWIN_SDK=macosx GOPATH=$WORK/macos:$GOPATH go build -v -x -ldflags -s -w -buildmode=c-archive -o $WORK/Tun2socks-macos-amd64.a ./gobind
PWD=$WORK/macos/src-arm64 GOMODCACHE=$GOPATH/pkg/mod GOOS=darwin GOARCH=arm64 GOFLAGS=-tags=macos CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -fembed-bitcode -arch arm64 CGO_CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -fembed-bitcode -arch arm64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -fembed-bitcode -arch arm64 CGO_ENABLED=1 DARWIN_SDK=macosx GOPATH=$WORK/macos:$GOPATH go build -v -x -ldflags -s -w -buildmode=c-archive -o $WORK/Tun2socks-macos-arm64.a ./gobind
WORK=/var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/go-build1656248372
WORK=/var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/go-build1211971048
WORK=/var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/go-build4247264775
PWD=$WORK/iossimulator/src-amd64 GOMODCACHE=$GOPATH/pkg/mod GOOS=ios GOARCH=amd64 GOFLAGS=-tags=ios CC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang CXX=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ CGO_CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -mios-simulator-version-min=17.5 -fembed-bitcode -arch x86_64 CGO_CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -mios-simulator-version-min=17.5 -fembed-bitcode -arch x86_64 CGO_LDFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.5.sdk -mios-simulator-version-min=17.5 -fembed-bitcode -arch x86_64 CGO_ENABLED=1 DARWIN_SDK=iphonesimulator GOPATH=$WORK/iossimulator:$GOPATH go build -v -x -ldflags -s -w -buildmode=c-archive -o $WORK/Tun2socks-iossimulator-amd64.a ./gobind
WORK=/var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/go-build878563695
package gobind/gobind
	imports github.com/celzero/firestack/intra
	imports github.com/celzero/firestack/intra/dns53
	imports github.com/celzero/firestack/intra/ipn
	imports github.com/celzero/firestack/intra/netstack
	imports gvisor.dev/gvisor/pkg/rawfile: build constraints exclude all Go files in /Users/f.paillard/go/pkg/mod/gvisor.dev/[email protected]/pkg/rawfile
package gobind/gobind
	imports github.com/celzero/firestack/intra
	imports github.com/celzero/firestack/intra/dns53
	imports github.com/celzero/firestack/intra/ipn
	imports github.com/celzero/firestack/intra/netstack
	imports gvisor.dev/gvisor/pkg/rawfile: build constraints exclude all Go files in /Users/f.paillard/go/pkg/mod/gvisor.dev/[email protected]/pkg/rawfile
package gobind/gobind
	imports github.com/celzero/firestack/intra
	imports github.com/celzero/firestack/intra/dns53
	imports github.com/celzero/firestack/intra/ipn
	imports github.com/celzero/firestack/intra/netstack
	imports gvisor.dev/gvisor/pkg/rawfile: build constraints exclude all Go files in /Users/f.paillard/go/pkg/mod/gvisor.dev/[email protected]/pkg/rawfile
package gobind/gobind
	imports github.com/celzero/firestack/intra
	imports github.com/celzero/firestack/intra/dns53
	imports github.com/celzero/firestack/intra/ipn
	imports github.com/celzero/firestack/intra/netstack
	imports gvisor.dev/gvisor/pkg/rawfile: build constraints exclude all Go files in /Users/f.paillard/go/pkg/mod/gvisor.dev/[email protected]/pkg/rawfile
package gobind/gobind
	imports github.com/celzero/firestack/intra
	imports github.com/celzero/firestack/intra/dns53
	imports github.com/celzero/firestack/intra/ipn
	imports github.com/celzero/firestack/intra/netstack
	imports gvisor.dev/gvisor/pkg/rawfile: build constraints exclude all Go files in /Users/f.paillard/go/pkg/mod/gvisor.dev/[email protected]/pkg/rawfile
rm -r -f "$WORK"
/Users/f.paillard/projects/firestack/bin/gomobile: ios/arm64: go build -v -x -ldflags -s -w -buildmode=c-archive -o /var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/gomobile-work-154784127/Tun2socks-ios-arm64.a ./gobind failed: exit status 1

make: *** [/Users/f.paillard/projects/firestack/build/apple-intra/Tun2socks.xcframework] Error 1
Thanks for the support
@ignoramous
Copy link
Contributor

See if it builds (or ends up at a different error) after go get gvisor.dev/gvisor@go?

Unfortunately, we don't have Mac to test building for Apple platforms.

I'm trying to use the lib to build an iOS/MacOS NEPacketTunnelProvider to setup a local DNS filtering VPN.

A word of caution: Firestack has been built with Android in mind, and so you may find adopting to iOS / macOS APIs very frustrating.

@paillardf
Copy link
Author

Same result with go get gvisor.dev/gvisor@go but I tried to update gvisor to the latest version in go.mod and I now have

/var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/gomobile-work-1330880706/ios/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/adapters/gonet/gonet.go:29:2: found packages stack (addressable_endpoint_state.go) and bridge (bridge_test.go) in /var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/gomobile-work-1330880706/ios/pkg/mod/gvisor.dev/[email protected]/pkg/tcpip/stack
package gobind/gobind
	imports github.com/celzero/firestack/intra
	imports github.com/celzero/firestack/intra/dns53
	imports github.com/celzero/firestack/intra/ipn
	imports github.com/celzero/firestack/intra/netstack
	imports gvisor.dev/gvisor/pkg/rawfile: build constraints exclude all Go files in /var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/gomobile-work-1330880706/ios/pkg/mod/gvisor.dev/[email protected]/pkg/rawfile
rm -r -f "$WORK"
/Users/f.paillard/projects/eyeo/firestack/bin/gomobile: ios/arm64: go build -v -x -ldflags -s -w -buildmode=c-archive -o /var/folders/7t/w6vzvhfx2t78f9lpkdx8xp440000gq/T/gomobile-work-1330880706/Tun2socks-ios-arm64.a ./gobind failed: exit status 1

@ignoramous
Copy link
Contributor

The Makefile needs to account for newer API additions, I guess.

Android exports pkgs (from import paths) that iOS doesn't:

INTRA_BUILD_CMD=$(IMPORT_PATH)/intra $(IMPORT_PATH)/intra/backend $(IMPORT_PATH)/intra/rnet $(IMPORT_PATH)/intra/settings

iOS:

export MACOSX_DEPLOYMENT_TARGET=10.14; $(GOMOBILE) $(GOBIND) -iosversion=9.0 -target=ios,iossimulator,macos -o $@ -ldflags '-s -w' -bundleid org.outline.tun2socks $(IMPORT_PATH)/outline/apple $(IMPORT_PATH)/outline/shadowsocks

@paillardf
Copy link
Author

The packet you are using gvisor.dev/gvisor doesn't seem compatible with macos/ios. The build flag in gvisor.dev/gvisor/pkg/rawfile only target linux arm64 and amd64 arch.

@ignoramous
Copy link
Contributor

Unsure about iOS but various projects do have gvisor/netstack running on macOS:

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

No branches or pull requests

2 participants