← Back to team overview

kicad-developers team mailing list archive

Re: version info does not get updated

 

On 9/3/2014 5:37 PM, yann jautard wrote:
> 
> Le 03/09/2014 22:48, Wayne Stambaugh a écrit :
>> On 9/3/2014 3:04 PM, yann jautard wrote:
>>> Le 03/09/2014 20:08, Wayne Stambaugh a écrit :
>>>> On 9/3/2014 8:08 AM, yann jautard wrote:
>>>>> Le 03/09/2014 12:32, yann jautard a écrit :
>>>>>> Le 02/09/2014 18:24, Wayne Stambaugh a écrit :
>>>>>>> I have this on my list of things to look at.  It should be
>>>>>>> possible to
>>>>>>> get CMake to generate make files that compare the source repo
>>>>>>> version
>>>>>>> against the version.h file and recreate it as required every time
>>>>>>> make
>>>>>>> is run.  Currently, the only time version.h gets updated is when the
>>>>>>> CMake files are modified or make rebuild_cache is run.
>>>>>>>
>>>>>>>
>>>>>> I checked it right now : I added "make rebuild-dep" to beginning of
>>>>>> the build process in kicad-install.sh. Running it with a kicad
>>>>>> install
>>>>>> witj not up to date version info results in rebuilding only
>>>>>> build_version.cpp and relinking all parts that have a user interface.
>>>> Rebuilding the dependencies is not what you want to do if all you are
>>>> trying to do is update the version string.
>>>> (...)
>>> yes of course that was rebuild_cache, I made a mistake writing the mail.
>>>
>>> So as you said you want to get Cmake to compare the version with the one
>>> in the file, I'm pretty sure it is not necessary. Just calling make
>>> rebuild_cache before make do the job pretty well.
>> This is not the optimal solution.  Using rebuild_cache will update
>> version.h even if the repo has not changed and cause unnecessary build
>> and link steps.  It's fine as a quick fix but the correct solution is to
>> have CMake generate the appropriate make file steps to test if there is
>> any change to the version string and regenerate version.h accordingly.
>>
>>
> 
> Sure it is not optimal. But considering the fact that there usually are
> several commits each day, I'm pretty confident it will not introduce
> unnecessary builds too often.
> And even if it does, the only recompiled file is build_version.cpp, and
> linking steps are almost as fast as just checking if there is something
> to build. So it is not a real problem. At east for me, even on my
> netbook I can live with that :)
> 
> What about some shell magic inside the build script that compares the
> version number in version.h with the output of "bzr revno" ? Will not it
> be easier to do than some similar Cmake stuff ?
> 

The magic is inside the build scripts generated by CMake not the
external kicad-install.sh which is primarily for users.  I would not
consider adding the version string check to kicad-install.sh an
acceptable solution.  Developers should be using CMake to generate the
make files and calling make to build KiCad.




References