Analyzing Errors Related to Build Circles

From Tizen Wiki
Jump to: navigation, search

Introduction

This document provides information about how to analyze errors related to build circles.

Case Study

Here we take a typical error related to build circle as an example:

The build circle below was detected during GBS local full build:

 aul->privacy-manager-server->capi-system-info->capi-media-sound-manager->libmm-sound->libmm-session->audio-session-manager->system-server->notification->aul

Major analysis procedure is as follows:

1. Check which package in the circle is the first one in the build chain in a successful case. In theory, the last link in the dependency chain should be the first one that finishes building. In this case, `audio-session-manager` turned out to be the first one according to the log.

2. Find out the possible reasons by reading the `buildrequires` in audio-session-manager's spec file.

      $ grep audio-session-manager ~/tizen/.repo/manifests/ivi/projects.xml
      <project name="platform/core/multimedia/audio-session-manager" path="platform/core/multimedia/audio-session-manager" groups="ivi"/>
      $ vi ~/tizen/platform/core/multimedia/audio-session-manager/packaging/audio-session-manager.spec
      # ---BuildRequires------------
      BuildRequires:  pkgconfig(glib-2.0)
      BuildRequires:  pkgconfig(mm-common)
      BuildRequires:  pkgconfig(sysman)
      BuildRequires:  pkgconfig(vconf)
      BuildRequires:  pkgconfig(avsysaudio)
      BuildRequires:  pkgconfig(security-server)

3. Check which one of the six `BuildRequires` can be provided by `system-server`.

  1) Clear `pkgconfig(glib-2.0)` by finding the source RPM of the binary RPM
     package that provides `pkgconfig(glib-2.0)`.
         $ cd ~/GBS-ROOT/local/order
         $ ls -a
         .  ..  .repo.cache  .repo.cache.local  .repo.cache.local.swp  .repo.cache.remote
         $ grep "P:.*pkgconfig(glib-2.0)" .repo.cache -n
           4934:P:glib2-devel.i686-1404815901/347248/1072372: glib2-devel = 2.36.4-0 glib2-devel(x86-32) = 2.36.4-0 glib2-doc = 2.19.6 pkgconfig(gio-
           2.0) = 2.36.4 pkgconfig(gio-unix-2.0) = 2.36.4 pkgconfig(glib-2.0) = 2.36.4 pkgconfig(gmodule-2.0) = 2.36.4 pkgconfig(gmodule-export-2.0) 
           = 2.36.4 pkgconfig(gmodule-no-export-2.0) = 2.36.4 pkgconfig(gobject-2.0) = 2.36.4 pkgconfig(gthread-2.0) = 2.36.4 glib2-devel = 2.36.4-0
         $ wget http://download.tizen.org/snapshots/tizen/ivi/ivi/latest/repos/atom/packages/i686/glib2-devel-2.36.4-4.1.i686.rpm
         $ rpm -qip glib2-devel-2.36.4-4.1.i686.rpm
           Name        : glib2-devel
           Version     : 2.36.4
           Release     : 4.1
           Architecture: i686
           Install Date: (not installed)
           Group       : Base/Libraries
           Size        : 2424961
           License     : LGPL-2.1+
           Signature   : (none)
           Source RPM  : glib2-2.36.4-4.1.src.rpm
           Build Date  : Sun 15 Jun 2014 04:39:29 AM EEST
           Build Host  : w19
           Relocations : (not relocatable)
           Vendor      : tizen
           URL         : http://www.gtk.org/
           Summary     : General-Purpose Utility Library -- Development Files
           Description :
           GLib is a general-purpose utility library, which provides many useful
           data types, macros, type conversions, string utilities, file utilities,
           a main loop abstraction, and so on.
           This package contains the development files for GLib.
           Distribution: Tizen:IVI / atom
  2) Clear all the other suspects the same way we clear `pkgconfig(glib-2.0)` except for `pkgconfig(sysman)`, which can be provided by both of the following:
     * **libslp-sysman** (provides sysman-devel-0.2.29-1.2.i686.rpm)
     * **system-server** (provides sysman-devel-2.0.0-4.1.i686.rpm)
     Detailed procedure is as follows:
         $ cd ~/GBS-ROOT/local/order
         $ grep "P:.*pkgconfig(sysman)" .repo.cache -n
           1102:P:sysman-devel.i686-1404818834/6559/1075710: pkgconfig(sysman) = 0.2.0 sysman-devel = 0.2.29-1 sysman-devel(x86-32) = 0.2.29-1 
           sysman-devel = 0.2.29-1
           13726:P:sysman-devel.i686-1404821068/6755/1076457: pkgconfig(sysman) = 0.2.0 sysman-devel = 2.0.0-0 sysman-devel(x86-32) = 2.0.0-0 
           sysman-devel = 2.0.0-0
         # 1st provider
         $ wget http://download.tizen.org/snapshots/tizen/ivi/ivi/latest/repos/atom/packages/i686/sysman-devel-0.2.29-1.2.i686.rpm
         $ rpm -qip sysman-devel-0.2.29-1.2.i686.rpm
           Name        : sysman-devel
           Version     : 0.2.29
           Release     : 1.2
           Architecture: i686
           Install Date: (not installed)
           Group       : Development/Libraries
           Size        : 15959
           License     : APLv2
           Signature   : (none)
           Source RPM  : sysman-0.2.29-1.2.src.rpm
           Build Date  : Thu 26 Jun 2014 02:28:48 PM EEST
           Build Host  : w17
           Relocations : (not relocatable)
           Vendor      : tizen
           Summary     : System Manager base (devel)
           Description :
           System Manager base library (devel)
           Distribution: Tizen:IVI / atom
         # 2nd provider
         $ wget http://download.tizen.org/snapshots/tizen/ivi/ivi/latest/repos/atom/packages/i686/sysman-devel-2.0.0-4.1.i686.rpm
         $ rpm -qip sysman-devel-2.0.0-4.1.i686.rpm
           Name        : sysman-devel
           Version     : 2.0.0
           Release     : 4.1
           Architecture: i686
           Install Date: (not installed)
           Group       : System/Development
           Size        : 16977
           License     : Apache-2.0
           Signature   : (none)
           Source RPM  : system-server-2.0.0-4.1.src.rpm
           Build Date  : Fri 27 Jun 2014 09:06:51 PM EEST
           Build Host  : w21
           Relocations : (not relocatable)
           Vendor      : tizen
           Summary     : Sysman devel library
           Description :
           sysman devel library.
           Distribution: Tizen:IVI / atom

