Commit Graph

80 Commits

Author SHA1 Message Date
Mikko Ylinen e8b99fac13 staging.bbclass: handle postinst-useradd-* fixmes
After 02457ef7f600ce954874e2d11e74b1c6daaa3bfc, PSEUDO for
postinst-useradd-* scripts get to use only one PSEUDO_LOCALSTATEDIR
which is set under recipes ${WORKDIR}.

When the those scripts are run in a clean build environment that
is built from the sstate (populate_sysroot_setscene run for
postinst-useradd-* providers), pseudo fails to run because it cannot
access the PSEUDO_LOCALSTATEDIR (recipe ${WORKDIR}s do not exist).
This triggers a sysroot staging error.

Previously, the PSEUDO_LOCALSTATEDIR setting in useradd.bbclass
worked because the RSS sstate/staging logic automagically processed
${STAGING_DIR_TARGET} in postinst-useradd-* scripts to point under
the sysroot being built.

The fix uses the same fixme processing by adding PSEUDO_LOCALSTATEDIR
variable to it. Furthermore, LOGFIFO is added to be able to use
the logging fifo of the recipe that actually runs postinst-useradd-*.

(From OE-Core rev: 764b93cac374a55c31c86627f13270db874cdbdb)

Signed-off-by: Mikko Ylinen <mikko.ylinen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-07 17:07:57 +00:00
Richard Purdie 911146122c staging: Fix a logic error which caused dependency removal
There was a logic error in the dependency cleanup code which meant
it would remove dependencies which other tasks still depended upon.
Fix the path names so the comparisions work as intended.

This fixes dependencies accidentally disappearing from sysroots
under certain reconfiguration situations.

(From OE-Core rev: 1634fe5148b3501f2c1b75cf7fb704a2ef60424e)

(From OE-Core rev: 3969c068bc9557b405a5ad61c10c402ec93bd932)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit a6631eed6fc70b305e769998d6f22f345e37decc)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 22:15:59 +01:00
Richard Purdie 8329bfd156 staging: Ensure dependencies are removed before being added
Currently items are added to the sysroot, the obsolete items are removed. If
a change such as pkgconfig -> pkgconf is made, this leads to conflicts of
overlapping files in the sysroot.

In order to better support this, handle removing items before adding them.
This requires some minor refactoring to construct the installed list
before the main function loop, otherwise there are no changes in this
patch other than reordering the operations.

(From OE-Core rev: add4f107c151d32d9ea914bb0b93c3d3c17c776c)

(From OE-Core rev: 970d4df7336e5102ac61e66689e977fb2e41a1aa)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 5b45fe40db81292dd6bb57b210d1e4ba32e65e9e)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 22:15:59 +01:00
Richard Purdie 292cb6a32f staging: Avoid sysroot removal races
Currently a task could remove a dependency needed by another task leading
to build failures, often due to missing dependencies (e.g. dynamic libraries
not being found). This was often seen for all-arch recipes in package_write_rpm.

When removing a dependency, first check that no other task active for the
recipe has that same dependency.

(From OE-Core rev: ff3617cc2cd5618f48a25aa4e3b2014430fcbe23)

(From OE-Core rev: 67438ac91a40429affc952ad1d7e92c763f52bab)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 3de078642925e720c2fca5b89cd3abb8b29d2439)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11 22:15:59 +01:00
Paul Eggleton a19c27b807 classes/staging: change fixme debug message from note to debug
These messages were added for debugging during the recipe specific
sysroot work. They may still be useful but they don't need to be notes -
if they are they show up in recipetool / devtool output when fetching
source.

(From OE-Core rev: a0e93d5c5dcf59d1898a3db727a5ab2d75e3d20e)

(From OE-Core rev: 81246ed59215b8f62800cfb20d8b71d8e528c0ec)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit bc1a4af950a2600028d89b7dcb4ff8f409b52739)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-27 22:36:45 +01:00
Richard Purdie abae42362a staging: Allow BB_LIMITEDDEPS to avoid BB_TASKDEPDATA
In the limited dependency case we don't use any of the data from
BB_TASKDEPDATA. Restructure the code so this variable doesn't have
to be set. This allows the function to be called from other contexts
without creating artificial constructs. There should be no functional
change, behaviour remains unchanged.

