ci: no longer remove elfutils while building the fuzzer

Without it coverage reports can't be built
```
[2022-01-31 00:05:36,094 DEBUG] Generating file view html index file as: "/out/report/linux/file_view_index.html".
Traceback (most recent call last):
  File "/opt/code_coverage/coverage_utils.py", line 829, in <module>
    sys.exit(Main())
  File "/opt/code_coverage/coverage_utils.py", line 823, in Main
    return _CmdPostProcess(args)
  File "/opt/code_coverage/coverage_utils.py", line 780, in _CmdPostProcess
    processor.PrepareHtmlReport()
  File "/opt/code_coverage/coverage_utils.py", line 577, in PrepareHtmlReport
    self.GenerateFileViewHtmlIndexFile(per_file_coverage_summary,
  File "/opt/code_coverage/coverage_utils.py", line 450, in GenerateFileViewHtmlIndexFile
    self.GetCoverageHtmlReportPathForFile(file_path),
  File "/opt/code_coverage/coverage_utils.py", line 422, in GetCoverageHtmlReportPathForFile
    assert os.path.isfile(
AssertionError: "/tmp/tmp.UYax4l19Gh/lib/system.h" is not a file.
```

It's a follow-up to 393a058d061d49d

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
This commit is contained in:
Evgeny Vereshchagin 2022-01-31 00:08:34 +00:00 committed by Andrii Nakryiko
parent fec0813359
commit ae220adbb2

View File

@ -22,10 +22,10 @@ export LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE:--fsanitize=fuzzer}
# fail to compile (for example, elfutils-0.185 fails to compile with LDFLAGS enabled
# due to https://bugs.gentoo.org/794601) so let's just point the script to
# commits referring to versions of libelf that actually can be built
elfutils=$(mktemp -d)
git clone git://sourceware.org/git/elfutils.git "$elfutils"
rm -rf elfutils
git clone git://sourceware.org/git/elfutils.git
(
cd "$elfutils"
cd elfutils
git checkout 983e86fd89e8bf02f2d27ba5dce5bf078af4ceda
git log --oneline -1
@ -50,11 +50,9 @@ make -C libelf -j$(nproc) V=1
)
make -C src BUILD_STATIC_ONLY=y V=1 clean
make -C src -j$(nproc) CFLAGS="-I$elfutils/libelf $CFLAGS" BUILD_STATIC_ONLY=y V=1
make -C src -j$(nproc) CFLAGS="-I$(pwd)/elfutils/libelf $CFLAGS" BUILD_STATIC_ONLY=y V=1
$CC $CFLAGS -Isrc -Iinclude -Iinclude/uapi -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c fuzz/bpf-object-fuzzer.c -o bpf-object-fuzzer.o
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE bpf-object-fuzzer.o src/libbpf.a "$elfutils/libelf/libelf.a" -l:libz.a -o "$OUT/bpf-object-fuzzer"
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE bpf-object-fuzzer.o src/libbpf.a "$(pwd)/elfutils/libelf/libelf.a" -l:libz.a -o "$OUT/bpf-object-fuzzer"
cp fuzz/bpf-object-fuzzer_seed_corpus.zip "$OUT"
rm -rf "$elfutils"