Support for absolute paths to config files

Using absolute paths in ABHELPER_JSON with remote-loading
now works; the paths are stripped to os.path.basename()
before being provided to the builders.

Signed-off-by: Thomas Goodwin <btgoodwin@geontech.com>
This commit is contained in:
Thomas Goodwin 2019-07-30 14:09:45 -04:00
parent 712363df3c
commit 39b23f4048

View File

@ -4,6 +4,7 @@ from yoctoabb import config
from yoctoabb.steps.writelayerinfo import WriteLayerInfo
from yoctoabb.steps.observer import RunConfigLogObserver
from datetime import datetime
import copy
import os
import json
@ -38,6 +39,13 @@ def add_abhelper_steps(factory):
workerdest=worker_helper,
haltOnFailure=True ))
# At the worker, all paths are relative to builddir/yocto-autobuilder-helper
# once the add_abhelper_steps run.
worker_env = copy.deepcopy(extra_env)
if worker_env.get('ABHELPER_JSON'):
configs = [os.path.basename(c) for c in worker_env['ABHELPER_JSON'].split(" ")]
worker_env['ABHELPER_JSON'] = " ".join(configs)
@util.renderer
def get_sstate_release_number(props):
"""
@ -216,7 +224,7 @@ for builder in config.subbuilders:
workers = config.builder_to_workers['default']
builders.append(util.BuilderConfig(name=builder,
workernames=workers,
factory=f, env=extra_env))
factory=f, env=worker_env))
def create_parent_builder_factory(buildername, waitname):
factory = util.BuildFactory()
@ -337,5 +345,5 @@ def create_parent_builder_factory(buildername, waitname):
return factory
builders.append(util.BuilderConfig(name="a-quick", workernames=config.workers, factory=create_parent_builder_factory("a-quick", "wait-quick"), env=extra_env))
builders.append(util.BuilderConfig(name="a-full", workernames=config.workers, factory=create_parent_builder_factory("a-full", "wait-full"), env=extra_env))
builders.append(util.BuilderConfig(name="a-quick", workernames=config.workers, factory=create_parent_builder_factory("a-quick", "wait-quick"), env=worker_env))
builders.append(util.BuilderConfig(name="a-full", workernames=config.workers, factory=create_parent_builder_factory("a-full", "wait-full"), env=worker_env))