def _run_build(factory, build, job_type, opts): """Runs the actual build. This method is the top-level driver for the build.""" workspace = factory.workspace workspace._clear_workspace_dirs() workspace._checkout_project(factory.default_project) build_script_path = workspace._resolve_build_input_file(build, '.py') script = BuildScript(factory.executor, build_script_path) if script.build_opts: if opts is None: opts = [] opts.extend(script.build_opts) context = factory.create_context(job_type, opts, script.extra_options) for project in script.extra_projects: workspace._checkout_project(project) workspace._print_project_info() workspace._check_projects() out_of_source = script.build_out_of_source or context.opts.out_of_source workspace._init_build_dir(out_of_source) if factory.default_project == Project.GROMACS: gromacs_dir = workspace.get_project_dir(Project.GROMACS) version = cmake.read_cmake_minimum_version(factory.executor, gromacs_dir) context.env._set_cmake_minimum_version(version) script.do_build(context, factory.cwd) return context
def get_actions(self): if self._branch and self._branch_projects: for project in sorted(self._branch_projects): spec = 'refs/heads/' + self._branch self._projects.override_refspec(project, RefSpec(spec)) if not self._builds: self._builds = self._default_builds for build in self._builds: build_type = build['type'] if build_type == 'matrix': self._projects.checkout_project(Project.GROMACS) matrix = get_matrix_info(self._factory, build['matrix-file']) del build['matrix-file'] build['matrix'] = matrix elif build_type in ('regtest-package', 'update-regtest-hash'): self._projects.checkout_project(Project.GROMACS) build_script_path = self._workspace._resolve_build_input_file( 'get-version-info', '.py') script = BuildScript(self._factory.executor, build_script_path) context = self._factory.create_context(JobType.GERRIT, None, None) assert not script.settings.build_opts assert not script.settings.build_out_of_source assert not script.settings.extra_options assert not script.settings.extra_projects self._workspace._init_build_dir(False) script.do_build(context, self._factory.cwd) version, md5sum = context._get_version_info() build['version'] = version build['md5sum'] = md5sum result = { 'builds': self._builds, 'revisions': self._projects.get_build_revisions() } if self._cross_verify_info: result['gerrit_info'] = self._cross_verify_info number = self._cross_verify_info['change'] patchnumber = self._cross_verify_info['patchset'] self._gerrit.post_cross_verify_start(number, patchnumber) return result
def get_actions(self): if self._branch and self._branch_projects: for project in sorted(self._branch_projects): spec = 'refs/heads/' + self._branch sha1 = self._gerrit.get_remote_hash(project, RefSpec(spec)) self._env['{0}_REFSPEC'.format(project.upper())] = spec self._env['{0}_HASH'.format(project.upper())] = sha1 if not self._builds: self._builds = self._default_builds for build in self._builds: build_type = build['type'] if build_type == 'matrix': self._workspace._checkout_project(Project.GROMACS) configs = get_build_configs(self._factory, build['matrix-file']) del build['matrix-file'] build['options'] = get_options_string(configs) elif build_type == 'update-regtest-hash': self._workspace._checkout_project(Project.GROMACS) build_script_path = self._workspace._resolve_build_input_file('get-version-info', '.py') script = BuildScript(self._factory.executor, build_script_path) context = self._factory.create_context(JobType.GERRIT, None, None) assert not script.build_opts assert not script.build_out_of_source assert not script.extra_options assert not script.extra_projects self._workspace._init_build_dir(False) script.do_build(context, self._factory.cwd) version, md5sum = context._get_version_info() build['version'] = version build['md5sum'] = md5sum result = { 'builds': self._builds } if self._env: result['env'] = self._env if self._cross_verify_info: result['gerrit_info'] = self._cross_verify_info number = self._cross_verify_info['change'] patchnumber = self._cross_verify_info['patchset'] self._gerrit.post_cross_verify_start(number, patchnumber) return result
def get_actions(self): if self._branch and self._branch_projects: for project in sorted(self._branch_projects): spec = 'refs/heads/' + self._branch self._projects.override_refspec(project, RefSpec(spec)) if not self._builds: self._builds = self._default_builds for build in self._builds: build_type = build['type'] if build_type == 'matrix': self._projects.checkout_project(Project.GROMACS) matrix = get_matrix_info(self._factory, build['matrix-file']) del build['matrix-file'] build['matrix'] = matrix elif build_type in ('regtest-package', 'update-regtest-hash'): self._projects.checkout_project(Project.GROMACS) build_script_path = self._workspace._resolve_build_input_file('get-version-info', '.py') script = BuildScript(self._factory.executor, build_script_path) context = self._factory.create_context(JobType.GERRIT, None, None) assert not script.settings.build_opts assert not script.settings.build_out_of_source assert not script.settings.extra_options assert not script.settings.extra_projects self._workspace._init_build_dir(False) script.do_build(context, self._factory.cwd) version, md5sum = context._get_version_info() build['version'] = version build['md5sum'] = md5sum result = { 'builds': self._builds, 'revisions': self._projects.get_build_revisions() } if self._cross_verify_info: result['gerrit_info'] = self._cross_verify_info number = self._cross_verify_info['change'] patchnumber = self._cross_verify_info['patchset'] self._gerrit.post_cross_verify_start(number, patchnumber) return result
def _run_build(factory, build, job_type, opts): """Runs the actual build. This method is the top-level driver for the build.""" projects = factory.projects workspace = factory.workspace workspace._clear_workspace_dirs() projects.checkout_project(factory.default_project) build_script_path = workspace._resolve_build_input_file(build, '.py') script = BuildScript(factory.executor, build_script_path) context = factory.create_context(job_type, opts, script.settings) for project in script.settings.extra_projects: projects.checkout_project(project) projects.print_project_info() projects.check_projects() out_of_source = script.settings.build_out_of_source or context.opts.out_of_source workspace._init_build_dir(out_of_source) if factory.default_project == Project.GROMACS: gromacs_dir = workspace.get_project_dir(Project.GROMACS) version = cmake.read_cmake_minimum_version(factory.executor, gromacs_dir) context.env._set_cmake_minimum_version(version) script.do_build(context, factory.cwd) return context