Patchwork [0/6,V3] refactor the archiver*.bbclass

login
register
mail settings
Submitter Robert Yang
Date March 11, 2014, 5:08 p.m.
Message ID <cover.1394555880.git.liezhi.yang@windriver.com>
Download mbox
Permalink /patch/68423/
State New
Headers show

Pull-request

git://git.openembedded.org/openembedded-core-contrib rbt/archiver_v3

Comments

Robert Yang - March 11, 2014, 5:08 p.m.
=== V3:
* Do the unpack, patch and configure in another WORKDIR as RP and Ross
  suggested, so that it would not affact the default build dependencies,
  thanks for Ross' prototype.
* Don't archive the logs (temp/log.do*), mainly because of:
  - We can easily get the log via reset the T rather than use the
    archiver.
  - If we need archive the logs, we must let the task to run as the last
    one, but it's hard to do this.

=== V2:
* Fix the warning between different machines which is reported by Martin
* Fix the error when the archiver.bbclass is not inherited but
  ARCHIVER_MODE[type] = "srpm" is set, reported by Ross.
* Fix the archiving for gcc staff which uses the shared source according
  to the recently changes of prefuncs and postfuncs in bitbake, so it only
  works well with bitbake's up to date master branch, if we want to backport it,
  we also need backport the pre/postfuncs related patches.

=== V1:
* The archive*.bbclass didn't work, and there were a few problems, for
  example:
  1) There were a few duplicated code
  2) There was no src_dir.org (or orig), but the diff command still use
     it, and it is not easy to fix this issue if we don't change a lot
     of the code.
  3) It didn't archive the source for the native or gcc
  4) The work flow is not very well
  5) The "subprocess.call('fakeroot cp xxxx'" should be removed
  6) And others ...

* So that we have to refactor it, the benefits are:
  1) Fix the problems and make it work well.
  2) Reduce more than 400 lines in total.
  3) Make it easy to use.

// Robert


The following changes since commit 23f7decb84922a3467c5b10b013e66596926b5cf:

  .templateconf: New file for customized template defaults (2014-03-11 08:11:07 -0700)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib rbt/archiver_v3
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/archiver_v3

Robert Yang (6):
  classes/archive*.bbclass: remove archive-*-source.bbclass
  archiver.bbclass: refactor it
  package_rpm.bbclass: archive the source to srpm package
  archiver.bbclass: move a few code to copyleft_compliance.bbclass
  local.conf.sample.extended: update for the archiver
  patch.bbclass: do_patch: unset TMPDIR from environment

 meta/classes/archive-configured-source.bbclass |  65 --
 meta/classes/archive-original-source.bbclass   |  65 --
 meta/classes/archive-patched-source.bbclass    |  65 --
 meta/classes/archiver.bbclass                  | 791 +++++++++----------------
 meta/classes/copyleft_compliance.bbclass       |  55 +-
 meta/classes/package_rpm.bbclass               |  33 +-
 meta/classes/patch.bbclass                     |   1 +
 meta/conf/local.conf.sample.extended           |  63 +-
 8 files changed, 367 insertions(+), 771 deletions(-)
 delete mode 100644 meta/classes/archive-configured-source.bbclass
 delete mode 100644 meta/classes/archive-original-source.bbclass
 delete mode 100644 meta/classes/archive-patched-source.bbclass
Ross Burton - March 13, 2014, 5:45 p.m.
On 11 March 2014 17:08, Robert Yang <liezhi.yang@windriver.com> wrote:
> Robert Yang (6):
>   classes/archive*.bbclass: remove archive-*-source.bbclass
>   archiver.bbclass: refactor it
>   package_rpm.bbclass: archive the source to srpm package
>   archiver.bbclass: move a few code to copyleft_compliance.bbclass
>   local.conf.sample.extended: update for the archiver
>   patch.bbclass: do_patch: unset TMPDIR from environment

This series appears to work for me and doesn't cause rebuilds (after
removing the patch change, as that obviously does).  Can anyone else
who actively uses the archiver verify that it still works for them?

Cheers,
Ross
Robert Yang - March 14, 2014, 3:03 p.m.
On 03/14/2014 01:45 AM, Burton, Ross wrote:
> On 11 March 2014 17:08, Robert Yang <liezhi.yang@windriver.com> wrote:
>> Robert Yang (6):
>>    classes/archive*.bbclass: remove archive-*-source.bbclass
>>    archiver.bbclass: refactor it
>>    package_rpm.bbclass: archive the source to srpm package
>>    archiver.bbclass: move a few code to copyleft_compliance.bbclass
>>    local.conf.sample.extended: update for the archiver
>>    patch.bbclass: do_patch: unset TMPDIR from environment
>
> This series appears to work for me and doesn't cause rebuilds (after
> removing the patch change, as that obviously does).  Can anyone else
> who actively uses the archiver verify that it still works for them?
>

Thank you very much for the testing and suggestions, I've updated it
a little:

* Remove the [PATCH 6/6] which is used for unset the TMPDIR, we can fix
   it in another thread as bug 5968 describes since it doesn't affect the
   archiver.

