Nathaniel Manista | cbf21da | 2016-02-02 22:17:44 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python2.7 |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 2 | # Copyright 2016, Google Inc. |
| 3 | # All rights reserved. |
| 4 | # |
| 5 | # Redistribution and use in source and binary forms, with or without |
| 6 | # modification, are permitted provided that the following conditions are |
| 7 | # met: |
| 8 | # |
| 9 | # * Redistributions of source code must retain the above copyright |
| 10 | # notice, this list of conditions and the following disclaimer. |
| 11 | # * Redistributions in binary form must reproduce the above |
| 12 | # copyright notice, this list of conditions and the following disclaimer |
| 13 | # in the documentation and/or other materials provided with the |
| 14 | # distribution. |
| 15 | # * Neither the name of Google Inc. nor the names of its |
| 16 | # contributors may be used to endorse or promote products derived from |
| 17 | # this software without specific prior written permission. |
| 18 | # |
| 19 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 20 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 21 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | |
| 31 | """Definition of targets to build artifacts.""" |
| 32 | |
Masood Malekghassemi | 0e12875 | 2016-07-15 14:36:54 -0700 | [diff] [blame] | 33 | import os.path |
| 34 | import sys |
| 35 | |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 36 | import jobset |
| 37 | |
| 38 | |
| 39 | def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={}, |
Masood Malekghassemi | 027835f | 2016-07-15 22:31:50 -0700 | [diff] [blame^] | 40 | flake_retries=0, timeout_retries=0, timeout_seconds=30*60): |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 41 | """Creates jobspec for a task running under docker.""" |
| 42 | environ = environ.copy() |
| 43 | environ['RUN_COMMAND'] = shell_command |
| 44 | |
| 45 | docker_args=[] |
| 46 | for k,v in environ.iteritems(): |
| 47 | docker_args += ['-e', '%s=%s' % (k, v)] |
| 48 | docker_env = {'DOCKERFILE_DIR': dockerfile_dir, |
Jan Tattermusch | 9835d4b | 2016-04-29 15:05:05 -0700 | [diff] [blame] | 49 | 'DOCKER_RUN_SCRIPT': 'tools/run_tests/dockerize/docker_run.sh', |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 50 | 'OUTPUT_DIR': 'artifacts'} |
| 51 | jobspec = jobset.JobSpec( |
Jan Tattermusch | 9835d4b | 2016-04-29 15:05:05 -0700 | [diff] [blame] | 52 | cmdline=['tools/run_tests/dockerize/build_and_run_docker.sh'] + docker_args, |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 53 | environ=docker_env, |
| 54 | shortname='build_artifact.%s' % (name), |
Masood Malekghassemi | 027835f | 2016-07-15 22:31:50 -0700 | [diff] [blame^] | 55 | timeout_seconds=timeout_seconds, |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 56 | flake_retries=flake_retries, |
| 57 | timeout_retries=timeout_retries) |
| 58 | return jobspec |
| 59 | |
| 60 | |
| 61 | def create_jobspec(name, cmdline, environ=None, shell=False, |
Masood Malekghassemi | 027835f | 2016-07-15 22:31:50 -0700 | [diff] [blame^] | 62 | flake_retries=0, timeout_retries=0, timeout_seconds=30*60): |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 63 | """Creates jobspec.""" |
| 64 | jobspec = jobset.JobSpec( |
| 65 | cmdline=cmdline, |
| 66 | environ=environ, |
| 67 | shortname='build_artifact.%s' % (name), |
Masood Malekghassemi | 027835f | 2016-07-15 22:31:50 -0700 | [diff] [blame^] | 68 | timeout_seconds=timeout_seconds, |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 69 | flake_retries=flake_retries, |
| 70 | timeout_retries=timeout_retries, |
| 71 | shell=shell) |
| 72 | return jobspec |
| 73 | |
| 74 | |
Jan Tattermusch | e046f71 | 2016-02-18 16:06:10 -0800 | [diff] [blame] | 75 | _MACOS_COMPAT_FLAG = '-mmacosx-version-min=10.7' |
| 76 | |
| 77 | _ARCH_FLAG_MAP = { |
| 78 | 'x86': '-m32', |
| 79 | 'x64': '-m64' |
| 80 | } |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 81 | |
Masood Malekghassemi | 0e12875 | 2016-07-15 14:36:54 -0700 | [diff] [blame] | 82 | python_windows_version_arch_map = { |
| 83 | ('x86', '2.7'): 'Python27_32bits', |
| 84 | ('x64', '2.7'): 'Python27', |
| 85 | ('x86', '3.4'): 'Python34_32bits', |
| 86 | ('x64', '3.4'): 'Python34', |
Nicolas "Pixel" Noble | 6a4e473 | 2016-02-20 01:30:57 +0100 | [diff] [blame] | 87 | } |
| 88 | |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 89 | class PythonArtifact: |
| 90 | """Builds Python artifacts.""" |
| 91 | |
Masood Malekghassemi | 0e12875 | 2016-07-15 14:36:54 -0700 | [diff] [blame] | 92 | def __init__(self, platform, arch, python_version, manylinux_build=None): |
Masood Malekghassemi | 010eb48 | 2016-05-03 15:59:40 -0700 | [diff] [blame] | 93 | if manylinux_build: |
Masood Malekghassemi | 0e12875 | 2016-07-15 14:36:54 -0700 | [diff] [blame] | 94 | self.name = 'python%s_%s_%s_%s' % (python_version, platform, arch, manylinux_build) |
Masood Malekghassemi | 010eb48 | 2016-05-03 15:59:40 -0700 | [diff] [blame] | 95 | else: |
Masood Malekghassemi | 0e12875 | 2016-07-15 14:36:54 -0700 | [diff] [blame] | 96 | self.name = 'python%s_%s_%s' % (python_version, platform, arch) |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 97 | self.platform = platform |
| 98 | self.arch = arch |
Masood Malekghassemi | 0e12875 | 2016-07-15 14:36:54 -0700 | [diff] [blame] | 99 | self.labels = ['artifact', 'python', python_version, platform, arch] |
| 100 | self.python_version = python_version |
| 101 | self.python_windows_prefix = python_windows_version_arch_map[arch, python_version] |
Masood Malekghassemi | 010eb48 | 2016-05-03 15:59:40 -0700 | [diff] [blame] | 102 | self.manylinux_build = manylinux_build |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 103 | |
| 104 | def pre_build_jobspecs(self): |
Masood Malekghassemi | 0e12875 | 2016-07-15 14:36:54 -0700 | [diff] [blame] | 105 | return [] |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 106 | |
| 107 | def build_jobspec(self): |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 108 | environ = {} |
| 109 | if self.platform == 'linux': |
| 110 | if self.arch == 'x86': |
| 111 | environ['SETARCH_CMD'] = 'linux32' |
Masood Malekghassemi | 010eb48 | 2016-05-03 15:59:40 -0700 | [diff] [blame] | 112 | # Inside the manylinux container, the python installations are located in |
| 113 | # special places... |
| 114 | environ['PYTHON'] = '/opt/python/{}/bin/python'.format(self.manylinux_build) |
| 115 | environ['PIP'] = '/opt/python/{}/bin/pip'.format(self.manylinux_build) |
Masood Malekghassemi | 010eb48 | 2016-05-03 15:59:40 -0700 | [diff] [blame] | 116 | environ['SKIP_PIP_INSTALL'] = '1' |
| 117 | # Platform autodetection for the manylinux1 image breaks so we set the |
| 118 | # defines ourselves. |
| 119 | # TODO(atash) get better platform-detection support in core so we don't |
| 120 | # need to do this manually... |
Masood Malekghassemi | f4c70ca | 2016-05-05 19:14:05 -0700 | [diff] [blame] | 121 | environ['CFLAGS'] = '-DGPR_MANYLINUX1=1' |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 122 | return create_docker_jobspec(self.name, |
Masood Malekghassemi | 010eb48 | 2016-05-03 15:59:40 -0700 | [diff] [blame] | 123 | 'tools/dockerfile/grpc_artifact_python_manylinux_%s' % self.arch, |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 124 | 'tools/run_tests/build_artifact_python.sh', |
Masood Malekghassemi | 027835f | 2016-07-15 22:31:50 -0700 | [diff] [blame^] | 125 | environ=environ, |
| 126 | timeout_seconds=60*60) |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 127 | elif self.platform == 'windows': |
| 128 | return create_jobspec(self.name, |
Nicolas "Pixel" Noble | 6a4e473 | 2016-02-20 01:30:57 +0100 | [diff] [blame] | 129 | ['tools\\run_tests\\build_artifact_python.bat', |
Masood Malekghassemi | 0e12875 | 2016-07-15 14:36:54 -0700 | [diff] [blame] | 130 | self.python_windows_prefix, |
Masood Malekghassemi | 751fbb0 | 2016-05-04 16:12:56 -0700 | [diff] [blame] | 131 | '32' if self.arch == 'x86' else '64' |
Nicolas "Pixel" Noble | 6a4e473 | 2016-02-20 01:30:57 +0100 | [diff] [blame] | 132 | ], |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 133 | shell=True) |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 134 | else: |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 135 | environ['SKIP_PIP_INSTALL'] = 'TRUE' |
Masood Malekghassemi | 0e12875 | 2016-07-15 14:36:54 -0700 | [diff] [blame] | 136 | environ['PYTHON'] = 'python{}'.format(self.python_version) |
Nicolas "Pixel" Noble | de808bb | 2016-02-18 01:13:14 +0100 | [diff] [blame] | 137 | return create_jobspec(self.name, |
| 138 | ['tools/run_tests/build_artifact_python.sh'], |
| 139 | environ=environ) |
Jan Tattermusch | 8640f92 | 2016-02-01 18:58:46 -0800 | [diff] [blame] | 140 | |
| 141 | def __str__(self): |
| 142 | return self.name |
| 143 | |
| 144 | |
Jan Tattermusch | 4437213 | 2016-02-01 16:20:03 -0800 | [diff] [blame] | 145 | class RubyArtifact: |
| 146 | """Builds ruby native gem.""" |
| 147 | |
| 148 | def __init__(self, platform, arch): |
| 149 | self.name = 'ruby_native_gem_%s_%s' % (platform, arch) |
| 150 | self.platform = platform |
| 151 | self.arch = arch |
| 152 | self.labels = ['artifact', 'ruby', platform, arch] |
| 153 | |
| 154 | def pre_build_jobspecs(self): |
| 155 | return [] |
| 156 | |
| 157 | def build_jobspec(self): |
| 158 | if self.platform == 'windows': |
| 159 | raise Exception("Not supported yet") |
| 160 | else: |
| 161 | if self.platform == 'linux': |
| 162 | environ = {} |
| 163 | if self.arch == 'x86': |
Jan Tattermusch | 7cf8bf4 | 2016-02-03 13:41:07 -0800 | [diff] [blame] | 164 | environ['SETARCH_CMD'] = 'linux32' |
Jan Tattermusch | 4437213 | 2016-02-01 16:20:03 -0800 | [diff] [blame] | 165 | return create_docker_jobspec(self.name, |
| 166 | 'tools/dockerfile/grpc_artifact_linux_%s' % self.arch, |
| 167 | 'tools/run_tests/build_artifact_ruby.sh', |
| 168 | environ=environ) |
| 169 | else: |
| 170 | return create_jobspec(self.name, |
| 171 | ['tools/run_tests/build_artifact_ruby.sh']) |
| 172 | |
| 173 | |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 174 | class CSharpExtArtifact: |
| 175 | """Builds C# native extension library""" |
| 176 | |
| 177 | def __init__(self, platform, arch): |
| 178 | self.name = 'csharp_ext_%s_%s' % (platform, arch) |
| 179 | self.platform = platform |
| 180 | self.arch = arch |
| 181 | self.labels = ['artifact', 'csharp', platform, arch] |
| 182 | |
| 183 | def pre_build_jobspecs(self): |
| 184 | if self.platform == 'windows': |
| 185 | return [create_jobspec('prebuild_%s' % self.name, |
| 186 | ['tools\\run_tests\\pre_build_c.bat'], |
| 187 | shell=True, |
| 188 | flake_retries=5, |
| 189 | timeout_retries=2)] |
| 190 | else: |
| 191 | return [] |
| 192 | |
| 193 | def build_jobspec(self): |
| 194 | if self.platform == 'windows': |
| 195 | msbuild_platform = 'Win32' if self.arch == 'x86' else self.arch |
| 196 | return create_jobspec(self.name, |
| 197 | ['tools\\run_tests\\build_artifact_csharp.bat', |
| 198 | 'vsprojects\\grpc_csharp_ext.sln', |
| 199 | '/p:Configuration=Release', |
| 200 | '/p:PlatformToolset=v120', |
| 201 | '/p:Platform=%s' % msbuild_platform], |
| 202 | shell=True) |
| 203 | else: |
| 204 | environ = {'CONFIG': 'opt', |
| 205 | 'EMBED_OPENSSL': 'true', |
Craig Tiller | 71ea4a1 | 2016-02-04 15:06:41 -0800 | [diff] [blame] | 206 | 'EMBED_ZLIB': 'true', |
Jan Tattermusch | 60cbec7 | 2016-02-26 13:47:16 -0800 | [diff] [blame] | 207 | 'CFLAGS': '-DGPR_BACKWARDS_COMPATIBILITY_MODE', |
| 208 | 'LDFLAGS': ''} |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 209 | if self.platform == 'linux': |
| 210 | return create_docker_jobspec(self.name, |
| 211 | 'tools/dockerfile/grpc_artifact_linux_%s' % self.arch, |
Jan Tattermusch | 60cbec7 | 2016-02-26 13:47:16 -0800 | [diff] [blame] | 212 | 'tools/run_tests/build_artifact_csharp.sh', |
| 213 | environ=environ) |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 214 | else: |
Jan Tattermusch | 60cbec7 | 2016-02-26 13:47:16 -0800 | [diff] [blame] | 215 | archflag = _ARCH_FLAG_MAP[self.arch] |
| 216 | environ['CFLAGS'] += ' %s %s' % (archflag, _MACOS_COMPAT_FLAG) |
| 217 | environ['LDFLAGS'] += ' %s' % archflag |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 218 | return create_jobspec(self.name, |
| 219 | ['tools/run_tests/build_artifact_csharp.sh'], |
| 220 | environ=environ) |
| 221 | |
| 222 | def __str__(self): |
| 223 | return self.name |
| 224 | |
Jan Tattermusch | e046f71 | 2016-02-18 16:06:10 -0800 | [diff] [blame] | 225 | |
murgatroid99 | 673f65b | 2016-02-01 11:19:07 -0800 | [diff] [blame] | 226 | node_gyp_arch_map = { |
| 227 | 'x86': 'ia32', |
| 228 | 'x64': 'x64' |
| 229 | } |
| 230 | |
| 231 | class NodeExtArtifact: |
| 232 | """Builds Node native extension""" |
| 233 | |
| 234 | def __init__(self, platform, arch): |
| 235 | self.name = 'node_ext_{0}_{1}'.format(platform, arch) |
| 236 | self.platform = platform |
| 237 | self.arch = arch |
| 238 | self.gyp_arch = node_gyp_arch_map[arch] |
| 239 | self.labels = ['artifact', 'node', platform, arch] |
| 240 | |
| 241 | def pre_build_jobspecs(self): |
| 242 | return [] |
| 243 | |
| 244 | def build_jobspec(self): |
| 245 | if self.platform == 'windows': |
| 246 | return create_jobspec(self.name, |
| 247 | ['tools\\run_tests\\build_artifact_node.bat', |
| 248 | self.gyp_arch], |
| 249 | shell=True) |
| 250 | else: |
| 251 | if self.platform == 'linux': |
| 252 | return create_docker_jobspec( |
| 253 | self.name, |
| 254 | 'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch), |
| 255 | 'tools/run_tests/build_artifact_node.sh {}'.format(self.gyp_arch)) |
| 256 | else: |
| 257 | return create_jobspec(self.name, |
| 258 | ['tools/run_tests/build_artifact_node.sh', |
| 259 | self.gyp_arch]) |
| 260 | |
Stanley Cheung | bf74d69 | 2016-02-23 22:39:25 -0800 | [diff] [blame] | 261 | class PHPArtifact: |
| 262 | """Builds PHP PECL package""" |
Stanley Cheung | 5adb71f | 2016-02-13 00:03:02 -0800 | [diff] [blame] | 263 | |
| 264 | def __init__(self, platform, arch): |
Stanley Cheung | bf74d69 | 2016-02-23 22:39:25 -0800 | [diff] [blame] | 265 | self.name = 'php_pecl_package_{0}_{1}'.format(platform, arch) |
Stanley Cheung | 5adb71f | 2016-02-13 00:03:02 -0800 | [diff] [blame] | 266 | self.platform = platform |
| 267 | self.arch = arch |
| 268 | self.labels = ['artifact', 'php', platform, arch] |
| 269 | |
| 270 | def pre_build_jobspecs(self): |
| 271 | return [] |
| 272 | |
| 273 | def build_jobspec(self): |
Stanley Cheung | 80db5be | 2016-02-24 21:35:56 -0800 | [diff] [blame] | 274 | if self.platform == 'linux': |
| 275 | return create_docker_jobspec( |
| 276 | self.name, |
| 277 | 'tools/dockerfile/grpc_artifact_linux_{}'.format(self.arch), |
| 278 | 'tools/run_tests/build_artifact_php.sh') |
| 279 | else: |
| 280 | return create_jobspec(self.name, |
| 281 | ['tools/run_tests/build_artifact_php.sh']) |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 282 | |
Jan Tattermusch | e046f71 | 2016-02-18 16:06:10 -0800 | [diff] [blame] | 283 | class ProtocArtifact: |
| 284 | """Builds protoc and protoc-plugin artifacts""" |
| 285 | |
| 286 | def __init__(self, platform, arch): |
| 287 | self.name = 'protoc_%s_%s' % (platform, arch) |
| 288 | self.platform = platform |
| 289 | self.arch = arch |
| 290 | self.labels = ['artifact', 'protoc', platform, arch] |
| 291 | |
| 292 | def pre_build_jobspecs(self): |
| 293 | return [] |
| 294 | |
| 295 | def build_jobspec(self): |
| 296 | if self.platform != 'windows': |
| 297 | cxxflags = '-DNDEBUG %s' % _ARCH_FLAG_MAP[self.arch] |
Jan Tattermusch | e7b7d86 | 2016-02-19 09:49:35 -0800 | [diff] [blame] | 298 | ldflags = '%s' % _ARCH_FLAG_MAP[self.arch] |
| 299 | if self.platform != 'macos': |
Jan Tattermusch | 07591a5 | 2016-02-19 10:28:24 -0800 | [diff] [blame] | 300 | ldflags += ' -static-libgcc -static-libstdc++ -s' |
Jan Tattermusch | e046f71 | 2016-02-18 16:06:10 -0800 | [diff] [blame] | 301 | environ={'CONFIG': 'opt', |
| 302 | 'CXXFLAGS': cxxflags, |
| 303 | 'LDFLAGS': ldflags, |
| 304 | 'PROTOBUF_LDFLAGS_EXTRA': ldflags} |
| 305 | if self.platform == 'linux': |
| 306 | return create_docker_jobspec(self.name, |
| 307 | 'tools/dockerfile/grpc_artifact_protoc', |
| 308 | 'tools/run_tests/build_artifact_protoc.sh', |
| 309 | environ=environ) |
| 310 | else: |
Jan Tattermusch | e7b7d86 | 2016-02-19 09:49:35 -0800 | [diff] [blame] | 311 | environ['CXXFLAGS'] += ' -std=c++11 -stdlib=libc++ %s' % _MACOS_COMPAT_FLAG |
Jan Tattermusch | e046f71 | 2016-02-18 16:06:10 -0800 | [diff] [blame] | 312 | return create_jobspec(self.name, |
| 313 | ['tools/run_tests/build_artifact_protoc.sh'], |
| 314 | environ=environ) |
| 315 | else: |
Jan Tattermusch | 6d15982 | 2016-02-19 16:03:22 -0800 | [diff] [blame] | 316 | generator = 'Visual Studio 12 Win64' if self.arch == 'x64' else 'Visual Studio 12' |
| 317 | vcplatform = 'x64' if self.arch == 'x64' else 'Win32' |
| 318 | return create_jobspec(self.name, |
| 319 | ['tools\\run_tests\\build_artifact_protoc.bat'], |
| 320 | environ={'generator': generator, |
| 321 | 'Platform': vcplatform}) |
Jan Tattermusch | e046f71 | 2016-02-18 16:06:10 -0800 | [diff] [blame] | 322 | |
| 323 | def __str__(self): |
| 324 | return self.name |
| 325 | |
| 326 | |
Jan Tattermusch | be538a1 | 2016-01-28 14:58:15 -0800 | [diff] [blame] | 327 | def targets(): |
| 328 | """Gets list of supported targets""" |
murgatroid99 | 41a9e83 | 2016-02-03 09:47:35 -0800 | [diff] [blame] | 329 | return ([Cls(platform, arch) |
Jan Tattermusch | 6d15982 | 2016-02-19 16:03:22 -0800 | [diff] [blame] | 330 | for Cls in (CSharpExtArtifact, NodeExtArtifact, ProtocArtifact) |
murgatroid99 | 41a9e83 | 2016-02-03 09:47:35 -0800 | [diff] [blame] | 331 | for platform in ('linux', 'macos', 'windows') |
| 332 | for arch in ('x86', 'x64')] + |
Masood Malekghassemi | 0e12875 | 2016-07-15 14:36:54 -0700 | [diff] [blame] | 333 | [PythonArtifact('linux', 'x86', '2.7', 'cp27-cp27m'), |
| 334 | PythonArtifact('linux', 'x86', '2.7', 'cp27-cp27mu'), |
| 335 | PythonArtifact('linux', 'x64', '2.7', 'cp27-cp27m'), |
| 336 | PythonArtifact('linux', 'x64', '2.7', 'cp27-cp27mu'), |
| 337 | PythonArtifact('macos', 'x64', '2.7'), |
| 338 | PythonArtifact('windows', 'x86', '2.7'), |
| 339 | PythonArtifact('windows', 'x64', '2.7'), |
| 340 | PythonArtifact('linux', 'x86', '3.4', 'cp34-cp34m'), |
| 341 | PythonArtifact('linux', 'x64', '3.4', 'cp34-cp34m'), |
| 342 | PythonArtifact('macos', 'x64', '3.4'), |
| 343 | PythonArtifact('windows', 'x86', '3.4'), |
| 344 | PythonArtifact('windows', 'x64', '3.4'), |
murgatroid99 | 41a9e83 | 2016-02-03 09:47:35 -0800 | [diff] [blame] | 345 | RubyArtifact('linux', 'x86'), |
murgatroid99 | 33c808b | 2016-02-03 15:27:41 -0800 | [diff] [blame] | 346 | RubyArtifact('linux', 'x64'), |
Stanley Cheung | 5adb71f | 2016-02-13 00:03:02 -0800 | [diff] [blame] | 347 | RubyArtifact('macos', 'x64'), |
Stanley Cheung | bf74d69 | 2016-02-23 22:39:25 -0800 | [diff] [blame] | 348 | PHPArtifact('linux', 'x64'), |
| 349 | PHPArtifact('macos', 'x64')]) |