Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Cloning the repo, pushing it elsewere and cloning again breaks the build process #563

@alexer

Description

@alexer
  • Operating system: Linux
  • Stlink tools version and/or git commit hash: latest/git-9d08810

Cloning the repository, pushing it to somewhere else, and cloning it from that second place breaks the build process.

Error from make:

CMake Error at CMakeLists.txt:91 (set_target_properties):
  set_target_properties called with incorrect number of arguments.

It seems to fail because some of the variables in

set_target_properties(${STLINK_LIB_SHARED}
        PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR}
        VERSION ${STLINK_SHARED_VERSION}
)

end up being empty, because cmake/Version.cmake tries to get the values with git describe which fails because it doesn't find any names, presumably because the tags aren't pushed by default.

Doing a git push --tags from a repo cloned directly from the official repository to the other repository, followed by git pull --tags in the non-working copy fixes this.

I suggest that in addition to checking that git exists and the project is under git, cmake/Version.cmake should also check that the repository actually contains any tags before taking the git-aware branch of the conditional.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions