|
1 | 1 | from config_generator.components.funcs.compile import Compile
|
2 | 2 | from config_generator.components.funcs.install_uv import InstallUV
|
3 |
| -from config_generator.components.funcs.fetch_c_driver_source import FetchCDriverSource |
| 3 | +from config_generator.components.funcs.install_c_driver import InstallCDriver |
4 | 4 | from config_generator.components.funcs.setup import Setup
|
5 | 5 |
|
6 |
| -from config_generator.etc.distros import find_large_distro, make_distro_str |
| 6 | +from config_generator.etc.distros import compiler_to_vars, find_large_distro, make_distro_str |
7 | 7 |
|
8 |
| -from shrub.v3.evg_build_variant import BuildVariant |
| 8 | +from shrub.v3.evg_build_variant import BuildVariant, DisplayTask |
| 9 | +from shrub.v3.evg_command import KeyValueParam, expansions_update |
9 | 10 | from shrub.v3.evg_task import EvgTask, EvgTaskRef
|
10 | 11 |
|
11 | 12 | from itertools import product
|
|
17 | 18 | # pylint: disable=line-too-long
|
18 | 19 | # fmt: off
|
19 | 20 | MATRIX = [
|
20 |
| - ('rhel79', None, ['Release'], ['shared'], ['impls']), |
| 21 | + ('rhel80', 'gcc', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]), |
| 22 | + ('rhel80', 'clang', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]), |
21 | 23 |
|
22 |
| - ('rhel81-power8', None, ['Release'], ['shared'], [None]), |
23 |
| - ('rhel83-zseries', None, ['Release'], ['shared'], [None]), |
| 24 | + ('ubuntu2004-arm64', 'gcc', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]), |
| 25 | + ('ubuntu2004-arm64', 'clang', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]), |
24 | 26 |
|
25 |
| - ('ubuntu2004', None, ['Debug'], ['shared'], [None]), |
26 |
| - ('ubuntu2004', 'gcc', ['Debug'], ['shared'], [None]), |
27 |
| - ('ubuntu2004', 'clang', ['Debug'], ['shared'], [None]), |
| 27 | + ('rhel8-power', None, ['Debug', 'Release'], ['shared', 'static'], [11, 17]), |
| 28 | + ('rhel8-zseries', None, ['Debug', 'Release'], ['shared', 'static'], [11, 17]), |
28 | 29 |
|
29 |
| - ('windows-64-vs2015', 'vs2015x64', ['Debug', 'Release'], ['shared'], [None]), |
30 |
| - ('windows-vsCurrent', 'vs2017x64', ['Debug', 'Release'], ['shared'], [None]), |
31 |
| - ('windows-vsCurrent', 'vs2019x64', ['Debug', 'Release'], ['shared'], [None]), |
32 |
| - ('windows-vsCurrent', 'vs2022x64', ['Debug', 'Release'], ['shared'], [None]), |
| 30 | + ('macos-14-arm64', None, ['Debug', 'Release'], ['shared', 'static'], [11, 17]), |
| 31 | + ('macos-14', None, ['Debug', 'Release'], ['shared', 'static'], [11, 17]), |
| 32 | + |
| 33 | + ('windows-64-vs2015', 'vs2015x64', ['Debug', 'Release'], ['shared', 'static'], [11, ]), # CXX-3215 |
| 34 | + ('windows-vsCurrent', 'vs2017x64', ['Debug', 'Release'], ['shared', 'static'], [11, 17, ]), |
| 35 | + ('windows-vsCurrent', 'vs2019x64', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, ]), |
| 36 | + ('windows-vsCurrent', 'vs2022x64', ['Debug', 'Release'], ['shared', 'static'], [11, 17, 20, 23]), |
33 | 37 | ]
|
34 | 38 | # fmt: on
|
35 | 39 | # pylint: enable=line-too-long
|
36 | 40 |
|
37 | 41 |
|
38 |
| -def generate_tasks(): |
39 |
| - res = [] |
40 |
| - |
41 |
| - for distro_name, compiler, build_types, link_types, polyfills in MATRIX: |
42 |
| - for build_type, link_type, polyfill in product(build_types, link_types, polyfills): |
| 42 | +def tasks(): |
| 43 | + for distro_name, compiler, build_types, link_types, cxx_standards in MATRIX: |
| 44 | + for build_type, link_type, cxx_standard in product(build_types, link_types, cxx_standards): |
43 | 45 | distro = find_large_distro(distro_name)
|
44 | 46 |
|
45 | 47 | name = f'{TAG}-{make_distro_str(distro_name, compiler, None)}'
|
46 | 48 | tags = [TAG, distro_name]
|
47 | 49 |
|
| 50 | + if cxx_standard is not None: |
| 51 | + name += f'-cxx{cxx_standard}' |
| 52 | + tags += [f'cxx{cxx_standard}'] |
| 53 | + |
48 | 54 | if compiler is not None:
|
49 | 55 | tags.append(compiler)
|
50 | 56 |
|
51 | 57 | name += f'-{build_type.lower()}-{link_type}'
|
52 | 58 | tags += [build_type.lower(), link_type]
|
53 | 59 |
|
54 |
| - if polyfill is not None: |
55 |
| - name += f'-{polyfill}' |
56 |
| - tags.append(polyfill) |
| 60 | + updates = [] |
| 61 | + compile_vars = {} |
| 62 | + |
| 63 | + updates += [KeyValueParam(key='build_type', value=build_type)] |
| 64 | + updates += [KeyValueParam(key=key, value=value) for key, value in compiler_to_vars(compiler).items()] |
57 | 65 |
|
58 |
| - patchable = None |
| 66 | + if cxx_standard is not None: |
| 67 | + compile_vars |= {'REQUIRED_CXX_STANDARD': cxx_standard} |
| 68 | + |
| 69 | + if link_type == 'static': |
| 70 | + compile_vars |= {'USE_STATIC_LIBS': 1} |
59 | 71 |
|
60 | 72 | # PowerPC and zSeries are limited resources.
|
61 |
| - if any(pattern in distro_name for pattern in ['power8', 'zseries']): |
62 |
| - patchable = False |
63 |
| - |
64 |
| - # In etc/calc_release_version.py: |
65 |
| - # error: unknown option `format=...' |
66 |
| - # usage: git tag ... |
67 |
| - # or: ... |
68 |
| - if distro_name == 'rhel79': |
69 |
| - patchable = False |
70 |
| - |
71 |
| - res.append( |
72 |
| - EvgTask( |
73 |
| - name=name, |
74 |
| - tags=tags, |
75 |
| - run_on=distro.name, |
76 |
| - patchable=patchable, |
77 |
| - commands=[ |
78 |
| - Setup.call(), |
79 |
| - FetchCDriverSource.call(), |
80 |
| - ] + ( |
81 |
| - # DEVPROD-13875 + astral-sh/uv/issues/10231. |
82 |
| - [] if "vs2015" in distro_name else [InstallUV.call()] |
83 |
| - ) + [ |
84 |
| - Compile.call( |
85 |
| - build_type=build_type, |
86 |
| - compiler=compiler, |
87 |
| - polyfill=polyfill, |
88 |
| - ) |
89 |
| - ], |
| 73 | + patchable = False if any(pattern in distro_name for pattern in ['power', 'zseries']) else None |
| 74 | + |
| 75 | + commands = [expansions_update(updates=updates)] if updates else [] |
| 76 | + commands += [ |
| 77 | + Setup.call(), |
| 78 | + InstallCDriver.call(), |
| 79 | + ] + ( |
| 80 | + # DEVPROD-13875 + astral-sh/uv/issues/10231. |
| 81 | + [] if "vs2015" in distro_name else [InstallUV.call()] |
| 82 | + ) + [ |
| 83 | + Compile.call( |
| 84 | + build_type=build_type, |
| 85 | + compiler=compiler, |
90 | 86 | )
|
| 87 | + ] |
| 88 | + |
| 89 | + yield EvgTask( |
| 90 | + name=name, |
| 91 | + tags=tags, |
| 92 | + run_on=distro.name, |
| 93 | + patchable=patchable, |
| 94 | + commands=commands, |
91 | 95 | )
|
92 | 96 |
|
93 |
| - return res |
94 |
| - |
95 |
| - |
96 |
| -TASKS = generate_tasks() |
97 |
| - |
98 |
| - |
99 |
| -def tasks(): |
100 |
| - res = TASKS.copy() |
101 |
| - |
102 |
| - # PowerPC and zSeries are limited resources. |
103 |
| - for task in res: |
104 |
| - if any(pattern in task.run_on for pattern in ["power8", "zseries"]): |
105 |
| - task.patchable = False |
106 |
| - |
107 |
| - return res |
108 |
| - |
109 | 97 |
|
110 | 98 | def variants():
|
111 | 99 | tasks = []
|
112 | 100 |
|
113 | 101 | one_day = 1440 # Seconds.
|
114 | 102 |
|
115 | 103 | # PowerPC and zSeries are limited resources.
|
116 |
| - tasks = [ |
117 |
| - EvgTaskRef(name=f'.{TAG} .rhel81-power8', batchtime=one_day), |
118 |
| - EvgTaskRef(name=f'.{TAG} .rhel83-zseries', batchtime=one_day), |
119 |
| - EvgTaskRef(name=f'.{TAG} !.rhel81-power8 !.rhel83-zseries'), |
| 104 | + limited_distros = [ |
| 105 | + 'rhel8-power', |
| 106 | + 'rhel8-zseries', |
120 | 107 | ]
|
121 | 108 |
|
122 |
| - return [ |
123 |
| - BuildVariant( |
124 |
| - name=f'{TAG}-matrix', |
125 |
| - display_name=f'{TAG}-matrix', |
126 |
| - tasks=tasks, |
127 |
| - ), |
| 109 | + distros = sorted(list({entry[0] for entry in MATRIX})) |
| 110 | + batched = [distro for distro in distros if distro in limited_distros] |
| 111 | + tasks = [ |
| 112 | + EvgTaskRef(name=f'.{TAG} .{distro}', batchtime=one_day) for distro in batched |
| 113 | + ] + [ |
| 114 | + EvgTaskRef(name=f'.{TAG}' + ''.join(f' !.{distro}' for distro in batched)) |
128 | 115 | ]
|
| 116 | + |
| 117 | + yield BuildVariant( |
| 118 | + name=f'{TAG}-matrix', |
| 119 | + display_name=f'{TAG}-matrix', |
| 120 | + tasks=tasks, |
| 121 | + display_tasks=[ |
| 122 | + DisplayTask( |
| 123 | + name=f'{TAG}-matrix', |
| 124 | + execution_tasks=[f'.{TAG}' + ''.join(f' !.{distro}' for distro in batched)], |
| 125 | + ) |
| 126 | + ], |
| 127 | + ) |
0 commit comments