Configuring Version Files ... CMake Error

Configuring Version Files ... CMake Error

Discuss everything related to running Spring on your chosen distribution of Linux.

Moderator: Moderators

Post Reply
StudioRage
Posts: 1
Joined: 25 Jun 2017, 02:15

Configuring Version Files ... CMake Error

Post by StudioRage » 25 Jun 2017, 02:35

I am trying to compile Spring RTS Engine for Linux Ubuntu version 16.04. The first error I had encountered was when I had tried to just use the terminal to clone the repository, something with the "AI" Folder, so I downloaded it as a zip archive instead no problems except it did not download anything from the "pre-download" folder, I got and error when trying to run the "cmake ." command, so I had to download that individually, it fixed that problem. And now I've run into an error after running the "make spring" command.

Code: Select all

Scanning dependencies of target generateVersionFiles
  Configuring Version files ...
CMake Error at rts/build/cmake/UtilVersion.cmake:186 (Message): Failed to fetch SPRING_ENGINE version.
Call Stack (most recent call first): rts/build/cmake/ConfigureVersion.cmake:28 (FetchSpringVersion)
  
CMakeFiles/generateVersionFiles.dir/build.make:57: recipe for target 'generateVersionFiles' failed make[3]: *** [generateVersionFiles] Error 1
CMakeFiles/Makefile2:102: recipe for target 'CMakeFiles/generateVersionFiles.dir/all' failed make[2]: *** [CMakeFiles/generateVersionFiles.dir/all] Error 2
CMakeFiles/Makefile2:3547: recipe for target 'rts/builds/CMakeFiles/spring.dir/rule' failed
make[1]: *** [rts/builds/CMakeFiles/spring.dir/rule] Error 2
Makefile:966: recipe for target 'spring' failed
make: *** [spring] Error 2
So I opened up the "UtilVersion.cmake" file and scrolled to line 186, and found what was causing the Error.
(( i just copied the entire thing so it would make sense ))

Code: Select all

# Gets the version for a source directory, either from GIT,
# or if that fails (for example if it is not a git repository,
# as is the case when using a tarball), from the VERSION file.
# Creates a FATAL_ERROR on failure.
# Sets the following vars:
# - ${prefix}_VERSION
Macro    (FetchSpringVersion dir prefix)
	# unset the vars
	Set(${prefix}_VERSION)
	Set(${prefix}_VERSION-NOTFOUND)

	If     (EXISTS "${dir}/.git")
		# Try to fetch version through git
		If     (NOT GIT_FOUND)
			Message(FATAL_ERROR "Git repository detected, but git executable not found; failed to fetch ${prefix} version.")
		EndIf  (NOT GIT_FOUND)

		# Fetch git version info
		Git_Util_Describe(${prefix}_Describe ${dir} "*")
		If     (NOT ${prefix}_Describe)
			Message(FATAL_ERROR "Failed to fetch git-describe for ${prefix}.")
		EndIf  (NOT ${prefix}_Describe)
		If     ("${${prefix}_Describe}" MATCHES "^${VERSION_REGEX_RELEASE}$")
			Set(${prefix}_IsRelease TRUE)
		Else   ("${${prefix}_Describe}" MATCHES "^${VERSION_REGEX_RELEASE}$")
			Set(${prefix}_IsRelease FALSE)
		EndIf  ("${${prefix}_Describe}" MATCHES "^${VERSION_REGEX_RELEASE}$")
		If     (NOT ${prefix}_IsRelease)
			# We always want the long git-describe output on non-releases
			# for example: 83.0.1-0-g1234567
			Git_Util_Describe(${prefix}_Describe ${dir} "*" --long)
		EndIf  (NOT ${prefix}_IsRelease)

		Git_Util_Branch(${prefix}_Branch ${dir})
		If     (${prefix}_IsRelease)
			Set(${prefix}_VERSION "${${prefix}_Describe}")
		Else   (${prefix}_IsRelease)
			If     (NOT ${prefix}_Branch)
				Message(FATAL_ERROR "Failed to fetch the git branch for ${prefix}.")
			EndIf  (NOT ${prefix}_Branch)
			Set(${prefix}_VERSION "${${prefix}_Describe} ${${prefix}_Branch}")
		EndIf  (${prefix}_IsRelease)
		ParseSpringVersion(${prefix} "${${prefix}_VERSION}")
		If     ("${${prefix}_Branch}" STREQUAL "master")
			If     (NOT "${${prefix}_COMMITS}" STREQUAL "" OR NOT "${${prefix}_HASH}" STREQUAL "")
				Message(AUTHOR_WARNING "Commit without a version tag found on branch master for ${prefix}; this indicates a tagging/branching/push error.")
			EndIf  (NOT "${${prefix}_COMMITS}" STREQUAL "" OR NOT "${${prefix}_HASH}" STREQUAL "")
		EndIf  ("${${prefix}_Branch}" STREQUAL "master")
	Else   (EXISTS "${dir}/.git")
		# Try to fetch version through VERSION file
		GetVersionFromFile(${prefix}_VERSION "${dir}/VERSION")
		If    (${${prefix}_VERSION-NOTFOUND})
(Line 186)		Message(FATAL_ERROR "Failed to fetch ${prefix} version.")
		Else  (${${prefix}_VERSION-NOTFOUND})
			Message(STATUS "${prefix} version fetched from VERSION file: ${${prefix}_VERSION}")
		EndIf (${${prefix}_VERSION-NOTFOUND})
	EndIf  (EXISTS "${dir}/.git")
If anyone knows how to fix this, or where the "VERSION file" is located and if I can do anything to that to make this work any help would be greatly appreciated.
0 x

abma
Spring Developer
Posts: 3536
Joined: 01 Jun 2009, 00:08

Re: Configuring Version Files ... CMake Error

Post by abma » 25 Jun 2017, 16:22

The first error I had encountered was when I had tried to just use the terminal to clone the repository, something with the "AI" Folder, so I downloaded it as a zip archive instead no problems except it did not download anything from the "pre-download" folder, I got and error when trying to run the "cmake ."
as ai's are optional the error in this case can be irgnored. when compiling without using git you need to download the official tarballs, for spring 103.0: https://springrts.com/dl/buildbot/defau ... .0/source/

the error you got very likely is because of one AI git repository was removed / renamed.

for the development (=develop branch) version you must use git.
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10184
Joined: 24 Jan 2006, 21:12

Re: Configuring Version Files ... CMake Error

Post by PicassoCT » 27 Aug 2017, 10:07

Hi im experiencing similar problems

Code: Select all

 11%] Built target engineSim
  Configuring Version files ...
CMake Error at rts/build/cmake/UtilVersion.cmake:196 (Message):
  Invalid version format: v1.0-1199-g84f98ee develop
Call Stack (most recent call first):
  rts/build/cmake/ConfigureVersion.cmake:28 (FetchSpringVersion)
  


CMakeFiles/generateVersionFiles.dir/build.make:57: recipe for target 'generateVersionFiles' failed
make[3]: *** [generateVersionFiles] Error 1
CMakeFiles/Makefile2:99: recipe for target 'CMakeFiles/generateVersionFiles.dir/all' failed
make[2]: *** [CMakeFiles/generateVersionFiles.dir/all] Error 2
CMakeFiles/Makefile2:4055: recipe for target 'rts/builds/CMakeFiles/spring.dir/rule' failed
make[1]: *** [rts/builds/CMakeFiles/spring.dir/rule] Error 2
Makefile:1109: recipe for target 'spring' failed
make: *** [spring] Error 2
picassoct@picassoct-VirtualBox ~/D/S/f/spring> 
I updated my code from github, i did not alter the AI Folders
0 x

abma
Spring Developer
Posts: 3536
Joined: 01 Jun 2009, 00:08

Re: Configuring Version Files ... CMake Error

Post by abma » 27 Aug 2017, 20:36

@PicassoCT:

you must create a valid git tag... you have made an invalid one.

Invalid version format: v1.0-1199-g84f98ee develop
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10184
Joined: 24 Jan 2006, 21:12

Re: Configuring Version Files ... CMake Error

Post by PicassoCT » 28 Aug 2017, 07:56

I know about git tags. I can set one manually. But what is considered valid? Is there some sort of regEx-gf, that must be satisfied and accepted?
0 x

abma
Spring Developer
Posts: 3536
Joined: 01 Jun 2009, 00:08

Re: Configuring Version Files ... CMake Error

Post by abma » 28 Aug 2017, 08:29

PicassoCT wrote:I know about git tags. I can set one manually. But what is considered valid? Is there some sort of regEx-gf, that must be satisfied and accepted?
https://github.com/spring/spring/blob/d ... .cmake#L50
1 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10184
Joined: 24 Jan 2006, 21:12

Re: Configuring Version Files ... CMake Error

Post by PicassoCT » 28 Aug 2017, 09:32

So i need to put a version string matching the example into what file.
0 x

abma
Spring Developer
Posts: 3536
Joined: 01 Jun 2009, 00:08

Re: Configuring Version Files ... CMake Error

Post by abma » 28 Aug 2017, 09:39

no file. you have created an "invalid" git tag name:
$ git tag
$ git describe
the version is used in a lot of places, thats why the check is so restrictive.
0 x

Post Reply

Return to “Linux”