VirusTotal / yara

The pattern matching swiss knife
https://virustotal.github.io/yara/
BSD 3-Clause "New" or "Revised" License
7.92k stars 1.42k forks source link

Mingw fail to find jansson #2089

Open nyx0 opened 2 weeks ago

nyx0 commented 2 weeks ago

Hello, I'm sorry to open an issue for that but after spending some time trying to figure out what I'm doing wrong I wanted to see if I'm missing something. I'm trying to compile YARA via mingw (64bits) with Jansson lib, unfortunately this case is not covered in the GitHub Action https://github.com/VirusTotal/yara/blob/4fc1ff822c11988ef616882a1a32e787359fdef4/.github/workflows/build.yml#L48

Tried on Ubuntu 24.04 and Debian 12 The error:

[...]
checking for isnan in -lm... yes
checking for log2 in -lm... yes
checking for strlcpy... no
checking for strlcat... no
checking for memmem... no
checking for timegm... no
checking for _mkgmtime... yes
checking for clock_gettime... yes
checking for stdbool.h... yes
checking for jansson.h... no
configure: error: please install Jansson library
$ pkg-config -libs jansson
-ljansson

It looks like png-config doesn't find jansson lib. Any idea what could be done here? thanks.

plusvic commented 2 weeks ago

Did you install the libjansson-dev package?

nyx0 commented 2 weeks ago

Yes, the compilation works for linux (I'm building for linux and windows on the same machine)

plusvic commented 2 weeks ago

mingw seems to offer a package for libjansson: https://packages.msys2.org/package/mingw-w64-x86_64-jansson

I've never tried to build yara with libjansson in mingw, so I won't be able to help with this. It looks like a setup issue, where the right package wasn't installed for the mingw environment.

nyx0 commented 2 weeks ago

Indeed i saw this package but i wasn't sure if i should use it since it was not in YARA github action. I will try that then thanks!