* Modified the do_ar_configured a little and tested the "bitbake
   core-image-sato world meta-toolchain", it worked well.

Here is the repo: (the same repo as before)

   git://git.openembedded.org/openembedded-core-contrib rbt/archiver_v3
 
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/archiver_v3

Robert Yang (5):
   classes/archive*.bbclass: remove archive-*-source.bbclass
   archiver.bbclass: refactor it
   package_rpm.bbclass: archive the source to srpm package
   archiver.bbclass: move a few code to copyleft_compliance.bbclass
   local.conf.sample.extended: update for the archiver

// Robert

> Cheers,
> Ross
>
>
Paul Eggleton - March 19, 2014, 12:14 p.m.
Hi Robert,

On Wednesday 12 March 2014 01:08:18 Robert Yang wrote:
> === V3:
> * Do the unpack, patch and configure in another WORKDIR as RP and Ross
>   suggested, so that it would not affact the default build dependencies,
>   thanks for Ross' prototype.
> * Don't archive the logs (temp/log.do*), mainly because of:
>   - We can easily get the log via reset the T rather than use the
>     archiver.
>   - If we need archive the logs, we must let the task to run as the last
>     one, but it's hard to do this.
> 
> === V2:
> * Fix the warning between different machines which is reported by Martin
> * Fix the error when the archiver.bbclass is not inherited but
>   ARCHIVER_MODE[type] = "srpm" is set, reported by Ross.
> * Fix the archiving for gcc staff which uses the shared source according
>   to the recently changes of prefuncs and postfuncs in bitbake, so it only
>   works well with bitbake's up to date master branch, if we want to backport
> it, we also need backport the pre/postfuncs related patches.
> 
> === V1:
> * The archive*.bbclass didn't work, and there were a few problems, for
>   example:
>   1) There were a few duplicated code
>   2) There was no src_dir.org (or orig), but the diff command still use
>      it, and it is not easy to fix this issue if we don't change a lot
>      of the code.
>   3) It didn't archive the source for the native or gcc
>   4) The work flow is not very well
>   5) The "subprocess.call('fakeroot cp xxxx'" should be removed
>   6) And others ...
> 
> * So that we have to refactor it, the benefits are:
>   1) Fix the problems and make it work well.
>   2) Reduce more than 400 lines in total.
>   3) Make it easy to use.
> 
> // Robert
> 
> 
> The following changes since commit 23f7decb84922a3467c5b10b013e66596926b5cf:
> 
>   .templateconf: New file for customized template defaults (2014-03-11
> 08:11:07 -0700)
> 
> are available in the git repository at:
> 
>   git://git.openembedded.org/openembedded-core-contrib rbt/archiver_v3
>  
> http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/
> archiver_v3
> 
> Robert Yang (6):
>   classes/archive*.bbclass: remove archive-*-source.bbclass
>   archiver.bbclass: refactor it
>   package_rpm.bbclass: archive the source to srpm package
>   archiver.bbclass: move a few code to copyleft_compliance.bbclass
>   local.conf.sample.extended: update for the archiver

I've had a look at this series - great work on the refactoring and cleanup! 
There were a couple of things I noticed, I've replied to the individual 
patches.

Cheers,
Paul
Richard Purdie - March 21, 2014, 5:03 p.m.
On Fri, 2014-03-14 at 23:03 +0800, Robert Yang wrote:
> 
> On 03/14/2014 01:45 AM, Burton, Ross wrote:
> > On 11 March 2014 17:08, Robert Yang <liezhi.yang@windriver.com> wrote:
> >> Robert Yang (6):
> >>    classes/archive*.bbclass: remove archive-*-source.bbclass
> >>    archiver.bbclass: refactor it
> >>    package_rpm.bbclass: archive the source to srpm package
> >>    archiver.bbclass: move a few code to copyleft_compliance.bbclass
> >>    local.conf.sample.extended: update for the archiver
> >>    patch.bbclass: do_patch: unset TMPDIR from environment
> >
> > This series appears to work for me and doesn't cause rebuilds (after
> > removing the patch change, as that obviously does).  Can anyone else
> > who actively uses the archiver verify that it still works for them?
> >
> 
> Thank you very much for the testing and suggestions, I've updated it
> a little:
> 
> * Remove the [PATCH 6/6] which is used for unset the TMPDIR, we can fix
>    it in another thread as bug 5968 describes since it doesn't affect the
>    archiver.
> 
> * Modified the do_ar_configured a little and tested the "bitbake
>    core-image-sato world meta-toolchain", it worked well.
> 
> Here is the repo: (the same repo as before)
> 
>    git://git.openembedded.org/openembedded-core-contrib rbt/archiver_v3
>  
> http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/archiver_v3
> 
> Robert Yang (5):
>    classes/archive*.bbclass: remove archive-*-source.bbclass
>    archiver.bbclass: refactor it
>    package_rpm.bbclass: archive the source to srpm package
>    archiver.bbclass: move a few code to copyleft_compliance.bbclass
>    local.conf.sample.extended: update for the archiver

I'm going to merge this into master (its queued in master-next for final
testing) but this is on the condition that we work on follow up patches
to the issues raised during review.

Cheers,

Richard