From: Joshua Lock <joshua.g.lock@linux.intel.com>
To: Stephano Cetola <stephano.cetola@linux.intel.com>,
yocto@yoctoproject.org
Subject: Re: [yocto-autobuilder][PATCH] add force bash option on build and preamble
Date: Tue, 11 Jul 2017 12:02:10 +0100 [thread overview]
Message-ID: <1499770930.3497.11.camel@linux.intel.com> (raw)
In-Reply-To: <20170710210446.45687-1-stephano.cetola@linux.intel.com>
On Mon, 2017-07-10 at 14:04 -0700, Stephano Cetola wrote:
> Certain distros (Ubuntu) use a less desirable shell for /bin/sh
> (dash). In some edge cases, if we source oe-init-build-env from
> outside the OEROOT folder, the script will fail (as stated in the
> oe-init-build-env script). By adding a variable to force bash as the
> shell, we can call "bash -c" to ensure that a compatible shell is
> used.
>
> Currently, refkit is the only build that suffers from this edge case.
Thanks for the fix! I split the patch into two before merging, one for
the buildstep logic change and a follow-on to update the buildset-
config.controller. Hope you don't mind.
Joshua
> Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com>
> ---
> buildset-config.controller/nightly-refkit.conf |
> 3 ++-
> lib/python2.7/site-packages/autobuilder/buildsteps/BuildImages.py |
> 3 +++
> lib/python2.7/site-packages/autobuilder/buildsteps/RunPreamble.py |
> 3 +++
> 3 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/buildset-config.controller/nightly-refkit.conf
> b/buildset-config.controller/nightly-refkit.conf
> index 1d2487da6..cbc8508d7 100644
> --- a/buildset-config.controller/nightly-refkit.conf
> +++ b/buildset-config.controller/nightly-refkit.conf
> @@ -11,7 +11,7 @@ repos: [{'poky':
> 'submodules': True}}]
> steps: [{'SetDest':{}},
> {'CheckOutLayers': {'submodules': True}},
> - {'RunPreamble': {'altcmd': 'refkit/oe-init-build-env'}},
> + {'RunPreamble': {'forcebash': True, 'altcmd': 'refkit/oe-
> init-build-env'}},
> {'GetDistroVersion' : {'distro': 'refkit'}},
> {'CreateAutoConf': {'machine': 'intel-corei7-64',
> 'packages': 'ipk',
> 'distro': 'refkit', 'buildhistory' :
> False,
> @@ -44,6 +44,7 @@ steps: [{'SetDest':{}},
> {'ScrapeTargets': {'source': 'refkit/meta-
> refkit/conf/distro/include/refkit-ci.inc',
> 'targetsvar':
> 'REFKIT_CI_BUILD_TARGETS'}},
> {'BuildImages': {'images': '#SCRAPEDTARGETS',
> + 'forcebash': True,
> 'oeinit': 'refkit/oe-init-build-env',
> 'overrideenv':
> ['BITBAKEDIR=#YPDIR/bitbake', 'OEROOT=#YPDIR/meta']}},
> {'ScrapeTargets': {'source': 'refkit/meta-
> refkit/conf/distro/include/refkit-ci.inc',
> diff --git a/lib/python2.7/site-
> packages/autobuilder/buildsteps/BuildImages.py b/lib/python2.7/site-
> packages/autobuilder/buildsteps/BuildImages.py
> index 60ce07ff7..0406fd2e9 100644
> --- a/lib/python2.7/site-
> packages/autobuilder/buildsteps/BuildImages.py
> +++ b/lib/python2.7/site-
> packages/autobuilder/buildsteps/BuildImages.py
> @@ -23,6 +23,7 @@ class BuildImages(BitbakeShellCommand):
> haltOnFailure = False
> flunkOnFailure = True
> name = "BuildImages"
> + forcebash = False
> def __init__(self, factory, argdict=None, **kwargs):
> self.layerversion_yoctobsp=0
> self.machine=""
> @@ -163,6 +164,8 @@ class BuildImages(BitbakeShellCommand):
> if self.minnowExists is None or self.minnowExists ==
> "True":
> self.command = env + ". ./" + self.oeinit + ";
> bitbake " + bitbakeflags + self.images
> self.description = ["Building " +
> str(self.images)]
> + if self.forcebash:
> + self.command = ['bash', '-c', self.command]
> ShellCommand.start(self)
>
> def describe(self, done=False):
> diff --git a/lib/python2.7/site-
> packages/autobuilder/buildsteps/RunPreamble.py b/lib/python2.7/site-
> packages/autobuilder/buildsteps/RunPreamble.py
> index e9de3c76c..23c4ace2b 100644
> --- a/lib/python2.7/site-
> packages/autobuilder/buildsteps/RunPreamble.py
> +++ b/lib/python2.7/site-
> packages/autobuilder/buildsteps/RunPreamble.py
> @@ -16,6 +16,7 @@ class RunPreamble(ShellCommand):
> haltOnFailure = False
> flunkOnFailure = True
> name = "RunPreamble"
> + forcebash = False
>
> def __init__(self, factory, argdict=None, **kwargs):
> self.factory = factory
> @@ -27,4 +28,6 @@ class RunPreamble(ShellCommand):
> self.command = ". ./oe-init-build-env"
> else:
> self.command = ". ./" + self.altcmd
> + if self.forcebash:
> + self.command = ['bash', '-c', self.command]
> ShellCommand.__init__(self, **kwargs)
> --
> 2.13.2
>
prev parent reply other threads:[~2017-07-11 11:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-10 21:04 [yocto-autobuilder][PATCH] add force bash option on build and preamble Stephano Cetola
2017-07-11 11:02 ` Joshua Lock [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1499770930.3497.11.camel@linux.intel.com \
--to=joshua.g.lock@linux.intel.com \
--cc=stephano.cetola@linux.intel.com \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.