Delete unneeded LLVM tools, clang libraries and testing tools.
This reduces the image size from 1.71 GB to 901 MB.
It may be possible to improve on this by deleting some LLVM
libraries though I don't know which ones we should delete
because AFL++ might use some).
Related https://github.com/google/oss-fuzz/issues/5170
Reduce build time by doing the following:
1. Building the second stage clang build with a clang binary we download
from chromium.
2. Changing NPROC to be half of the cores instead of assuming it's 16
cores. This still addresses the OOM when building on GCB but speeds up
local building.
3. Don't install recommended packages and use --depth 1 when possible
(very minor improvements compared to the above).
In all this reduces local build time of base-clang from 32 minutes
to 11 minutes.
Because build times are reduced, it will be easier to
iteratively develop changes needed for #5170
* Revert "Update Dockerfile"
This reverts commit 5eae19fb57.
* Revert "Move python 3 install to base-clang, needed for clang build. (#4967)"
This reverts commit 018314eefa.
* Use python3 in checkout_build_install_llvm.sh
```
-- Looking for os_signpost_interval_begin - not found
CMake Error at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
Could NOT find Python3 (missing: Python3_EXECUTABLE Interpreter)
Call Stack (most recent call first):
/usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:582 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-3.19/Modules/FindPython/Support.cmake:3148 (find_package_handle_standard_args)
/usr/local/share/cmake-3.19/Modules/FindPython3.cmake:398 (include)
CMakeLists.txt:711 (find_package)
-- Configuring incomplete, errors occurred!
See also "/work/llvm-stage1/CMakeFiles/CMakeOutput.log".
See also "/work/llvm-stage1/CMakeFiles/CMakeError.log".
The command '/bin/sh -c /root/checkout_build_install_llvm.sh' returned a non-zero code: 1
```
Fix clang updating script to actually update clang based on Chrome's
With this change, clang (llvm-project) will be updated from:
e84b7a5fe230e42b8e6fe451369874a773bf1867
to Chrome's current version:
99ac9ce7016d701b43b8f0c308dc3463da57d983.
This commit fixes two bad bugs:
1. Using the output of a command instead of the return code.
2. Using ! to determine whether the command succeeded ! in bash
will do the same thing for 0 and 1.
These bugs were hidden by OUR_LLVM_REVISION which we traditionally
set to the last commit we rolled back to. If this were a comment
instead of stored as a variable that is not supposed to be used
unless FORCE_OUR_REVISION is set, this bug probably could have
been caught earlier. Instead, the code always used the value
provided by this variable.
Fixes https://github.com/google/oss-fuzz/issues/3805
* [infra] Add retry wrapper to LLVM checkout commands.
* Fix a typo.
* Clean up the retry wrapper as per discussion with Abhishek.
* Fix disabling / enabling exit-on-error mode, bash is hard!
* Fix a comment.