Closed radu-matei closed 6 years ago
And I just found your issue https://github.com/golang/go/issues/22998
And I just found your issue golang/go#22998
Yes, that is the root cause of this. lgo relies on -buildmode=shared
internally. There is a bug in go that buildmode=shared
fails if the target packaeg (A) has an indirect dependency to another package (B) and the shared library of B (e.g. libB.so
) is already installed.
Supprisingly, packages with indirect dependencies are rare, but it still sometimes happens.
In this case, I think the easiest workaround is just adding k8s.io/apimachinery/pkg/util/sets
to the blacklist lgo maintains because errors are caused by the indirect dependencies to k8s.io/apimachinery/pkg/util/sets
by PopAny
.
I blacklisted k8s.io/apimachinery/pkg/util/sets
and updated the docker image (yunabe/lgo:latest
).
Can you docker pull
and try it again?
I successfully built the image and tried to run a basic example - this is the output:
# /tmp/go-build478673581/libgithub.com-yunabe-lgo-sess7b2274696d65223a313532343234363035373238363437363030307d-exec4.so
github.com/yunabe/lgo/sess7b2274696d65223a313532343234363035373238363437363030307d/exec4.LgoExport_main: missing section for relocation target k8s.io/client-go/kubernetes/typed/core/v1.(*CoreV1Client).Pods
github.com/yunabe/lgo/sess7b2274696d65223a313532343234363035373238363437363030307d/exec4.LgoExport_main: reloc 8 to non-elf symbol k8s.io/client-go/kubernetes/typed/core/v1.(*CoreV1Client).Pods (outer=k8s.io/client-go/kubernetes/typed/core/v1.(*CoreV1Client).Pods) 0
github.com/yunabe/lgo/sess7b2274696d65223a313532343234363035373238363437363030307d/exec4.LgoExport_main: undefined: "k8s.io/client-go/kubernetes/typed/core/v1.(*CoreV1Client).Pods"
Failed to build a shared library of github.com/yunabe/lgo/sess7b2274696d65223a313532343234363035373238363437363030307d/exec4: exit status 2
Interesting. Can you share the code you executed in your basic example?
I tried to get started with the example in the client-go
repo
Thanks. It seems like the workaround I implemented to bypasss https://github.com/golang/go/issues/22998 to fix https://github.com/yunabe/lgo/issues/11 is not working in this case.
Maybe because Pods
is an interface method or Pods
is defined via embedding.
I'm investigating the condition to reproduce this issue. For the meanwhile, you can bypass the issue by adding import _ "k8s.io/client-go/kubernetes/typed/core/v1"
to your code.
Now it works, thanks a lot!
Hi, and thanks for the awesome project!
I'm trying to install the Kubernetes
client-go
so I can use it in a notebook. This is what I'm trying to do in the Dockerfile:While most of the packages seem to be installed correctly, some of them fail in the following way:
Although it seems to be an issue with the package itself, I want to make sure that:
are not issues with the compatibility of this project.
Thanks!