write git sha version in diagnostic message#693
Conversation
There was a problem hiding this comment.
i wonder whether we could somehow make the build process go generate some code with the git commit hash. because they could be running a different binary-- if i switch branches with my daemon on, or pass a different GOPATH this doesnt work.
There was a problem hiding this comment.
Yeah... the problem is we cant force go generate steps to be included in the go build process. And unless we force people to use make to build, which sucks, we cant guarantee that the code has the right hash embedded...
There was a problem hiding this comment.
This is worse. it will fail mysteriously. binaries must not report to be a version they are not.
There was a problem hiding this comment.
So what info should we report?
There was a problem hiding this comment.
How about the hash of the binary?
|
|
I think #691 is relevant to this. |
|
What about distributed binaries not build from source on the users machine? |
|
@travisperson 🐳 ⭐ 🍍 (I dont know) |
|
Let's just use: |
|
One other way to do it is using something like this: https://github.com/turon/git-rcs-keywords Maybe we can create a script (and/or Makefile target) that sets up everything. |
|
gonna close this for now. Can reopen later if the topic comes up |
|
FYI: This is how go itself deals with the problem: |
|
@okket that's clever. Though we should add this as part of the metadata on signed binaries. (we cant put it in the source code itself because that would cause another commit) |
This PR finds the users go-ipfs folder in the GOPATH and queries it for the sha of the latest commit. This will be helpful to determine which nodes on the network are out of date. Older nodes will simply display the string "github.com/jbenet/go-ipfs" (which was the default value until this commit)