Openembedded Core Discussions
 help / color / mirror / Atom feed
* [RFC] One shared state reuse solution
@ 2012-03-30 21:54 Chris Larson
  2012-03-30 22:00 ` Chris Larson
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Chris Larson @ 2012-03-30 21:54 UTC (permalink / raw)
  To: openembedded-core

Greetings,

Over the past day, I've implemented a solution for the shared state
reuse issues Mentor has seen with our poky-based product. This
solution is similar in concept to what we had in our Mentor Embedded
Linux 4 (non-yocto-based) product.

This implementation restructures SSTATE_DIR such that non-target
sstate archives are placed in a directory specific to the host we're
running on, and allows fallback to sstates from compatible hosts. In
addition, there is a hook in place for modifying the returned build
host identifier string. Using these capabilities, configured as you'll
see below at the gist, I can populate sstate-cache from a Centos5
machine and fully reuse that shared state on a u1004 machine, but if I
take the u1004 sstate-cache and pull it over to Centos5, all the
non-target recipes will be rebuilt.

This has a list of "compatible hosts", which are used as fallback
regardless of what distro you're running on, so assumes you won't be
running on a host older than the ones you're using as your
compatibility baseline. I think this will satisfy the needs of most,
and as you'll see when you look at the implementation, is entirely
opt-in currently, so does no harm to anyone who chooses not to utilize
it.

https://gist.github.com/2253903 - shows an example of how to make use
of this functionality
https://github.com/kergoth/oe-core/compare/sstate-structure - the implementation

Regarding the implementation, I realize it isn't as clean as it could
be, but the only way to resolve it in a cleaner way would be to modify
bitbake, which I wasn't prepared to do at this juncture. The
fundamental issue adding complexity is that SSTATE_DIR is pulled from
the configuration metadata, not cached per-recipe, so one can't
manipulate where individual recipes get their archives stored. As a
workaround, I set the global SSTATE_DIR to the host-bound location,
then when writing the archives for target recipes, moves the archive
up to the parent directory (to the root of the original SSTATE_DIR)
and symlinks it back.

Richard had proposed modifying the filename rather than the directory
structure (e.g. via the sstate package arch), but this would make
things far more complex. In order to implement fallback, one would
have to mangle the filename, and one wouldn't be able to simply
leverage SSTATE_MIRRORS to fetch the variants in a simple way, as it
would have to attempt to fetch multiple filenames, which would require
invasive changes to sstate.bbclass. I think using the directory
structure is the easiest and cleanest route to the goal without
invasive changes, and given it's opt-in nature, I'd like to see this
go upstream, at a minimum as a temporary measure until/if a longer
term more invasive solution occurs.

I'm looking for questions, comments, testers, and in particular,
thoughts on whether this will meet the needs of others with similar
requirements (e.g. others shipping metadata with associated shared
state).
-- 
Christopher Larson



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-03-31  0:19 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-30 21:54 [RFC] One shared state reuse solution Chris Larson
2012-03-30 22:00 ` Chris Larson
2012-03-30 22:02 ` Koen Kooi
2012-03-30 22:04   ` Chris Larson
2012-03-30 23:23   ` Chris Larson
2012-03-31  0:10     ` Koen Kooi
2012-03-30 22:04 ` Mark Hatle
2012-03-30 22:09   ` Chris Larson
2012-03-30 22:17     ` Mark Hatle
2012-03-30 22:26       ` Chris Larson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox