1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

Much more cmake processes when sccache is enabled (because build becomes IO bound task)

This commit is contained in:
Alexander Presnyakov
2025-04-30 03:06:33 +00:00
parent 07de09bd66
commit 198054bda4
2 changed files with 10 additions and 1 deletions

View File

@@ -718,6 +718,7 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise')
],
},
{
// Get the copy of compile cache from the nightly build from S3
name: 'get-local-sccache',
depends_on: ['submodules'],
image: 'amazon/aws-cli',
@@ -737,7 +738,10 @@ local Pipeline(branch, platform, event, arch='amd64', server='10.6-enterprise')
'if aws s3 cp s3://cspkg/nightly-sccache/stable-23.10-' + server + '-' + arch + '-' + std.strReplace(platform, ":", "-") + '/sccache.tar.zst /tmp/sccache.tar.zst; then',
' echo "SCCache archive found. Extracting..."',
' tar -I zstd -xf /tmp/sccache.tar.zst -C /mdb/sccache',
' ls /mdb/sccache/ && mv /mdb/sccache/mdb/sccache /mdb/sccache_inner && rm -rf /mdb/sccache/ && mv /mdb/sccache_inner /mdb/sccache', # TODO remove
// TODO remove when all correct caches are uploaded
' ls /mdb/sccache/; if [ -f /mdb/sccache/mdb ]; then mv /mdb/sccache/mdb/sccache /mdb/sccache_inner && rm -rf /mdb/sccache/ && mv /mdb/sccache_inner /mdb/sccache; fi',
' echo "SCCache successfully downloaded and extracted."',
' ls /mdb/sccache',
'else',

View File

@@ -317,6 +317,11 @@ construct_cmake_flags() {
if [[ $SCCACHE = true ]]; then
warn "Use sccache"
# If sccache works well, the build becomes an IO bound task instead of CPU bound
# It happens because most of the time is spent is hashing the input files
# So we can run more jobs in parallel
CPUS=$((CPUS * 3))
message "Adjusted the number of CPUs for parallel build to $CPUS (multiplied by 3 to reduce IO wait)"
MDB_CMAKE_FLAGS="${MDB_CMAKE_FLAGS} -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
fi