Client daemon fails to build with Yara module support
arcrose opened this issue · comments
When trying to build the MIG Client Daemon from the mig-client-daemon
branch, a compilation error occurs.
Steps to Reproduce
- Make sure you have
yara
installed, e.g. by runnerbrew install yara
on macOS - Clone the mig repository and checkout the
mig-client-daemon
branch. - Checkout
mig-client-daemon
andcd client/mig-client-daemon
- Rename
modules/yara
tomodules/yara.go
so it will be included by the compiler in the next step. - Compile from
mig-client-daemon/
withgo build -o mig-client-daemon main.go
If you encounter an error stating that libcrypto.pc
couldn't be found in PKG_CONFIG_PATH
, append the path to libcrypto.pc
's pkgconfig
directory to PKG_CONFIG_PATH
. This will likely be contained by OpenSSL. For example, on macOS with OpenSSL installed via Homebrew, I set
export PKG_CONFIG_PATH="/usr/local/Cellar/openssl/1.0.2o_1/lib/pkgconfig/"
to overcome this issue.
Once the above is resolved, you should see an error stating
go build mig.ninja/mig/vendor/github.com/hillu/go-yara: invalid flag in pkg-config --cflags: -L/usr/local/Cellar/yara/3.7.1/lib