From 39b23f40480fc5975cde4b4b0cb6e51e520ccb7d Mon Sep 17 00:00:00 2001 From: Thomas Goodwin Date: Tue, 30 Jul 2019 14:09:45 -0400 Subject: [PATCH] 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 --- builders.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/builders.py b/builders.py index 35903de..16c1344 100644 --- a/builders.py +++ b/builders.py @@ -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))