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

Failure at cutter_plugin build #7

Open
IlabSentuser opened this issue Apr 1, 2023 · 4 comments
Open

Failure at cutter_plugin build #7

IlabSentuser opened this issue Apr 1, 2023 · 4 comments

Comments

@IlabSentuser
Copy link

Hi, I am a bit new at this so I might be wrong but when trying to build the cutter plugin an error is shown:
image
After some digging I found that the line 37 of the CMakeLists states:

find_library(RzYara NAMES rz_yara PATHS "${RIZIN_INSTALL_PLUGDIR}")

I tried changing the above line to make it work for me:

find_library(RzYara NAMES librz_yara.so PATHS "${RIZIN_INSTALL_PLUGDIR}")

After doing so, it worked. I am unsure of why I had to do this change, as I suppose it works for you with what was already set, but I couldn't get it to work. As I am not an expert at it, probably what I did was a hack or something. But I thought I should let you know in case it can become a problem at some point.

Regards.

@IlabSentuser
Copy link
Author

I have continue to analyze this and I think I know the reason for my aforementioned problem. Apparently (and to me it makes sense) the issue is on the line 6 of the same file:

set(RIZIN_INSTALL_PLUGDIR "lib/rizin/plugins" CACHE STRING "Directory where to find librz_yara")

I was assuming that '/usr/' was at some point being added to the string or something but after setting some

message(...${RIZIN_INSTALL_PLUGDIR})

and some others to get some insight into the problem I found that it was indeed searching in the wrong folder. I don't get why with my previous change it was 'supposedly' able to find the lib though. I am assuming that on your build systems you have the ./lib directory available or something, but in 'normal' systems it should not be the case. Or maybe I am just wrong and hacking this stuff more.
In any case just what I got so far in case you decide it should get some checking. Regards.

@wargio
Copy link
Member

wargio commented Apr 2, 2023

if you do not install the plugin systemwide, then you need something like this

cd rz_libyara

meson --buildtype=release --prefix="~/.local" build
ninja -C build install

cd cutter-plugin
mkdir build && cd build
cmake -G Ninja -DRIZIN_INSTALL_PLUGDIR="../build" -DCMAKE_INSTALL_PREFIX="~/.local" ..
ninja
ninja install

@IlabSentuser
Copy link
Author

Hi, I did install it system wide though, however, I am thinking that maybe the fact that I use Arch linux, which has a lightly different folder structure may be part of the problem. Not sure though., but it crossed my mind that maybe the build instructions are accurate for some ubuntu/debian derivative. Will try to check this out later and see if it builds correctly on those distros.

@wargio
Copy link
Member

wargio commented Apr 6, 2023

i'm using arch linux and that way of building just works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants