janpfeifer / gonb

GoNB, a Go Notebook Kernel for Jupyter
https://github.com/janpfeifer/gonb
MIT License
467 stars 32 forks source link

Can't install gonb undefined: exec #74

Closed Qwoter closed 9 months ago

Qwoter commented 9 months ago

My setup is clean go install using go env manager goenv but the same issue occurred when doing clean install without go version manager. >go version go version go1.21.1 darwin/arm64

When running >go install github.com/janpfeifer/gonb@latest I get this error:

# github.com/janpfeifer/gonb/internal/goexec
go/1.21.1/pkg/mod/github.com/janpfeifer/gonb@v0.9.1/internal/goexec/cwd_others.go:18:9: undefined: exec
go/1.21.1/pkg/mod/github.com/janpfeifer/gonb@v0.9.1/internal/goexec/cwd_others.go:18:36: undefined: strconv
go/1.21.1/pkg/mod/github.com/janpfeifer/gonb@v0.9.1/internal/goexec/cwd_others.go:19:2: undefined: klog
go/1.21.1/pkg/mod/github.com/janpfeifer/gonb@v0.9.1/internal/goexec/cwd_others.go:20:15: undefined: os
go/1.21.1/pkg/mod/github.com/janpfeifer/gonb@v0.9.1/internal/goexec/cwd_others.go:25:5: undefined: klog
go/1.21.1/pkg/mod/github.com/janpfeifer/gonb@v0.9.1/internal/goexec/cwd_others.go:26:3: undefined: klog
go/1.21.1/pkg/mod/github.com/janpfeifer/gonb@v0.9.1/internal/goexec/cwd_others.go:29:11: undefined: strings
go/1.21.1/pkg/mod/github.com/janpfeifer/gonb@v0.9.1/internal/goexec/cwd_others.go:31:6: undefined: strings
go/1.21.1/pkg/mod/github.com/janpfeifer/gonb@v0.9.1/internal/goexec/cwd_others.go:32:11: undefined: strings

Additional info:

>echo $GOPATH
/Users/XXX/go/1.21.1
>echo $GOROOT
/Users/XXX/.goenv/versions/1.21.1

Not sure if some dependency is missing or if my setup has some issues.

janpfeifer commented 9 months ago

I'm sorry to hear about the issues @Qwoter, and thanks for the report.

But it's a fresh release, there may be an issue. I'll try to reproduce it tomorrow morning and report back.

janpfeifer commented 9 months ago

I think I found the issue. The offending package has a different implementation for non-linux builds, and I don't have a way to test it (both my desktop/laptop are linux boxes), my bad 😞

I'm fixing it "blindly", because it looks easily, and there is no way for me to test.

Would you mind seeing if it works for you ? You would have to install it with:

go install github.com/janpfeifer/gonb@b0baf1e

If you let me knows whether it works, I'll create the v0.9.2 release so it's available to everyone with a Mac.

Again thanks for the report!

janpfeifer commented 9 months ago

Actually I tested it with cross-compilation:

env GOOS=darwin GOARCH=arm64 go build -o /tmp/gonb_darwin_arm64 .

And it seems to have worked, so I'm hopeful 😄

Qwoter commented 9 months ago

Checked on my setup and go install github.com/janpfeifer/gonb@b0baf1e works!

janpfeifer commented 9 months ago

I just released v0.9.2 with the fix :)