[Mesa-dev] [PATCH v2] build: unify mesa version by using a VERSION file

Chad Versace chad.versace at linux.intel.com
Thu Jul 25 14:23:03 PDT 2013


On 07/25/2013 01:28 PM, Kenneth Graunke wrote:
> On 07/25/2013 12:39 PM, Emil Velikov wrote:
>> Rather than having to keep track of all the build systems and their respecitve
>> definition of the mesa version, use a single top file VERSION. Every build
>> system is responsible for reading/parsing the file and using it
>>
>> v2:
>> * remove useless bulletpoint from the documentation, suggested by Matt
>> * "Androing is Linux. Use '/' in stead of '\'", spotted by Chad V
>> * use cleaner code to get the version in scons, suggested by Chad V
>>
>> Reviewed-by: Matt Turner <mattst88 at gmail.com>
>> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
>> ---
>>
>> Thanks for the tips and review guys.
>> Feel free to commit if it's ok now - lacking the access rights :\
>>
>> Cheers
>> Emil
>
> I like the idea of this patch, but there's one problem: autogen.sh dies with a really cryptic error if the VERSION file
> ends with a newline.  My editor, at least, seems to want to append that automatically, so I assume others will run into
> that problem as well.
>
> We could work around this by always doing:
> $ echo -n '9.3.0-devel' > VERSION
>
> but...I wonder if there's some way to make this more robust without complicating the code too badly.

I like this patch too. We should accept it only if we ensure that all three build systems are equally
fault tolerant of a trailing newline in the VERSION file.
Otherwise, a maintainer may update VERSION with an accidental newline, test only
on $buildsystem1, and thus break $buildsystem2 and $buildsystem3.

Of the three build systems:

   - The Android changes do, in fact, have a bug. In GNUMake, shell commands are
     invoked as $(shell arg0 arg1 ...). So, the Android change should read as
     below. This tolerates a trailing newline.

        +MESA_VERSION=$(shell cat $(MESA_TOP)/VERSION)

   - The SCons code becomes tolerant of the newline if `mesa_version = f.read()`
     is changed to `mesa_version = f.read().strip()`.

   - M4 is a mystery to me. Maybe Matt (CC'd) can suggest a fix there.


   -



More information about the mesa-dev mailing list