diff options
author | Andrew Morrow <andrew.c.morrow@gmail.com> | 2022-12-13 13:56:23 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-12-13 23:03:13 +0000 |
commit | 7657e615d237c2e198ee296e8462c0f3b54f6465 (patch) | |
tree | 7cf37a749ae79ce6c2b11080e1453aedf4bb78a0 /buildscripts | |
parent | df32b43a03177b6cb9295549c6f8c5ca384ef82a (diff) | |
download | mongo-7657e615d237c2e198ee296e8462c0f3b54f6465.tar.gz |
SERVER-62994 Use v4 toolchain for everything except clang format
It has been a pleasure working here and quite the wild ride.
Good luck everyone.
Diffstat (limited to 'buildscripts')
-rwxr-xr-x | buildscripts/auto_install_db_contrib_tool.sh | 4 | ||||
-rwxr-xr-x | buildscripts/clang_format.py | 1 | ||||
-rwxr-xr-x | buildscripts/clang_tidy.py | 2 | ||||
-rwxr-xr-x | buildscripts/evergreen_gen_build_metrics_tasks.py | 2 | ||||
-rw-r--r-- | buildscripts/gdb/mongo.py | 2 | ||||
-rw-r--r-- | buildscripts/libdeps/README.md | 2 | ||||
-rw-r--r-- | buildscripts/linter/runner.py | 8 | ||||
-rw-r--r-- | buildscripts/resmokelib/powercycle/setup/__init__.py | 4 | ||||
-rw-r--r-- | buildscripts/scons_metrics/metrics.py | 7 | ||||
-rw-r--r-- | buildscripts/tests/resmoke_end2end/README.md | 4 | ||||
-rw-r--r-- | buildscripts/tests/resmokelib/utils/test_scheduler.py | 16 | ||||
-rw-r--r-- | buildscripts/tests/tooling_metrics/test_scons_tooling_metrics.py | 4 |
12 files changed, 30 insertions, 26 deletions
diff --git a/buildscripts/auto_install_db_contrib_tool.sh b/buildscripts/auto_install_db_contrib_tool.sh index 1ba77c12460..d63bd97df78 100755 --- a/buildscripts/auto_install_db_contrib_tool.sh +++ b/buildscripts/auto_install_db_contrib_tool.sh @@ -7,8 +7,8 @@ echo "| Running a script to automatically install db-contrib-tool (https://git echo "+-----------------------------------------------------------------------------------------------------------+" echo -if [[ -d "/opt/mongodbtoolchain/v3/bin" ]]; then - export PATH="/opt/mongodbtoolchain/v3/bin:$PATH" +if [[ -d "/opt/mongodbtoolchain/v4/bin" ]]; then + export PATH="/opt/mongodbtoolchain/v4/bin:$PATH" fi rc_file="" diff --git a/buildscripts/clang_format.py b/buildscripts/clang_format.py index de335123ded..fdbd9c5931a 100755 --- a/buildscripts/clang_format.py +++ b/buildscripts/clang_format.py @@ -56,6 +56,7 @@ CLANG_FORMAT_HTTP_LINUX_CACHE = "https://s3.amazonaws.com/boxes.10gen.com/build/ CLANG_FORMAT_HTTP_DARWIN_CACHE = "https://s3.amazonaws.com/boxes.10gen.com/build/clang-format-7.0.1-x86_64-apple-darwin.tar.gz" +# TODO: Move clang format to the v4 toolchain CLANG_FORMAT_TOOLCHAIN_PATH = "/opt/mongodbtoolchain/v3/bin/clang-format" # Path in the tarball to the clang-format binary diff --git a/buildscripts/clang_tidy.py b/buildscripts/clang_tidy.py index 60631b5e9c7..9bbbc3d1cf3 100755 --- a/buildscripts/clang_tidy.py +++ b/buildscripts/clang_tidy.py @@ -109,7 +109,7 @@ def main(): parser.add_argument("-l", "--log-file", type=str, default="clang_tidy", help="clang tidy log from evergreen") # TODO: Is there someway to get this without hardcoding this much - parser.add_argument("-y", "--clang-tidy-toolchain", type=str, default="v3") + parser.add_argument("-y", "--clang-tidy-toolchain", type=str, default="v4") parser.add_argument("-f", "--clang-tidy-cfg", type=str, default=".clang-tidy") args = parser.parse_args() diff --git a/buildscripts/evergreen_gen_build_metrics_tasks.py b/buildscripts/evergreen_gen_build_metrics_tasks.py index c2fe1541404..7585b2e483e 100755 --- a/buildscripts/evergreen_gen_build_metrics_tasks.py +++ b/buildscripts/evergreen_gen_build_metrics_tasks.py @@ -64,7 +64,7 @@ def main(): ############################## else: - for toolchain in ['v3', 'v4']: + for toolchain in ['v4']: # possibly we want to add clang to the mix here, so leaving as an easy drop in for compiler in ['gcc']: for link_model in ['dynamic', 'static']: diff --git a/buildscripts/gdb/mongo.py b/buildscripts/gdb/mongo.py index 3f4437852b3..c68e022200c 100644 --- a/buildscripts/gdb/mongo.py +++ b/buildscripts/gdb/mongo.py @@ -16,8 +16,6 @@ def detect_toolchain(progspace): readelf_bin = '/opt/mongodbtoolchain/v4/bin/readelf' if not os.path.exists(readelf_bin): - readelf_bin = '/opt/mongodbtoolchain/v3/bin/readelf' - if not os.path.exists(readelf_bin): readelf_bin = 'readelf' gcc_version_regex = re.compile(r'.*\]\s*GCC: \(GNU\) (\d+\.\d+\.\d+)\s*$') diff --git a/buildscripts/libdeps/README.md b/buildscripts/libdeps/README.md index a0fd283496e..0b5080c8e51 100644 --- a/buildscripts/libdeps/README.md +++ b/buildscripts/libdeps/README.md @@ -31,7 +31,7 @@ Which will give an output similar to this: 1 Build invocation: - "/usr/bin/python3.8" "buildscripts/scons.py" "--variables-files=etc/scons/mongodbtoolchain_v3_gcc.vars" "--dbg=on" "--opt=on" "--enable-free-mon=on" "--enable-http-client=on" "--cache=all" "--cache-dir=/home/ubuntu/scons-cache" "--install-action=hardlink" "--link-model=dynamic" "--build-tools=next" "--ssl" "--modules=enterprise" "CCACHE=ccache" "ICECC=icecc" "-j50" "generate-libdeps-graph" + "/usr/bin/python3.8" "buildscripts/scons.py" "--variables-files=etc/scons/mongodbtoolchain_stable_gcc.vars" "--dbg=on" "--opt=on" "--enable-free-mon=on" "--enable-http-client=on" "--cache=all" "--cache-dir=/home/ubuntu/scons-cache" "--install-action=hardlink" "--link-model=dynamic" "--build-tools=next" "--ssl" "--modules=enterprise" "CCACHE=ccache" "ICECC=icecc" "-j50" "generate-libdeps-graph" Nodes in Graph: 859 Edges in Graph: 90843 diff --git a/buildscripts/linter/runner.py b/buildscripts/linter/runner.py index ef2eeddd08f..903cedf6aac 100644 --- a/buildscripts/linter/runner.py +++ b/buildscripts/linter/runner.py @@ -78,7 +78,7 @@ def _find_linter(linter, config_dict): # 1. In the same directory as the interpreter # 2. Check user base -- i.e. site.USERBASE. With "pip install --user" puts files # 3. The current path - # 4. In '/opt/mongodbtoolchain/v3/bin' if virtualenv is set up. + # 4. In '/opt/mongodbtoolchain/v4/bin' if virtualenv is set up. python_dir = os.path.dirname(sys.executable) if sys.platform == "win32": # On Windows, these scripts are installed in %PYTHONDIR%\scripts like @@ -94,7 +94,7 @@ def _find_linter(linter, config_dict): python_dir = '/usr/local/bin' # On Linux, these scripts are installed in %PYTHONDIR%\bin like - # '/opt/mongodbtoolchain/v3/bin', but they may point to the wrong interpreter. + # '/opt/mongodbtoolchain/v4/bin', but they may point to the wrong interpreter. cmd_str = os.path.join(python_dir, linter.cmd_name) cmd = [sys.executable, cmd_str] @@ -116,8 +116,8 @@ def _find_linter(linter, config_dict): return base.LinterInstance(linter, cmd) # Check 4: When a virtualenv is setup the linter modules are not installed, so we need - # to use the linters installed in '/opt/mongodbtoolchain/v3/bin'. - cmd = [sys.executable, os.path.join('/opt/mongodbtoolchain/v3/bin', linter.cmd_name)] + # to use the linters installed in '/opt/mongodbtoolchain/v4/bin'. + cmd = [sys.executable, os.path.join('/opt/mongodbtoolchain/v4/bin', linter.cmd_name)] if _check_version(linter, cmd, linter.get_lint_version_cmd_args()): return base.LinterInstance(linter, cmd) diff --git a/buildscripts/resmokelib/powercycle/setup/__init__.py b/buildscripts/resmokelib/powercycle/setup/__init__.py index a0021c5655e..07c43d76d94 100644 --- a/buildscripts/resmokelib/powercycle/setup/__init__.py +++ b/buildscripts/resmokelib/powercycle/setup/__init__.py @@ -50,13 +50,13 @@ class SetUpEC2Instance(PowercycleCommand): # Third operation - # Set up virtualenv on remote. venv = powercycle_constants.VIRTUALENV_DIR - python = "/opt/mongodbtoolchain/v3/bin/python3" if "python" not in self.expansions else self.expansions[ + python = "/opt/mongodbtoolchain/v4/bin/python3" if "python" not in self.expansions else self.expansions[ "python"] cmds = f"python_loc=$(which {python})" cmds = f"{cmds}; remote_dir={remote_dir}" cmds = f"{cmds}; if [ \"Windows_NT\" = \"$OS\" ]; then python_loc=$(cygpath -w $python_loc); remote_dir=$(cygpath -w $remote_dir); fi" - cmds = f"{cmds}; virtualenv --python $python_loc --system-site-packages {venv}" + cmds = f"{cmds}; $python_loc -m venv --system-site-packages {venv}" cmds = f"{cmds}; activate=$(find {venv} -name 'activate')" cmds = f"{cmds}; . $activate" cmds = f"{cmds}; pip3 install -r $remote_dir/etc/pip/powercycle-requirements.txt" diff --git a/buildscripts/scons_metrics/metrics.py b/buildscripts/scons_metrics/metrics.py index 084bff01ffb..8dea3f346c4 100644 --- a/buildscripts/scons_metrics/metrics.py +++ b/buildscripts/scons_metrics/metrics.py @@ -107,8 +107,11 @@ class SconsMetrics: TOTAL_COMMAND_EXECUTION_TIME_REGEX, self.raw_report) if os.path.exists(cache_debug_log_file): - with open(cache_debug_log_file, "r") as fh: - self.final_cache_hit_ratio = self._parse_float(CACHE_HIT_RATIO_REGEX, fh.read()) + try: + with open(cache_debug_log_file, "r") as fh: + self.final_cache_hit_ratio = self._parse_float(CACHE_HIT_RATIO_REGEX, fh.read()) + except Exception: # pylint: disable=broad-except + self.final_cache_hit_ratio = 0.0 else: self.final_cache_hit_ratio = 0.0 diff --git a/buildscripts/tests/resmoke_end2end/README.md b/buildscripts/tests/resmoke_end2end/README.md index bbc00b66718..ef3fa3b1ea8 100644 --- a/buildscripts/tests/resmoke_end2end/README.md +++ b/buildscripts/tests/resmoke_end2end/README.md @@ -1,9 +1,9 @@ * All end-to-end resmoke tests can be run via a resmoke suite itself: ``` -mongodb_repo_root$ /opt/mongodbtoolchain/v3/bin/python3 buildscripts/resmoke.py run --suites resmoke_end2end_tests +mongodb_repo_root$ /opt/mongodbtoolchain/v4/bin/python3 buildscripts/resmoke.py run --suites resmoke_end2end_tests ``` * Finer grained control of tests can also be run with by invoking python's unittest main by hand. E.g: ``` -mongodb_repo_root$ /opt/mongodbtoolchain/v3/bin/python3 -m unittest -v buildscripts.tests.resmoke_end2end.test_resmoke.TestTestSelection.test_at_sign_as_replay_file +mongodb_repo_root$ /opt/mongodbtoolchain/v4/bin/python3 -m unittest -v buildscripts.tests.resmoke_end2end.test_resmoke.TestTestSelection.test_at_sign_as_replay_file ``` diff --git a/buildscripts/tests/resmokelib/utils/test_scheduler.py b/buildscripts/tests/resmokelib/utils/test_scheduler.py index d9af87e2f4b..48ffb77117a 100644 --- a/buildscripts/tests/resmokelib/utils/test_scheduler.py +++ b/buildscripts/tests/resmokelib/utils/test_scheduler.py @@ -32,10 +32,12 @@ class TestScheduler(unittest.TestCase): self.assertEqual(self.__scheduler.queue, []) -class TestBuiltinScheduler(TestScheduler): - """Unit tests for the sched.scheduler class.""" - scheduler = sched.scheduler - - def test_cancel_with_identical_time_and_priority(self): - with self.assertRaises(AssertionError): - super().test_cancel_with_identical_time_and_priority() +# TODO(SERVER-72079) Either reneable this test to remove uses of scheduler.py +# See ticket for more details +# class TestBuiltinScheduler(TestScheduler): +# """Unit tests for the sched.scheduler class.""" +# scheduler = sched.scheduler + +# def test_cancel_with_identical_time_and_priority(self): +# with self.assertRaises(AssertionError): +# super().test_cancel_with_identical_time_and_priority() diff --git a/buildscripts/tests/tooling_metrics/test_scons_tooling_metrics.py b/buildscripts/tests/tooling_metrics/test_scons_tooling_metrics.py index ab23c951f2e..a80b526ed55 100644 --- a/buildscripts/tests/tooling_metrics/test_scons_tooling_metrics.py +++ b/buildscripts/tests/tooling_metrics/test_scons_tooling_metrics.py @@ -13,8 +13,8 @@ if os.name == "nt": @patch("sys.argv", [ - 'buildscripts/scons.py', "CC=/opt/mongodbtoolchain/v3/bin/gcc", - "CXX=/opt/mongodbtoolchain/v3/bin/g++", "NINJA_PREFIX=test_success", "--ninja" + 'buildscripts/scons.py', "CC=/opt/mongodbtoolchain/v4/bin/gcc", + "CXX=/opt/mongodbtoolchain/v4/bin/g++", "NINJA_PREFIX=test_success", "--ninja" ]) @patch("atexit.register") class TestSconsAtExitMetricsCollection(unittest.TestCase): |