Bug 1568460 - Set MOZ_FETCHES_DIR more appropriately. r=tomprince

For some tasks, the workdir known to the decision task doesn't actually match
the workdir used in the task, which makes MOZ_FETCHES_DIR wrong when the
decision task derives it from the workdir.

On other tasks, MOZ_FETCHES_DIR is set to a relative directory, which
may work in some places where MOZ_FETCHES_DIR is used, but not in
others, that happen to be executed from a different directory.

To solve both problems, we set MOZ_FETCHES_DIR as a relative directory
everywhere, and we make run-task normalize it to an absolute path
before executing the task.

Differential Revision: https://phabricator.services.mozilla.com/D39152

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mike Hommey 2019-07-29 20:48:40 +00:00
parent 27acd9ae77
commit 633f41e4b0
4 changed files with 12 additions and 12 deletions

View File

@ -157,7 +157,7 @@ jobs:
run:
using: run-task
sparse-profile: profile-generate
command: mv fetches build/src && cd build/src && ./taskcluster/scripts/misc/run-profileserver.sh
command: cd build/src && ./taskcluster/scripts/misc/run-profileserver.sh
win64-shippable/opt:
description: "Win64 Profile Generation"
@ -186,4 +186,4 @@ jobs:
run:
using: run-task
sparse-profile: profile-generate
command: mv fetches build/src && cd build/src && ./taskcluster/scripts/misc/run-profileserver.sh
command: cd build/src && ./taskcluster/scripts/misc/run-profileserver.sh

View File

@ -15,10 +15,10 @@ job-defaults:
by-shell:
sm:
SHELL: /bin/bash
JSSHELL: /home/cltbld/fetches/js
JSSHELL: js
v8:
SHELL: /bin/bash
JSSHELL: /home/cltbld/fetches/d8/release/d8
JSSHELL: d8/release/d8
max-run-time: 1800
treeherder:
kind: test
@ -26,7 +26,7 @@ job-defaults:
run:
using: mach
workdir: /home/cltbld
mach: jsshell-bench --perfherder={shell} --binary=$JSSHELL {test}
mach: jsshell-bench --perfherder={shell} --binary=$MOZ_FETCHES_DIR/$JSSHELL {test}
run-on-projects:
by-shell:
sm: ['mozilla-central', 'try', 'integration']

View File

@ -829,8 +829,12 @@ def main(args):
vcs_checkout_from_args(args, 'comm')
try:
if 'GECKO_PATH' in os.environ:
os.environ['GECKO_PATH'] = os.path.abspath(os.environ['GECKO_PATH'])
for k in ('GECKO_PATH', 'MOZ_FETCHES_DIR'):
if k in os.environ:
os.environ[k] = os.path.abspath(os.environ[k])
print_line(b'setup', b'%s is %s\n' % (
k.encode('utf-8'),
os.environ[k].encode('utf-8')))
if 'MOZ_FETCHES' in os.environ:
fetch_artifacts()

View File

@ -229,11 +229,7 @@ def use_fetches(config, jobs):
env = worker.setdefault('env', {})
env['MOZ_FETCHES'] = {'task-reference': json.dumps(job_fetches, sort_keys=True)}
if worker['os'] in ('windows', 'macosx'):
env.setdefault('MOZ_FETCHES_DIR', 'fetches')
else:
workdir = job['run'].get('workdir', '/builds/worker')
env.setdefault('MOZ_FETCHES_DIR', '{}/fetches'.format(workdir))
env.setdefault('MOZ_FETCHES_DIR', 'fetches')
yield job