[m-rev.] for review: record the git revision the Mercury compiler was compiled with

Julien Fischer jfischer at opturion.com
Fri Apr 17 11:26:33 AEST 2015


Hi,

On Fri, 17 Apr 2015, Sebastian Godelet wrote:

> Hi Paul,
>
> On 16/04/2015 21:18, Paul Bone wrote:
>> On Sat, Apr 04, 2015 at 01:24:57PM +0800, Sebastian Godelet wrote:
>>> Hi,
>>> 
>>> I think this functionality would be nice to have as I've seen it
>>> already in some other tools which are configured and build from git
>>> repositories.
>>> 
>>> Sebastian.
>>> 
>> 
>> Thanks for contributing this, I've wanted this feature myself for some 
>> time.
>> 
>> The patch itself looks fine.  My question is how will this behave when
>> someone builds the source distribution?
> well I don't know that much about the source distribution process.
> All I ever did with Mercury in that regard was to download a recent ROTD, 
> compile that and bootstrap the git distribution with that.
> Right now, with this patch, if you ./configure outside a git repository,
> the git revision would have the value "unknown".
> I could imagine some mechanism similar to the VERSION file can be used,
> i.e. when the configure script can't figure out the revision value, then it 
> reads in the value from a REVISION file or something like that.
> Another possibility would be to create some option like ./configure 
> --revision g2acde, but my autotools knowledge is rather limited.
> Anyway, I'd really like to know how for example the ROTD tarballs are 
> created, I guess that would help in implementing.

They are created using the 'tar' target in the top-level Mmakefile
(typically, using the shell script in tools/build_srcdist.)

One way to make this work would be to get the 'tar' target to create a
file containing the revision information, for example:

     .mercury_revision_info

and then have the configure script check for the existence of that file
during configuration.  If it exists, then configure should use the
contents of that file to set REVISION.

Cheers,
Julien.



More information about the reviews mailing list