Bug 2619 - do_package_write_rpm fails - fakeroot issue
Summary: do_package_write_rpm fails - fakeroot issue
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 1.2.1
Hardware: x86 Multiple
: Medium normal
Target Milestone: 1.3 M4
Assignee: Robert Yang
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2012-06-18 15:57 UTC by Laurentiu Serban
Modified: 2012-08-30 08:14 UTC (History)
11 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: ---


Attachments
failure logs (829 bytes, application/octet-stream)
2012-07-03 12:10 UTC, Laurentiu Serban
no flags Details
logs for the test without the flags set (2.12 KB, application/octet-stream)
2012-07-03 12:11 UTC, Laurentiu Serban
no flags Details
cooker log (189.93 KB, application/octet-stream)
2012-07-03 12:13 UTC, Laurentiu Serban
no flags Details
cooker log (102.69 KB, application/octet-stream)
2012-08-19 22:45 UTC, Laurentiu Serban
no flags Details
run.SBUILDSPEC (5.92 KB, application/octet-stream)
2012-08-19 22:45 UTC, Laurentiu Serban
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurentiu Serban 2012-06-18 15:57:53 UTC
Unsing 
"inherit archive-original-source" in 
 meta/classes/package_rpm.bbclass

and 
SOURCE_ARCHIVE_PACKAGE_TYPE ?= 'srpm' 
SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= 'logs_with_scripts'
in conf/local.conf

causes 
do_package_write_rpm to fail

One of the error messages is the following (for gnome-common-2.28.0):
DEBUG: Executing python function sstate_task_prefunc
DEBUG: Python function sstate_task_prefunc finished
DEBUG: Executing python function do_archive_scripts_logs
DEBUG: Python function do_archive_scripts_logs finished
DEBUG: Executing python function do_package_write_rpm
DEBUG: Executing python function read_subpackage_metadata
DEBUG: Python function read_subpackage_metadata finished
DEBUG: Executing python function do_package_rpm
DEBUG: Executing python function write_specfile
NOTE: Creating EMPTY RPM Package for gnome-common-dbg
NOTE: Not creating empty RPM package for gnome-common-staticdev
NOTE: Creating RPM package for gnome-common
NOTE: Creating RPM package for gnome-common
NOTE: Not creating empty RPM package for gnome-common-doc
NOTE: Creating EMPTY RPM Package for gnome-common-dev
NOTE: Not creating empty RPM package for gnome-common-locale
DEBUG: Python function write_specfile finished
DEBUG: SITE files ['endian-little', 'bit-32', 'common-linux', 'common-glibc', 'allarch-linux', 'common']
DEBUG: Executing shell function SBUILDSPEC
DEBUG: Python function do_package_rpm finished
DEBUG: Python function do_package_write_rpm finished
ERROR: Function failed: SBUILDSPEC (see /home/lserban/work/poky/build/tmp/work/all-poky-linux/gnome-common-2.28.0-r1/temp/log.do_package_write_rpm.23403 for further information)
/home/lserban/work/poky/build/tmp/work/all-poky-linux/gnome-common-2.28.0-r1/temp/run.SBUILDSPEC.23403: line 79: fakeroot: command not found
Comment 1 liang li 2012-06-19 09:08:19 UTC
add following to conf/local.conf:

INHERIT += "archive-original-source"
SOURCE_ARCHIVE_PACKAGE_TYPE ?= 'srpm' 
SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= 'logs_with_scripts'

when run "bitbake core-image-sato" ,no error happend during build process.
git info: e0a70547069fe7e8a2d6bdaffc985fb172d46c31
git branch: poky/master

test host is ubuntu 12.04 x86_64.
Comment 2 Xiaofeng Yan 2012-06-21 01:45:11 UTC
The usage for archiver.bblcass changed with the better method. 
Please review local.conf.sample.extended for the future usage.
You can use the following method in conf/local.conf:

ARCHIVER_MODE ?= "original"
ARCHIVER_MODE[type] ?= "srpm"
ARCHIVER_MODE[log_type] ?= "logs_with_scripts"
ARCHIVER_CLASS = "${@'archive-${ARCHIVER_MODE}-source' if ARCHIVER_MODE != 'none' else ''}"
INHERIT += "${ARCHIVER_CLASS}" 


