From: Christopher J. Morrone Date: Fri, 22 Jan 2016 02:36:01 +0000 (-0500) Subject: LU-7699 build: Replace version_tag.pl with LUSTRE-VERSION-GEN X-Git-Tag: 2.8.51~23 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=ee813dbaa2a2b86f4873c4c289f62a0243aa9809 LU-7699 build: Replace version_tag.pl with LUSTRE-VERSION-GEN This patch overhauls how version numbers are handled. The biggest change is removing the two independent places where versions were being generated (LB_BUILDID and lustre_tag*.pl) with a single script named LUSTRE-VERSION-GEN at the top level of the tree. LUSTRE-VERSION-GEN is based on the GIT-VERSION-GEN script that git's own source code build system uses. LUSTRE-VERSION-GEN generates the lustre version string from either git, or if git is not available from the LUSTRE-VERSION-FILE file, or if _that_ is not available, its own internal DEFAULT_VERSION default version number. This allows building the lustre code under all reasonable conditions. The new method uses LUSTRE-VERSION-GEN to supply the correct full lustre version (which may contain git --describe information) to AC_INIT. This means that the autotools actually know the correct version number. Some benefits of this are: * We can use standard {AC_}PACKAGE_VERSION macros and variables instead of inventing our own * ./configure --version and other commands will list the correct version of Lustre * The lustre tarball created by "make dist" will contain the full version number The lustre/autoconf/lustre-version.ac file was replaced with a new config/lustre-version.m4 file. We no longer need to work with m4-only macros prefore AC_INIT is called, so the new file defines a LUSTRE_VERSION_VARIABLES function for us to call from configure.ac. The new lustre-version.m4 derives the derive LUSTRE_{MAJOR,MINOR,PATCH,FIX} from AC_PACKAGE_VERSION rather than being yet another source of version numbers. The LUSTRE_VER_ALLOWED_OFFSET and LUSTRE_CLI_VER_OFFSET_WARN m4 macros were dropped, and the OBD_OCD_VERSION strings stored directly in lustre_ver.h.in instead. LB_CHECK_VERSION was removed (no longer necessary). AC_LUSTRE_VERSION_STRING was drop. It is no longer necessary now that we can set LUSTRE_VERSION_STRING directly to @PACKAGE_VERSION@ in lustre_ver.h.in. The DOWNSTREAM_RELEASE configure argument is deprecated and all related code removed. The lustre/doc/VERSIONING documenation is relocated to Documentation/versioning.txt and updated to reflect the new versioning method and practices. The META file and BUILDID variables and related code are removed since they are no longer used under the new versioning method. Note that this patch makes lustre only look at the dotted version tags in git, so we can finally stop using three to five tags for every release. Now we can just use one clear tag. The tags with underscores are obsolete. Change-Id: I7196f92ed4975776cc8e73fd3ebf436b5921f83e Signed-off-by: Christopher J. Morrone Reviewed-on: http://review.whamcloud.com/18107 Tested-by: Jenkins Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/.gitignore b/.gitignore index eeebf7b..af522ee 100644 --- a/.gitignore +++ b/.gitignore @@ -86,6 +86,7 @@ TAGS /Rules /series /stamp-h1 +/LUSTRE-VERSION-FILE # # Top level generic files diff --git a/Documentation/versioning.txt b/Documentation/versioning.txt new file mode 100644 index 0000000..c96965d --- /dev/null +++ b/Documentation/versioning.txt @@ -0,0 +1,82 @@ +Lustre versioning +================= + +This document describes versioning of source and binaries for Lustre. + +Versions +======== + +The Lustre version is generated by the LUSTRE-VERSION-GEN script at the +top level of the lustre source tree. The script prints the version to +stdout and also updates the file at the top of the source tree named +LUSTRE-VERSION-FILE to contain the current version (if the file does not +already exist, or if it contains an out-of-date version). + +LUSTRE-VERISON-GEN is called when the autotools are initialized, +either when autogen.sh is run or when autoreconf runs. The stdout +of the script is used as the version option of AC_INIT in configure.ac. +This ensures that the AC_PACKAGE_VERSION m4 macro, the PACKAGE_VERSION +output variable, and the PACKAGE_VERSION preprocessor symbol are all +correctly set to the current version. Likewise AC_PACKAGE_STRING and +PACKAGE_STRING will contain the current version. + +If the lustre tree is in a git working directory, LUSTRE-VERSION-GEN +uses "git --describe" to generate the version number. If the tree is +not in a git working directory but a LUSTRE-VERSION-FILE file exists +(such as in the tarball created by "make dist"), the script falls back +to using the value in the file. Finally, if it is not a git working +directory and the LUSTRE-VERSION-FILE also does not exist (such as when +the source tree is retrieved with "git archive --remote") LUSTRE-VERSION-GEN +will fall back to using its own internal DEFAULT_VERSION variable. + +Tagging Guidelines - General +============================ + +It is best practice to edit the DEFAULT_VERSION in LUSTRE-VERSION-GEN +before creating a tag of the same name. Public community versions +should have the form "1.1.1" or "1.1.1.1". + +Tagging Guildines - Third Party +=============================== + +Third parties (e.g. vendors, labs, universities) that wish to tag their +own releases should append a version that unamiguously identifies the +release for their organization. This is done by adding an underscore, +and then a unique version to the tag. + +For instance, lets consider a vendor named Acme. They are releasing a +their second patched version of Lustre 2.8.0 to their customers. They +would set the version to something like the following: + + 2.8.0_2.acme + +The third party subversion string can contain alphanumerics, underscores, +and periods. + +Strictly speaking, if one is certain that the third party release code +will only be built from inside a git working directory, only a git tag +need be made. In other words, creating a git commit to update the +DEFAULT_VERSION in LUSTRE-VERSION-GEN is a not always necessary. +LUSTRE-VERSION-GEN can retrieve the version solely using git, from the +git tag and git describe information. + +Releases +======== + +Major releases should get a 3-digit version x.y.0, and if a maintenance +release is needed it will increment the 3rd digit. During development, +versions start at x.y.50 and increment toward the x.(y+1).0 release. + +Usage: +------ + +New numbers are used as follows: + +1. major: + - increased when major new functionality becomes available +2. minor: + - for each new release with new functionality +3. patch: + - for a stable maintenance release or development snapshot +4. fix: + - minor fix release diff --git a/LUSTRE-VERSION-GEN b/LUSTRE-VERSION-GEN new file mode 100755 index 0000000..f9d6c66 --- /dev/null +++ b/LUSTRE-VERSION-GEN @@ -0,0 +1,37 @@ +#!/bin/sh + +DEFAULT_VERSION=2.8.50 +LVF=LUSTRE-VERSION-FILE + +LF=' +' + +if test -d ${GIT_DIR:-.git} -o -f .git && + VN=$(git describe --match "[0-9]*" --abbrev=7 HEAD 2>/dev/null) && + case "$VN" in + *$LF*) (exit 1) ;; + [0-9]*) + git update-index -q --refresh + test -z "$(git diff-index --name-only HEAD --)" || + VN="$VN-dirty" ;; + esac +then + VN=$(echo "$VN" | sed -e 's/-/_/g'); +elif test -r $LVF +then + VN=$(sed -e 's/^LUSTRE_VERSION = //' <$LVF) +else + VN="$DEFAULT_VERSION" +fi + +if test -r $LVF +then + VC=$(sed -e 's/^LUSTRE_VERSION = //' <$LVF) +else + VC=unset +fi +test "$VN" = "$VC" || { + echo "LUSTRE_VERSION = $VN" >$LVF +} + +echo $VN diff --git a/autoMakefile.am b/autoMakefile.am index adffb63..0943370 100644 --- a/autoMakefile.am +++ b/autoMakefile.am @@ -93,9 +93,6 @@ dist-hook: undef.h -name .svn -o \ -name .git -o \ -name .#* -exec rm -rf {} \; - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$(top_distdir)" distdir="$(distdir)" \ - module-dist-hook EXTRA_DIST = @PACKAGE_TARNAME@.spec \ build/Makefile \ @@ -103,7 +100,9 @@ EXTRA_DIST = @PACKAGE_TARNAME@.spec \ config.h.in \ undef.h \ lustre-dkms_pre-build.sh \ - lustre-dkms_post-build.sh + lustre-dkms_post-build.sh \ + LUSTRE-VERSION-GEN \ + LUSTRE-VERSION-FILE rpm-local: @(if test -z "$(RPMBUILD)"; then \ @@ -252,16 +251,3 @@ checkstack-update: checkstack-clean: rm -f ${CSTK} ${CSTKO} - -module-dist-hook: - @if [ -d .git ]; then \ - perl lustre/scripts/version_tag.pl \ - --make_META > $(distdir)/META; \ - elif [ -f META ]; then \ - cp META $(distdir)/META; \ - else \ - echo -e "\n" \ - "*** I have no idea how to create a META file in $(distdir).\n"\ - "*** Please file a bug at https://jira.hpdd.intel.com/\n"; \ - exit 1; \ - fi diff --git a/config/lustre-build-linux.m4 b/config/lustre-build-linux.m4 index e1f17bb..26cdfa4 100644 --- a/config/lustre-build-linux.m4 +++ b/config/lustre-build-linux.m4 @@ -81,9 +81,7 @@ AC_ARG_WITH([release], AC_HELP_STRING([--with-release=string], [set the release string (default=$kvers_YYYYMMDDhhmm)]), [RELEASE=$withval], [ - RELEASE="" - AS_IF([test "$DOWNSTREAM_RELEASE"], [RELEASE="${DOWNSTREAM_RELEASE}_"]) - RELEASE="$RELEASE$(echo $LINUXRELEASE | tr '-' '_')_$BUILDID"]) + RELEASE="$(echo $LINUXRELEASE | tr '-' '_')"]) AC_MSG_RESULT($RELEASE) AC_SUBST(RELEASE) diff --git a/config/lustre-build.m4 b/config/lustre-build.m4 index 1ecaf8a..459b54c 100644 --- a/config/lustre-build.m4 +++ b/config/lustre-build.m4 @@ -1,14 +1,4 @@ # -# LB_CHECK_VERSION -# -# Verify that LUSTRE_VERSION was defined properly -# -AC_DEFUN([LB_CHECK_VERSION], [ -AS_IF([test "LUSTRE_VERSION" = "LUSTRE""_VERSION"], - [AC_MSG_ERROR([This script was not built with a version number.])]) -]) # LB_CHECK_VERSION - -# # LB_CANONICAL_SYSTEM # # fixup $target_os for use in other places @@ -23,84 +13,12 @@ AC_SUBST(lb_target_os) ]) # LB_CANONICAL_SYSTEM # -# LB_DOWNSTREAM_RELEASE +# LB_DOWNSTREAM_RELEASE (DEPRECATED) # AC_DEFUN([LB_DOWNSTREAM_RELEASE], -[AC_ARG_WITH([downstream-release], - AC_HELP_STRING([--with-downstream-release=string], - [set a string in the BUILD_VERSION and RPM Release: (default is nothing)]), - [DOWNSTREAM_RELEASE=$with_downstream_release], - [ # if not specified, see if it's in the META file - AS_IF([test -f META], - [DOWNSTREAM_RELEASE=$(sed -ne '/^LOCAL_VERSION =/s/.*= *//p' META)]) - ]) -AC_SUBST(DOWNSTREAM_RELEASE) -]) # LB_DOWNSTREAM_RELEASE - -# -# LB_BUILDID -# -# Check if the source is a GA release and if not, set a "BUILDID" -# -# Currently there are at least two ways/modes of/for doing this. One -# is if we are in a valid git repository, the other is if we are in a -# non-git source tree of some form. Building the latter from the former -# will be handled here. -AC_DEFUN([LB_BUILDID], [ -AC_CACHE_CHECK([for buildid], [lb_cv_buildid], [ -lb_cv_buildid="" -AS_IF([git branch >/dev/null 2>&1], [ - ffw=0 - hash="" - ver=$(git describe --match v[[0-9]]_*_[[0-9]]* --tags) - if [[[ $ver = *-*-* ]]]; then - hash=${ver##*-} - ffw=${ver#*-} - ffw=${ffw%-*} - ver=${ver%%-*} - fi - # it's tempting to use [[ $ver =~ ^v([0-9]+_)+([0-9]+|RC[0-9]+)$ ]] - # here but the portability of the regex on the right is dismal - # (thanx suse) - if echo "$ver" | egrep -q "^v([[0-9]]+_)+([[0-9]]+|RC[[0-9]]+)$"; then - ver=$(echo $ver | sed -e 's/^v\(.*\)/\1/' \ - -e 's/_RC[[0-9]].*$//' -e 's/_/./g') - fi - - # a "lustre fix" value of .0 should be truncated - if [[[ $ver = *.*.*.0 ]]]; then - ver=${ver%.0} - fi - # ditto for a "lustre fix" value of _0 - if [[[ $ver = v*_*_*_0 ]]]; then - ver=${ver%_0} - fi - if [[[ $ver = v*_*_* ]]]; then - ver=${ver#v} - ver=${ver//_/.} - fi - - if test "$ver" != "$VERSION"; then - AC_MSG_WARN([most recent tag found: $ver does not match current version $VERSION.]) - fi - - if test "$ffw" != "0"; then - lb_cv_buildid="$hash" - fi -], [test -f META], [ - lb_cv_buildid=$(sed -ne '/^BUILDID =/s/.*= *//p' META) -]) -]) -AS_IF([test -z "$lb_cv_buildid"], [ - AC_MSG_WARN([ - -FIXME: I don't know how to deal with source trees outside of git that -don't have a META file. Not setting a buildid. -]) -]) -BUILDID=$lb_cv_buildid -AC_SUBST(BUILDID) -]) # LB_BUILDID +[AC_ARG_WITH([downstream-release],, + AC_MSG_ERROR([--downstream-release was deprecated. Please read Documentation/versioning.txt.]) +)]) # LB_DOWNSTREAM_RELEASE # # LB_CHECK_FILE @@ -605,7 +523,6 @@ LB_CONFIG_DIST LB_DOWNSTREAM_RELEASE LB_USES_DPKG -LB_BUILDID LB_LIBCFS_DIR diff --git a/config/lustre-version.m4 b/config/lustre-version.m4 new file mode 100644 index 0000000..9507a50 --- /dev/null +++ b/config/lustre-version.m4 @@ -0,0 +1,23 @@ +# +# LUSTRE_VERSION_VARIABLES +# +AC_DEFUN([LUSTRE_VERSION_VARIABLES], [ + +LUSTRE_MAJOR=`echo AC_PACKAGE_VERSION | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\1/']` +LUSTRE_MINOR=`echo AC_PACKAGE_VERSION | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\2/']` +LUSTRE_PATCH=`echo AC_PACKAGE_VERSION | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\3/']` +LUSTRE_FIX=`echo AC_PACKAGE_VERSION | sed -re ['s/([0-9]+)\.([0-9]+)\.([0-9]+)(\.([0-9]+))?.*/\5/']` +AS_IF([test -z "$LUSTRE_FIX"], [LUSTRE_FIX="0"]) + +m4_pattern_allow(AC_LUSTRE) +[AC_LUSTRE_MAJOR]=$LUSTRE_MAJOR +[AC_LUSTRE_MINOR]=$LUSTRE_MINOR +[AC_LUSTRE_PATCH]=$LUSTRE_PATCH +[AC_LUSTRE_FIX]=$LUSTRE_FIX + +AC_SUBST([AC_LUSTRE_MAJOR]) +AC_SUBST([AC_LUSTRE_MINOR]) +AC_SUBST([AC_LUSTRE_PATCH]) +AC_SUBST([AC_LUSTRE_FIX]) + +]) diff --git a/configure.ac b/configure.ac index c6219c5..0295c7c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,12 +1,10 @@ AC_PREREQ([2.57]) -AC_INIT([Lustre], [LUSTRE_VERSION], [https://jira.hpdd.intel.com/], [lustre]) -sinclude(lustre/autoconf/lustre-version.ac) +AC_INIT([Lustre], m4_esyscmd([sh -c "./LUSTRE-VERSION-GEN | tr -d '\n'"]), + [https://jira.hpdd.intel.com/], [lustre]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_MACRO_DIR([config]) -LB_CHECK_VERSION - LC_CONFIG_SRCDIR AC_CANONICAL_SYSTEM @@ -22,4 +20,5 @@ AM_PROG_AS AC_PATH_PROG(RPMBUILD, rpmbuild) AC_CHECK_TOOLS(AR, ar) +LUSTRE_VERSION_VARIABLES LB_CONFIGURE diff --git a/contrib/lbuild/lbuild b/contrib/lbuild/lbuild index 270214e..5706c65 100755 --- a/contrib/lbuild/lbuild +++ b/contrib/lbuild/lbuild @@ -659,9 +659,6 @@ load_target() { # kernel. don't make it look like one if $PATCHLESS || [ -n "$SERIES" ]; then EXTRA_VERSION=$(echo $EXTRA_VERSION | sed -e "s/\(.*_lustre\)\..*/\1/") - if ! $PATCHLESS && [ -n "$BUILDID" ]; then - EXTRA_VERSION="${EXTRA_VERSION}.${BUILDID}" - fi fi fi # EXTRA_VERSION=${EXTRA_VERSION//-/_} @@ -1927,10 +1924,6 @@ check_options unpack_lustre -# XXX - should we _always_ get the buildid from the META file? what are the -# other (i.e. non-lustre-tarball use cases of lbuild)? -BUILDID=$(sed -n -e 's/^BUILDID = //p' lustre/META) - load_target if [ -n "$OFED_VERSION" -a "$OFED_VERSION" != "inkernel" ]; then diff --git a/lustre-dkms.spec.in b/lustre-dkms.spec.in index 36ce678..9c30502 100644 --- a/lustre-dkms.spec.in +++ b/lustre-dkms.spec.in @@ -91,10 +91,6 @@ BUILT_MODULE_LOCATION[\${#BUILT_MODULE_LOCATION[@]}]="lustre/llite/" DEST_MODULE_LOCATION[\${#DEST_MODULE_LOCATION[@]}]="/extra/lustre/" EOF -sed -i 's/BUILDID[[:print:]]*/BUILDID = %{buildid}/' META -sed -i 's/PRISTINE[[:print:]]*/PRISTINE = 1/' META -cp META ldiskfs/META - %install if [ "$RPM_BUILD_ROOT" != "/" ]; then rm -rf $RPM_BUILD_ROOT diff --git a/lustre.spec.in b/lustre.spec.in index 8f0e709..337c80c 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -28,20 +28,16 @@ # as an alternative to this implementation we could simply "make -C $kdir kernelversion" %{!?kversion: %global kversion %(files="include/generated/utsrelease.h include/linux/utsrelease.h include/linux/version.h"; for f in $files; do if test -r %{kobjdir}/$f && grep UTS_RELEASE %{kobjdir}/$f >/dev/null; then sed -ne '/^#define UTS_RELEASE/s/.*"\\(.*\\)"$/\\1/p' %{kobjdir}/$f; break; fi; done)} -%define buildid %(if [ -n "@BUILDID@" ]; then echo "_@BUILDID@"; fi) - %if 0%{?build_src_rpm} %{!?myrelease: %global myrelease 1} %else - %{!?downstream_release: %global downstream_release "@DOWNSTREAM_RELEASE@"} - %{!?myrelease: %global myrelease %(if [ -n "%downstream_release" ]; then echo -n "%{downstream_release}_"; fi; echo %kversion | tr '-' '_')} + %{!?myrelease: %global myrelease %(echo %kversion | tr '-' '_')} # for those uses that don't want the -smp/-bigsmp (or the .arch) on the end # of %kversion %define krequires %(echo %{kversion} | sed -e 's/\.x86_64$//' -e 's/\.i[3456]86$//' -e 's/-smp$//' -e 's/-bigsmp$//' -e 's/[-.]ppc64$//' -e 's/\.aarch64$//' -e 's/-default$//') %endif -# always append the buildid, even when the caller defines %release -%define fullrelease %{myrelease}%{buildid} +%define fullrelease %{myrelease} # in order to get kernel symset and/or kernel module dependencies into # the RPM, in order to support weak-modules, the internal dependency gen- diff --git a/lustre/autoMakefile.am b/lustre/autoMakefile.am index 664a9e21..fb41119 100644 --- a/lustre/autoMakefile.am +++ b/lustre/autoMakefile.am @@ -68,8 +68,10 @@ all-recursive: lustre_build_version BUILD_VER_H=$(top_builddir)/lustre/include/lustre/lustre_build_version.h lustre_build_version: - perl $(top_builddir)/lustre/scripts/version_tag.pl $(top_srcdir) $(top_builddir) > tmpver - echo "#define LUSTRE_RELEASE @RELEASE@" >> tmpver + echo -n "#define BUILD_VERSION \"" > tmpver + cat $(top_builddir)/LUSTRE-VERSION-FILE | tr -d '\n' | \ + sed -e 's/^LUSTRE_VERSION = //' >> tmpver + echo "\"" >> tmpver cmp -s $(BUILD_VER_H) tmpver > tmpdiff 2> /dev/null && \ $(RM) tmpver tmpdiff || \ mv -f tmpver $(BUILD_VER_H) diff --git a/lustre/autoconf/Makefile.am b/lustre/autoconf/Makefile.am index d229901..09e9a07 100644 --- a/lustre/autoconf/Makefile.am +++ b/lustre/autoconf/Makefile.am @@ -1 +1 @@ -EXTRA_DIST = lustre-core.m4 lustre-version.ac kerberos5.m4 +EXTRA_DIST = lustre-core.m4 kerberos5.m4 diff --git a/lustre/autoconf/lustre-version.ac b/lustre/autoconf/lustre-version.ac deleted file mode 100644 index f9e5d1c..0000000 --- a/lustre/autoconf/lustre-version.ac +++ /dev/null @@ -1,32 +0,0 @@ -m4_define([LUSTRE_MAJOR],[2]) -m4_define([LUSTRE_MINOR],[8]) -m4_define([LUSTRE_PATCH],[50]) -m4_define([LUSTRE_FIX],[0]) - -dnl # liblustre delta is 0.0.1.32 , next version with fixes is ok, but -dnl # after following release candidate/beta would spill this warning already. -m4_define([LUSTRE_VER_ALLOWED_OFFSET],["OBD_OCD_VERSION(0, 0, 1, 32)"]) - -dnl # linux lustre delta is 0.4.0.0 , next stable release version is ok -m4_define([LUSTRE_CLI_VER_OFFSET_WARN],["OBD_OCD_VERSION(0, 4, 50, 0)"]) - -dnl # User editable part ends here. ----------------------------------------- - -m4_pattern_allow(AC_LUSTRE) -m4_define([LUSTRE_VERSION],m4_if(LUSTRE_FIX,[0],LUSTRE_MAJOR.LUSTRE_MINOR.LUSTRE_PATCH,LUSTRE_MAJOR.LUSTRE_MINOR.LUSTRE_PATCH.LUSTRE_FIX)) - -[AC_LUSTRE_MAJOR]=LUSTRE_MAJOR -[AC_LUSTRE_MINOR]=LUSTRE_MINOR -[AC_LUSTRE_PATCH]=LUSTRE_PATCH -[AC_LUSTRE_FIX]=LUSTRE_FIX -[AC_LUSTRE_VERSION_STRING]=LUSTRE_VERSION -[AC_LUSTRE_VER_ALLOWED_OFFSET]=LUSTRE_VER_ALLOWED_OFFSET -[AC_LUSTRE_CLI_VER_OFFSET_WARN]=LUSTRE_CLI_VER_OFFSET_WARN - -AC_SUBST([AC_LUSTRE_MAJOR]) -AC_SUBST([AC_LUSTRE_MINOR]) -AC_SUBST([AC_LUSTRE_PATCH]) -AC_SUBST([AC_LUSTRE_FIX]) -AC_SUBST([AC_LUSTRE_VERSION_STRING]) -AC_SUBST([AC_LUSTRE_VER_ALLOWED_OFFSET]) -AC_SUBST([AC_LUSTRE_CLI_VER_OFFSET_WARN]) diff --git a/lustre/doc/VERSIONING b/lustre/doc/VERSIONING deleted file mode 100644 index 3ed1c7e..0000000 --- a/lustre/doc/VERSIONING +++ /dev/null @@ -1,52 +0,0 @@ -Lustre versioning -================= - -This document describes versioning of source and binaries for Lustre. - -Versions -======== - -The Lustre build version is set in lustre/autoconf/lustre-version.ac -file with the LUSTRE_MAJOR, LUSTRE_MINOR, LUSTRE_PATCH, and LUSTRE_FIX -fields. These are used to generate the LUSTRE_VERSION string and the -LUSTRE_VERSION_CODE in lustre/include/lustre_ver.h. - -LUSTRE_VERSION_CODE can be used in conjunction with OBD_OCD_VERSION() -to conditionally enable functionality by Lustre version, or to mark -some part of code obsolete when a future version of Lustre is built. -It is preferable to mark code obsolete starting at the x.y.50 build -so that it is removed early in the development cycle. - -Packages -======== - -Major releases should get a 3-digit version x.y.0, and if a maintenance -release is needed it will increment the 3rd digit. During development, -versions start at x.y.50 and increment toward the x.(y+1).0 release. - -Release candidate versions must have the proper build version for the -release, but are tagged in Git as v2_1_0_RC1. Final release versions -are tagged in Git as both v2_1_0_0 and 2.1.0. - -Usage: ------- - -New numbers are used as follows: - -1. major: - - increased when major new functionality becomes available -2. minor: - - for each new release with new functionality -3. patch: - - for a stable maintenance release or development snapshot -4. test: - - when developers feel it is time to exchange a named version - -What will run, what won't ? ---------------------------- - -1. If the test level is non-zero, i.e. there are 4 digits in the - version, no guarantees of any kind are made. - -2. For three digit releases/tags the code should perform - according to the announcement. diff --git a/lustre/include/lustre_ver.h.in b/lustre/include/lustre_ver.h.in index cb8ac71..15f3327 100644 --- a/lustre/include/lustre_ver.h.in +++ b/lustre/include/lustre_ver.h.in @@ -8,7 +8,7 @@ #define LUSTRE_MINOR @AC_LUSTRE_MINOR@ #define LUSTRE_PATCH @AC_LUSTRE_PATCH@ #define LUSTRE_FIX @AC_LUSTRE_FIX@ -#define LUSTRE_VERSION_STRING "@AC_LUSTRE_VERSION_STRING@" +#define LUSTRE_VERSION_STRING "@PACKAGE_VERSION@" #define OBD_OCD_VERSION(major, minor, patch, fix) \ (((major) << 24) + ((minor) << 16) + ((patch) << 8) + (fix)) @@ -23,13 +23,13 @@ /* liblustre clients are only allowed to connect if their LUSTRE_FIX mismatches * by this amount (set in lustre/autoconf/lustre-version.ac). */ -#define LUSTRE_VERSION_ALLOWED_OFFSET @AC_LUSTRE_VER_ALLOWED_OFFSET@ +#define LUSTRE_VERSION_ALLOWED_OFFSET OBD_OCD_VERSION(0, 0, 1, 32) #ifdef __KERNEL__ /* If lustre version of client and servers it connects to differs by more * than this amount, client would issue a warning. * (set in lustre/autoconf/lustre-version.ac) */ -#define LUSTRE_VERSION_OFFSET_WARN @AC_LUSTRE_CLI_VER_OFFSET_WARN@ +#define LUSTRE_VERSION_OFFSET_WARN OBD_OCD_VERSION(0, 4, 50, 0) #endif #endif diff --git a/lustre/scripts/Makefile.am b/lustre/scripts/Makefile.am index 76b4686..eaa08b9 100644 --- a/lustre/scripts/Makefile.am +++ b/lustre/scripts/Makefile.am @@ -71,8 +71,7 @@ endif endif # UTILS -EXTRA_DIST = license-status version_tag.pl version_tag-git.pl \ - version_tag-none.pl lustre_rmmod ldev lc_mon lhbadm \ +EXTRA_DIST = license-status lustre_rmmod ldev lc_mon lhbadm \ lc_servip lustre_routes_config lustre_routes_conversion \ $(addsuffix .in,$(genscripts)) lfs_migrate lustre_req_history \ lustre lnet lsvcgss lc_common haconfig Lustre.ha_v2 dkms.mkconf \ diff --git a/lustre/scripts/version_tag-git.pl b/lustre/scripts/version_tag-git.pl deleted file mode 100644 index 1f0dbf4..0000000 --- a/lustre/scripts/version_tag-git.pl +++ /dev/null @@ -1,57 +0,0 @@ -my ($tag, $fcoms, $hash); - -sub get_buildid() -{ - - return $main::am_buildid; - -} - -sub is_pristine() -{ - - if ($fcoms > 0) { - return 0; - } - - my $diffcount=`git diff | wc -l`; - if ($diffcount > 0) { - return 0; - } - - return 1; - -} - -sub get_tag() -{ - - return $tag; - -} - -# "git describe" will just return a tag name if the current commit is -# tagged. Otherwise, the output will look something like this: -# -# --g -# -# Examples: -# 2.0.59-1-g4c20b1f -# 2.0.59-1somecompany-1-g4c20b1f -# foobar-15-g2e937ca -# -my $desc=`git describe --tags`; -if ($desc =~ /(.+?)(?:-(\d)+-g([0-9a-f]+))\n?/) { - # tag with describe info added - $tag = $1; - $fcoms = $2; - $hash = $3; -} else { - # plain tag - $tag = $desc; - chomp $tag; - $fcoms = 0; - $hash = ""; -} - -1; diff --git a/lustre/scripts/version_tag-none.pl b/lustre/scripts/version_tag-none.pl deleted file mode 100644 index bbbb0fa..0000000 --- a/lustre/scripts/version_tag-none.pl +++ /dev/null @@ -1,41 +0,0 @@ -my ($tag, $version, $buildid, $pristine); - -sub get_tag() -{ - - return $tag; - -} - -sub get_buildid() -{ - - return $buildid; - -} - -sub is_pristine() -{ - - return $pristine; - -} - -my $META = new IO::File; -if (!$META->open("META")) { - die "unable to open the META file: $!\n"; -} -my $line; -while (defined($line = <$META>)) { - if ($line =~ /^TAG\s*=\s*(.+)/) { - $tag = $1; - } elsif ($line =~ /^VERSION\s*=\s*([\d\.])/) { - $version = $1; - } elsif ($line =~ /^BUILDID\s*=\s*([a-g\d]+)/) { - $buildid = $1; - } elsif ($line =~ /^PRISTINE\s*=\s*([01])/) { - $pristine = $1; - } -} - -1; diff --git a/lustre/scripts/version_tag.pl b/lustre/scripts/version_tag.pl deleted file mode 100644 index c464ef6..0000000 --- a/lustre/scripts/version_tag.pl +++ /dev/null @@ -1,163 +0,0 @@ -#!/usr/bin/perl -# -*- Mode: perl; indent-tabs-mode: nil; cperl-indent-level: 4 -*- - -use IO::File; - -# get all of the values we want out of the autoMakefile -sub read_autoMakefile() { - - my $file = new IO::File; - my ($line, $dir, $objdir, $modules, $version, $local_version, $buildid); - if (!$file->open("autoMakefile")) { - die "Run ./configure first\n"; - } - $modules = 1; - while (defined($line = <$file>)) { - chomp($line); - if ($line =~ /^LINUX :?= (.*)/) { - $dir = $1; - } elsif ($line =~ /^LINUX_OBJ :?= (.*)/) { - $objdir = $1; - } elsif ($line =~ /^MODULES_TRUE = #/ || - $line =~ /^MODULE_TARGET = $/) { - # modules are not being built - $modules = 1; - } elsif ($line =~ /^VERSION = (.*)/) { - $version = "$1"; - } elsif ($line =~ /^DOWNSTREAM_RELEASE = (.*)/ && $1 ne "") { - $local_version = "$1"; - } elsif ($line =~ /^BUILDID = (.*)/ && $1 ne "") { - $buildid = "$1"; - } - } - $file->close(); - - return ($dir, $objdir, $modules, $version, $local_version, $buildid); - -} - -sub get_kernver($$) -{ - - my $dir = shift; - my $objdir = shift; - - my $ver = new IO::File; - if (!$ver->open("$objdir/include/generated/utsrelease.h") && - !$ver->open("$objdir/include/linux/utsrelease.h") && - !$ver->open("$objdir/include/linux/version.h") && - !$ver->open("$dir/include/generated/utsrelease.h") && - !$ver->open("$dir/include/linux/utsrelease.h") && - !$ver->open("$dir/include/linux/version.h")) { - die "Run make dep on '$dir'\n"; - } - - while(defined($line = <$ver>)) { - $line =~ /\#define UTS_RELEASE "(.*)"/; - if ($1) { - $kernver = $1; - last; - } - } - $ver->close(); - chomp($kernver); - return $kernver; - -} - -sub generate_ver($$$$$$$) -{ - - my $tag = shift; - my $local_version = shift; - my $buildid = shift; - my $linuxdir = shift; - my $pristine = shift; - my $kernver = shift; - my $env_vers = shift; - - print "#define BUILD_VERSION \"$tag"; - - if ($env_vers) { - print "-$env_vers\"\n"; - return 0; - } - - if ($local_version ne "") { - print "-$local_version"; - } - - print "-$buildid"; - # if we want to get rid of the PRISTINE/CHANGED thing, get rid of these - # lines. maybe we only want to print -CHANGED when something is changed - # and print nothing when it's pristine - if ($pristine) { - print "-PRISTINE"; - } else { - print "-CHANGED"; - } - - if ($kernver ne "") { - print "-$kernver"; - } - - print "\"\n"; - -} - -my $progname = $0; -$progname =~ s/.*\///; - -chomp(my $cwd = `pwd`); - -my $path = $0; -$path =~ s/(.+)\/.*/\1/; -push(@INC, $cwd . "/" . $path); - -# The _first_ argument on the command line may be --make_META -# Remove it from ARGV if found -if ($ARGV[0] eq "--make_META") { - shift @ARGV; - $make_meta = 1; -} - -# ARGV[0] = srcdir -# ARGV[1] = builddir - -# need to be in srcdir -if ($ARGV[0]) { - chdir($ARGV[0]); -} - -if (-d ".git") { - require "version_tag-git.pl"; -} else { - die("a tree status can only be determined in an source code control system checkout\n") - if ($make_meta); - require "version_tag-none.pl"; -} - -($am_linuxdir, $am_linuxobjdir, $am_modules, $am_version, $local_version, - $am_buildid) = read_autoMakefile(); - -my $tag = get_tag(); -my $pristine = is_pristine(); -my $buildid = get_buildid(); - -if (!$make_meta) { - my $kernver = ""; - $kernver = get_kernver($am_linuxdir, $am_linuxobjdir) - if ($am_linuxdir ne ""); - - my $linuxdir =~ s/\//\./g; - generate_ver($tag, $local_version, $buildid, $linuxdir, $pristine, $kernver, - $ENV{LUSTRE_VERS}); -} else { - print "TAG = $tag\n"; - print "VERSION = $am_version\n"; - print "BUILDID = $buildid\n"; - print "PRISTINE = $pristine\n"; - print "LOCAL_VERSION = $local_version\n"; -} - -exit(0);