VirusTotal / yara

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

Build fails for Ubuntu 22.04 #2082

Closed DavidConnack closed 1 month ago

DavidConnack commented 1 month ago

Describe the bug Building Yara from source in AWS Codebuild using the Ubuntu runtime fails with the following error:

no acceptable sed could be found in $PATH
make[1]: *** [Makefile:1909: libyara/modules/tests/la-tests.lo] Error 1

To Reproduce

apt-get install -y automake libtool make gcc pkg-config
curl -OL https://github.com/VirusTotal/yara/archive/refs/tags/v4.5.0.tar.gz
tar -zxf v4.5.0.tar.gz
cd yara-4.5.0
./bootstrap.sh
./configure
make
make install
make check

Expected behavior Yara should build with out any errors.

Screenshots If applicable, add screenshots to help explain your problem.

Please complete the following information:

Additional context I have confirmed that sed does exist:

which sed
/usr/bin/sed
plusvic commented 1 month ago

And what's the content of environment variable $PATH?

DavidConnack commented 1 month ago

/usr/bin:/usr/local/bin/sbt/bin:/root/.goenv/shims:/root/.goenv/bin:/go/bin:/root/.phpenv/shims:/root/.phpenv/bin:/root/.pyenv/shims:/root/.pyenv/bin:/root/.rbenv/shims:/usr/local/rbenv/bin:/usr/local/rbenv/shims:/root/.dotnet/:/root/.dotnet/tools/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/tools:/codebuild/user/bin

What is strange is that I see this in the logs: checking for a sed that does not truncate output... /usr/bin/sed

plusvic commented 1 month ago

This is really weird. I don't really know what to do because that error comes from the configure script that is automatically generated by autoconf. It may has to do with the version of sed installed in the system, but it's strange because Ubuntu 22.04 is not that old.

DavidConnack commented 1 month ago

It was a pebcak error 😅. I was running my script using source which for some reason caused it to fail. Ive refactored my script and removed the source and it now builds correctly.

Thanks for your help!

plusvic commented 1 month ago

That's interesting. Good to know.