Or you can use liang li's method.
Comment 3 Xiaofeng Yan 2012-06-21 01:51:23 UTC
The improper usage cause this problem. So I marked this bug for invalid.
Comment 4 Laurentiu Serban 2012-07-03 11:51:32 UTC
This bug is reproduce in 1.2.1.
I am not opening a new one but I set the version to 1.2.1.

The testing was done according to comment#1 from liang li
Comment 5 Laurentiu Serban 2012-07-03 12:10:49 UTC
Created attachment 616 [details]
failure logs
Comment 6 Laurentiu Serban 2012-07-03 12:11:37 UTC
Created attachment 617 [details]
logs for the test without the flags set
Comment 7 Laurentiu Serban 2012-07-03 12:13:32 UTC
Created attachment 618 [details]
cooker log
Comment 8 Laurentiu Serban 2012-07-03 13:53:48 UTC
Using
SOURCE_ARCHIVE_PACKAGE_TYPE ?= 'tar'
SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= 'logs'

there are no failures
Comment 9 Laurentiu Serban 2012-08-19 22:45:04 UTC
Created attachment 699 [details]
cooker log
Comment 10 Laurentiu Serban 2012-08-19 22:45:29 UTC
Created attachment 700 [details]
run.SBUILDSPEC
Comment 11 Laurentiu Serban 2012-08-19 22:46:40 UTC
There are failures using

ARCHIVER_MODE ?= "original"
ARCHIVER_MODE[type] ?= "srpm"
ARCHIVER_MODE[log_type] ?= "logs_with_scripts"
ARCHIVER_CLASS = "${@'archive-${ARCHIVER_MODE}-source' if ARCHIVER_MODE != 'none' else ''}"
INHERIT += "${ARCHIVER_CLASS}"

Logs attached.
Comment 12 Robert Yang 2012-08-21 03:02:56 UTC
The fakeroot error is happened on 1.2.1, but there are other issues on 1.3, I think that it should be fixed on both 1.2.2 and 1.3, beside this, there are several other things needs to do:
1) The archiver.bbclass uses both tab and space as the indent, even mixes them in one function, this should be corrected.

2) The comment line is too long, should split them into small peaces which is under 72 or 80 characters.

3) Typo fixes.

4) Make it shorter and easier to use if possible.
Comment 13 Stefan Stanacar 2012-08-29 13:14:12 UTC
It works for me with:

INHERIT += "archive-original-source"

SOURCE_ARCHIVE_PACKAGE_TYPE ?= 'srpm'
SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= 'logs_with_scripts'

on Ubuntu 12.04 
git commit b4c5725af4cd85d5644f0373e2674e903c4eab2b

It fails on Fedora though, but after installing fakeroot package from Fedora's repos it doesn't fail anymore. Docs don't mention fakeroot as recommended packages for Fedora or Ubuntu but it seems in Ubuntu fakeroot it's installed by default (or pulled with some other package)
Comment 14 Robert Yang 2012-08-30 05:45:02 UTC
(In reply to comment #13)
> It works for me with:
> 
> INHERIT += "archive-original-source"
> 
> SOURCE_ARCHIVE_PACKAGE_TYPE ?= 'srpm'
> SOURCE_ARCHIVE_LOG_WITH_SCRIPTS ?= 'logs_with_scripts'
> 
> on Ubuntu 12.04 
> git commit b4c5725af4cd85d5644f0373e2674e903c4eab2b
> 
> It fails on Fedora though, but after installing fakeroot package from
> Fedora's repos it doesn't fail anymore. Docs don't mention fakeroot as
> recommended packages for Fedora or Ubuntu but it seems in Ubuntu fakeroot
> it's installed by default (or pulled with some other package)

yes, but it should not depend fakeroot, it has been fixed in the up-to-date master branch:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=c96f6ee659cd4c20fd826f633e634ba0ef2f340b
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=2ba95cc79e44bb2bf94d07b90cd305c3198fee68
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=3883f82926adc973516a24f69f56f6c63eb66d37
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=436211f0525dbeab4d701a59093b6597ca72400c
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=4396677ade349c01c8cd0d42b12618723099fbf8
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=44b8c1bb30883ebe71005b89b83ec7e43a957bad
Comment 15 Stefan Stanacar 2012-08-30 08:14:19 UTC
Yup, verified in bb0aab79e488a99cb1b43f72f0e8ddbe39d97519