On Tue, Apr 21, 2020 at 10:49 AM 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?
Yes, I think this is a useful idea. I like that we could support end-user custom version IDs as well as having something much more useful than 0.0.0 as the version number, in the event of working from a checkout rather than a release tarball. Now, the question is, does the .release file exist only on release branches or also in master? If in master, then I think the .release file would need to be incremented on 'master' immediately after branching for a release. So, for example, immediately after branching for nuttx-9.1, the following commit on 'master' would increment .release to 9.2. Would we want an additional field for '-prerelease', '-rc1', '-rc2', '-release'? Thoughts? Nathan