Skip to content

Cannot use third party libraries #261

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

Closed
ammar-elsabe opened this issue Jul 10, 2023 · 5 comments
Closed

Cannot use third party libraries #261

ammar-elsabe opened this issue Jul 10, 2023 · 5 comments
Assignees

Comments

@ammar-elsabe
Copy link

Importing third party libraries works, it doesn't complain there. However, when I try to use them it will always complain saying
undefined "<module name>" in <module name>.<function name> <*ast.SelectorExpr>.

For example trying to run the example notebook Display.ipynb

Display.ipynb

Or when I try to use the gota example for ReadCSV

gota

go version: go1.20.5 linux/amd64, running on fedora 38

go env:

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ammarelsabe/.cache/go-build"
GOENV="/home/ammarelsabe/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/ammarelsabe/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/ammarelsabe/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/lib/golang"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.5"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build599508906=/tmp/go-build -gno-record-gcc-switches"
@cosmos72
Copy link
Member

confirmed, it seems imports are broken when gophernotes is compiled with go >= 1.20

This is the same problem as cosmos72/gomacro#146

@ammar-elsabe
Copy link
Author

Just tried recompiling it with 1.19.10, can confirm it works, it'll do for now, thanks. I'll close this since it's on gomacro's side.

@cosmos72
Copy link
Member

I'd rather keep this issue open until it's solved, as it seriously affects gophernotes too.

@cosmos72 cosmos72 reopened this Jul 11, 2023
@cosmos72 cosmos72 self-assigned this Aug 5, 2023
@cosmos72
Copy link
Member

cosmos72 commented Aug 5, 2023

[UPDATE] as I wrote in gomacro issue 146

I checked this bug by compiling and running gomacro with various Go toolchains.
The results are:

  • [OK] Go 1.19.12 from go.dev/dl/

  • [BUG] Go 1.20.7 from go.dev/dl/

  • [BUG] Go 1.21rc4 from go.dev/dl/

  • [OK] Go 1.19.12 from Debian package golang-1.19:amd64

  • [OK] Go 1.20.7 from Debian package golang-1.20:amd64

  • [OK] Go 1.21rc3 from Debian package golang-1.21:amd64

So Debian is actively applying a patch that fixes this issue.
Now I need to find such patch and check why it was not merged into the upstream Go toolchain at go.dev/dl/

@cosmos72
Copy link
Member

cosmos72 commented Nov 3, 2023

Fixed by commit 5514204

Some imports may still fail, if they contain versioned dependencies that conflict with gophernotes dependencies.
Example: import "gonum.org/v1/plot" currently fails with:

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

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

No branches or pull requests

2 participants