Skip to content

Commit e346fff

Browse files
authored
Miscellaneous maintenance of EVG config (#1714)
* Remove obsolete curl_args variable expansion * Bump latest CMake version to 3.30.2 * Update shrub.py: 3.0.4 -> 3.1.3 * Attempt find_cmake_latest in an EVG setup function before compile and build scripts * CDRIVER-4645 Remove obsolete and unused debug-compile-* tasks
1 parent 1761c7a commit e346fff

File tree

19 files changed

+248
-232
lines changed

19 files changed

+248
-232
lines changed

.evergreen/config_generator/components/c_std_compile.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from shrub.v3.evg_command import EvgCommandType
33
from shrub.v3.evg_task import EvgTaskRef
44

5+
from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
6+
57
from config_generator.etc.distros import find_large_distro
68
from config_generator.etc.distros import make_distro_str
79
from config_generator.etc.distros import to_cc
@@ -80,7 +82,10 @@ def tasks():
8082
name=task_name,
8183
run_on=distro.name,
8284
tags=tags + [f'std-c{std}'],
83-
commands=[StdCompile.call(vars=compile_vars | with_std)],
85+
commands=[
86+
FindCMakeLatest.call(),
87+
StdCompile.call(vars=compile_vars | with_std)
88+
],
8489
)
8590
)
8691

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from shrub.v3.evg_command import EvgCommandType
2+
3+
from config_generator.etc.function import Function
4+
from config_generator.etc.utils import bash_exec
5+
6+
7+
class FindCMakeLatest(Function):
8+
'''
9+
Call `find_cmake_latest` in an attempt to download-and-build the latest
10+
CMake version as a Setup task with `retry_on_failure: true` prior to
11+
subsequent use of `find-cmake-latest.sh` by compile and build scripts.
12+
'''
13+
14+
name = 'find-cmake-latest'
15+
command_type = EvgCommandType.SETUP
16+
commands = [
17+
bash_exec(
18+
command_type=command_type,
19+
retry_on_failure=True,
20+
working_dir='mongoc',
21+
script='. .evergreen/scripts/find-cmake-latest.sh && find_cmake_latest'
22+
),
23+
]
24+
25+
@classmethod
26+
def call(cls, **kwargs):
27+
return cls.default_call(**kwargs)
28+
29+
30+
def functions():
31+
return FindCMakeLatest.defn()

