Commit Graph

18 Commits

Author SHA1 Message Date
Richard Purdie c433e9bc6d gobject-introspection: Fix sysroot postinst scripting error
Clearly the echo into ld.so.conf doesn't make sense and there was a cut and paste
error when writing this code. As long as the directory existed, the builds worked
so it created a race. Fix it as people hit build failures.

(From OE-Core rev: b7b45faaf1246bef262a65d033aa1daa3219e318)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-23 23:30:14 +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
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
Alexander Kanavin 1e988187a1 gobject-introspection: update to 1.50.0
(From OE-Core rev: 0934a6c51bb04042b24c8074836e860343d34507)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:09 +00:00
Robert Yang f22415435f gobject-introspection: set GI_SCANNER_DISABLE_CACHE for native
The native recipe should not write files to $HOME/.cache as target, this can
avoid problems when multi builds are running on the same host like:
|   File "./g-ir-scanner", line 66, in <module>
|     sys.exit(scanner_main(sys.argv))
|   File "../gobject-introspection-1.48.0/giscanner/scannermain.py", line 543, in scanner_main
|     transformer = create_transformer(namespace, options)
|   File "../gobject-introspection-1.48.0/giscanner/scannermain.py", line 389, in create_transformer
|     symbol_filter_cmd=options.symbol_filter_cmd)
|   File "../gobject-introspection-1.48.0/giscanner/transformer.py", line 54, in __init__
|     self._cachestore = CacheStore()
|   File "../gobject-introspection-1.48.0/giscanner/cachestore.py", line 61, in __init__
|     self._check_cache_version()
|   File "../gobject-introspection-1.48.0/giscanner/cachestore.py", line 89, in _check_cache_version
|     self._clean()
|   File "../gobject-introspection-1.48.0/giscanner/cachestore.py", line 141, in _clean
|     self._remove_filename(os.path.join(self._directory, filename))
|   File "../gobject-introspection-1.48.0/giscanner/cachestore.py", line 123, in _remove_filename
|     os.unlink(filename)
| FileNotFoundError: [Errno 2] No such file or directory: '/home/pokybuild/.cache/g-ir-scanner/0a47aa95823c95a0b5d1bd610b60d02f35785f26'
| Makefile:3518: recipe for target 'GModule-2.0.gir' failed

(From OE-Core rev: d3c48ff7d19e86b2338b1778f9563969bba3d336)

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-09 12:12:23 +01:00
Alexander Kanavin 16fae9fffe gobject-introspection: odd versions are development snapshots
(From OE-Core rev: 5c2fcbc42dc85764863771ed62c7415aafb85916)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-03 09:58:38 +01:00
Richard Purdie d37837a00d gobject-introspection: Ensure prelink config file exists to avoid build failures
gobject-introspection relies upon prelink-rtld. In order to function correctly,
we generate an ld.so.conf file which is generated before users of prelink-rtld
are called.

There is currently a race in gobject-introspection since the configuration file
may not have been created. This adds in code to ensure that regardless of codepath
(new build, existing build, from sstate), we trigger the creation of the configuration
file and avoid build failures.

(From OE-Core rev: 10e0c1a3a452baa05d160a92a54b2e33cf0fd061)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-18 09:27:52 +01:00
Alexander Kanavin cf1af6b384 pythonnative.bbclass, python3native.bbclass: export STAGING_INCDIR, STAGING_LIBDIR, PYTHON variables
We patch Python's distutils modules to access STAGING_INCDIR/LIBDIR, so when
they are not set, scripts that utilize distutils (e.g. python-config) fail.
Several recipes need to export those manually to prevent such failures,
so let's do that in the class instead.

PYTHON variable is exported because otherwise autotools' python.m4
macro will pick up its own internal default, which may not be the version
that we want.

glib recipe in particular was previously using Python 2.x during build due to python.m4
defaulting to it - now it's using Python 3.x, and so needs a small fix in
deletion of *.pyc files.

