@@ -39,18 +39,18 @@ class Distro(BaseModel):
39
39
def validate_os_ver (cls , value ):
40
40
return Version (value )
41
41
42
- # See: https://evergreen.mongodb.com/distros
43
- # pylint: disable=line-too-long
44
- #fmt: off
42
+
43
+ def ls_distro (name , ** kwargs ):
44
+ return [
45
+ Distro (name = f'{ name } -large' , size = 'large' , ** kwargs ),
46
+ Distro (name = f'{ name } -small' , size = 'small' , ** kwargs ),
47
+ ]
48
+
49
+
45
50
DEBIAN_DISTROS = [
46
- Distro (name = 'debian92-large' , os = 'debian' , os_type = 'linux' , os_ver = '9.2' , size = 'large' ), # CDRIVER-5873
47
- Distro (name = 'debian92-small' , os = 'debian' , os_type = 'linux' , os_ver = '9.2' , size = 'small' ), # CDRIVER-5873
48
- Distro (name = 'debian10-large' , os = 'debian' , os_type = 'linux' , os_ver = '10' , size = 'large' ), # CDRIVER-5874
49
- Distro (name = 'debian10-small' , os = 'debian' , os_type = 'linux' , os_ver = '10' , size = 'small' ), # CDRIVER-5874
50
- Distro (name = 'debian11-large' , os = 'debian' , os_type = 'linux' , os_ver = '11' , size = 'large' ),
51
- Distro (name = 'debian11-small' , os = 'debian' , os_type = 'linux' , os_ver = '11' , size = 'small' ),
52
- Distro (name = 'debian92-large' , os = 'debian' , os_type = 'linux' , os_ver = '9.2' , size = 'large' ),
53
- Distro (name = 'debian92-small' , os = 'debian' , os_type = 'linux' , os_ver = '9.2' , size = 'small' ),
51
+ * ls_distro (name = 'debian92' , os = 'debian' , os_type = 'linux' , os_ver = '9.2' ), # CDRIVER-5873
52
+ * ls_distro (name = 'debian10' , os = 'debian' , os_type = 'linux' , os_ver = '10' ), # CDRIVER-5874
53
+ * ls_distro (name = 'debian11' , os = 'debian' , os_type = 'linux' , os_ver = '11' ),
54
54
]
55
55
56
56
MACOS_DISTROS = [
@@ -63,89 +63,57 @@ def validate_os_ver(cls, value):
63
63
]
64
64
65
65
RHEL_DISTROS = [
66
- Distro (name = 'rhel80-large' , os = 'rhel' , os_type = 'linux' , os_ver = '8.0' , size = 'large' ),
67
- Distro (name = 'rhel80-small' , os = 'rhel' , os_type = 'linux' , os_ver = '8.0' , size = 'small' ),
68
- Distro (name = 'rhel84-large' , os = 'rhel' , os_type = 'linux' , os_ver = '8.4' , size = 'large' ),
69
- Distro (name = 'rhel84-small' , os = 'rhel' , os_type = 'linux' , os_ver = '8.4' , size = 'small' ),
70
- Distro (name = 'rhel8.9-large' , os = 'rhel' , os_type = 'linux' , os_ver = '8.7' , size = 'large' ),
71
- Distro (name = 'rhel8.9-small' , os = 'rhel' , os_type = 'linux' , os_ver = '8.7' , size = 'small' ),
72
- Distro (name = 'rhel92-large' , os = 'rhel' , os_type = 'linux' , os_ver = '9.0' , size = 'large' ),
73
- Distro (name = 'rhel92-small' , os = 'rhel' , os_type = 'linux' , os_ver = '9.0' , size = 'small' ),
74
- ]
75
-
76
- RHEL_ARM64_DISTROS = [
77
- Distro (name = 'rhel82-arm64-large' , os = 'rhel' , os_type = 'linux' , os_ver = '8.2' , size = 'large' , arch = 'arm64' ),
78
- Distro (name = 'rhel82-arm64-small' , os = 'rhel' , os_type = 'linux' , os_ver = '8.2' , size = 'small' , arch = 'arm64' ),
79
- Distro (name = 'rhel92-arm64-large' , os = 'rhel' , os_type = 'linux' , os_ver = '9.0' , size = 'large' , arch = 'arm64' ),
80
- Distro (name = 'rhel92-arm64-small' , os = 'rhel' , os_type = 'linux' , os_ver = '9.0' , size = 'small' , arch = 'arm64' ),
66
+ * ls_distro (name = 'rhel76' , os = 'rhel' , os_type = 'linux' , os_ver = '7.6' ),
67
+ * ls_distro (name = 'rhel80' , os = 'rhel' , os_type = 'linux' , os_ver = '8.0' ),
68
+ * ls_distro (name = 'rhel84' , os = 'rhel' , os_type = 'linux' , os_ver = '8.4' ),
69
+ * ls_distro (name = 'rhel90' , os = 'rhel' , os_type = 'linux' , os_ver = '9.0' ),
70
+ * ls_distro (name = 'rhel91' , os = 'rhel' , os_type = 'linux' , os_ver = '9.1' ),
71
+ * ls_distro (name = 'rhel92' , os = 'rhel' , os_type = 'linux' , os_ver = '9.2' ),
72
+ * ls_distro (name = 'rhel93' , os = 'rhel' , os_type = 'linux' , os_ver = '9.3' ),
73
+ * ls_distro (name = 'rhel94' , os = 'rhel' , os_type = 'linux' , os_ver = '9.4' ),
74
+ * ls_distro (name = 'rhel95' , os = 'rhel' , os_type = 'linux' , os_ver = '9.5' ),
75
+ * ls_distro (name = 'rhel8.9' , os = 'rhel' , os_type = 'linux' , os_ver = '8.7' ),
76
+ * ls_distro (name = 'rhel92' , os = 'rhel' , os_type = 'linux' , os_ver = '9.0' ),
81
77
]
82
78
83
79
RHEL_POWER_DISTROS = [
84
- Distro (name = 'rhel8-power-large' , os = 'rhel' , os_type = 'linux' , os_ver = '8' , size = 'large' , arch = 'power' ),
85
- Distro (name = 'rhel8-power-small' , os = 'rhel' , os_type = 'linux' , os_ver = '8' , size = 'small' , arch = 'power' ),
86
- Distro (name = 'rhel9-power-large' , os = 'rhel' , os_type = 'linux' , os_ver = '9' , size = 'large' , arch = 'power' ),
87
- Distro (name = 'rhel9-power-small' , os = 'rhel' , os_type = 'linux' , os_ver = '9' , size = 'small' , arch = 'power' ),
80
+ * ls_distro (name = 'rhel8-power' , os = 'rhel' , os_type = 'linux' , os_ver = '8' , arch = 'power' ),
88
81
]
89
82
90
83
RHEL_ZSERIES_DISTROS = [
91
- Distro (name = 'rhel8-zseries-large' , os = 'rhel' , os_type = 'linux' , os_ver = '8' , size = 'large' , arch = 'zseries' ),
92
- Distro (name = 'rhel8-zseries-small' , os = 'rhel' , os_type = 'linux' , os_ver = '8' , size = 'small' , arch = 'zseries' ),
93
- Distro (name = 'rhel9-zseries-large' , os = 'rhel' , os_type = 'linux' , os_ver = '9' , size = 'large' , arch = 'zseries' ),
94
- Distro (name = 'rhel9-zseries-small' , os = 'rhel' , os_type = 'linux' , os_ver = '9' , size = 'small' , arch = 'zseries' ),
84
+ * ls_distro (name = 'rhel8-zseries' , os = 'rhel' , os_type = 'linux' , os_ver = '8' , arch = 'zseries' ),
95
85
]
96
86
97
87
UBUNTU_DISTROS = [
98
- Distro (name = 'ubuntu2004-large' , os = 'ubuntu' , os_type = 'linux' , os_ver = '20.04' , size = 'large' ),
99
- Distro (name = 'ubuntu2004-small' , os = 'ubuntu' , os_type = 'linux' , os_ver = '20.04' , size = 'small' ),
100
- Distro (name = 'ubuntu2204-large' , os = 'ubuntu' , os_type = 'linux' , os_ver = '22.04' , size = 'large' ),
101
- Distro (name = 'ubuntu2204-small' , os = 'ubuntu' , os_type = 'linux' , os_ver = '22.04' , size = 'small' ),
88
+ * ls_distro (name = 'ubuntu2004' , os = 'ubuntu' , os_type = 'linux' , os_ver = '20.04' ),
89
+ * ls_distro (name = 'ubuntu2204' , os = 'ubuntu' , os_type = 'linux' , os_ver = '22.04' ),
102
90
]
103
91
104
92
UBUNTU_ARM64_DISTROS = [
105
- Distro (name = 'ubuntu2004-arm64-large' , os = 'ubuntu' , os_type = 'linux' , os_ver = '20.04' , size = 'large' , arch = 'arm64' ),
106
- Distro (name = 'ubuntu2004-arm64-small' , os = 'ubuntu' , os_type = 'linux' , os_ver = '20.04' , size = 'small' , arch = 'arm64' ),
107
- Distro (name = 'ubuntu2204-arm64-large' , os = 'ubuntu' , os_type = 'linux' , os_ver = '22.04' , size = 'large' , arch = 'arm64' ),
108
- Distro (name = 'ubuntu2204-arm64-small' , os = 'ubuntu' , os_type = 'linux' , os_ver = '22.04' , size = 'small' , arch = 'arm64' ),
93
+ * ls_distro (name = 'ubuntu2004-arm64' , os = 'ubuntu' , os_type = 'linux' , os_ver = '20.04' , arch = 'arm64' ),
109
94
]
110
95
111
96
WINDOWS_DISTROS = [
112
- Distro (name = 'windows-64-vs2013-large' , os = 'windows' , os_type = 'windows' , vs_ver = '2013' , size = 'large' ),
113
- Distro (name = 'windows-64-vs2013-small' , os = 'windows' , os_type = 'windows' , vs_ver = '2013' , size = 'small' ),
114
- Distro (name = 'windows-64-vs2015-large' , os = 'windows' , os_type = 'windows' , vs_ver = '2015' , size = 'large' ),
115
- Distro (name = 'windows-64-vs2015-small' , os = 'windows' , os_type = 'windows' , vs_ver = '2015' , size = 'small' ),
116
- Distro (name = 'windows-64-vs2017-large' , os = 'windows' , os_type = 'windows' , vs_ver = '2017' , size = 'large' ),
117
- Distro (name = 'windows-64-vs2017-small' , os = 'windows' , os_type = 'windows' , vs_ver = '2017' , size = 'small' ),
118
- Distro (name = 'windows-64-vs2019-large' , os = 'windows' , os_type = 'windows' , vs_ver = '2019' , size = 'large' ),
119
- Distro (name = 'windows-64-vs2019-small' , os = 'windows' , os_type = 'windows' , vs_ver = '2019' , size = 'small' ),
120
-
121
- Distro (name = 'windows-2022-large' , os = 'windows' , os_type = 'windows' , os_ver = '2022' ),
122
- Distro (name = 'windows-2022-small' , os = 'windows' , os_type = 'windows' , os_ver = '2022' ),
123
-
124
- Distro (name = 'windows-64-2019' , os = 'windows' , os_type = 'windows' , os_ver = '2019' ),
125
-
126
- Distro (name = 'windows-64-vsMulti-small' , os = 'windows' , os_type = 'windows' , vs_ver = 'vsMulti' , size = 'small' ),
97
+ * ls_distro (name = 'windows-64-vs2015' , os = 'windows' , os_type = 'windows' , vs_ver = '2015' ),
98
+ * ls_distro (name = 'windows-64-vs2017' , os = 'windows' , os_type = 'windows' , vs_ver = '2017' ),
99
+ * ls_distro (name = 'windows-64-vs2019' , os = 'windows' , os_type = 'windows' , vs_ver = '2019' ),
127
100
128
- Distro (name = 'windows-vsCurrent-2022-large' , os = 'windows' , os_type = 'windows' , os_ver = '2022' , vs_ver = 'vsCurrent' , size = 'large' ),
129
- Distro (name = 'windows-vsCurrent-2022-small' , os = 'windows' , os_type = 'windows' , os_ver = '2022' , vs_ver = 'vsCurrent' , size = 'small' ),
130
-
131
- Distro (name = 'windows-vsCurrent-large' , os = 'windows' , os_type = 'windows' , vs_ver = 'vsCurrent' , size = 'large' ), # Windows Server 2019
132
- Distro (name = 'windows-vsCurrent-small' , os = 'windows' , os_type = 'windows' , vs_ver = 'vsCurrent' , size = 'small' ), # Windows Server 2019
101
+ * ls_distro (name = 'windows-vsCurrent' , os = 'windows' , os_type = 'windows' , vs_ver = 'vsCurrent' ), # Windows Server 2019
133
102
]
134
- #fmt: on
135
- # pylint: enable=line-too-long
136
103
104
+ # See: https://evergreen.mongodb.com/distros
137
105
# Ensure no-arch distros are ordered before arch-specific distros.
138
- ALL_DISTROS = [] + \
139
- DEBIAN_DISTROS + \
140
- MACOS_DISTROS + \
141
- MACOS_ARM64_DISTROS + \
142
- RHEL_DISTROS + \
143
- RHEL_ARM64_DISTROS + \
144
- RHEL_POWER_DISTROS + \
145
- RHEL_ZSERIES_DISTROS + \
146
- UBUNTU_DISTROS + \
147
- UBUNTU_ARM64_DISTROS + \
148
- WINDOWS_DISTROS
106
+ ALL_DISTROS = [
107
+ * DEBIAN_DISTROS ,
108
+ * MACOS_DISTROS ,
109
+ * MACOS_ARM64_DISTROS ,
110
+ * RHEL_DISTROS ,
111
+ * RHEL_POWER_DISTROS ,
112
+ * RHEL_ZSERIES_DISTROS ,
113
+ * UBUNTU_DISTROS ,
114
+ * UBUNTU_ARM64_DISTROS ,
115
+ * WINDOWS_DISTROS ,
116
+ ]
149
117
150
118
151
119
def find_distro (name ) -> Distro :
@@ -205,6 +173,10 @@ def make_distro_str(distro_name, compiler, arch) -> str:
205
173
'vs2015x86' : '-x86' ,
206
174
'vs2017x64' : '-x64' ,
207
175
'vs2017x86' : '-x86' ,
176
+ 'vs2019x64' : '-x64' ,
177
+ 'vs2019x86' : '-x86' ,
178
+ 'vs2022x64' : '-x64' ,
179
+ 'vs2022x86' : '-x86' ,
208
180
}.get (compiler , f'-{ compiler } ' )
209
181
else :
210
182
distro_str = distro_name
@@ -219,10 +191,56 @@ def make_distro_str(distro_name, compiler, arch) -> str:
219
191
220
192
def to_cc (compiler ):
221
193
return {
222
- 'vs2013x64' : 'Visual Studio 12 2013 Win64 ' ,
194
+ 'vs2013x64' : 'Visual Studio 12 2013' ,
223
195
'vs2013x86' : 'Visual Studio 12 2013' ,
224
- 'vs2015x64' : 'Visual Studio 14 2015 Win64 ' ,
196
+ 'vs2015x64' : 'Visual Studio 14 2015' ,
225
197
'vs2015x86' : 'Visual Studio 14 2015' ,
226
- 'vs2017x64' : 'Visual Studio 15 2017 Win64 ' ,
198
+ 'vs2017x64' : 'Visual Studio 15 2017' ,
227
199
'vs2017x86' : 'Visual Studio 15 2017' ,
200
+ 'vs2019x64' : 'Visual Studio 16 2019' ,
201
+ 'vs2019x86' : 'Visual Studio 16 2019' ,
202
+ 'vs2022x64' : 'Visual Studio 17 2022' ,
203
+ 'vs2022x86' : 'Visual Studio 17 2022' ,
228
204
}.get (compiler , compiler )
205
+
206
+
207
+ def to_platform (compiler ):
208
+ return {
209
+ 'vs2013x64' : 'x64' ,
210
+ 'vs2013x86' : 'Win32' ,
211
+ 'vs2015x64' : 'x64' ,
212
+ 'vs2015x86' : 'Win32' ,
213
+ 'vs2017x64' : 'x64' ,
214
+ 'vs2017x86' : 'Win32' ,
215
+ 'vs2019x64' : 'x64' ,
216
+ 'vs2019x86' : 'Win32' ,
217
+ 'vs2022x64' : 'x64' ,
218
+ 'vs2022x86' : 'Win32' ,
219
+ }.get (compiler , compiler )
220
+
221
+
222
+ def compiler_to_vars (compiler ):
223
+ match compiler , compiler .split ('-' ):
224
+ case _, ['gcc' , * rest ]:
225
+ return {
226
+ 'CC' : '-' .join (['gcc' ] + rest ),
227
+ 'CXX' : '-' .join (['g++' ] + rest ),
228
+ }
229
+
230
+ case _, ['clang' , * rest ]:
231
+ return {
232
+ 'CC' : '-' .join (['clang' ] + rest ),
233
+ 'CXX' : '-' .join (['clang++' ] + rest ),
234
+ }
235
+
236
+ case str (vs ), _ if 'vs' in vs :
237
+ return {
238
+ 'CMAKE_GENERATOR' : to_cc (vs ),
239
+ 'CMAKE_GENERATOR_PLATFORM' : to_platform (vs ),
240
+ }
241
+
242
+ case compiler , _:
243
+ return {
244
+ 'CC' : compiler ,
245
+ 'CXX' : compiler ,
246
+ }
0 commit comments