gopherdata / gophernotes

The Go kernel for Jupyter notebooks and nteract.
MIT License
3.8k stars 262 forks source link

Import `google.golang.org/grpc` fails #253

Open ChristianKniep opened 1 year ago

ChristianKniep commented 1 year ago

When importing import "google.golang.org/grpc" I get this.

error loading plugin "/go/src/gomacro.imports/gomacro_pid_9/import_7/import_7.so": 
  plugin.Open("/go/src/gomacro.imports/gomacro_pid_9/import_7/import_7"): 
    plugin was built with a different version of package google.golang.org/grpc/metadata
cosmos72 commented 1 year ago

The bug is confirmed - I am getting a slightly different error from import "google.golang.org/grpc", but it still fails:

error loading plugin "/home/max/go/src/gomacro.imports/gomacro_pid_29747/import_1/import_1.so":
  plugin.Open("/home/max/go/src/gomacro.imports/gomacro_pid_29747/import_1/import_1"):
    plugin was built with a different version of package internal/goarch

Looking at the dependencies of google.golang.org/grpc, I'd say it's a dependency version conflict:

Unluckily, the import mechanism is not smart enough to resolve version conflicts between packages being imported (and their dependencies) and packages imported by a previous import or statically compiled in the main program.

cosmos72 commented 8 months ago

Commit 55142043d19696ba037e3e93f9ec6c7f8436e82d fixes most errors while importing packages.

Some imports still fail, mostly due to version conflicts between gophernotes dependencies and dependencies of the package being imported. The most common version conflict I found is:

 error loading plugin "[...]/import_1.so": plugin.Open("[...]/import_1"):
   plugin was built with a different version of package golang.org/x/text/transform

which happens really often: import "google.golang.org/grpc" fails with such error, and import "gonum.org/v1/plot" fails with the same error too.

@sbinet any chance to remove the dependency from golang.org/x/text/transform in github.com/go-zeromq/zmq4, or at least update it?