(From OE-Core rev: c1e0eb62f2d89b10b187016200018830b1c77945)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-01 16:22:42 +01:00
Alexander Kanavin a2eb6d4867 gobject-introspection: move to Python 3
(From OE-Core rev: db702fb12f7b34928a52e522ad269ac43f1dcace)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-07 15:22:37 +01:00
Alexander Kanavin 2a16d50a8e gobject-introspection: update to 1.48.0
Add a patch that reverts an incomplete upstream attempt at cross-compile support;
upstream has been notified:
https://bugzilla.gnome.org/show_bug.cgi?id=696773

(From OE-Core rev: 7070c02c4878f479ae7002184c56b44bc408fb26)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-04 14:13:34 +01:00
Alexander Kanavin 4977a0743b python-native, python3-native: remove the use of exported HOST_SYS and BUILD_SYS variables
The code that utilized them was superseded by the code (in the same patch!)
that is utilizing STAGING_LIBDIR/STAGING_INCDIR, and wasn't correct in the
first place as HOST_SYS is not necessarily the same as the sysroot directory
name.

(From OE-Core rev: 8834e81a38c24a066bb4fefa93da61011d0db244)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-01 12:38:41 +01:00
Paul Eggleton 2c7cf1370e gobject-introspection: set SUMMARY and HOMEPAGE
We should at least have SUMMARY set for all recipes in OE-Core, and
there's a reasonable HOMEPAGE in this case so use it.

(From OE-Core rev: 719a38d28b5ea364727239c66571dec083bc33c6)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-30 15:58:10 +01:00
Peter Kjellerstedt 4021e9bad6 gobject-introspection: Use SYSROOT_DIRS to add dirs to stage in sysroot
(From OE-Core rev: e843e7d6cb01fe2f4f9d7c7a881e87ceaed2b794)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-13 13:41:28 +01:00
Jussi Kukkonen ea41b6375d gobject-introspection: Depend on native flex and bison
(From OE-Core rev: 39bd2f895623a0daf1882ee0b73e7318c1f034fe)

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-29 07:41:43 +01:00
Christopher Larson 7c1badfddb gobject-introspection: fix floating dep on python-mako
This was resulting in non-deterministic builds where g-ir-doc-tool may or may
not exist depending on whether python-mako was built previously. Add
a PACKAGECONFIG so the dependency is explicit.

(From OE-Core rev: 91b7857f3c90151fa78c0cc797f3544057992441)

Signed-off-by: Sujith H <sujith.h@gmail.com>
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Sujith Haridasan <Sujith_Haridasan@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-29 07:41:42 +01:00
Alexander Kanavin abd5b24ff7 bitbake.conf: rename 'gobject-introspection-data' machine feature to 'qemu-usermode'
The new value is more general and better reflects what having the feature really means.
Introspection data, then, is built only if 'gobject-introspection-data' is in
DISTRO_FEATURES and 'qemu-usermode' is in MACHINE_FEATURES.

(From OE-Core rev: 9927a3d72e2272d8e3dc4785ba02e27802ee1c6c)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-28 15:55:49 +01:00
Richard Purdie 3a1d9fbe96 gobject-introspection: Override GIO_MODULE_DIR when scanning
This is to stop GLib linking to GConf and other modules (e.g gnutls).

If for example gconf is installed in the sysroot then GLib will use it by
default for the GSettings backend.  This will pull a lot more libraries into the
scanner processes and expands the potential for runtime issues since dependencies
may be missing of change since they're not in the dependency chain.

Use an invalid modules directory so we avoid loading any modules or the
libraries they link against which the system may be in the process of rebuilding.

(From OE-Core rev: ae3c9052e3b1f19c1ceadc5aeb93d4828e1c7a61)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12 22:11:43 +00:00
Alexander Kanavin 10e99777da gobject-introspection: add the recipe
The recipe has comments that explain what is going on and why.

Also, there are patches necessary to make it work in Yocto cross-compilation environment;
they will be submitted upstream.

(From OE-Core rev: c54c5fc63c05d416f3733a742fc94f7a169adc8b)

Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-03-12 22:11:43 +00:00