Commit f554c54f by Nicolas Capens Committed by Nicolas Capens

Produce less debug info in Kokoro builds

On a 4-core Linux VM it has the following effect: LESS_DEBUG_INFO=0 real 20m13.051s user 63m45.648s sys 6m51.636s 745.8 MB libvk_swiftshader.so 13 GB build dir LESS_DEBUG_INFO=1 real 15m2.821s user 51m8.659s sys 5m17.466s 197.8 MB libvk_swiftshader.so 3.1 GB build dir Also use /DEBUG:FASTLINK on Visual Studio. It disables producing a single .pdb which can be relocated. Specifying LESS_DEBUG_INFO=1 has no effect on Windows currently, but is done for consistency and in case we start using Clang on Windows. Also color errors in presubmit consistently. Bug: b/147735529 Change-Id: Ieb5c84c192178653f74043daf3d8ee599d3ecf6b Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/40228 Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Tested-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com>
parent 63468081
cmake_minimum_required(VERSION 3.6.3) cmake_minimum_required(VERSION 3.6.3)
set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD 14)
...@@ -344,6 +344,9 @@ if(MSVC) ...@@ -344,6 +344,9 @@ if(MSVC)
add_definitions(-D_SBCS) # Single Byte Character Set (ASCII) add_definitions(-D_SBCS) # Single Byte Character Set (ASCII)
add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE) # Disable MSVC warnings about std::aligned_storage being broken before VS 2017 15.8 add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE) # Disable MSVC warnings about std::aligned_storage being broken before VS 2017 15.8
set_cpp_flag("/DEBUG:FASTLINK" DEBUG)
set_cpp_flag("/DEBUG:FASTLINK" RELWITHDEBINFO)
if(SWIFTSHADER_WARNINGS_AS_ERRORS) if(SWIFTSHADER_WARNINGS_AS_ERRORS)
set_cpp_flag("/WX") # Treat all warnings as errors set_cpp_flag("/WX") # Treat all warnings as errors
endif() endif()
...@@ -374,7 +377,6 @@ if(MSVC) ...@@ -374,7 +377,6 @@ if(MSVC)
"/we4838" # conversion from 'type_1' to 'type_2' requires a narrowing conversion "/we4838" # conversion from 'type_1' to 'type_2' requires a narrowing conversion
"/we5038" # data member 'member1' will be initialized after data member 'member2' data member 'member' will be initialized after base class 'base_class' "/we5038" # data member 'member1' will be initialized after data member 'member2' data member 'member' will be initialized after base class 'base_class'
) )
else() else()
set_cpp_flag("-fno-exceptions") set_cpp_flag("-fno-exceptions")
......
...@@ -20,7 +20,10 @@ if [[ -z "${REACTOR_BACKEND}" ]]; then ...@@ -20,7 +20,10 @@ if [[ -z "${REACTOR_BACKEND}" ]]; then
REACTOR_BACKEND="LLVM" REACTOR_BACKEND="LLVM"
fi fi
cmake .. "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" "-DREACTOR_BACKEND=${REACTOR_BACKEND}" "-DREACTOR_VERIFY_LLVM_IR=1" # Lower the amount of debug info, to reduce Kokoro build times.
LESS_DEBUG_INFO=1
cmake .. "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" "-DREACTOR_BACKEND=${REACTOR_BACKEND}" "-DREACTOR_VERIFY_LLVM_IR=1" "-DLESS_DEBUG_INFO=${LESS_DEBUG_INFO}"
make --jobs=$(nproc) make --jobs=$(nproc)
# Run unit tests # Run unit tests
......
...@@ -11,13 +11,16 @@ if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL! ...@@ -11,13 +11,16 @@ if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
git submodule update --init git submodule update --init
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL! if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
# Lower the amount of debug info, to reduce Kokoro build times.
SET LESS_DEBUG_INFO=1
SET MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild" SET MSBUILD="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild"
SET CONFIG=Debug SET CONFIG=Debug
cd %SRC%\build cd %SRC%\build
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL! if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
cmake .. -G "Visual Studio 15 2017 Win64" -Thost=x64 "-DCMAKE_BUILD_TYPE=%BUILD_TYPE%" "-DREACTOR_BACKEND=%REACTOR_BACKEND%" "-DREACTOR_VERIFY_LLVM_IR=1" cmake .. -G "Visual Studio 15 2017 Win64" -Thost=x64 "-DCMAKE_BUILD_TYPE=%BUILD_TYPE%" "-DREACTOR_BACKEND=%REACTOR_BACKEND%" "-DREACTOR_VERIFY_LLVM_IR=1" "-DLESS_DEBUG_INFO=%LESS_DEBUG_INFO%"
if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL! if !ERRORLEVEL! neq 0 exit /b !ERRORLEVEL!
%MSBUILD% /p:Configuration=%CONFIG% SwiftShader.sln %MSBUILD% /p:Configuration=%CONFIG% SwiftShader.sln
......
...@@ -15,14 +15,17 @@ if [[ -z "${REACTOR_BACKEND}" ]]; then ...@@ -15,14 +15,17 @@ if [[ -z "${REACTOR_BACKEND}" ]]; then
REACTOR_BACKEND="LLVM" REACTOR_BACKEND="LLVM"
fi fi
# Disable ASAN checks for debug builds to work around Kokoro timeouts that # Lower the amount of debug info, to reduce Kokoro build times.
# affect llvm-debug builds. See b/147355576 for more information. LESS_DEBUG_INFO=1
# Disable ASAN checks for debug builds, to reduce Kokoro build times.
# ASAN builds are recommended to be optimized.
ASAN="ON" ASAN="ON"
if [[ "${BUILD_TYPE}" == "Debug" ]]; then if [[ "${BUILD_TYPE}" == "Debug" ]]; then
ASAN="OFF" ASAN="OFF"
fi fi
cmake .. "-DSWIFTSHADER_ASAN=${ASAN}" "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" "-DREACTOR_BACKEND=${REACTOR_BACKEND}" "-DREACTOR_VERIFY_LLVM_IR=1" cmake .. "-DSWIFTSHADER_ASAN=${ASAN}" "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" "-DREACTOR_BACKEND=${REACTOR_BACKEND}" "-DREACTOR_VERIFY_LLVM_IR=1" "-DLESS_DEBUG_INFO=${LESS_DEBUG_INFO}"
make -j$(sysctl -n hw.logicalcpu) make -j$(sysctl -n hw.logicalcpu)
# Run unit tests # Run unit tests
......
...@@ -44,10 +44,10 @@ function run_bug_in_commit_msg() { ...@@ -44,10 +44,10 @@ function run_bug_in_commit_msg() {
if [ $? -ne 0 ] if [ $? -ne 0 ]
then then
echo "Git commit message must have a Bug: line" echo "${red}Git commit message must have a Bug: line"
echo "followed by a bug ID in the form b/# for Buganizer bugs or" echo "followed by a bug ID in the form b/# for Buganizer bugs or"
echo "project:# for Monorail bugs (e.g. 'Bug: chromium:123')." echo "project:# for Monorail bugs (e.g. 'Bug: chromium:123')."
echo "Omit any digits when no ID is required (e.g. 'Bug: fix build')." echo "Omit any digits when no ID is required (e.g. 'Bug: fix build').${normal}"
return 1 return 1
fi fi
} }
...@@ -61,9 +61,10 @@ function run_copyright_headers() { ...@@ -61,9 +61,10 @@ function run_copyright_headers() {
done | grep -v "(standard input)" > ${tmpfile} done | grep -v "(standard input)" > ${tmpfile}
if test -s ${tmpfile}; then if test -s ${tmpfile}; then
# tempfile is NOT empty # tempfile is NOT empty
echo "Copyright issue in these files:" echo "${red}Copyright issue in these files:"
cat ${tmpfile} cat ${tmpfile}
rm ${tmpfile} rm ${tmpfile}
echo "${normal}"
return 1 return 1
else else
rm ${tmpfile} rm ${tmpfile}
...@@ -95,4 +96,4 @@ check clang-format run_clang_format ...@@ -95,4 +96,4 @@ check clang-format run_clang_format
check gofmt run_gofmt check gofmt run_gofmt
echo echo
echo "${green}All check completed successfully.$normal" echo "${green}All check completed successfully.${normal}"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment