Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Mark Hatle <mark.hatle@windriver.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 3/3] rpm: Generate per distribution and multilib macro files
Date: Tue, 23 Jun 2015 15:57:55 +0100	[thread overview]
Message-ID: <1435071475.11489.84.camel@linuxfoundation.org> (raw)
In-Reply-To: <1434560682-89221-4-git-send-email-mark.hatle@windriver.com>

On Wed, 2015-06-17 at 12:04 -0500, Mark Hatle wrote:
> The distribution and multilib macro files are required for rpmbuild, on the
> target, to work properly.  These override the default settings from the
> upstream macro files with the proper values for the OE configuration.
> 
> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
[...]
> +def multilib_rpmmacros(d):
> +    localdata = d.createCopy()
> +    # We need to clear the TOOLCHAIN_OPTIONS (--sysroot)
> +    localdata.delVar('TOOLCHAIN_OPTIONS')
> +
> +    # Set it to the consistent of 'd'.
> +    localdata.setVar('distromacrodir', d.getVar('distromacrodir', True))
> +    localdata.setVar('WORKDIR', d.getVar('WORKDIR', True))
> +
> +    ret = gen_arch_macro(localdata)
> +
> +    variants = d.getVar("MULTILIB_VARIANTS", True) or ""
> +    for item in variants.split():
> +        # Load overrides from 'd' to avoid having to reset the value...
> +        overrides = d.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
> +        localdata.setVar("OVERRIDES", overrides)
> +        localdata.setVar("MLPREFIX", item + "-")
> +        bb.data.update_data(localdata)
> +        ret += gen_arch_macro(localdata)
> +    return ret

This doesn't look right. Usually there should be a loop of the form:

for x in y:
    localdata = d.createCopy()
    overrides = d.getVar("OVERRIDES", False) + f(x)
    localdata.setVar("OVERRIDES", overrides)
    bb.data.update_data(localdata)

where overrides is modified in the copy. If you don't do this, the
overrides will continue to be applied in the datastore with the way the
datastore currently works. This may happen to work but won't be correct.

As it happens, the datastore changes I've proposed will handle this
better but right now, the code above doesn't do what I think you'd want
it too. If its been copied from somewhere, that source also likely needs
fixing.

Cheers,

Richard




      reply	other threads:[~2015-06-23 14:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17 17:04 [PATCH 0/3] RPM bug fixes Mark Hatle
2015-06-17 17:04 ` [PATCH 1/3] rpm: Fix lua 'print' statement capture Mark Hatle
2015-06-17 17:04 ` [PATCH 2/3] rpm: Rebrand rpm custom macro paths to be distro specific Mark Hatle
2015-06-17 17:04 ` [PATCH 3/3] rpm: Generate per distribution and multilib macro files Mark Hatle
2015-06-23 14:57   ` Richard Purdie [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=1435071475.11489.84.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=mark.hatle@windriver.com \
    --cc=openembedded-core@lists.openembedded.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox