diff options
-rwxr-xr-x | SConstruct | 15 | ||||
-rw-r--r-- | etc/evergreen.yml | 68 | ||||
-rw-r--r-- | etc/evergreen_nightly.yml | 2 | ||||
-rw-r--r-- | etc/evergreen_yml_components/definitions.yml | 129 | ||||
-rw-r--r-- | etc/evergreen_yml_components/variants/ninja.yml | 94 | ||||
-rw-r--r-- | etc/scons/experimental_unified_ninja.vars | 7 | ||||
-rw-r--r-- | evergreen/ninja_compile.sh | 5 |
7 files changed, 229 insertions, 91 deletions
diff --git a/SConstruct b/SConstruct index 3b85e800328..a0700af4f92 100755 --- a/SConstruct +++ b/SConstruct @@ -846,16 +846,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', @@ -988,7 +983,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 faf64b38f7e..ef5e180275a 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 @@ -341,26 +342,6 @@ buildvariants: tasks: - name: tla_plus -- name: enterprise-rhel80-ninja - display_name: "Ninja Build: 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-build - - name: compile_ninja_TG - distros: - - rhel80-build - - &enterprise-rhel80-dynamic-v4gcc-debug-experimental-template name: enterprise-rhel80-dynamic-v4gcc-debug-experimental display_name: "~ Shared Library Enterprise RHEL 8.0 v4 Toolchain GCC DEBUG" @@ -1035,21 +1016,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 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: enterprise-windows-cxx20-debug-experimental display_name: "~ Enterprise Windows C++20 DEBUG" cron: "0 4 * * *" # From the ${project_nightly_cron} parameter. @@ -1170,20 +1136,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. @@ -1475,24 +1427,6 @@ buildvariants: - rhel80-xlarge - name: generate_buildid_to_debug_symbols_mapping -- 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 - 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 - - &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 0bc49f2687f..5e8a5058866 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 3d819834fd5..2830f41e4eb 100644 --- a/etc/evergreen_yml_components/definitions.yml +++ b/etc/evergreen_yml_components/definitions.yml @@ -1246,6 +1246,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: @@ -2331,11 +2340,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: [] @@ -2353,11 +2444,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: [] @@ -7482,6 +7571,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..5ae1f870eef --- /dev/null +++ b/etc/evergreen_yml_components/variants/ninja.yml @@ -0,0 +1,94 @@ +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 + +- name: enterprise-rhel80-ninja + display_name: "Ninja Build: 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 + 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-build + - name: compile_ninja_TG + distros: + - rhel80-build 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 |