Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(76)

Issue 4897043: code review 4897043: build: support versioning without hg (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 7 months ago by niemeyer
Modified:
13 years, 7 months ago
Reviewers:
adg, lucio
CC:
golang-dev, rsc, gustavo_niemeyer.net
Visibility:
Public.

Description

build: support versioning without hg CL 4873048 introduced the ability to build without hg and getting an "unknown" version. While this approach works to avoid the hg dependency, it also means that every exported tree that is built without hg or .hg will have not only missing information, but will also be compatible to one another. Considering that it is a common practice to remove the VCS data in distributions, I suggest we don't take this approach to avoid its consequences. This CL fixes the same problem in a different way: if a VERSION file at the top of the tree exists, use it at all times. If it doesn't, fall back to using information from hg necessarily, and fail if that's not possible. The error message when VERSION and hg are not available instructs users to handle it properly. The VERSION file can be generated with "src/version.bash -save" while hg is still around.

Patch Set 1 #

Patch Set 2 : code review 4897043: src/version.bash: support versioning without hg #

Patch Set 3 : diff -r 53b068e61dd0 https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r 53b068e61dd0 https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 53b068e61dd0 https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r 53b068e61dd0 https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 7 : diff -r f5a4bd48e8f4 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -6 lines) Patch
M src/version.bash View 1 2 3 4 5 2 chunks +18 lines, -6 lines 0 comments Download

Messages

Total messages: 12
niemeyer
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 7 months ago (2011-08-15 16:18:28 UTC) #1
rsc
if we're going to have VERSION, it should override everything. if it exists, don't bother ...
13 years, 7 months ago (2011-08-15 16:30:13 UTC) #2
niemeyer
> if we're going to have VERSION, > it should override everything. That's done. PTAL
13 years, 7 months ago (2011-08-15 17:08:00 UTC) #3
rsc
LGTM
13 years, 7 months ago (2011-08-15 17:13:35 UTC) #4
rsc
http://codereview.appspot.com/4897043/diff/13001/src/version.bash File src/version.bash (right): http://codereview.appspot.com/4897043/diff/13001/src/version.bash#newcode6 src/version.bash:6: GOROOT=$(cd `dirname $0`/..; pwd) GOROOT="$(dirname $0)/.." should suffice
13 years, 7 months ago (2011-08-15 17:13:41 UTC) #5
gustavo_niemeyer.net
> GOROOT="$(dirname $0)/.." > should suffice It does, but the message on -save is slightly ...
13 years, 7 months ago (2011-08-15 17:17:39 UTC) #6
niemeyer
*** Submitted as http://code.google.com/p/go/source/detail?r=ed3e04904ee7 *** build: support versioning without hg CL 4873048 introduced the ability ...
13 years, 7 months ago (2011-08-15 17:19:38 UTC) #7
rsc
> It does, but the message on -save is slightly nicer with the current version. ...
13 years, 7 months ago (2011-08-15 17:20:08 UTC) #8
adg
LGTM Nice.
13 years, 7 months ago (2011-08-15 21:51:28 UTC) #9
lucio
I had occasion to convert this BASH script to Plan 9's RC and I would ...
13 years, 7 months ago (2011-08-18 06:54:43 UTC) #10
lucio
Sorry folks, this was intended for a single recipient :-( Lucio. On 8/18/11, Lucio De ...
13 years, 7 months ago (2011-08-18 07:00:27 UTC) #11
gustavo_niemeyer.net
13 years, 7 months ago (2011-08-18 15:08:48 UTC) #12
Hey Lucio,

> 1. The -save option is not effective if a VERSION file already exists:
> the code exits before testing.

You're right.. my follow up change to put precedence on VERSION at all
times broke this.  I'll fix it, thanks.

> may not be quite what you want, but your version seems to ignore any
> version other than "default" which doesn't seem right either.  I may
> of course be missing something, feel free to put me right.

This is more about the convention for versioning Go than about the
branch name itself.  We only have two versions at the moment: weekly
and release, so the logic feels right.

Please note that I haven't touched that logic.

-- 
Gustavo Niemeyer
http://niemeyer.net
http://niemeyer.net/plus
http://niemeyer.net/twitter
http://niemeyer.net/blog

-- I never filed a patent.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b