Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#1694 closed defect (fixed)

Measured times and sizes include packaging, when package management is in effect

Reported by: Pierre Labastie Owned by: Pierre Labastie
Priority: normal Milestone: 3.0
Component: jhalfs Version: SVN
Severity: normal Keywords:
Cc:

Description


Change History (13)

comment:1 by Pierre Labastie, 7 years ago

Owner: changed from alfs-log@… to Pierre Labastie
Status: newassigned

comment:2 by Pierre Labastie, 7 years ago

Summary: Measured times include packaging, when package management is in effectMeasured times and sizes include packaging, when package management is in effect

This is not a small change, because right now, the total size of the system is measured before launching the scriptlet, and after it has exited. For times, it is slightly easier, because the command to report the time is included in the scriptlet.

comment:3 by Pierre Labastie, 7 years ago

Milestone: 2.4

Let's try to do that for 2.4, but if the changes are to painful, we'll revert to 3.0.

comment:4 by Pierre Labastie, 7 years ago

For SBU, It is easy to output the "Totalseconds: ..." before packing and after install.

For sizes, it is more complicated: right now, the Makefile outputs "KB: ..." before unpacking the tarball, and another "KB: ..." after the script exits. The computation is done in the following way: Required space : KB after - KB before Installed size : KB before next script - KB before this script.

We can of course keep the same protocol for "KB before", and get a value of "KB after" by outputting after install and before packing. Problem is the installed size. The next "KB before" will include both installed size and the size of the package binary (.deb or .tar.gz).

We can get the installed size from "du -sk $PKG_DEST", but then we would have to change the create-SBU_du-report.sh script, depending on whether we use package management or not...

Furthermore, when we later want to include porg style, it'll break again.

comment:5 by Pierre Labastie, 7 years ago

A possible plan:

  • Remove the second "KB: ..." generation from Makefile.
  • generate 2 "KB: ..." during the script, one before install, and one after. We would have 3 "KB: ..." values (KB1, KB2, KB3) and we can compute:
    • Required size = KB3 -KB1
    • Installed size = KB3 -KB2

Let's try that...

comment:6 by Pierre Labastie, 7 years ago

But now, we would change "create-sbu_du-report.sh to account for those 3 values. This means it will not work anymore for CLFS... Or we have to change CLFS too. Well it's just a few lines more in clfs.xsl. It is maybe a big change for a "rc" time, but let's try...

comment:7 by Pierre Labastie, 7 years ago

Problem is with packages, which do things after install: tests for systemd and dejagnu, and locales in glibc (actually, I'm not sure how those should be counted, since the user may choose to not install them or to install all, or to install one more for her(his) own locale). Anyway, those things occur after the binary package has been saved to its repo, so all size calculation will include the size of the binary package, unless we exclude /var/lib/packages from the du command. But wait, what about the timings?

Wouldn't it be possible to packInstall after the "adjust"/"test" phase? I'd say it's the way to go.

in reply to:  7 comment:8 by Pierre Labastie, 7 years ago

Replying to pierre:

Problem is with packages, which do things after install: tests for systemd and dejagnu, and locales in glibc (actually, I'm not sure how those should be counted, since the user may choose to not install them or to install all, or to install one more for her(his) own locale). Anyway, those things occur after the binary package has been saved to its repo, so all size calculation will include the size of the binary package, unless we exclude /var/lib/packages from the du command. But wait, what about the timings?

Wouldn't it be possible to packInstall after the "adjust"/"test" phase? I'd say it's the way to go.

No, it is just stupid: those phases need an installed package...

comment:9 by Pierre Labastie, 7 years ago

OK, I cannot think of a "minimal" way of doing this. I'll move the milestone to 3.0, and document that figures are wrong when using package management. Hmm, maybe a more radical way: make package management incompatible with SBU report in Config.in!

comment:10 by Pierre Labastie, 7 years ago

Milestone: 2.43.0

comment:11 by Pierre Labastie, 7 years ago

Workaround committed in r3924 r3925: Make SBU and size computations incompatible with package management in Config.in...

comment:12 by Pierre Labastie, 7 years ago

4 months later, had some time to think a little more:

  • for SBUs: From man bash about the SECONDS variable:
    Each time this parameter is referenced, the  number  of  seconds
    since  shell  invocation is returned.  If a value is assigned to
    SECONDS, the value returned upon subsequent  references  is  the
    number  of seconds since the assignment plus the value assigned.
    
    so it is possible to have something like:
    PREV_SEC=$SECONDS
    PackInstall
    SECONDS=$PREV_SEC
    
    and the packing time is not counted.
  • for Sizes: just exclude /var/lib from du commands

comment:13 by Pierre Labastie, 7 years ago

Resolution: fixed
Status: assignedclosed

Timings and sizes are the same with anf without package management now. Fixed at r3976 in trunk and r3977 in 2.4 branch.

Last edited 7 years ago by Pierre Labastie (previous) (diff)
Note: See TracTickets for help on using tickets.