All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: bitbake-devel <bitbake-devel@lists.openembedded.org>
Subject: Risks with extending the python methodpool
Date: Tue, 09 Feb 2016 11:47:35 +0000	[thread overview]
Message-ID: <1455018455.16142.67.camel@linuxfoundation.org> (raw)

I started today looking at a backtrace problem where the
filename/lineno entries were works of fiction.

That turned out to be "simple" in that exec_func_python() uses FILE as
the filename which may or may not be the case and is basically wrong.
We can at least fix that not to confuse as much.

I realised that only a certain percentage of our functions are making
it into the methodpool, "def x():" ones do, as does anonymous python
and the ones executed by exec_func_python don't.

This causes some problems since the code fragment that exec_func_python
builds can never really have correct filename/linenos as the code
stands today. I therefore started down the path of "why don't we just
put all functions into methodpool".

This would have some advantages, not least that all the methods would
start to become available from things like devshell.

I had this mostly working, or so I thought, then tried a clean build.
glibc blew up. It does:

do_patch_append() {
    bb.build.exec_func('do_fix_readlib_c', d)
}

and do_fix_readlib_c was no longer being executed.

This is because we'd injected an entry for do_patch into methodpool
(from the export_functions code) before the append was known about.

I guess we've never really supported appending to a def x(): style
python function, or to an anonymous python fragment (it has no name) so
there isn't a current issue but we can't extend the methodpool approach
any further :(.

With this all in mind I can go back to the drawing board on how to fix
the original backtrace problem. It does highlight the need to fix
things in a few areas and some good cleanups that can be made. I
thought I'd better write it down as I'll never remember this in six
months though and I thought some others may find it interesting.

Cheers,

Richard






                 reply	other threads:[~2016-02-09 11:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1455018455.16142.67.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bitbake-devel@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 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.