Skip to content
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

Merged
merged 1 commit into from Jul 20, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -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'

This comment has been minimized.

Copy link
@aneeshusa

aneeshusa Jul 20, 2016

Member

Use another envs.Environment here.

This comment has been minimized.

Copy link
@larsbergstrom

larsbergstrom Jul 20, 2016

Author Contributor

hrm, when I was using envs.Environment, the debugging seemed to indicate that it wasn't overwriting it - we were still getting the old value in testing. I can give it another try, though, and see what happens.

This comment has been minimized.

Copy link
@aneeshusa

aneeshusa Jul 20, 2016

Member

This is a stylistic change we can always make later, so I'm OK with this as-is if we need the PR for windows nightlies now.

This comment has been minimized.

Copy link
@larsbergstrom

larsbergstrom Jul 20, 2016

Author Contributor

Yeah, it's already in deployment as-formatted, so I'm kinda tempted to get this landed (since I already feel bad about having an ad-hoc branch in production).

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)
@@ -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"] }}"

ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.