.evergreen/config_generator/components/loadbalanced.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from config_generator.components.funcs.bootstrap_mongo_orchestration import BootstrapMongoOrchestration
66
from config_generator.components.funcs.fetch_build import FetchBuild
77
from config_generator.components.funcs.fetch_det import FetchDET
8+
from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
89
from config_generator.components.funcs.run_simple_http_server import RunSimpleHTTPServer
910
from config_generator.components.funcs.run_tests import RunTests
1011
from config_generator.components.funcs.upload_build import UploadBuild
@@ -76,6 +77,7 @@ def tasks():
7677
run_on=find_large_distro(_DISTRO_NAME).name,
7778
tags=['loadbalanced', _DISTRO_NAME, _COMPILER],
7879
commands=[
80+
FindCMakeLatest.call(),
7981
bash_exec(
8082
command_type=EvgCommandType.TEST,
8183
env={

.evergreen/config_generator/components/make_docs.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from shrub.v3.evg_command import s3_put
33
from shrub.v3.evg_task import EvgTask
44

5+
from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
6+
57
from config_generator.etc.function import Function
68
from config_generator.etc.function import merge_defns
79
from config_generator.etc.utils import bash_exec
@@ -132,6 +134,7 @@ def tasks():
132134
EvgTask(
133135
name="make-docs",
134136
commands=[
137+
FindCMakeLatest.call(),
135138
MakeDocs.call(),
136139
UploadDocs.call(),
137140
UploadManPages.call(),

.evergreen/config_generator/components/mock_server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from shrub.v3.evg_task import EvgTaskRef
44

55
from config_generator.components.funcs.fetch_det import FetchDET
6+
from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
67
from config_generator.components.funcs.run_simple_http_server import RunSimpleHTTPServer
78
from config_generator.etc.utils import Task
89
from config_generator.etc.utils import bash_exec
@@ -16,6 +17,7 @@ def tasks():
1617
# Call fetch-det to define PYTHON3_BINARY expansion required for run-simple-http-server.
1718
FetchDET.call(),
1819
RunSimpleHTTPServer.call(),
20+
FindCMakeLatest.call(),
1921
bash_exec(
2022
command_type=EvgCommandType.TEST,
2123
add_expansions_to_env=True,

.evergreen/config_generator/components/openssl_static_compile.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
from shrub.v3.evg_command import EvgCommandType
33
from shrub.v3.evg_task import EvgTaskRef
44

5+
from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
6+
57
from config_generator.etc.distros import find_large_distro
68
from config_generator.etc.distros import make_distro_str
79
from config_generator.etc.distros import to_cc
@@ -69,7 +71,10 @@ def tasks():
6971
name=task_name,
7072
run_on=distro.name,
7173
tags=tags,
72-
commands=[StaticOpenSSLCompile.call(vars=compile_vars)],
74+
commands=[
75+
FindCMakeLatest.call(),
76+
StaticOpenSSLCompile.call(vars=compile_vars),
77+
],
7378
)
7479
)
7580

.evergreen/config_generator/components/scan_build.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
from shrub.v3.evg_command import FunctionCall
44
from shrub.v3.evg_task import EvgTaskRef
55

6+
from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
7+
68
from config_generator.etc.distros import find_large_distro
79
from config_generator.etc.distros import make_distro_str
810
from config_generator.etc.distros import to_cc
@@ -74,6 +76,7 @@ def tasks():
7476
run_on=distro.name,
7577
tags=tags,
7678
commands=[
79+
FindCMakeLatest.call(),
7780
ScanBuild.call(vars=compile_vars),
7881
FunctionCall(func='upload scan artifacts'),
7982
],

.evergreen/config_generator/etc/compile.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from config_generator.etc.distros import to_cc
44
from config_generator.etc.utils import Task
55

6+
from config_generator.components.funcs.find_cmake_latest import FindCMakeLatest
67
from config_generator.components.funcs.upload_build import UploadBuild
78

89

@@ -35,6 +36,7 @@ def generate_compile_tasks(SSL, TAG, SASL_TO_FUNC, MATRIX, MORE_TAGS=None, MORE_
3536
task_name = f'{tag}-{task_name}'
3637

3738
commands = []
39+
commands.append(FindCMakeLatest.call())
3840
commands.append(SASL_TO_FUNC[sasl].call(vars=compile_vars))
3941
commands.append(UploadBuild.call())
4042

.evergreen/config_generator/etc/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,11 @@ def bash_exec(
3434
include_expansions_in_env: Iterable[str] | None = None,
3535
working_dir: str | None = None,
3636
command_type: EvgCommandType | None = None,
37+
retry_on_failure: bool | None = None,
3738
env: Mapping[str, str] | None = None,
3839
**kwargs,
3940
):
40-
return subprocess_exec(
41+
ret = subprocess_exec(
4142
binary="bash",
4243
args=["-c", dedent(script)],
4344
include_expansions_in_env=list(include_expansions_in_env) if include_expansions_in_env else None,
@@ -47,6 +48,11 @@ def bash_exec(
4748
**kwargs,
4849
)
4950

51+
if retry_on_failure is not None:
52+
ret.params |= {"retry_on_failure": retry_on_failure}
53+
54+
return ret
55+
5056

5157
def all_components():
5258
res = []

.evergreen/generated_configs/functions.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,16 @@ functions:
248248
for file in $(find .evergreen/scripts -type f); do
249249
chmod +rx "$file" || exit
250250
done
251+
find-cmake-latest:
252+
- command: subprocess.exec
253+
type: setup
254+
params:
255+
binary: bash
256+
working_dir: mongoc
257+
retry_on_failure: true
258+
args:
259+
- -c
260+
- . .evergreen/scripts/find-cmake-latest.sh && find_cmake_latest
251261
kms-divergence-check:
252262
- command: subprocess.exec
253263
type: test

0 commit comments

Comments
 (0)