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

Please include installation instructions #10

Open
sjackman opened this issue Dec 21, 2016 · 9 comments
Open

Please include installation instructions #10

sjackman opened this issue Dec 21, 2016 · 9 comments

Comments

@sjackman
Copy link

Thanks! A formula for Homebrew-science would be great.

brentp added a commit that referenced this issue Dec 22, 2016
@brentp
Copy link
Owner

brentp commented Dec 22, 2016

I added a section to the readme on installation, please have a look and let me know if you have any questions.

@sjackman
Copy link
Author

go get doesn't seem to install any executables.

❯❯❯ GOPATH=~/.go go get -u github.com/brentp/goleft/...
package github.com/brentp/goleft/emdepth/mops: found packages mops (mops.go) and emdepth (mops_test.go) in /Users/sjackman/.go/src/github.com/brentp/goleft/emdepth/mops
❯❯❯ which goleft
goleft not found
❯❯❯ ls ~/.go/bin
ls: /Users/sjackman/.go/bin: No such file or directory

@brentp
Copy link
Owner

brentp commented Dec 22, 2016

go get should get you what you need for development. If you want to install, you can run go install from the directory where goleft resides. How can I clarify this?

@brentp
Copy link
Owner

brentp commented Dec 22, 2016

I can put the main into cmd/goleft/main.go and then go install should install the binary. I'll leave this open to track that change.

brentp added a commit that referenced this issue Dec 22, 2016
@brentp brentp closed this as completed in f4b2e96 Dec 22, 2016
@brentp
Copy link
Owner

brentp commented Dec 22, 2016

Please see the updated readme and re-open this issue if you have any problems. Thanks for bringing this to my attention.

@sjackman
Copy link
Author

sjackman commented Dec 22, 2016

I'd suggest add GOPATH and PATH to the installation instructions:

export GOPATH=~/.go
PATH="$GOPATH/bin:$PATH"
go get -u github.com/brentp/goleft/...
go install github.com/brentp/goleft/cmd/goleft
goleft --help
❯❯❯ GOPATH=~/.go go get -u github.com/brentp/goleft/...=
package github.com/brentp/goleft: no buildable Go source files in /Users/sjackman/.go/src/github.com/brentp/goleft

no buildable Go source files

Is that warning expected?

If you are using go, you can build from source with:

How do I build goleft from source? Is go install github.com/brentp/goleft/cmd/goleft installing a precompiled binary, or building from source?

Thanks for your help, Brent.

@brentp
Copy link
Owner

brentp commented Dec 22, 2016

I'm hesitant to add more than I already have since most users would and should just copy the provided binary to their $PATH unless they are familiar with the go ecosystem.

yes:
go install github.com/brentp/goleft/cmd/goleft installs from source.

yes:
the warning is expected since the root go directory contains no source code by design.

I'll re-open this as a placeholder with the intent of adding an INSTALL-dev.md for those wishing to build from source.

@brentp brentp reopened this Dec 22, 2016
@sjackman
Copy link
Author

sjackman commented Dec 22, 2016

for those wishing to build from source.

Perhaps I'm being pedantic, but go install github.com/brentp/goleft/cmd/goleft does install from source. How would the INSTALL-dev.md instructions differ from the README.md instructions?

I'm hesitant to add more than I already have

The README.md installation instructions should be sufficient to leave a working executable in the user's PATH. The current instructions yield:

❯❯❯ go get -u github.com/brentp/goleft/...
package github.com/brentp/goleft/...: cannot download, $GOPATH not set. For more details see: go help gopath

go help gopath yields 660 words. That badly needs a tl;dr summary, such as export GOPATH=~/.go. Someone familiar with the go ecosystem will know that they can skip this step.

since most users would and should just copy the provided binary to their $PATH

If so, then the installation instructions should include that step. It's currently not clear where the executable is installed, and it's not easy to copy an executable if you don't know where it is.

A suggestion:

export GOPATH=~/.go
go get -u github.com/brentp/goleft/...
go install github.com/brentp/goleft/cmd/goleft
~/.go/bin/goleft --help

Finally, copy the ~/.go/bin/goleft executable to a directory located in your $PATH, such as ~/bin.

brentp added a commit that referenced this issue Dec 22, 2016
@brentp
Copy link
Owner

brentp commented Dec 22, 2016

I see what you mean, I have made another commit to clarify the point about install vs from source.

Installing go should give you a working go installation where any thing installed by go install will be on your path. that's why I consider additional explanation as something to be relegated to a more detailed document outside the readme (which I want to keep brief).

I'm more sticky on all of this because I want to promote that the preferred way to use is to download the binary. That said, I want it to be used so I'll accept PR's that clarify anything I've overlooked.

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