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

Arch linux support / installation? #262

Open
khughitt opened this issue Jan 17, 2021 · 2 comments
Open

Arch linux support / installation? #262

khughitt opened this issue Jan 17, 2021 · 2 comments

Comments

@khughitt
Copy link

khughitt commented Jan 17, 2021

Greetings!

I noticed that the golearn Wiki currently only lists Ubuntu/OpenSUSE as being supported linux platforms.

Is this still the case?

I started following the installation instructions, just to see if it would work, but I ran into issues related to the handling of GOROOT / GOPATH..

Whereas golearn suggests setting GOROOT=$HOME/go and $GOPATH=$HOME/go/bin, the arch wiki suggests that GOPATH should be ~/go instead.

When I attempted to follow the conventions from the golearn install docs, when attempting to call go get, I run into the following issue:

go tool: no such tool "compile"

(compile lives /usr/lib/go/pkg/tool/linux_amd64/ on arch linux, where $GOROOT is typically set to /usr/lib/go...)

When attempting to use the Arch conventions, the go get command succeeds, but the source code for golearn doesn't appear to be pulled, so the $GOPATH/src/github.com/sjwhitworth/golearn path does not exist.

It seems likely that I'm simply misunderstanding something about how GOPATH and GOROOT work, and how they interact with go get..

Has anyone had luck working with golearn on arch linux?

Any advice would be greatly appreciated.

@Sentimentron
Copy link
Collaborator

On most Linux distributions, it looks something like this:

  • GOROOT=/usr/local/go
  • GOPATH=/home/sentimentron/go

Arch Linux should be the same. Basically, GOROOT is the system bit that's shared between all users on the system, GOPATH is just for you and contains a bin/, src/ and pkg/ directory. When you run go get, it should end up in GOPATH.

@khughitt
Copy link
Author

khughitt commented Jan 26, 2021

Hi @Sentimentron,

Thanks for taking the time to respond, and for the clarifications!

It seems like my system is indeed configured properly then, but for some reason, the source code is not be pulled, e.g.:

~/go
❯ echo $GOPATH
/home/<user>/go

~/go
❯ cd $GOPATH/src/github.com/sjwhitworth/golearn
cd: no such file or directory: /home/<user>/go/src/github.com/sjwhitworth/golearn

❯ go get -t -u -v github.com/sjwhitworth/golearn
go: github.com/sjwhitworth/golearn upgrade => v0.0.0-20210117164941-cde96fa8267f

~/go
❯ fd golearn
bin/pkg/mod/cache/download/github.com/sjwhitworth/golearn
bin/pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/sjwhitworth/[email protected]
bin/pkg/mod/github.com/sjwhitworth/[email protected]
bin/pkg/mod/github.com/sjwhitworth/[email protected]/golearn.go
pkg/mod/cache/download/github.com/sjwhitworth/golearn
pkg/mod/cache/download/sumdb/sum.golang.org/lookup/github.com/sjwhitworth/[email protected]
pkg/mod/github.com/sjwhitworth/[email protected]
pkg/mod/github.com/sjwhitworth/[email protected]/golearn.go

I also tried adding the "-d" switch, which, according to the help:

The -d flag instructs get to download the source code needed to build
the named packages, including downloading necessary dependencies,
but not to build and install them.

But that had no impact either..

Any ideas what the issue could be?

Also, Is the note about $GOPATH including $GOROOT + "bin/" OS X specific then? If so, perhaps it could be useful to add a note in the README to that effect?

Version Info:

  • go 1.15.7

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

No branches or pull requests

2 participants