[oe] about staging

Frans Meulenbroeks fransmeulenbroeks at gmail.com
Fri Oct 30 07:40:25 UTC 2009


Hi,

Yesterday I ended up in a discussion on staging in #oe (ok, ok, I
mainly caused the discussion :-) )
Also based upon that I looked at various recipes on how people
implement staging.

There does not seem to be really standard way.
Some recipes copy from ${S} which ihmo is not desirable; i think it
should be a file that is exported by the application).
Others use other mechanisms.

For my own recipe I ended up with something like:

do_stage() {
        install -d ${STAGING_INCDIR}
        install -d ${STAGING_INCDIR}/${PN}
        install -m 0644 ${D}/${includedir}/${PN}/*.h ${STAGING_INCDIR}/${PN}
}

as that seems the best. ${D} contans the exported/installed files from
the application. Those files are the ones the application wants to
make externally available and those should end up in staging. Not
something from ${S}.

There is something odd here though. Only a few recipes do this
1453 recipes have a do_stage or do_stage_append function.
646 of these do autotools_stage_all (and perhaps other things).
The rest? all kind of interesting variants. Some understandable, some
outright odd.

That has lead me to the following thoughts:
Why is not all of install/usr/include (including subdirs) copied to
staging inc?
Why is not all of install/usr/lib copiied to staging lib?
(and of course alternatives like /usr/loocal/lib, /usr/local/include, ...)

A solution could be to do this automatically (and have a way with a
var to add additional dirs). This is more or less identical to making
the _dev packages but now copying stuff to staging.
Alternately we could opt for a manual solution where do_stage()
invokes e.g. do_stage_inc() and do_stage_lib(), which (apart from the
obvious defaults) use a variable to decide what directories/files are
copied to staging (normally from ${D}).
After that we can clean the existing recipes and probably get rid of
most of the do_stage rules.

What do people feel about this?

Any volunteers to implement this? I'm more than happy to do part of
the recipe cleaning. My knowledge of the internal structure and do's
and don't's of the build system are pretty weak (and so is my pyhthon
knowledge) so I'd rather not make the build system changes myself.
(unless someone stands up who wants to guide and mentor me).

Frans

PS: I used install in my example above, which I know is the regular
way to do it.
As I also had some subdirs it was more complicated than given above.
Would a cp -r followed by a chmod -R have been ok instead? (it would
definitely be a lot simpler). FM




More information about the Openembedded-devel mailing list