diff --git a/etc/evergreen_yml_components/tasks/compile_tasks.yml b/etc/evergreen_yml_components/tasks/compile_tasks.yml index 09b53c557e2..8a4e0a3bbbc 100644 --- a/etc/evergreen_yml_components/tasks/compile_tasks.yml +++ b/etc/evergreen_yml_components/tasks/compile_tasks.yml @@ -735,6 +735,28 @@ tasks: ninja_file: "fast.ninja" targets: "install-devcore compiledb" + - name: compile_ninja_fast_icecc + tags: ["assigned_to_jira_team_devprod_build", "auxiliary", "bazel_check"] + depends_on: + - name: version_expansions_gen + variant: generate-tasks-for-version + commands: + - func: "scons compile" + vars: + generating_for_ninja: true + separate_debug: off + task_compile_flags: >- + --build-profile=fast + BAZEL_BUILD_ENABLED=1 + BAZEL_INTEGRATION_DEBUG=1 + CCACHE= + ICECC=icecc + - func: "f_expansions_write" + - func: "ninja compile" + vars: + ninja_file: "fast.ninja" + targets: "install-devcore compiledb" + - name: compile_ninja_san_profile tags: ["assigned_to_jira_team_devprod_build", "auxiliary"] depends_on: @@ -2743,6 +2765,12 @@ task_groups: tasks: - compile_ninja_fast_profile + - <<: *compile_task_group_template + name: compile_ninja_fast_icecc_TG + tags: [] + tasks: + - compile_ninja_fast_icecc + - <<: *compile_task_group_template name: compile_ninja_compiledb_profile_TG tasks: diff --git a/etc/evergreen_yml_components/variants/misc/misc.yml b/etc/evergreen_yml_components/variants/misc/misc.yml index 060ab2ccc37..f81d6d2c82d 100644 --- a/etc/evergreen_yml_components/variants/misc/misc.yml +++ b/etc/evergreen_yml_components/variants/misc/misc.yml @@ -171,6 +171,24 @@ buildvariants: distros: - ubuntu1804-xlarge + # This variant simulates a developer workstation build by using both icecream and remote + # execution. This is to track how the bazel conversion affects developer build times. + - name: ubuntu2204-ninja-bazel-icecc + display_name: "Ninja Bazel Icecc: Ubuntu 22.04" + cron: "0 4 * * *" # From the ${project_nightly_cron} parameter. + run_on: + - ubuntu2204-arm64-icecc + stepback: false + expansions: + compile_flags: --ssl --ocsp-stapling=off MONGO_DISTMOD=ubuntu2204 -j$(grep -c ^processor /proc/cpuinfo) + repo_edition: enterprise + has_packages: false + compile_variant: ubuntu2204-ninja-build-profiles + ninja_jobs: 300 + ninja_retries: 3 + tasks: + - name: compile_ninja_fast_icecc_TG + - name: enterprise-rhel-80-64-bit-dynamic-ninja display_name: "Ninja Build: Enterprise RHEL 8.0" tags: [] diff --git a/evergreen/ninja_compile.sh b/evergreen/ninja_compile.sh index dcdd8f2ca46..00b3c3c6da3 100644 --- a/evergreen/ninja_compile.sh +++ b/evergreen/ninja_compile.sh @@ -8,14 +8,27 @@ set -o verbose activate_venv +if [[ -n "${ninja_jobs}" ]]; then + JOBS_ARG="-j${ninja_jobs}" +fi + if [ "Windows_NT" = "$OS" ]; then vcvars="$(vswhere -latest -property installationPath | tr '\\' '/' | dos2unix.exe)/VC/Auxiliary/Build/" echo "call \"$vcvars/vcvarsall.bat\" amd64" > msvc.bat for i in "${compile_env[@]}"; do echo "set $i" >> msvc.bat done - echo "ninja -f ${ninja_file} ${targets}" >> msvc.bat - cmd /C msvc.bat + echo "ninja -f ${ninja_file} ${JOBS_ARG} ${targets}" >> msvc.bat + for i in $(seq ${ninja_retries:=1}); do + cmd /C msvc.bat && RET=0 && break || RET=$? && sleep 1 + done else - eval ${compile_env} ninja -f ${ninja_file} ${targets} + for i in $(seq ${ninja_retries:=1}); do + eval ${compile_env} ninja -f ${ninja_file} ${JOBS_ARG} ${targets} && RET=0 && break || RET=$? && sleep 1 + done +fi + +if [ $RET -ne 0 ]; then + echo "Ninja command failed" + exit $RET fi