New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows changes to make the HOME env var work #442
Changes from all commits
File filter...
Jump to…
| @@ -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' | ||
larsbergstrom
Author
Contributor
|
||
| 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) | ||
Use another
envs.Environmenthere.