(From OE-Core rev: 71e5243e3ebadb90b45fe418dac3eaa2c1b896bd)

(From OE-Core rev: e962e257f4c124869953d1fbb3da7dbf564f818a)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-18 13:17:44 +01:00
Peter Kjellerstedt 7b56a4327b useradd.bbclass: Handle COMPONENTS_DIR when restoring state
The export of PSEUDO in useradd_sysroot() contains references to
${COMPONENTS_DIR}. These need to be handled when restoring
postinst-useradd-${PN} from the sstate cache.

(From OE-Core rev: 097875bc9ab9d60a452b01ac6825775983684d68)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-11 16:56:00 +01:00
Peter Kjellerstedt 439bb8cc71 bitbake.conf: Add COMPONENTS_DIR for ${STAGING_DIR}-components
The path to where to install and find the sysroot components is used
in many places. This warrants it to get its own variable.

(From OE-Core rev: 70a84b525470f72339568409daf84845904e4cab)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-11 16:55:59 +01:00
Peter Kjellerstedt 1d57ca352f sstate.bbclass, staging.bbclass: Handle HOSTTOOLS_DIR when restoring state
Paths to host tools that have been copied to ${HOSTTOOLS_DIR} may end
up in the sstate cache. They thus need to be corrected when restoring
from the sstate cache.

(From OE-Core rev: f8671aecf05a286dd2b34b07bb5fbbe0c31e26d0)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-05-01 08:56:35 +01:00
Richard Purdie 283a9b3883 staging: Fix sysroot problem with populate_sysroot dependencies on do_fetch
Dependencies on svn:// urls were failing as the cleandirs on do_fetch was destroying
any sysroot setup by the extend_recipe_sysroot function.

Add code so that if the task do_fetch, we move the cleandirs to a separate function before
the extend_recipe_sysroot prefunc else we'd wipe out the sysroot we just created.

This allows fetcher do_populate_sysroot dependencies to work correctly again.

I did try various other approaches and a seperate function with cleandirs was the
cleanest way to add this without code duplication or too much complexity.

(From OE-Core rev: b32fbfc85b14059f0bfdeeffe2c52f8d3c20f276)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-11 18:10:18 +01:00
Richard Purdie 0793c758b1 Revert "staging: Fix sysroot problem with populate_sysroot dependencies on do_fetch"
There seems to be an issue with the patch, revert for now.

This reverts commit cd5e0a32184d98beb8d81e6b5527166d3ca4fb3c.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-11 00:57:03 +01:00
Richard Purdie 177d4be3c1 staging: Fix sysroot problem with populate_sysroot dependencies on do_fetch
Dependencies on svn:// urls were failing as the cleandirs on do_fetch was destroying
any sysroot setup by the extend_recipe_sysroot function.

Add code so that if the task do_fetch, we move the cleandirs to the extend_recipe_sysroot
task else we'd wipe out the sysroot we just created.

This allows fetcher do_populate_sysroot dependencies to work correctly again.

(From OE-Core rev: cd5e0a32184d98beb8d81e6b5527166d3ca4fb3c)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-10 23:00:44 +01:00
Richard Purdie faf70253ba staging: Remove uninstalled dependencies from sysroots
Currently, if something is added to a sysroot, its hash remains unchanged,
and it continues to be buildable, it doesn't get removed from the sysroot.

This patch handles the case where something is removed from DEPENDS or
[depends].

It does introduce its own issue where something could get removed even
though some other task in parallel may have the same requirement. This
case should be extrememly rare and fixing the more common DEPENDS removal
is likely the bigger win though.

