Files
7dbe7e89d1 enhance: use RelWithDebInfo build type for CI to reduce peak compiler memory (#48154)
## Summary
Switch CI pipelines from Release (`-O3`) to RelWithDebInfo (`-O2 -g
-DNDEBUG`), reducing peak compiler memory by ~15%. RelWithDebInfo is a
standard CMake build type that uses `-O2` natively and includes debug
symbols for better crash diagnostics in CI. Production image builds
remain at Release (`-O3`).

## Changes
- Update Jenkins (PR, PR-Arm, PR-for-go-sdk, UT-CPP) to use
`mode=RelWithDebInfo`
- Update GitHub Actions (`main.yaml`) to use `mode=RelWithDebInfo`
- Allow all standard CMake build types in `3rdparty_build.sh` validation
- Add gcc>=13 implicit include workaround in `CMakeLists.txt`

## Test plan
- [ ] CI builds with `mode=RelWithDebInfo` use `-O2` instead of `-O3`
- [ ] Default builds still use Release with `-O3`
- [ ] ASAN CI jobs pass with reduced memory usage

issue: #48400

Signed-off-by: xiaofan-luan <xiaofan.xl@zilliz.com>
Signed-off-by: xiaofanluan <xiaofan.luan@zilliz.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 13:17:26 +08:00

77 lines
2.6 KiB
Groovy

@Library('jenkins-shared-library@tekton') _
// DEPRECATED: This job is deprecated, it is replaced by ci-v2/ut-cpp job
def pod = libraryResource 'io/milvus/pod/tekton-4am.yaml'
def milvus_helm_chart_version = '4.2.56'
pipeline {
options {
skipDefaultCheckout true
parallelsAlwaysFailFast()
buildDiscarder logRotator(artifactDaysToKeepStr: '30')
preserveStashes(buildCount: 5)
// abort previous build if it's a PR, otherwise queue the build
disableConcurrentBuilds(abortPrevious: env.CHANGE_ID != null)
timeout(time: 6, unit: 'HOURS')
throttleJobProperty(
categories: ['cpp-unit-test'],
throttleEnabled: true,
throttleOption: 'category'
)
}
environment {
LOKI_ADDR = 'http://loki-1-loki-distributed-gateway.loki.svc.cluster.local'
LOKI_CLIENT_RETRIES = 3
}
agent {
kubernetes {
cloud '4am'
yaml pod
}
}
stages {
stage('meta') {
steps {
container('jnlp') {
script {
isPr = env.CHANGE_ID != null
gitMode = isPr ? 'merge' : 'fetch'
gitBaseRef = isPr ? "$env.CHANGE_TARGET" : "$env.BRANCH_NAME"
}
}
}
}
stage('build & test') {
steps {
container('tkn') {
script {
def job_name = tekton.cpp_ut arch: 'amd64',
isPr: isPr,
gitMode: gitMode ,
gitBaseRef: gitBaseRef,
pullRequestNumber: "$env.CHANGE_ID",
make_cmd: "make clean && make jobs=8 USE_ASAN=ON mode=RelWithDebInfo build-cpp-with-coverage",
test_entrypoint: "./scripts/run_cpp_codecov.sh",
codecov_report_name: "cpp-unit-test",
codecov_files: "./lcov_output.info",
tekton_pipeline_timeout: '3h'
}
}
}
post {
always {
container('tkn') {
script {
tekton.sure_stop()
}
}
}
}
}
}
}