-
Notifications
You must be signed in to change notification settings - Fork 605
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
CONTRIBUTING.md: Instructions to get the source code should be updated for new version of Go #648
Comments
(this isn't particularly blocking me -- I'll just clone the repo -- but thought I'd file the bug in case this is affecting new contributors) |
Mark, Are you using a go version >= 1.8? for go version < 1.8, GOPATH needs to be set for go get github.com/foo/bar to check out the github.com/foo/bar repo. Setting the GOPATH is required. for go version >= 1.18 this is not require as by default GOPATH is set to $HOME/go. In your case, if you are using a go version >= 1.8 and did not set GOPATH, you should have a check out of the repo under $HOME/go/src/github.com/google/pprof. The code that you see in ~/go/pkg/mod/github.com/google/[email protected]/ is not the checkout repo (it does not have a .git directory). The directory is set to readonly/execute. |
Pretty sure the go version I’m using is above 1.18 (check with the hash
above) but the go on google workstations is pretty fresh
you should have a check out of the repo under $HOME/go/src/github.com/google/pprof
I git clone’d the pprof repo into ~/projects/pprof. Perhaps this is the
problem? This is usually what I do with git clones of forks of github
projects.
…On Thu, 7 Oct 2021 at 17:17, chavey ***@***.***> wrote:
Mark,
Are you using a go version >= 1.18?
for go version < 1.18, GOPATH needs to be set for go get
github.com/foo/bar to check out the github.com/foo/bar repo. Setting the
GOPATH is required.
for go version >= 1.18 this is not require as by default GOPATH is set to
$HOME/go.
In your case, if you are using a go version >= 1.18 and did not set
GOPATH, you should have a check out of the repo under $HOME/go/src/
github.com/google/pprof.
I you are using a go version < 1.18, you will not have a src directory.
The code that you see in ~/go/pkg/mod/
***@***.***/ is not the
checkout repo (it does not have a .git directory). The directory is set to
readonly/execute.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#648 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZYOKQIIQPYGKE4RXU62TUFU3OFANCNFSM5EQDGQKA>
.
|
Actually, let me check when I'm at my workstation tomorrow, the above is off-the-cuff and may be wrong. |
Is 1.18 a typo? I thought GOPATH was only required before Go 1.8? https://rakyll.org/default-gopath/ |
Let me maybe be a bit clearer on what I'm asking:
|
Hmm, I am not sure |
Looking in the output of 'go help get' looks like maybe we want `go
get -d ***@***.***`, that says not to build or
install packages.
…On Fri, 8 Oct 2021 at 20:32, Alexey Alexandrov ***@***.***> wrote:
Hmm, I am not sure go install ***@***.*** works that well for the development case, as I think it will download the sources into a versioned directory under ~/go/pkg/ ?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
I think with Go modules it can actually be just
|
Yeah, to be honest I always just `git clone` rather than `go get` when I'm
developing a project (I like having my edited-projects in a "projects"
directory separate from the mostly-read-only ~/go/src), so Alexey's
suggestion would work for me.
…On Fri, 8 Oct 2021 at 20:53, Alexey Alexandrov ***@***.***> wrote:
I think with Go modules it can actually be just
$ cd $(mktemp -d)
$ git clone ***@***.***:google/pprof.git
Cloning into 'pprof'...
Bremote: Enumerating objects: 3429, done.
remote: Counting objects: 100% (158/158), done.
remote: Compressing objects: 100% (108/108), done.
remote: Total 3429 (delta 66), reused 103 (delta 44), pack-reused 3271
Receiving objects: 100% (3429/3429), 2.95 MiB | 5.93 MiB/s, done.
Resolving deltas: 100% (2257/2257), done.
$ cd pprof
/tmp/tmp.d4vkfHmtp6/pprof
$ go test -v ./...
go: downloading github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639
go: downloading github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
? github.com/google/pprof [no test files]
? github.com/google/pprof/driver [no test files]
=== RUN TestParseData
--- PASS: TestParseData (0.00s)
PASS
...
...
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#648 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAZYOJKA7O7ZILMZEWSLB3UF25RBANCNFSM5EQDGQKA>
.
|
Yes, sorry for the typo, it should read 1.8. (https://golang.org/doc/go1.8#gopath) |
Right, yeah, I'm definitely using some version > 1.8. My version is an
in-development version between 1.17 and 1.18.
…On Sat, 9 Oct 2021 at 08:41, chavey ***@***.***> wrote:
for go version < 1.18, GOPATH needs to be set
Is 1.18 a typo? I thought GOPATH was only required before Go 1.8? rakyll.org/default-gopath
Yes, sorry for the typo, it should read 1.8. (https://golang.org/doc/go1.8#gopath)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
This older thread about 'go get' golang/go#31529 (comment), suggests using git clone. $ cd /tmp |
Should we had a section about using git clone OR are we ok with the current documentation? |
Since |
What operating system and processor architecture are you using?
Google's defualt workstation golang binary:
What did you do?
Followed steps in
CONTRIBUTING.md
to get the source code. MyGOPATH
is empty and defaults to~/go
(so I think you could maybe remove that bit of the CONTRIBUTING.md too?)I have some errors due to the new changes around go modules.
Then running the commands to run the tests:
I tried going into
~/go/src/
but there is nosrc
dir, only~/go/bin/
and~/go/pkg/
. The code seems to be in pkg/mod:What did you expect to see?
No errors, and able to run the tests with instructions given.
What did you see instead?
Errors and the tests weren't in the directory given.
The text was updated successfully, but these errors were encountered: