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-16 15:02:06 +0000
commit35baeb29980662b6d82a00ab1fb98d120e593202 (patch)
tree3c5cd82079a6ade0fdfc46a2a5a4a3746ab0e993
parent3ed1e1368861952f6215dad0ee71a4ce64f0aebc (diff)
downloadmongo-35baeb29980662b6d82a00ab1fb98d120e593202.tar.gz
SERVER-68003 Make experiment_unified_ninja.vars the default
(cherry picked from commit 41d0a45aaf90b8e4e9a91f13a72e5623ecd963c4) (cherry picked from commit 6e2d63630ee90db15b7b122aba1b8c538357a0df)
-rwxr-xr-xSConstruct15
-rw-r--r--etc/evergreen.yml173
-rw-r--r--etc/scons/experimental_unified_ninja.vars7
-rw-r--r--evergreen/ninja_compile.sh5
4 files changed, 159 insertions, 41 deletions
diff --git a/SConstruct b/SConstruct
index d9cf926dc66..be98b43100d 100755
--- a/SConstruct
+++ b/SConstruct
@@ -836,16 +836,11 @@ env_vars.Add('CXXFLAGS',
help='Sets flags for the C++ compiler',
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',
+env_vars.Add(
+ 'DESTDIR',
help='Where builds will install files',
- default=default_destdir)
+ default='$BUILD_ROOT/install',
+)
env_vars.Add('DSYMUTIL',
help='Path to the dsymutil utility',
@@ -977,7 +972,7 @@ env_vars.Add('MSVC_VERSION',
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 80ce89976f3..8329ea99fd4 100644
--- a/etc/evergreen.yml
+++ b/etc/evergreen.yml
@@ -1178,6 +1178,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 compile expansions":
- *f_expansions_write
- command: subprocess.exec
@@ -2003,36 +2012,100 @@ tasks:
- name: compile_ninja
commands:
- - func: "scons compile"
- vars:
- generating_for_ninja: true
- task_install_action:
- default
- task_compile_flags: >-
- --ninja
- - *f_expansions_write
- - command: subprocess.exec
- params:
- binary: bash
- args:
- - "./src/evergreen/ninja_compile.sh"
+ - func: "scons compile"
+ vars:
+ generating_for_ninja: true
+ task_install_action:
+ default
+ task_compile_flags: >-
+ --ninja
+ - *f_expansions_write
+ - func: "ninja compile"
+ vars:
+ ninja_file: "build.ninja"
+
+- name: compile_ninja_default_profile
+ tags: []
+ commands:
+ - func: "scons compile"
+ vars:
+ generating_for_ninja: true
+ 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: []
+ commands:
+ - func: "scons compile"
+ vars:
+ generating_for_ninja: true
+ 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: []
+ commands:
+ - func: "scons compile"
+ vars:
+ generating_for_ninja: true
+ 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: []
+ commands:
+ - func: "scons compile"
+ vars:
+ generating_for_ninja: true
+ 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
commands:
- - func: "scons compile"
- vars:
- generating_for_ninja: true
- task_install_action:
- default
- task_compile_flags: >-
- --build-tools=next
- --ninja
- - *f_expansions_write
- - command: subprocess.exec
- params:
- binary: bash
- args:
- - "./src/evergreen/ninja_compile.sh"
+ - func: "scons compile"
+ vars:
+ generating_for_ninja: true
+ task_install_action:
+ default
+ task_compile_flags: >-
+ --build-tools=next
+ --ninja
+ - *f_expansions_write
+ - func: "ninja compile"
+ vars:
+ ninja_file: "build.ninja"
- name: compile_build_tools_next
commands:
@@ -6916,6 +6989,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
@@ -9756,6 +9849,32 @@ buildvariants:
- rhel80-small
- name: generate_buildid_to_debug_symbols_mapping
+- 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
+
# This variant compiles on RHEL 7.0 and runs tests on RHEL 7.6
- name: rhel76_compile_rhel70
display_name: RHEL 7.0/7.6 Cross-ABI
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 eea669343fe..9e230f35eae 100644
--- a/evergreen/ninja_compile.sh
+++ b/evergreen/ninja_compile.sh
@@ -5,13 +5,14 @@ cd src
set -o errexit
set -o verbose
+
activate_venv
python -m pip install ninja
if [ "Windows_NT" = "$OS" ]; then
vcvars="$(vswhere -latest -property installationPath | tr '\\' '/' | dos2unix.exe)/VC/Auxiliary/Build/"
echo "call \"$vcvars/vcvarsall.bat\" amd64" > msvc.bat
- echo "ninja install-core" >> msvc.bat
+ echo "ninja -f ${ninja_file} install-core" >> msvc.bat
cmd /C msvc.bat
else
- ninja install-core
+ ninja -f ${ninja_file} install-core
fi