summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTausif Rahman <tausif.rahman@mongodb.com>2022-08-26 13:56:34 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-09-19 15:55:19 +0000
commit763a3efc818a57eb034a75c37300df0b8ea3eabc (patch)
tree790d9fb846abb8b5c9425d55a3862fdc478bab8a
parentcc34fa291c577b580d8c3619cc787797a5bc9445 (diff)
downloadmongo-763a3efc818a57eb034a75c37300df0b8ea3eabc.tar.gz
SERVER-68003 Make experiment_unified_ninja.vars the default
(cherry picked from commit 41d0a45aaf90b8e4e9a91f13a72e5623ecd963c4) (cherry picked from commit 6e2d63630ee90db15b7b122aba1b8c538357a0df)
-rwxr-xr-xSConstruct11
-rw-r--r--etc/evergreen.yml50
-rw-r--r--etc/evergreen_nightly.yml2
-rw-r--r--etc/evergreen_yml_components/definitions.yml129
-rw-r--r--etc/evergreen_yml_components/variants/ninja.yml74
-rw-r--r--etc/scons/experimental_unified_ninja.vars7
-rw-r--r--evergreen/ninja_compile.sh5
-rw-r--r--site_scons/mongo/build_profiles.py2
8 files changed, 207 insertions, 73 deletions
diff --git a/SConstruct b/SConstruct
index 3a1bdd30392..f6960c31037 100755
--- a/SConstruct
+++ b/SConstruct
@@ -1017,17 +1017,10 @@ env_vars.Add(
converter=variable_shlex_converter,
)
-default_destdir = '$BUILD_ROOT/install'
-if get_option('ninja') != 'disabled':
- # Workaround for SERVER-53952 where issues wih different
- # ninja files building to the same install dir. Different
- # ninja files need to build to different install dirs.
- default_destdir = '$BUILD_DIR/install'
-
env_vars.Add(
'DESTDIR',
help='Where builds will install files',
- default=default_destdir,
+ default='$BUILD_ROOT/install',
)
env_vars.Add(
@@ -1221,7 +1214,7 @@ env_vars.Add(
env_vars.Add(
'NINJA_BUILDDIR',
help="Location for shared Ninja state",
- default="$BUILD_DIR/ninja",
+ default="$BUILD_ROOT/ninja",
)
env_vars.Add(
diff --git a/etc/evergreen.yml b/etc/evergreen.yml
index 12bb13805a5..369f2800f94 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -57,6 +57,7 @@ include:
- filename: etc/evergreen_yml_components/variants/task_generation.yml
- filename: etc/evergreen_yml_components/variants/sanitizer.yml
- filename: etc/evergreen_yml_components/variants/in_memory.yml
+- filename: etc/evergreen_yml_components/variants/ninja.yml
variables:
- &libfuzzertests
@@ -921,21 +922,6 @@ buildvariants:
# distros:
# - windows-vsCurrent-xlarge
-- name: enterprise-windows-ninja
- display_name: "Ninja Build: Enterprise Windows"
- cron: "0 4 * * *" # From the ${project_nightly_cron} parameter.
- modules:
- - enterprise
- expansions:
- compile_flags: --ssl MONGO_DISTMOD=windows CPPPATH="c:/sasl/include" LIBPATH="c:/sasl/lib" -j$(bc <<< "$(grep -c '^processor' /proc/cpuinfo) / 1.5") --win-version-min=win10
- tasks:
- - name: compile_ninja_next_TG
- distros:
- - windows-vsCurrent-large
- - name: compile_ninja_TG
- distros:
- - windows-vsCurrent-large
-
- name: enterprise-windows-cxx20-debug-experimental
display_name: "~ Enterprise Windows C++20 DEBUG"
cron: "0 4 * * *" # From the ${project_nightly_cron} parameter.
@@ -1055,20 +1041,6 @@ buildvariants:
- name: unittest_shell_hang_analyzer_gen
- name: generate_buildid_to_debug_symbols_mapping
-- name: macos-enterprise-ninja
- display_name: "Ninja Build: macOS Enterprise"
- cron: "0 4 * * *" # From the ${project_nightly_cron} parameter.
- modules:
- - enterprise
- run_on:
- - macos-1100
- expansions:
- compile_env: DEVELOPER_DIR=/Applications/Xcode13.app
- compile_flags: --ssl -j$(sysctl -n hw.logicalcpu) --libc++ --variables-files=etc/scons/xcode_macosx.vars
- tasks:
- - name: compile_ninja_next_TG
- - name: compile_ninja_TG
-
- name: enterprise-macos-rosetta-2
display_name: "Enterprise macOS Via Rosetta 2"
cron: "0 4 * * *" # From the ${project_nightly_cron} parameter.
@@ -1367,26 +1339,6 @@ buildvariants:
<<: *enterprise-rhel-80-64-bit-dynamic-required-expansions
compile_flags: --ssl MONGO_DISTMOD=rhel80 -j$(grep -c ^processor /proc/cpuinfo) --variables-files=etc/scons/mongodbtoolchain_v3_gcc.vars --link-model=dynamic --use-glibcxx-debug --dbg=on --allocator=system
-- name: enterprise-rhel-80-64-bit-dynamic-required-ninja
- display_name: "Ninja Build: Enterprise RHEL 8.0"
- cron: "0 4 * * *" # From the ${project_nightly_cron} parameter.
- modules:
- - enterprise
- run_on:
- - rhel80-small
- stepback: false
- expansions:
- compile_flags: --ssl --ocsp-stapling=off MONGO_DISTMOD=rhel80 -j$(grep -c ^processor /proc/cpuinfo) --variables-files=etc/scons/mongodbtoolchain_v3_gcc.vars --link-model=dynamic
- repo_edition: enterprise
- has_packages: false
- tasks:
- - name: compile_ninja_next_TG
- distros:
- - rhel80-xlarge
- - name: compile_ninja_TG
- distros:
- - rhel80-xlarge
-
- &enterprise-rhel-80-64-bit-dynamic-all-feature-flags-required-template
name: enterprise-rhel-80-64-bit-dynamic-all-feature-flags-required
display_name: "! Shared Library Enterprise RHEL 8.0 (all feature flags)"
diff --git a/etc/evergreen_nightly.yml b/etc/evergreen_nightly.yml
index d9a412655f0..74ea08924a4 100644
--- a/etc/evergreen_nightly.yml
+++ b/etc/evergreen_nightly.yml
@@ -11,6 +11,8 @@ include:
#- filename: etc/evergreen_yml_components/variants/in_memory.yml
### Uncomment when using this file for a LTS or Rapid release branch. ###
- filename: etc/evergreen_yml_components/variants/sanitizer.yml
+### Uncomment when using this file for a LTS or Rapid release branch. ###
+- filename: etc/evergreen_yml_components/variants/ninja.yml
parameters:
diff --git a/etc/evergreen_yml_components/definitions.yml b/etc/evergreen_yml_components/definitions.yml
index f0d219f401e..00c54b69ea1 100644
--- a/etc/evergreen_yml_components/definitions.yml
+++ b/etc/evergreen_yml_components/definitions.yml
@@ -1180,6 +1180,15 @@ functions:
args:
- "src/evergreen/scons_compile.sh"
+ "ninja compile":
+ - *f_expansions_write
+ - command: subprocess.exec
+ type: test
+ params:
+ binary: bash
+ args:
+ - "./src/evergreen/ninja_compile.sh"
+
"generate version expansions": &generate_version_expansions
command: subprocess.exec
params:
@@ -2304,11 +2313,93 @@ tasks:
task_compile_flags: >-
--ninja
- *f_expansions_write
- - command: subprocess.exec
- params:
- binary: bash
- args:
- - "./src/evergreen/ninja_compile.sh"
+ - func: "ninja compile"
+ vars:
+ ninja_file: "build.ninja"
+
+- name: compile_ninja_default_profile
+ tags: []
+ depends_on:
+ - name: version_expansions_gen
+ variant: generate-tasks-for-version
+ commands:
+ - func: "scons compile"
+ vars:
+ generating_for_ninja: true
+ separate_debug: off
+ task_install_action:
+ default
+ task_compile_flags: >-
+ --build-profile=default
+ --variables-files=etc/scons/mongodbtoolchain_v3_gcc.vars
+ --ninja
+ - *f_expansions_write
+ - func: "ninja compile"
+ vars:
+ ninja_file: "build.ninja"
+
+- name: compile_ninja_opt_profile
+ tags: []
+ depends_on:
+ - name: version_expansions_gen
+ variant: generate-tasks-for-version
+ commands:
+ - func: "scons compile"
+ vars:
+ generating_for_ninja: true
+ separate_debug: off
+ task_install_action:
+ default
+ task_compile_flags: >-
+ --build-profile=opt
+ CCACHE=
+ ICECC=
+ - *f_expansions_write
+ - func: "ninja compile"
+ vars:
+ ninja_file: "opt.ninja"
+
+- name: compile_ninja_fast_profile
+ tags: []
+ depends_on:
+ - name: version_expansions_gen
+ variant: generate-tasks-for-version
+ commands:
+ - func: "scons compile"
+ vars:
+ generating_for_ninja: true
+ separate_debug: off
+ task_install_action:
+ default
+ task_compile_flags: >-
+ --build-profile=fast
+ CCACHE=
+ ICECC=
+ - *f_expansions_write
+ - func: "ninja compile"
+ vars:
+ ninja_file: "fast.ninja"
+
+- name: compile_ninja_san_profile
+ tags: []
+ depends_on:
+ - name: version_expansions_gen
+ variant: generate-tasks-for-version
+ commands:
+ - func: "scons compile"
+ vars:
+ generating_for_ninja: true
+ separate_debug: off
+ task_install_action:
+ default
+ task_compile_flags: >-
+ --build-profile=san
+ CCACHE=
+ ICECC=
+ - *f_expansions_write
+ - func: "ninja compile"
+ vars:
+ ninja_file: "san.ninja"
- name: compile_ninja_next
tags: []
@@ -2326,11 +2417,9 @@ tasks:
--build-tools=next
--ninja
- *f_expansions_write
- - command: subprocess.exec
- params:
- binary: bash
- args:
- - "./src/evergreen/ninja_compile.sh"
+ - func: "ninja compile"
+ vars:
+ ninja_file: "build.ninja"
- name: compile_build_tools_next
tags: []
@@ -7490,6 +7579,26 @@ task_groups:
display_name: build.ninja
- <<: *compile_task_group_template
+ name: compile_ninja_default_profile_TG
+ tasks:
+ - compile_ninja_default_profile
+
+- <<: *compile_task_group_template
+ name: compile_ninja_opt_profile_TG
+ tasks:
+ - compile_ninja_opt_profile
+
+- <<: *compile_task_group_template
+ name: compile_ninja_san_profile_TG
+ tasks:
+ - compile_ninja_san_profile
+
+- <<: *compile_task_group_template
+ name: compile_ninja_fast_profile_TG
+ tasks:
+ - compile_ninja_fast_profile
+
+- <<: *compile_task_group_template
name: server_discovery_and_monitoring_json_test_TG
tasks:
- server_discovery_and_monitoring_json_test
diff --git a/etc/evergreen_yml_components/variants/ninja.yml b/etc/evergreen_yml_components/variants/ninja.yml
new file mode 100644
index 00000000000..3a2a684de87
--- /dev/null
+++ b/etc/evergreen_yml_components/variants/ninja.yml
@@ -0,0 +1,74 @@
+buildvariants:
+
+- name: enterprise-windows-ninja
+ display_name: "Ninja Build: Enterprise Windows"
+ cron: "0 4 * * 0" # Run once a week to ensure no failures introduced to ninja builds
+ modules:
+ - enterprise
+ expansions:
+ compile_flags: --ssl MONGO_DISTMOD=windows CPPPATH="c:/sasl/include c:/snmp/include" LIBPATH="c:/sasl/lib c:/snmp/lib" -j$(bc <<< "$(grep -c '^processor' /proc/cpuinfo) / 1.5") --win-version-min=win10
+ tasks:
+ - name: compile_ninja_next_TG
+ distros:
+ - windows-vsCurrent-large
+ - name: compile_ninja_TG
+ distros:
+ - windows-vsCurrent-large
+
+- name: macos-enterprise-ninja
+ display_name: "Ninja Build: macOS Enterprise"
+ cron: "0 4 * * 0" # Run once a week to ensure no failures introduced to ninja builds
+ modules:
+ - enterprise
+ run_on:
+ - macos-1100
+ expansions:
+ compile_env: DEVELOPER_DIR=/Applications/Xcode13.app
+ compile_flags: --ssl -j$(sysctl -n hw.logicalcpu) --libc++ --variables-files=etc/scons/xcode_macosx.vars
+ tasks:
+ - name: compile_ninja_next_TG
+ - name: compile_ninja_TG
+
+- name: ubuntu1804-ninja-build-profiles
+ display_name: "Ninja Build Profiles: Ubuntu 18.04"
+ cron: "0 4 * * 0" # Run once a week to ensure no failures introduced to build profiles
+ modules:
+ - enterprise
+ run_on:
+ - ubuntu1804-small
+ stepback: false
+ expansions:
+ compile_flags: --ssl --ocsp-stapling=off MONGO_DISTMOD=ubuntu1804 -j$(grep -c ^processor /proc/cpuinfo)
+ repo_edition: enterprise
+ has_packages: false
+ tasks:
+ - name: compile_ninja_default_profile_TG
+ distros:
+ - ubuntu1804-xlarge
+ - name: compile_ninja_opt_profile_TG
+ distros:
+ - ubuntu1804-xlarge
+ - name: compile_ninja_san_profile_TG
+ distros:
+ - ubuntu1804-xlarge
+ - name: compile_ninja_fast_profile_TG
+ distros:
+ - ubuntu1804-xlarge
+
+- name: enterprise-rhel-80-64-bit-dynamic-required-ninja
+ display_name: "Ninja Build: Enterprise RHEL 8.0"
+ cron: "0 4 * * 0" # Run once a week to ensure no failures introduced to ninja builds
+ modules:
+ - enterprise
+ run_on:
+ - rhel80-small
+ expansions:
+ compile_flags: --ssl MONGO_DISTMOD=rhel80 -j$(grep -c ^processor /proc/cpuinfo) --variables-files=etc/scons/mongodbtoolchain_v3_gcc.vars --link-model=dynamic
+ has_packages: false
+ tasks:
+ - name: compile_ninja_next_TG
+ distros:
+ - rhel80-xlarge
+ - name: compile_ninja_TG
+ distros:
+ - rhel80-xlarge
diff --git a/etc/scons/experimental_unified_ninja.vars b/etc/scons/experimental_unified_ninja.vars
index 21e03e71296..fe1f1febe89 100644
--- a/etc/scons/experimental_unified_ninja.vars
+++ b/etc/scons/experimental_unified_ninja.vars
@@ -1,6 +1,9 @@
+# This file is now empty and the settings have been made the default.
+# This file exists only to prevent breakage when used with existing command line invocations.
+
# Configures the build for building with a unified ninja
# Each configuration will share a ninja log
# This allows the output binaries of each configuration to share a common directory
-NINJA_BUILDDIR="$BUILD_ROOT/ninja"
-DESTDIR="$BUILD_ROOT/install"
+# NINJA_BUILDDIR="$BUILD_ROOT/ninja"
+# DESTDIR="$BUILD_ROOT/install"
diff --git a/evergreen/ninja_compile.sh b/evergreen/ninja_compile.sh
index f3b51ae5e1d..823944277be 100644
--- a/evergreen/ninja_compile.sh
+++ b/evergreen/ninja_compile.sh
@@ -5,6 +5,7 @@ cd src
set -o errexit
set -o verbose
+
activate_venv
python -m pip install ninja
if [ "Windows_NT" = "$OS" ]; then
@@ -13,8 +14,8 @@ if [ "Windows_NT" = "$OS" ]; then
for i in "${compile_env[@]}"; do
echo "set $i" >> msvc.bat
done
- echo "ninja install-core" >> msvc.bat
+ echo "ninja -f ${ninja_file} install-core" >> msvc.bat
cmd /C msvc.bat
else
- eval ${compile_env} ninja install-core
+ eval ${compile_env} ninja -f ${ninja_file} install-core
fi
diff --git a/site_scons/mongo/build_profiles.py b/site_scons/mongo/build_profiles.py
index 8ab85883067..e32163a61b4 100644
--- a/site_scons/mongo/build_profiles.py
+++ b/site_scons/mongo/build_profiles.py
@@ -83,7 +83,7 @@ BUILD_PROFILES = {
sanitize="undefined,address",
link_model="dynamic",
dbg="on",
- opt="off",
+ opt="debug",
ICECC="icecc",
CCACHE="ccache",
NINJA_PREFIX="san",