diff --git a/buildbot/master/files/config/factories.py b/buildbot/master/files/config/factories.py index 00e45587..aca9b747 100644 --- a/buildbot/master/files/config/factories.py +++ b/buildbot/master/files/config/factories.py @@ -59,16 +59,13 @@ class DynamicServoFactory(ServoFactory): def __init__(self, builder_name, environment): self.environment = environment self.is_windows = re.match('windows.*', builder_name) is not None - try: - config_dir = os.path.dirname(os.path.realpath(__file__)) - yaml_path = os.path.join(config_dir, 'steps.yml') - with open(yaml_path) as steps_file: - builder_steps = yaml.safe_load(steps_file) - commands = builder_steps[builder_name] - dynamic_steps = [self.make_step(command) for command in commands] - except Exception as e: # Bad step configuration, fail build - print(str(e)) - dynamic_steps = [BadConfigurationStep(e)] + self.builder_name = builder_name + config_dir = os.path.dirname(os.path.realpath(__file__)) + yaml_path = os.path.join(config_dir, 'steps.yml') + with open(yaml_path) as steps_file: + builder_steps = yaml.safe_load(steps_file) + commands = builder_steps[builder_name] + dynamic_steps = [self.make_step(command) for command in commands] pkill_step = [self.make_pkill_step("servo")] @@ -85,6 +82,13 @@ def make_step(self, command): # Add bash -l before every command on Windows builders bash_args = ["bash", "-l"] if self.is_windows else [] step_kwargs['command'] = bash_args + command + if self.is_windows: + step_env += envs.Environment({ + # Set home directory, to avoid adding `cd` command every time + 'HOME': r'C:\buildbot\slave\{}\build'.format( + self.builder_name + ), + }) step_class = steps.ShellCommand args = iter(command) @@ -109,6 +113,17 @@ def make_step(self, command): elif arg == './etc/ci/upload_nightly.sh': step_kwargs['logEnviron'] = False step_env += envs.upload_nightly + if self.is_windows: + # s3cmd on Windows only works within msys + step_env['MSYSTEM'] = 'MSYS' + step_env['PATH'] = ';'.join([ + r'C:\msys64\usr\bin', + r'C:\Windows\system32', + r'C:\Windows', + r'C:\Windows\System32\Wbem', + r'C:\Windows\System32\WindowsPowerShell\v1.0', + r'C:\Program Files\Amazon\cfn-bootstrap', + ]) step_kwargs['env'] = step_env return step_class(**step_kwargs) @@ -182,9 +197,12 @@ def make_step(self, command): # Add bash -l before every command on Windows builders bash_command = ["bash", "-l"] if self.is_windows else [] step_kwargs['command'] = bash_command + command - step_env += envs.Environment({ - # Set home directory, to avoid adding `cd` command on every command - 'HOME': r'C:\buildbot\slave\{}\build'.format(self.builder_name), + if self.is_windows: + step_env += envs.Environment({ + # Set home directory, to avoid adding `cd` command every time + 'HOME': r'C:\buildbot\slave\{}\build'.format( + self.builder_name + ), }) step_class = steps.ShellCommand @@ -210,6 +228,17 @@ def make_step(self, command): elif arg == './etc/ci/upload_nightly.sh': step_kwargs['logEnviron'] = False step_env += envs.upload_nightly + if self.is_windows: + # s3cmd on Windows only works within msys + step_env['MSYSTEM'] = 'MSYS' + step_env['PATH'] = ';'.join([ + r'C:\msys64\usr\bin', + r'C:\Windows\system32', + r'C:\Windows', + r'C:\Windows\System32\Wbem', + r'C:\Windows\System32\WindowsPowerShell\v1.0', + r'C:\Program Files\Amazon\cfn-bootstrap', + ]) step_kwargs['env'] = step_env return step_class(**step_kwargs) diff --git a/homu/files/cfg.toml b/homu/files/cfg.toml index 881cd126..be4a87e9 100644 --- a/homu/files/cfg.toml +++ b/homu/files/cfg.toml @@ -124,8 +124,8 @@ secret = "{{ pillar["homu"]["gh-webhook-secret"] }}" [repo.servo.buildbot] url = "http://build.servo.org" secret = "{{ pillar["homu"]["buildbot-secret"] }}" -builders = ["linux-dev", "linux-rel", "android", "mac-dev-unit", "mac-rel-wpt", "mac-rel-css", "arm32", "arm64", "windows"] -try_builders = ["linux-dev", "linux-rel", "android", "mac-dev-unit", "mac-rel-wpt", "mac-rel-css", "arm32", "arm64", "windows"] +builders = ["linux-dev", "linux-rel", "android", "mac-dev-unit", "mac-rel-wpt", "mac-rel-css", "arm32", "arm64", "windows-dev"] +try_builders = ["linux-dev", "linux-rel", "android", "mac-dev-unit", "mac-rel-wpt", "mac-rel-css", "arm32", "arm64", "windows-dev"] username = "{{ pillar["homu"]["buildbot-http-user"] }}" password = "{{ pillar["homu"]["buildbot-http-pass"] }}"