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

After binding ios framework with help of gomobile framework has nothing in it #6253

Closed
mNizhurin opened this issue Apr 25, 2019 · 4 comments
Closed
Labels
kind/support A question or request for support

Comments

@mNizhurin
Copy link

mNizhurin commented Apr 25, 2019

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

$ go version go1.12.4 darwin/amd64

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="amd64"
GOBIN=""
GOCACHE="/Users/max/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/max/.go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/opt/go/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/kh/8ts9nvy534b3b0n8fwzpqrwm0000gn/T/go-build592238090=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go get github.com/ipfs/go-ipfs/cmd/ipfs
go get -d github.com/ipfs/go-ipfs/cmd/ipfs/...
gomobile bind -target=ios github.com/ipfs/go-ipfs

What did you expect to see?

Framework with .h file containing interface for classes, constructors and methods to work with ipfs.

What did you see instead?

As you can see, only IpfsVersion is available:

Ipfs.h:

// Objective-C API for talking to the following Go packages
//
//	github.com/ipfs/go-ipfs
//
// File is generated by gomobile bind. Do not edit.
#ifndef __Ipfs_FRAMEWORK_H__
#define __Ipfs_FRAMEWORK_H__

#include "Ipfs.objc.h"
#include "Universe.objc.h"

#endif

Ipfs.objc.h

// Objective-C API for talking to github.com/ipfs/go-ipfs Go package.
//   gobind -lang=objc github.com/ipfs/go-ipfs
//
// File is generated by gobind. Do not edit.

#ifndef __Ipfs_H__
#define __Ipfs_H__

@import Foundation;
#include "ref.h"
#include "Universe.objc.h"


FOUNDATION_EXPORT NSString* _Nonnull const IpfsApiVersion;
/**
 * CurrentVersionNumber is the current application's version literal
 */
FOUNDATION_EXPORT NSString* _Nonnull const IpfsCurrentVersionNumber;

@interface Ipfs : NSObject
/**
 * CurrentCommit is the current git commit, this is set as a ldflag in the Makefile
 */
+ (NSString* _Nonnull) currentCommit;
+ (void) setCurrentCommit:(NSString* _Nonnull)v;

@end

#endif
@mNizhurin
Copy link
Author

mNizhurin commented Apr 25, 2019

golang/go#31655 (comment)
Here what gomobile says about this problem

@Stebalien
Copy link
Member

Stebalien commented Apr 25, 2019

They're correct. The root IPFS package doesn't have much in it. You'll want to bind to github.com/ipfs/go-ipfs/core.

(closing for tracking as this isn't a bug)

@Stebalien Stebalien added the kind/support A question or request for support label Apr 25, 2019
@mNizhurin
Copy link
Author

mNizhurin commented Apr 29, 2019

Now all the code in CoreIpfsNode.h looks like this:
// skipped field IpfsNode.Identity with unsupported type: github.com/libp2p/go-libp2p-peer.ID
// skipped field IpfsNode.Repo with unsupported type: github.com/ipfs/go-ipfs/repo.Repo
// skipped field IpfsNode.Pinning with unsupported type: github.com/ipfs/go-ipfs/pin.Pinner
...
Any suggestions how to fix this?
Thank you!

@momack2 momack2 added this to Done in ipfs/go-ipfs May 9, 2019
@Stebalien
Copy link
Member

Stebalien commented May 18, 2019

I'm sorry, none of us have any experience with gomobile. I'd ask on the golang IRC channel (or maybe Stack Overflow?).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support A question or request for support
Projects
No open projects
Development

No branches or pull requests

2 participants