> If the .version file is not present, the Makefile
> creates a dummy .version with version number 0.0.0. That is not a useful
> version number and effects the OS identification in all of the above uses.

This only happens when the .git directory is also not present, i.e. we
are using a release tarball.
The tarball should contain .version unless it was manually deleted or
there is a problem with the zipme.sh (or version.sh) script and it
didn't generate it in the first place.
Similarly, a release branch should contain the .git directory (thus,
.version will be created by Makefile) unless it was manually deleted.
Should we support these cases?





On Tue, Apr 21, 2020 at 3:49 PM Gregory Nutt <spudan...@gmail.com> wrote:
>
> When we do a release, the zipme script creates a proper version of the
> .version file.  This later becomes the version.h header file and is used
> in several places:
>
>  1. NSH Greeting
>  2. libcurl (OS identity)
>  3. webserver (OS identity)
>  4. procfs version file
>  5. uname OS version number
>
> The .version file is re-built every time you build nuttx if anything
> changes.  If the release number is no longer the HEAD, then it marks the
> version as dirty.
>
> This is good information.  Even fir development builds, it is is nice to
> now what version the current code derives from.
>
> We can't just put the .version file in the repository.  It is in the
> .gitignore file since it is updated often and those updates should not
> come upstream.  If the .version file is not present, the Makefile
> creates a dummy .version with version number 0.0.0. That is not a useful
> version number and effects the OS identification in all of the above uses.
>
> I wonder if we should now create a .release file which is essentially
> the the released .version file.  If the Makefile discovers that there is
> no .version file but there is a .release file, it could copy the
> .release file to the .version file.  So we would not have garbage like
> 0.0.0 as a version but something like 9.0.2.  Even better 9.0.2-dirty.
>
> The .version file would never be replaced if it is already present
> (supporting the capability for end-user custom version IDs).   The
> .release file would not appear in the .gitignore and would never be
> modified except for at releases.
>
> What do you all think?  Is this a useful idea?
>
> Greg
>
>
>
>

Reply via email to