trivial: Fix oss-fuzz by installing missing deps

This commit is contained in:
Richard Hughes 2021-07-12 08:54:05 +01:00
parent 488f2e1f37
commit e4aeb99296

View File

@ -26,7 +26,7 @@ class Builder:
"OUT", os.path.realpath(os.path.join(DEFAULT_BUILDDIR, "out"))
)
self.srcdir = self._ensure_environ("SRC", os.path.realpath(".."))
self.ldflags = ["-lpthread", "-lresolv", "-ldl", "-lffi", "-lz"]
self.ldflags = ["-lpthread", "-lresolv", "-ldl", "-lffi", "-lz", "-llzma"]
# defined in env
self.cflags = ["-Wno-deprecated-declarations"]
@ -344,6 +344,18 @@ def _build(bld: Builder) -> None:
if __name__ == "__main__":
# install missing deps here rather than patching the Dockerfile in oss-fuzz
try:
subprocess.check_call(
["apt-get", "install", "-y", "liblzma-dev"], stdout=open(os.devnull, "wb")
)
except FileNotFoundError:
pass
except subprocess.CalledProcessError as e:
print(e.output)
sys.exit(1)
_builder = Builder()
_build(_builder)
sys.exit(0)