4. Analyze the root cause.

  `libslp-sysman` provides `sysman-devel-0.2.29-1.2.i686.rpm`, whereas `system-server` provides `sysman-devel-2.0.0-4.1.i686.rpm`. In the case the
  error message above was displayed, libslp-sysman served as the dependency package of audio-session-manager who requires sysman-devel, but GBS took
  system-server as the dependency package when detecting build circles because system-server provides higher version of sysman-devel. This causes GBS
  reported unnecessary build circle and incorrectly exit.

5. Report bug to Tizen package maintainer to solve the problem once and for all.

 ===Bug  Description===
  Package Name: system-server
  Path: platform/core/system/system-server
  Issue: sysman-devel-0.2.29-1.2.i686.rpm provided by system-server causes GBS to detect incorrect build circle.
  Build Error Message: warning: circle found: 
aul->privacy-manager-server->capi-system-info->capi-media-sound-manager->libmm-sound- >libmm-session-> audio-session-manager->system-server->notification->aul
  Reason: libslp-sysman provides sysman-devel-0.2.29-1.2.i686.rpm, whereas system-server provides sysman-devel-2.0.0-4.1.i686.rpm. In the case the
error message above was displayed, libslp-sysman served as the dependency package of audio-session-manager who requires sysman-devel, but GBS took
system-server as the dependency package when detecting build circles because system-server provides higher version of sysman-devel. This causes GBS
reported unnecessary build circle and incorrectly exit.
  Solution: Propose to remove sysman-devel-0.2.29-1.2.i686.rpm from system-server.

Appendix-Detecting All Build Circles

1. Remove "exclude_packages=libtool,gettext" from gbs.conf.

2. Run `gbs build -A i586` to find out first batch of build circles.

      warning: circle found: libtool->texinfo->help2man->gettext->expat->libtool

3. Run `gbs build -A i586 --exclude=libtools` to find out second batch of build circles.

      warning: circle found: texinfo->help2man->gettext->glibc->texinfo

4. Run `gbs build -A i586 --exclude=libtools,gettext` to find out other build circles, if any.