You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On MSYS2, CMake is used to build Capstone,
On ArchLinux, GNU Make is used to build Capstone.
Packaging in ArchLinux shows proper version in the pkgconf.
Packaging in MSYS2 shows bogus version in the pkgconf.
Why?
ArchLinux case
When built with GNU Make it uses pkconfig.mk to generate capstone.pc
# Package version of Capstone for Makefile.# To be used to generate capstone.pc for pkg-config# version major & minor PKG_MAJOR = 5
PKG_MINOR = 0
# version bugfix level. Example: PKG_EXTRA = 1PKG_EXTRA = 1
# version tag. Examples: rc1, b2, post1 - or just comment out for no tagPKG_TAG =
When built with CMake it uses CMakeLists project version definition to generate capstone.pc
Here are the relevant bits:
# Version definition (Already see what happens?)project(capstone
VERSION 5.0
)
# Generation step (Added messages for debugging purposes)## installationif(CAPSTONE_INSTALL)
include("GNUInstallDirs")
install(FILES${HEADERS_COMMON}DESTINATION${CMAKE_INSTALL_INCLUDEDIR}/capstone)
message("PROJECT_VERSION_MAJOR: ${PROJECT_VERSION_MAJOR}")
message("PROJECT_VERSION_MINOR: ${PROJECT_VERSION_MINOR}")
message("PROJECT_VERSION_PATCH: ${PROJECT_VERSION_PATCH}")
configure_file(capstone.pc.in ${CMAKE_BINARY_DIR}/capstone.pc @ONLY)
# All other code is irrelevant
PREFACE
Bug report stacktrace (blame me)
xmake-io/xmake#4940
msys2/MINGW-packages#20581
What happens?
On MSYS2, CMake is used to build Capstone,
On ArchLinux, GNU Make is used to build Capstone.
Packaging in ArchLinux shows proper version in the pkgconf.
Packaging in MSYS2 shows bogus version in the pkgconf.
Why?
ArchLinux case
When built with GNU Make it uses
pkconfig.mk
to generatecapstone.pc
If we grab out built package:
https://archlinux.org/packages/extra/x86_64/capstone/download/
It will show proper version (Extracted for convenience):
Version: 5.0.1
No problem for ArchLinux so far.
BUT...
MSYS case
When built with CMake it uses CMakeLists
project
version definition to generatecapstone.pc
Here are the relevant bits:
Hmm... CMake says
5.0
... It should be5.0.1
Why?Let's look at the generated
capstone.pc
!If we grab out built package (CLANG64 variant, which is the one I found first and later confirmed it's across all MSYS2 Environments):
https://mirror.msys2.org/mingw/clang64/mingw-w64-clang-x86_64-capstone-5.0.1-1-any.pkg.tar.zst
And see the contents of the
capstone.pc
:Oh noes! It is
5.0
!But even worse, it's bogus because it's
5.0.
, caused by that missing variable... in CMake.PROJECT_VERSION_PATCH wasn't defined.
It's required to use the PATCH version!
The text was updated successfully, but these errors were encountered: