Skip to content

Commit

Permalink
Bug 1570798 - Restore relative path for MOZ_FETCHES_DIR. r=nalexander
Browse files Browse the repository at this point in the history
Bug 1563711 changed MOZ_FETCHES_DIR to make the MOZ_ANDROID_FAT_AAR_*
environment variables absolute paths. Unfortunately, the replacement
relies on non-osx/windows tasks to run in docker-worker, which is not
necessarily true, and that makes the MOZ_FETCHES_DIR wrong in
non-osx/windows generic-worker tasks.  Apparently, that currently works,
but that's not guaranteed to stay this way.

The MOZ_ANDROID_FAT_AAR_* environment variables don't need to be
absolute paths, though. MOZ_FETCHES_DIR is normalized by run-task, and
MOZ_ANDROID_FAT_AAR_* can be set relative to that, which we do here.

Differential Revision: https://phabricator.services.mozilla.com/D40334
  • Loading branch information
glandium committed Aug 2, 2019
1 parent 52ef3aa commit 4017571
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
8 changes: 4 additions & 4 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ endif
ifdef MOZ_ANDROID_FAT_AAR_ARCHITECTURES
recurse_android-fat-aar-artifact:
$(call py_action,fat_aar,\
$(if $(MOZ_ANDROID_FAT_AAR_ARMEABI_V7A),--armeabi-v7a $(MOZ_ANDROID_FAT_AAR_ARMEABI_V7A)) \
$(if $(MOZ_ANDROID_FAT_AAR_ARM64_V8A),--arm64-v8a $(MOZ_ANDROID_FAT_AAR_ARM64_V8A)) \
$(if $(MOZ_ANDROID_FAT_AAR_X86),--x86 $(MOZ_ANDROID_FAT_AAR_X86)) \
$(if $(MOZ_ANDROID_FAT_AAR_X86_64),--x86-64 $(MOZ_ANDROID_FAT_AAR_X86_64)) \
$(addprefix --armeabi-v7a $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_ARMEABI_V7A)) \
$(addprefix --arm64-v8a $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_ARM64_V8A)) \
$(addprefix --x86 $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_X86)) \
$(addprefix --x86-64 $(MOZ_FETCHES_DIR)/,$(MOZ_ANDROID_FAT_AAR_X86_64)) \
--distdir $(abspath $(DIST)/fat-aar))
endif

Expand Down
4 changes: 2 additions & 2 deletions taskcluster/docs/kinds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ If you want to run this task locally, you need to specify these environment vari
- MOZ_ANDROID_FAT_AAR_ARCHITECTURES: must be a comma-separated list of architecture.
Eg: "armeabi-v7a,arm64-v8a,x86,x86_64".
- each of MOZ_ANDROID_FAT_AAR_ARM64_V8A, MOZ_ANDROID_FAT_AAR_ARMEABI_V7A,
MOZ_ANDROID_FAT_AAR_X86, MOZ_ANDROID_FAT_AAR_X86_64 must be an absolute path to the
architecture-specific AAR.
MOZ_ANDROID_FAT_AAR_X86, MOZ_ANDROID_FAT_AAR_X86_64 must be a path relative to
MOZ_FETCHES_DIR.

build-signing
-------------
Expand Down
6 changes: 1 addition & 5 deletions taskcluster/taskgraph/transforms/build_fat_aar.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
from __future__ import absolute_import, print_function, unicode_literals

import copy
import os

from taskgraph.transforms.base import TransformSequence
from taskgraph.transforms.job import get_default_moz_fetches_dir
from taskgraph.util.declarative_artifacts import get_geckoview_upstream_artifacts
from taskgraph.util.taskcluster import get_artifact_prefix

Expand Down Expand Up @@ -52,9 +50,7 @@ def set_fetches_and_locations(config, jobs):

aar_file_name = aar_location.split('/')[-1]
env_var = MOZ_ANDROID_FAT_AAR_ENV_MAP[platform]
job['worker']['env'][env_var] = os.path.join(
get_default_moz_fetches_dir(job), aar_file_name
)
job['worker']['env'][env_var] = aar_file_name

job['dependencies'] = dependencies

Expand Down
13 changes: 2 additions & 11 deletions taskcluster/taskgraph/transforms/job/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,21 +233,12 @@ def use_fetches(config, jobs):

env = worker.setdefault('env', {})
env['MOZ_FETCHES'] = {'task-reference': json.dumps(job_fetches, sort_keys=True)}
env.setdefault('MOZ_FETCHES_DIR', get_default_moz_fetches_dir(job))
# The path is normalized to an absolute path in run-task
env.setdefault('MOZ_FETCHES_DIR', 'fetches')

yield job


def get_default_moz_fetches_dir(job):
if job.get('worker', {}).get('os') in ('windows', 'macosx'):
moz_fetches_dir = 'fetches'
else:
workdir = job['run'].get('workdir', '/builds/worker')
moz_fetches_dir = '{}/fetches'.format(workdir)

return moz_fetches_dir


@transforms.add
def make_task_description(config, jobs):
"""Given a build description, create a task description"""
Expand Down

0 comments on commit 4017571

Please sign in to comment.