Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is both libyaml and libcyaml needed for building cstest? #2560

Open
kingiler opened this issue Nov 28, 2024 · 1 comment
Open

Is both libyaml and libcyaml needed for building cstest? #2560

kingiler opened this issue Nov 28, 2024 · 1 comment
Labels
build & packaging Build system and packaging related Documentation Testing Test related issue

Comments

@kingiler
Copy link

Work environment

Questions Answers
OS/arch/bits Manjaro amd 64
Architecture amd64
Source of Capstone git clone
Version/git commit e46838e

Expected behavior

With CAPSTONE_BUILD_CSTEST, cmake should able to build cstest. It should attempt to build libyaml from source if not found as stated in the BUILDING.md.

Actual behavior

CMake gives following error message

Could not find libyaml using the following names: libyaml, yaml

From the CMakeLists.txt in suite/cstest/CMakeLists.txt, it contains the following lines

find_library(libyaml
    NAMES libyaml yaml
    REQUIRED)

while having external project for libcyaml.

@Rot127
Copy link
Collaborator

Rot127 commented Nov 28, 2024

libcyaml depends on libyaml. libcyaml is basically a wrapper around the very raw access libyaml provides to parse yaml files.
I added it back then, because I was under time constraints. So just using libyaml would have been too much code to write.

Now, why is libyaml a dependency cmake doesn't resolve on its own (by downloading it and building it)?
Because libcyaml and libyaml are both ExternalProjects, and I struggled on making them depend on each other. Meaning: first libyaml is checked and maybe built if not present. And then libcyaml.

It didn't seem (or still isn't) possible to do it without some extra work or weird hacks.
This "making an ExternalProject depend on another ExternalProject" isn't easily done last time I checked.

I might have overlooked something, but due to the mentioned time constraints I had to stop looking at it and made libyaml a dependency the developer has to install on her own.

I documented this in suite/cstest/README.md but apparently forgot to add a note about it in the BUILDING.md.
If you could open a PR to add this note, I would really appreciate it.

@Rot127 Rot127 added Testing Test related issue build & packaging Build system and packaging related Documentation labels Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build & packaging Build system and packaging related Documentation Testing Test related issue
Projects
None yet
Development

No branches or pull requests

2 participants