(From OE-Core rev: 06227bc5e533841ab12cde84a6ed6f8b8ddeb5cb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-24 23:43:33 +00:00
Richard Purdie ce9cbae874 staging: Update extend_recipe_sysroot vardepsexclude after code changes
Changed were made to the code but not reflected in vardepsexclude, fix this.

(From OE-Core rev: e59dc6985e22e7ac30b6afa81d448fbc372f5dab)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-24 23:43:33 +00:00
Richard Purdie 3d3194a68f staging: Drop BB_SETSCENE_VERIFY_FUNCTION2
The original description for this was:
"""
Since we clean out do_populate_sysroot if do_configure runs, don't
allow do_populate_sysroot_setscene functions if we're going to
run do_configure.
"""

With RSS, we don't need to clean do_populate_sysroot any more. Since
we no longer do that, this function also has no purpose any longer
and can also be removed.

(From OE-Core rev: 637c6d17b4a812379cbab64d340660092e046965)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-24 23:43:33 +00:00
Richard Purdie 6e74b4e031 staging: Drop do_configure clean prefunc
With recipe specific sysroots its now pointless to do this, may as well
save the cpu cycles.

(From OE-Core rev: b70c8e91e6c4240e95e8b22bcc36525a5a0703f9)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-24 23:43:32 +00:00
Richard Purdie d74efb6aa9 staging: Drop BB_SETSCENE_VERIFY_FUNCTION since it was replaced
BB_SETSCENE_VERIFY_FUNCTION2 replaced BB_SETSCENE_VERIFY_FUNCTION
and due to our minimum bitbake requirements there is no point in
retaining the older version any more.

(From OE-Core rev: f08d6ccda5db9fdc81d53370aea1f599718897da)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-24 23:43:32 +00:00
Richard Purdie 529582a238 staging: Add missing parameter to debug message
(From OE-Core rev: 77ac40f8d4a4718b05f3692222a0dc91d90f0ab8)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Richard Purdie ab78c782f7 staging: Improve file creation resiliance
If you abort a build mid execution of the staging extend_sysroot function
there are currently races and cleanup of that function may fail.

This change splits the code into separate phases so that the manifests are
manipulated before files are installed, meaning we should be able to reverse
actions if builds fail, crash or are interrupted.

(From OE-Core rev: fc504b6b8538453d2f058d7cc69be098f52f8091)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Richard Purdie 175a457032 staging: Add shared manifest support
(From OE-Core rev: 51834006476786f847b3ca60d5ed83a952fc64cb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Richard Purdie c8b280e8a4 staging: Don't put ptest files into the sysroot
This wastes space/time as the ptest files aren't going to be used in the
sysroot so add them to the blacklist.

(From OE-Core rev: 61591fe2eea588ff92ff7f81f2ed8844617f5307)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-07 14:50:09 +00:00
Richard Purdie 85e9af9d78 staging: Reduce the number of mkdirs calls
The number of mkdir calls was showing up high on the profile charts since
it was getting called once per file which is excessive. Each call results
in one or more syscalls which is bad for performance. Cache which
directories we've seen to reduce the calls to a more reasonable number
and speed up recipe specific sysroots.

(From OE-Core rev: 680fb343be5d0a7f9abbe9c75ca232abe5871663)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-01 18:02:12 +00:00
Richard Purdie 758f18167f sstate/staging: Batch log messages for performance
According to profile data, repeated calls to bb.debug and bb.note in
the extend_recipe_sysroot() codepath were accounting for 75% of the time
(1.5s) in calls from tasks like do_image_complete.

This batches up the log messages into one call into the logging system
which gives similar behaviour to disabling the logging but retains the
debug information.

Since setscene_depvalid is also called from bitbake's setscene code,
we have to be a little creative with the function parameters and leave
the other debug output mechanism in place. This should hopefully
speed up recipe specific sysroots.

(From OE-Core rev: 3b0af8dc0f796345d1f1ba77ea35bbd090a5feb3)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-01 18:02:12 +00:00
Richard Purdie d45d4a5a21 staging: Handle stale sysroot rebuild issue
If a stale sysroot object was found the complete stamp wasn't removed,
meaning later code could fail when the new link creation was attempted.
Ensure the stale complete stamp is also removed if present.

(From OE-Core rev: d7d26488f252d60628862ee114a4404e8d6cb6f1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Richard Purdie f66f1af4b1 staging: Fix missing nativesdk do_populate_sysroot depends on binutils
Recent changes exposed the fact this dependency was missing in nativesdk
cases, fix this.

(From OE-Core rev: 46bd7e48cb5ae654d915fa493420534219682e85)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Richard Purdie 1d4c20ecc2 staging: Allow removal of stale sysroot objects
The main sysroot components of unreachable build targets will be removed by the core
code. This currently doesn't trigger a removal in the individual workdirs. This
adds in symlinking between the complete stamps and the component sysroot meaning
we can detect when someting was removed and hence remove it from the sysroot.

This fixes cases where DISTRO_FEATURES like systemd are changed amongst other
things and makes builds more robust against configuration changes.

If a dependency is rebuild, that is caught by checksum comparision code elsewhere
in this function as before.

(From OE-Core rev: 7656347c556915dc9acc5a2311ec4e879de6f43d)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Richard Purdie a4274bcc37 staging: Drop common prefix WORKDIR from manifest files
Manifest files containing the same duplicated prefix are wasteful on space
and ultimately this costs build time. Drop the WORKDIR prefix from the manifest
files since this small change mounts up a lot.

(From OE-Core rev: 1cb245a99762e21a170b6a9beabb07e558424946)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-28 23:32:16 +00:00
Richard Purdie da114c7d7d staging: Handle overlapping files for build-sysroot
The use of bb.fatal means build-sysroots fails as soon as multiple gdb's are
built with overlapping files, or multiple recipes with overlapping headers
exist.

Change the fatal call into an exception which we can then trap. Also
avoid trying to call readlink on something with isn't a symlink.

This allows build-sysroots to work better under various scenarios.

(From OE-Core rev: e20343a90e401bc92167867729076d321081d120)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26 10:44:27 +00:00
Richard Purdie bb5fe4c35d staging/allarch: Remove hardcoded PACKAGE_ARCHS from the class
The code was making an assumption that the only PACKAGE_ARCH in use
was TUNE_PKGARCH. This is incorrect so iterate over the list from
PACKAGE_EXTRA_ARCH instead.

We also need to change allarch to preserve this variable, else the
staging code doesn't function. We do this in a way which clears the
variable history so that the task hashes remain unaffected.

[Thanks to Andrew Goodbody <andrew.goodbody@cambrionix.com> for
testing/fixing]

(From OE-Core rev: b1bab7a6eff6b195824be7d754de58c6e9ee2bfb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-26 10:44:27 +00:00
Richard Purdie 6ab4c5033a classes/oeqa: Replace subprocess.check_call() with check_output()
If you use subprocess.check_output() the traceback will contain the output
when the command fails which is very useful for debugging. There is no
good reason not to use this everywhere.

(From OE-Core rev: ad750dd1cc9d789abe723daddd098ce41d8547f5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 23:30:57 +00:00
Richard Purdie 9107d6ca14 Switch to Recipe Specific Sysroots
This patch is comparatively large and invasive. It does only do one thing, switching the
system to build using recipe specific sysroots and where changes could be isolated from it,
that has been done.

With the current single sysroot approach, its possible for software to find things which
aren't in their dependencies. This leads to a determinism problem and is a growing issue in
several of the market segments where OE makes sense. The way to solve this problem for OE is
to have seperate sysroots for each recipe and these will only contain the dependencies for
that recipe.

Its worth noting that this is not task specific sysroots and that OE's dependencies do vary
enormously by task. This did result in some implementation challenges. There is nothing stopping
the implementation of task specific sysroots at some later point based on this work but
that as deemed a bridge too far right now.

Implementation details:

* Rather than installing the sysroot artefacts into a combined sysroots, they are now placed in
  TMPDIR/sysroot-components/PACKAGE_ARCH/PN.

* WORKDIR/recipe-sysroot and WORKDIR/recipe-sysroot-native are built by hardlinking in files
  from the sysroot-component trees. These new directories are known as RECIPE_SYSROOT and
  RECIPE_SYSROOT_NATIVE.

* This construction is primarily done by a new do_prepare_recipe_sysroot task which runs
  before do_configure and consists of a call to the extend_recipe_sysroot function.

* Other tasks need things in the sysroot before/after this, e.g. do_patch needs quilt-native
  and do_package_write_deb needs dpkg-native. The code therefore inspects the dependencies
  for each task and adds extend_recipe_sysroot as a prefunc if it has populate_sysroot
  dependencies.

* We have to do a search/replace 'fixme' operation on the files installed into the sysroot to
  change hardcoded paths into the correct ones. We create a fixmepath file in the component
  directory which lists the files which need this operation.

* Some files have "postinstall" commands which need to run against them, e.g. gdk-pixbuf each
  time a new loader is added. These are handled by adding files in bindir with the name
  prefixed by "postinst-" and are run in each sysroot as its created if they're present.
  This did mean most sstate postinstalls have to be rewritten but there shouldn't be many of them.

* Since a recipe can have multiple tasks and these tasks can run against each other at the same
  time we have to have a lock when we perform write operations against the sysroot. We also have
  to maintain manifests of what we install against a task checksum of the dependency. If the
  checksum changes, we remove its files and then add the new ones.

* The autotools logic for filtering the view of m4 files is no longer needed (and was the model
  for the way extend_recipe_sysroot works).

* For autotools, we used to build a combined m4 macros directory which had both the native and
  target m4 files. We can no longer do this so we use the target sysroot as the default and add
  the native sysroot as an extra backup include path. If we don't do this, we'd have to build
  target pkg-config before we could built anything using pkg-config for example (ditto gettext).
  Such dependencies would be painful so we haven't required that.

* PKDDATA_DIR was moved out the sysroot and works as before using sstate to build a hybrid copy
  for each machine. The paths therefore changed, the behaviour did not.

* The ccache class had to be reworked to function with rss.

* The TCBOOTSTRAP sysroot for compiler bootstrap is no longer needed but the -initial data
  does have to be filtered out from the main recipe sysroots. Putting "-initial" in a normal
  recipe name therefore remains a bad idea.

* The logic in insane needed tweaks to deal with the new path layout, as did the debug source
  file extraction code in package.bbclass.

* The logic in sstate.bbclass had to be rewritten since it previously only performed search and
  replace on extracted sstate and we now need this to happen even if the compiled path was
  "correct". This in theory could cause a mild performance issue but since the sysroot data
  was the main data that needed this and we'd have to do it there regardless with rss, I've opted
  just to change the way the class for everything. The built output used to build the sstate output
  is now retained and installed rather than deleted.

* The search and replace logic used in sstate objects also seemed weak/incorrect and didn't hold
  up against testing. This has been rewritten too. There are some assumptions made about paths, we
  save the 'proper' search and replace operations to fixmepath.cmd but then ignore this. What is
  here works but is a little hardcoded and an area for future improvement.

* In order to work with eSDK we need a way to build something that looks like the old style sysroot.
  "bitbake build-sysroots" will construct such a sysroot based on everything in the components
  directory that matches the current MACHINE. It will allow transition of external tools and can
  built target or native variants or both. It also supports a clean task. I'd suggest not relying on
  this for anything other than transitional purposes though. To see XXX in that sysroot, you'd have
  to have built that in a previous bitbake invocation.

* pseudo is run out of its components directory. This is fine as its statically linked.

* The hacks for wayland to see allarch dependencies in the multilib case are no longer needed
  and can be dropped.

* wic needed more extensive changes to work with rss and the fixes are in a separate commit series

* Various oe-selftest tweaks were needed since tests did assume the location to binaries and the
  combined sysroot in several cases.

* Most missing dependencies this work found have been sent out as separate patches as they were found
  but a few tweaks are still included here.

* A late addition is that extend_recipe_sysroot became multilib aware and able to populate multilib
  sysroots. I had hoped not to have to add that complexity but the meta-environment recipe forced my
  hand. That implementation can probably be neater but this is on the list of things to cleanup later
  at this point.

In summary, the impact people will likely see after this change:

* Recipes may fail with missing dependencies, particularly native tools like gettext-native,
  glib-2.0-native and libxml2.0-native. Some hosts have these installed and will mask these errors

* Any recipe/class using SSTATEPOSTINSTFUNCS will need that code rewriting into a postinst

* There was a separate patch series dealing with roots postinst native dependency issues. Any postinst
  which expects native tools at rootfs time will need to mark that dependency with PACKAGE_WRITE_DEPS.

There could well be other issues. This has been tested repeatedly against our autobuilders and oe-selftest
and issues found have been fixed. We believe at least OE-Core is in good shape but that doesn't mean
we've found all the issues.

Also, the logging is a bit chatty at the moment. It does help if something goes wrong and goes to the
task logfiles, not the console so I've intentionally left this like that for now. We can turn it down
easily enough in due course.

(From OE-Core rev: 809746f56df4b91af014bf6a3f28997d6698ac78)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 12:05:17 +00:00
Richard Purdie b0f70c5f9e staging: Add dependency on virtual/binutils for strip binary
The staging code strips binaries and we need virtual/binutils for that.
Add a specific dependency since the one from do_configure and others
may not be enough to ensure the binaries are in our own sysroot.

(From OE-Core rev: 9a799f70574ee8e0b1267497edfb4ac63166ef8f)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20 11:53:49 +00:00
Joshua Lock c4e2c59088 meta: remove True option to getVar calls
getVar() now defaults to expanding by default, thus remove the True
option from getVar() calls with a regex search and replace.

Search made with the following regex: getVar ?\(( ?[^,()]*), True\)

(From OE-Core rev: 7c552996597faaee2fbee185b250c0ee30ea3b5f)

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-16 10:23:23 +00:00
Richard Purdie 53c9723ea8 staging: Drop unused SYSROOT_LOCK
This hasn't been used in years and isn't referenced anywhere, drop
the definition.

(From OE-Core rev: 68258f856f08f35813964e58ef761471e29373ad)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-08 10:31:29 +00:00
Richard Purdie 0918ac9fdd staging: Add BB_SETSCENE_VERIFY_FUNCTION2 for bitbake runqueue changes
We're about to rewrite the data structures in taskdata/runqueue in bitbake
and we 'leaked' knowledge about those structures to this single function.

Add a 'v2' function definition for use with the newer bitbake, the older
one can remain for compatibility for a while, then be removed. The function
is comparatively simple and rarely changes.

(From OE-Core rev: 2a6f88d51414993d18096f7f0dc27c0b862240bc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:01 +01:00
Richard Purdie 642a997ade classes/lib: Update xrange -> range for python3
xrange() no longer exists in python 3, use range()

(From OE-Core rev: d022b4335100612d6596cc4c4956cb98ed5873cc)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-02 08:24:00 +01:00
Peter Kjellerstedt e839431468 staging.bbclass: Make it easier to define which dirs to stage
The directories that should be staged in the sysroot are now specified
in the SYSROOT_DIRS variable. Extra directories that should be staged
for native are specified in SYSROOT_DIRS_NATIVE. Finally, directories
that should not be staged are specified in SYSROOT_DIRS_BLACKLIST.

This also removes the sysroot_stage_libdir() function as it is no
longer used (it was just a wrapper for sysroot_stage_dir()).

(From OE-Core rev: 80e7e7f78d957b8159bede2a5cd5614d8d73039c)

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:27 +01:00
Robert Yang 41242a22b3 staging.bbclass: remove trail slash from SYSROOT_DESTDIR
Fixed path:
QA Issue: <foo> sysroot-destdir//usr/lib/ <foo>

Note the 2 slashes "//".

(From OE-Core rev: 227247dfebe6cdff67ba2c0976b59e3f9d34f7ea)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-21 09:32:41 +00:00
Jackie Huang 606c9e7f78 staging.bbclass: make already-stripped can be skipped
Add a check like what we does in package.bbclass
so that the already-stripped QA test can be skipped.

(From OE-Core rev: 2262fdb256954b22dadb2f7c6922e6046c269742)

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-22 16:08:50 +00:00
Richard Purdie fed80c3d40 staging: Strip files in sysroot
Add functionality to strip binaries/libraries going into the sysroot. Whilst
this does fractionally slow down the build, it also significantly reduces the
size of the sstate cache files.

(From OE-Core rev: 30f3774f4cd5bbb8c1e6884aeff5af91ab053fc1)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-23 16:07:23 +01:00
Richard Purdie 78a2c81427 staging: Exclude MULTI_PROVIDER_WHISTLIST from do_populate_sysroot
If you switch between multilib and non-multilib builds, pretty much
everything rebuilds due to the use of MULTI_PROVIDER_WHITELIST
in do_populate_sysroot. It doesn't need to do this so exclude
that variable for checksum purposes.

(From OE-Core rev: 7f3a44ff30d07083ee8c4e2b7ac91dc6a9c8857b)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-09-30 14:10:33 +01:00
Paul Eggleton 5d8552e1b4 classes/staging: ensure do_populate_sysroot re-execs on changes to sysroot preprocessing funcs
Without this dependency, changes to functions added to
SYSROOT_PREPROCESS_FUNCS do not change do_populate_sysroot's signature
and thus don't cause it to re-execute.

Fixes [YOCTO #5852].

(From OE-Core rev: 9950a88906bd701d0892b3ed222717ff78a93921)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-25 09:55:36 +00:00
Richard Purdie bdbc158b47 staging: Save out provider information into the sysroot
This patch saves out provider information into the sysroot for all providers
except those in MULTI_PROVIDER_WHITELIST. This means that we will start seeing
warnings when two providers for the same thing are installed into the sysroot.

In the future those warnings can be turned into errors.

Partially addresses [YOCTO #4102]

(From OE-Core rev: 9e696b9d32e33ba37dc09ff312328e540fc25de2)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-03-25 09:55:36 +00:00
Richard Purdie 480bf037ae sstate: Get rid of crazy name mapping
When originally developed, it was thought a task may have more than one associated
sstate archive. The way the code has grown that idea is now not possible or needed.
We can therefore assume one sstate archive per task and drop the crazy name
mapping code. Simpler is better in this case.

The downside is that various sstate archives will change name so this forces a cache
rebuild. Given the other sstate changes going in at this time, this isn't really
a bad thing as things would rebuild anyway.

(From OE-Core rev: 5afe86a6854b21692fd97c5fc7fab50dbc068acb)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-18 17:08:05 +00:00
Richard Purdie 931cf6e9a8 staging: Use hardlinking for sysroot_stage_dir
This saves about 2GB on a core-image-sato build so is worth doing and is
consistent with our efforts to try and decrease our build footprint.

Build time in my local test seemed unaffected but on more IO bound
machines it should help.

(From OE-Core rev: 7136cbc64e5efb09f3fae3e2e35a181ca3d66dd4)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-11-14 13:39:47 +00:00
Martin Jansa f33afade31 bitbake.conf: Remove double slash from PATH_prepend and PKG_CONFIG_DIR
* we correctly have
  ${STAGING_DIR_NATIVE}${base_sbindir_native}
  and then double slash in
  ${STAGING_DIR_NATIVE}/${base_bindir_native}
* similar in PKG_CONFIG_DIR where libdir also starts with slash
  ${STAGING_DIR_HOST}/${libdir}/pkgconfig
* also fix double slash in insane.bbclass and staging.bbclass
* I was a bit nervous about staging change (in case the / was important
  in some weird use-case, but the extra slash is there since following
  commit where other extra slashes were removed only the one before
  libdir was kept:

  commit 6ea78d6489
  Author: Richard Purdie <rpurdie@linux.intel.com>
  Date:   Mon Nov 2 17:10:51 2009 +0000

  autotools.bbclass: Separate out useful staging functions into
                     base.bbclass and call from autotools classes
* this isn't fixing any real-world issue AFAIK, I was just trying to
  debug one weird case where debugedit fails with
  canonicalization unexpectedly shrank by one character
  and it's easier to grep for '//' without many harmless instances
  already in run* scripts etc

(From OE-Core rev: 0ddaf52e9e344986ae2b016cc068d9eee71b4347)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14 16:55:24 +01:00
Richard Purdie d3846f06d1 classes: tar 1.27 fixes
tar version 1.27 returns:

tar: --same-order option cannot be used with -c

with the commandlines we have been using. We can remove the -s option (which
is --same-order) to remove the error.

(From OE-Core rev: 3d5a6d0a480a0fa98260a3b3ffc71b8d9e3e58af)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-10-14 16:55:21 +01:00
Richard Purdie f8ea6a8eed staging.bbclass: Drop unused/legacy function
(From OE-Core rev: 9120c88085236e1be9854376e43a7b14f937ba03)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 13:13:00 +00:00
Richard Purdie 1e593e92d2 staging/insane.bbclass: Move legacy do_stage check iinto insane.bbclass
We might as well put all the sanity checks in one place.

(From OE-Core rev: 05be11c7508984cc4aa757becb7a8f47c5b7e919)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-06 13:12:59 +00:00
Richard Purdie 34b415842d staging: Drop obsolete comments
(From OE-Core rev: 44a2374dcfd68c8e158e0c901d75dbd7327652a5)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-01-25 12:58:35 +00:00