In the scope of tarantool/tarantool#6182 we want to explicitly mark tarantool's pre-releases as X.Y.Z-alphaN, X.Y.Z-betaN, X.Y.Z-rcN (releases will remain X.Y.Z). We also want to add a '-dev' suffix for nightly builds (I mean, for builds that are NOT constructed from a tagged commit). We meet several problems around packpack on this road.
- The
VERSION environment variable value is declined if it does not correspond to the format expected by packpack (A.B.C.D.<...>) (see also the packpack patch in this commit).
- Packpack stores
git describe --long --always output in the VERSION file even when we provide the VERSION variable externally. Now there is no way to store something in our own format in the VERSION file (AFAIU).
- We need different formats for RPM / Deb / tarball / VERSION file (at least X.Y.Z~betaN should be used in packages to order it before X.Y.Z; the
VERSION file is bundled into the executable at building and used in several APIs).
I propose the following flow:
- Packpack calls
./gen-version VERSION script from the repository root, if it is present, to generate the VERSION file content before creating tarball (when we're in a git repository).
- Packpack calls
./gen-version tarball, when packpack tarball is called (and the script is present), to use in construction of a tarball file name.
- Packpack calls
./gen-version rpm|deb, when it is called to generate RPM or Deb package, to fill the Version field / a last changelog entry and construct a package file name.
This way we'll have a great flexibility in the version format.
Also we'll able to get rid of scripting around packpack to set a VERSION variable and may return back to just call OS=<...> DIST=<...> /path/to/packpack to package a project. I think it is the nice property.
In the scope of tarantool/tarantool#6182 we want to explicitly mark tarantool's pre-releases as X.Y.Z-alphaN, X.Y.Z-betaN, X.Y.Z-rcN (releases will remain X.Y.Z). We also want to add a '-dev' suffix for nightly builds (I mean, for builds that are NOT constructed from a tagged commit). We meet several problems around packpack on this road.
VERSIONenvironment variable value is declined if it does not correspond to the format expected by packpack (A.B.C.D.<...>) (see also the packpack patch in this commit).git describe --long --alwaysoutput in theVERSIONfile even when we provide theVERSIONvariable externally. Now there is no way to store something in our own format in theVERSIONfile (AFAIU).VERSIONfile is bundled into the executable at building and used in several APIs).I propose the following flow:
./gen-version VERSIONscript from the repository root, if it is present, to generate theVERSIONfile content before creating tarball (when we're in a git repository)../gen-version tarball, whenpackpack tarballis called (and the script is present), to use in construction of a tarball file name../gen-version rpm|deb, when it is called to generate RPM or Deb package, to fill the Version field / a last changelog entry and construct a package file name.This way we'll have a great flexibility in the version format.
Also we'll able to get rid of scripting around packpack to set a VERSION variable and may return back to just call
OS=<...> DIST=<...> /path/to/packpackto package a project. I think it is the nice property.