Re: Cmake: determening Ceph version when there is no git checkout.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11-7-2017 16:05, Sage Weil wrote:
> On Tue, 11 Jul 2017, Willem Jan Withagen wrote:
>> Hi,
>>
>> I'm doing some work to be ready when Luminous gets fully released.
>> But I now run into the following code from src/CMakeLists.txtx
>> ====
>> # the src/.git_version file may be written out by make-dist; otherwise
>> # we pull the git version from .git
>> option(ENABLE_GIT_VERSION "build Ceph with git version string" ON)
>> if(${ENABLE_GIT_VERSION})
>>   get_git_head_revision(GIT_REFSPEC CEPH_GIT_VER)
>>   git_describe(CEPH_GIT_NICE_VER --always)
>>   #if building from a source tarball via make-dist
>>   if(${CEPH_GIT_VER} STREQUAL "GITDIR-NOTFOUND")
>>     message(STATUS "Ceph/.git directory not found, parsing
>> ${CMAKE_CURRENT_SOURCE_DIR}/.git_version for CEPH_GIT_VER and
>> CEPH_GIT_NICE_VER")
>>     file(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/.git_version
>> CEPH_GIT_SHA_AND_TAG)
>>     list(GET CEPH_GIT_SHA_AND_TAG 0 CEPH_GIT_VER)
>>     list(GET CEPH_GIT_SHA_AND_TAG 1 CEPH_GIT_NICE_VER)
>>   endif(${CEPH_GIT_VER} STREQUAL "GITDIR-NOTFOUND")
>>   # remove 'v' prefix from raw git version
>>   string(SUBSTRING ${CEPH_GIT_NICE_VER} 1 -1 CEPH_GIT_NICE_VER)
>> else(${ENABLE_GIT_VERSION})
>>   set(CEPH_GIT_VER "no_version")
>>   set(CEPH_GIT_NICE_VER "Development")
>> endif(${ENABLE_GIT_VERSION})
>> ====
>>
>> This build the Ceph version from data in the .git repo.
>> But that is not how FreeBSD packaging works. There a tarbal is fetched
>> but that does not contain any git info.
>>
>> Work is done in:
>> 	/usr/ports/net/ceph/work/ceph-12.1.0
>> and that is about all where I can extract some versioning from.
>>
>> Does anybody have suggestions for an easy way out?
>> Other than hardcode it in the Makefile as an option to CMake.
> 
> Take a look at the make-dist script; it puts the git version info in a 
> tarball that has everything needed to build.  (i.e., it writes out 
> the .git_version file referenced above.)

I think I used the wrong words....

The make-dis script begins with:
if [ ! -d .git ]; then
    echo "no .git present.  run this from the base dir of the git checkout."
    exit 1
fi

When I say tarball, I mean that the FreeBSD packaging system will fetch
something like:
https://codeload.github.com/ceph/ceph-v12.1.0_GH0.tar.gz

And that tar file does not contain ANY git information.
So I have to extract that from somewhere/something else. All I know is
the TAG v12.1.0. So if I want to have a git hash in the version I need
to construct it from that, or use that reference to fetch the hash.

Otherwise I'll need to put it in the package makefile everytime, I
release a new version.
	
--WjW
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux