[OE-core] [PATCH 18/20] classes/populate_sdk_ext: Add SDK_EXT_TARGET_MANIFEST and SDK_EXT_HOST_MANIFEST
Paul Eggleton
paul.eggleton at linux.intel.com
Tue Feb 2 22:15:14 UTC 2016
On Tue, 02 Feb 2016 16:13:12 Aníbal Limón wrote:
> On 02/02/2016 04:06 PM, Paul Eggleton wrote:
> > On Tue, 02 Feb 2016 16:05:06 Aníbal Limón wrote:
> >> On 02/02/2016 03:52 PM, Paul Eggleton wrote:
> >>> On Tue, 02 Feb 2016 09:14:21 Aníbal Limón wrote:
> >>>> From: Aníbal Limón <limon.anibal at gmail.com>
> >>>>
> >>>> Extensible SDK needs to point to the correct manifest so add
> >>>> SDK_EXT_TARGET_MANIFEST and SDK_EXT_HOST_MANIFEST variables.
> >>>>
> >>>> oeqa/oetest.py: Fix SDKExtTestContext for load the correct manifests.
> >>>>
> >>>> Signed-off-by: Aníbal Limón <limon.anibal at gmail.com>
> >>>> ---
> >>>>
> >>>> meta/classes/populate_sdk_ext.bbclass | 3 +++
> >>>> meta/lib/oeqa/oetest.py | 11 +++++++++--
> >>>> 2 files changed, 12 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/meta/classes/populate_sdk_ext.bbclass
> >>>> b/meta/classes/populate_sdk_ext.bbclass index fc96a4b..27dc030 100644
> >>>> --- a/meta/classes/populate_sdk_ext.bbclass
> >>>> +++ b/meta/classes/populate_sdk_ext.bbclass
> >>>> @@ -43,6 +43,9 @@ B_task-populate-sdk-ext = "${SDK_DIR}"
> >>>>
> >>>> TOOLCHAINEXT_OUTPUTNAME = "${SDK_NAME}-toolchain-ext-${SDK_VERSION}"
> >>>> TOOLCHAIN_OUTPUTNAME_task-populate-sdk-ext =
> >>>> "${TOOLCHAINEXT_OUTPUTNAME}"
> >>>>
> >>>> +SDK_EXT_TARGET_MANIFEST =
> >>>> "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.target.manifest"
> >>>> +SDK_EXT_HOST_MANIFEST =
> >>>> "${SDK_DEPLOY}/${TOOLCHAINEXT_OUTPUTNAME}.host.manifest" +
> >>>>
> >>>> SDK_TITLE_task-populate-sdk-ext = "${@d.getVar('DISTRO_NAME', True) or
> >>>>
> >>>> d.getVar('DISTRO', True)} Extensible SDK"
> >>>>
> >>>> python copy_buildsystem () {
> >>>>
> >>>> diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
> >>>> index 6beb6c5..c951989 100644
> >>>> --- a/meta/lib/oeqa/oetest.py
> >>>> +++ b/meta/lib/oeqa/oetest.py
> >>>>
> >>>> @@ -382,14 +382,18 @@ class SDKTestContext(TestContext):
> >>>> self.sdktestdir = sdktestdir
> >>>> self.sdkenv = sdkenv
> >>>>
> >>>> + if not hasattr(self, 'target_manifest_name'):
> >>>> + self.target_manifest_name = "SDK_TARGET_MANIFEST"
> >>>>
> >>>> try:
> >>>> - with open(d.getVar("SDK_TARGET_MANIFEST", True)) as f:
> >>>>
> >>>> + with open(d.getVar(self.target_manifest_name, True)) as f:
> >>>> self.pkgmanifest = f.read()
> >>>>
> >>>> except IOError as e:
> >>>> bb.fatal("No package manifest file found. Did you build
> >>>> the
> >>>> sdk
> >>>>
> >>>> image?\n%s" % e)
> >>>>
> >>>> + if not hasattr(self, 'host_manifest_name'):
> >>>> + self.host_manifest_name = "SDK_HOST_MANIFEST"
> >>>>
> >>>> try:
> >>>> - with open(d.getVar("SDK_HOST_MANIFEST", True)) as f:
> >>>>
> >>>> + with open(d.getVar(self.host_manifest_name, True)) as f:
> >>>> self.hostpkgmanifest = f.read()
> >>>>
> >>>> except IOError as e:
> >>>> bb.fatal("No host package manifest file found. Did you
> >>>> build
> >>>>
> >>>> the sdk image?\n%s" % e) @@ -406,6 +410,9 @@ class
> >>>>
> >>>> SDKTestContext(TestContext):
> >>>> class SDKExtTestContext(SDKTestContext):
> >>>> def __init__(self, d, sdktestdir, sdkenv):
> >>>> + self.target_manifest_name = "SDK_EXT_TARGET_MANIFEST"
> >>>> + self.host_manifest_name = "SDK_EXT_HOST_MANIFEST"
> >>>> +
> >>>>
> >>>> super(SDKExtTestContext, self).__init__(d, sdktestdir, sdkenv)
> >>>>
> >>>> self.sdkextfilesdir =
> >>>> os.path.join(os.path.dirname(os.path.abspath(
> >>>
> >>> I really don't like the idea of passing the variable name here rather
> >>> than
> >>> values. However, besides that, the manifest is always the SDK name plus
> >>> .host.manifest or .target.manifest - do we even need to pass separate
> >>> names? All you should need is the name of the SDK i.e. the value of
> >>> TOOLCHAINEXT_OUTPUTNAME.
> >>
> >> I prefer to have explicit value and construct them into one place
> >> instead of have many name constructions like you said to use
> >> TOOLCHAINEXT_OUTPUTNAME and suppose that always be end with .{host,
> >> target}.manifest.
> >
> > When you add a variable to populate_sdk_ext.bbclass, it isn't just defined
> > for the ext SDK - it's defined for every image recipe. I want to try to
> > avoid defining additional variables and thus expanding the environment
> > where we don't really need to.
>
> I guess two more variable expansions gives you no more/less performance
> and also gives you the possibility to have the thing set in a clean manner,
OK, if you insist on using those, don't pass the variable name - get the value
of the variable and then pass the value. For the record I'm still unhappy
about unnecessarily adding variables like this.
> > The naming of the manifest is something we can rely on, because external
> > tools need to be able to.
>
> May be now, :).
If we change that we also break anything that reads those files. We won't be
changing those any time soon.
Cheers,
Paul
--
Paul Eggleton
Intel Open Source Technology Centre
More information about the Openembedded-core
mailing list