Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Emerge progress bar
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
gsfgf
Veteran
Veteran


Joined: 08 May 2002
Posts: 1266

PostPosted: Sat Mar 22, 2003 3:44 pm    Post subject: Reply with quote

i tried it, and emerge hung after calling make. Cool idea though. Does it depend on stuff not in the ebuild?
_________________
Aim:gsfgf0
Back to top
View user's profile Send private message
dev
Apprentice
Apprentice


Joined: 06 Jul 2002
Posts: 248
Location: San Antonio, TX

PostPosted: Sat Mar 22, 2003 4:51 pm    Post subject: Reply with quote

gsfgf wrote:
i tried it, and emerge hung after calling make. Cool idea though. Does it depend on stuff not in the ebuild?


What package?
Back to top
View user's profile Send private message
balk
n00b
n00b


Joined: 10 Apr 2002
Posts: 62
Location: Olanda

PostPosted: Sun Mar 23, 2003 8:24 am    Post subject: Re: Emerge progress bar Reply with quote

duff wrote:
Code:
# NOPROGRESS="yes" emerge foo

Quote:
besides taht I don't get to see any bar, mozilla 1.3 won't build with this thing, has anyone else also tried this?

the build keeps hanging on "make WORKDIR=/var/tmp/portage/mozilla-1.3/work"

I did, same error. But setting NOPROGRESS="YES" solves the problem for now (still building)
_________________
Powered by Gentoo since 1.0_rc6
Back to top
View user's profile Send private message
H-Pi
Apprentice
Apprentice


Joined: 26 Jun 2002
Posts: 175
Location: Delft (NL)

PostPosted: Sun Mar 23, 2003 3:08 pm    Post subject: Reply with quote

yeah I know, but it was just to alert the maker, and check if it was my problem or anyone had trouble with mozilla
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Sun Mar 23, 2003 3:53 pm    Post subject: Reply with quote

Great addition to portage :)
It would be even greater if the progress bar could run in a different window.
I run my emerges on a console; having the package-name and the progress in a tiny window/systray on my graphical desktop would be way cool 8)
Back to top
View user's profile Send private message
count
Apprentice
Apprentice


Joined: 28 May 2002
Posts: 242
Location: Dalton, MA

PostPosted: Sun Mar 23, 2003 4:06 pm    Post subject: Reply with quote

I've started helping out a bit with GnoPortage (a Gnome interface to portage) and this progess bar code could really be helpful.

Credit will of course be given where due ;)
_________________
- Joseph Monti
_________________
This message is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more info visit http://joemonti.org/
Back to top
View user's profile Send private message
Princess Firefly
Tux's lil' helper
Tux's lil' helper


Joined: 21 Apr 2002
Posts: 80

PostPosted: Mon Mar 24, 2003 8:08 am    Post subject: more than 100% Reply with quote

I haven't looked at your code but it seems like we're working on a similar thing. The post dealing with my script is here.

Anyway, I recently noticed that for a couple of ebuilds I was getting my progress bar going over 100% as well. One reason was that some ebuilds have "make -n" lines like this:

Code:
/bin/sh ./libtool --mode=compile gcc -DGHTTP_MAJOR_VERSION=1 -DGHTTP_MINOR_VERSION=0 -DGHTTP_MICRO_VERSION=9 -DPACKAGE=\"libghttp\" -DVERSION=\"1.0.9\" -DSTDC_HEADERS=1  -I. -I.      -march=pentium3 -O3 -pipe -c ghttp.c


but when you actually make them it turns into:

Code:
/bin/sh ./libtool --mode=compile gcc -DGHTTP_MAJOR_VERSION=1 -DGHTTP_MINOR_VERSION=0 -DGHTTP_MICRO_VERSION=9 -DPACKAGE=\"libghttp\" -DVERSION=\"1.0.9\" -DSTDC_HEADERS=1  -I. -I.      -march=pentium3 -O3 -pipe -c ghttp.c
mkdir .libs
gcc -DGHTTP_MAJOR_VERSION=1 -DGHTTP_MINOR_VERSION=0 -DGHTTP_MICRO_VERSION=9 -DPACKAGE=\"libghttp\" -DVERSION=\"1.0.9\" -DSTDC_HEADERS=1 -I. -I. -march=pentium3 -O3 -pipe -c ghttp.c  -fPIC -DPIC -o .libs/ghttp.lo


That's 2 lines that contain gcc in the real make for one line that contains gcc in the make -n.

I used grep to count instances of "gcc" and when checking the output of the real make I had to change "currentgcc=$(grep -c "gcc" Build.log)" to be "currentgcc=$(grep -c ^"gcc" Build.log)" (notice addition of ^ sign). This only counts lines with gcc at the front and seemed to fix the overestimation.

xpfx
Back to top
View user's profile Send private message
The Jaff
n00b
n00b


Joined: 14 Mar 2003
Posts: 26
Location: Sweden

PostPosted: Mon Mar 24, 2003 8:07 pm    Post subject: WARNING! Reply with quote

Warning!
This ebuild (emerge-progress) completely breaks emerging/compilation/installation of OpenSSL (libssl.so.something goes missing) and as a conseqence (at least on my system) gdm, metacity, gnome etc. stop functioning. Even with NOPROGRESS="yes" the problem is still there.
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Mon Mar 24, 2003 9:25 pm    Post subject: Reply with quote

Kewl :)
Quote:

* Building GCC...
make -j2 bootstrap-lean LIBPATH=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2 BOOT_CF LAGS=-march=athlon-xp -pipe STAGE1_CFLAGS=-O
[267%] [************************************************************]


But it works OK :)
Back to top
View user's profile Send private message
Jarjar
Apprentice
Apprentice


Joined: 21 Jul 2002
Posts: 265
Location: Sweden

PostPosted: Mon Mar 24, 2003 9:44 pm    Post subject: Re: WARNING! Reply with quote

The Jaff wrote:
Warning!
This ebuild (emerge-progress) completely breaks emerging/compilation/installation of OpenSSL (libssl.so.something goes missing) and as a conseqence (at least on my system) gdm, metacity, gnome etc. stop functioning. Even with NOPROGRESS="yes" the problem is still there.

Either that, or openssl fucks itself. ;)
Code:

>>> Downloading http://cesnet.dl.sourceforge.net/sourceforge/xine/xine-lib-0.9.13.tar.gz
/usr/bin/wget: error while loading shared libraries: libssl.so.0.9.6: cannot open shared object file                                                            : No such file or directory
>>> Downloading http://switch.dl.sourceforge.net/sourceforge/xine/xine-lib-0.9.13.tar.gz
/usr/bin/wget: error while loading shared libraries: libssl.so.0.9.6: cannot open shared object file                                                            : No such file or directory
>>> Downloading http://flow.dl.sourceforge.net/sourceforge/xine/xine-lib-0.9.13.tar.gz
/usr/bin/wget: error while loading shared libraries: libssl.so.0.9.6: cannot open shared object file                                                            : No such file or directory
!!! Couldn't download xine-lib-0.9.13.tar.gz. Aborting.

Any fix?
_________________
[Server etc. | C2D 2.2 @ 3.0 GHz / 4 GB RAM / 3x1 TB + 1x2 TB SATA disks + 1.5 TB ext. | Gentoo]
[Laptop | Macbook Pro 15" / Core i7 (Sandy) Quad 2.2 GHz / 16 GB RAM / Samsung 840 250 GB SSD + 1 TB + 2 TB HDD / 6750M 1 GB / OS X, Win 7]
Back to top
View user's profile Send private message
duff
Guru
Guru


Joined: 19 Jun 2002
Posts: 466
Location: Clemson, SC

PostPosted: Mon Mar 24, 2003 10:09 pm    Post subject: Reply with quote

Whoo, this is going to be a long reply. Hope I address everything.

First, thanks to everyone's positive reaction, even though it's not as perfect as we would all hope.

So, the mozilla issue. I've noticed that...and it actually will work (eventually). I let it run on my P4 2GHz for an hour and it eventually started. So what's the problem? If you're familiar with Makefiles, you should know that make sets the internal variable MAKE to the command you used and all the non-target arguments you pass to it. But for some reason, the Mozilla devs didn't trust make and in client.mk (IIRC) the have the line
Code:
MAKE := gmake
or something to that effect. :? I've commented off this line and built Mozilla directly (using emake):[img:8c687b5eff]http://www.ces.clemson.edu/~eduffy/ss-moz.png[/img:8c687b5eff]
So, the progress bar is a little off (should be no surprise at this point). But at least it didn't hang. I haven't give this a lot of thought..but I'll try to come up with some reasonable hack to get around this.

*Levi* wrote:
Work pretty great. Stopped at 11% once, but otherwise kinda nifty! :)
Gah! 11%! which one did that?

dev wrote:
You know that the progress bar shows AFTER the ./configure portion right? It starts as soon as the compiling actually starts. So you won't see it right away.
Thanks for pointing that out...I forgot to mention that. So usually you see 2 progress bars, one for the build and one for the install.

TheCoop wrote:
how does it deal with build errors? Does it print the last gcc command, the error msgs and exit or jsut exit to the prompt?
I'm not sure...I can't think of the last time an ebuild didn't compile. It should just drop you back to the shell. Then you can cd over to the /var/tmp/...work directory and run the real make from there.

H-Pi wrote:
this brings me to the idea that you could build in a estimated time average calculator, like wget has, or is the make-proces too non-linear for this?
Too hard too calculate. Between regular shell commands and comiling C or C++ code of varing lengths, I have no idea how to compute an ETA for that. But if somelse wants to try it, be my guest! :wink:

The Jaff wrote:
NOPROGRESS="yes" is a bit.. backwards, innit?
Of course, this would mean that PROGRESS="yes" should be the default.

I agree with you, but to disable color in emerge you set the NOCOLOR variable to yes, I was going for consistancy over logic. :P

H-Pi wrote:
whoops, the make of xscreensaver goes a little too high (and it's still busy):

HOLY #(*$, 19,000%! 8O

H-Pi wrote:
I'm interested in which technique you used for the bar to calculate the percentages
You can look in /usr/lib/portage/bin/make. It's the same way we were all tought how to calculate percentages in kindergarden. 100*current/total.

Lowspirit wrote:
Still interested in knowing if the Portage dev have been made aware of this? Have this been filed on Bugzilla cause it should (as an enhancement).
Hadn't yet. I wanted to see how was accepted by users and how well it stood up before I made an ass out of myself in front of the devs. I want to work on some more improvements before it goes on Bugzilla.

gsfgf wrote:
i tried it, and emerge hung after calling make. ... Does it depend on stuff not in the ebuild?

Just grep, ps, ls, and wc. Can't imagine anyone not having these.

AlterEgo wrote:
It would be even greater if the progress bar could run in a different window.
I run my emerges on a console; having the package-name and the progress in a tiny window/systray on my graphical desktop would be way cool 8)

Ehhh... would a comination of pipes and root-tail help? :|

count wrote:
I've started helping out a bit with GnoPortage (a Gnome interface to portage) and this progess bar code could really be helpful.
I've been keeping my eye on that project, and if there's anything I could do to help format it, let me know. You could have GnoPortage execute emerge as
Code:
# GNOPORTAGE=1 emerge foo
and I could have it the output easier to handle on the GUI end.
Princess Firefly wrote:
I haven't looked at your code but it seems like we're working on a similar thing. ...

Thanks for the info, but I think I may be counting differently then you. I don't count the number of lines or even the number of commands that get executed; I count the number of lines that make directly executes. So when make -n shows just one command, that is the only command executed by make. I don't count the two that are called by the sh process that's spawned.
Back to top
View user's profile Send private message
duff
Guru
Guru


Joined: 19 Jun 2002
Posts: 466
Location: Clemson, SC

PostPosted: Mon Mar 24, 2003 10:18 pm    Post subject: Re: WARNING! Reply with quote

The Jaff wrote:
Warning!
This ebuild (emerge-progress) completely breaks emerging/compilation/installation of OpenSSL (libssl.so.something goes missing) and as a conseqence (at least on my system) gdm, metacity, gnome etc. stop functioning. Even with NOPROGRESS="yes" the problem is still there.

:( Does an emerge -C openssl and a re-emerge help?
Back to top
View user's profile Send private message
Jarjar
Apprentice
Apprentice


Joined: 21 Jul 2002
Posts: 265
Location: Sweden

PostPosted: Mon Mar 24, 2003 10:57 pm    Post subject: Re: WARNING! Reply with quote

duff wrote:
The Jaff wrote:
Warning!
This ebuild (emerge-progress) completely breaks emerging/compilation/installation of OpenSSL (libssl.so.something goes missing) and as a conseqence (at least on my system) gdm, metacity, gnome etc. stop functioning. Even with NOPROGRESS="yes" the problem is still there.

:( Does an emerge -C openssl and a re-emerge help?

Just "emerge -C openssl && emerge openssl" didn't help.
I gotta fix this soon..
ssh, wget, maybe Galeon (I don't dare to restart it..) _needs_ libcrypto.so* and/or libssl.so*. :(
_________________
[Server etc. | C2D 2.2 @ 3.0 GHz / 4 GB RAM / 3x1 TB + 1x2 TB SATA disks + 1.5 TB ext. | Gentoo]
[Laptop | Macbook Pro 15" / Core i7 (Sandy) Quad 2.2 GHz / 16 GB RAM / Samsung 840 250 GB SSD + 1 TB + 2 TB HDD / 6750M 1 GB / OS X, Win 7]
Back to top
View user's profile Send private message
TecHunter
Tux's lil' helper
Tux's lil' helper


Joined: 15 Feb 2003
Posts: 124

PostPosted: Tue Mar 25, 2003 1:15 am    Post subject: Reply with quote

o
great
i hope it could be one of the official character of emerge in the near future
_________________
Gentoo is GREAT!!!
Back to top
View user's profile Send private message
scrllock
Tux's lil' helper
Tux's lil' helper


Joined: 14 Oct 2002
Posts: 102

PostPosted: Tue Mar 25, 2003 2:06 am    Post subject: Reply with quote

well, this is a very neat tool, except that it screws up my openssl... thus i was forced to uninstall it.
Back to top
View user's profile Send private message
H-Pi
Apprentice
Apprentice


Joined: 26 Jun 2002
Posts: 175
Location: Delft (NL)

PostPosted: Tue Mar 25, 2003 10:47 am    Post subject: Reply with quote

duff wrote:

H-Pi wrote:
this brings me to the idea that you could build in a estimated time average calculator, like wget has, or is the make-proces too non-linear for this?
Too hard too calculate. Between regular shell commands and comiling C or C++ code of varing lengths, I have no idea how to compute an ETA for that. But if somelse wants to try it, be my guest! :wink:


well, in your script, you could add something like (I'm not that good in bash so I'll try to explain in c-ish code):

Code:

starttime = currentTime;
while (read token) {
    eta = ((total - current) / current) * (currentTime - startTime);
    ....      // some code to update the eta counter just like the percentage counter does
    ....      // the rest as it is now
}


where currentTime is the current time as it when you call it, I think you could do that with 'date' right?

you see the eta counter statrs with 0, because it hasn't measured anything, but when the time increases, it'll become more precise

I just used the sam 'current' and 'total' from your script

the calculation I used did I learn in the incubator ;)

I should learn some bash scripting :)

Quote:
You can look in /usr/lib/portage/bin/make. It's the same way we were all tought how to calculate percentages in kindergarden. 100*current/total.


I understand, but just wondered where you got the total from, but I think I understood the source now


Last edited by H-Pi on Wed Mar 26, 2003 11:30 am; edited 1 time in total
Back to top
View user's profile Send private message
The Jaff
n00b
n00b


Joined: 14 Mar 2003
Posts: 26
Location: Sweden

PostPosted: Tue Mar 25, 2003 1:33 pm    Post subject: Re: WARNING! Reply with quote

Jarjar wrote:
The Jaff wrote:
Warning!
This ebuild (emerge-progress) completely breaks emerging/compilation/installation of OpenSSL (libssl.so.something goes missing) and as a conseqence (at least on my system) gdm, metacity, gnome etc. stop functioning. Even with NOPROGRESS="yes" the problem is still there.

Either that, or openssl fucks itself. ;)
Code:

>>> Downloading http://cesnet.dl.sourceforge.net/sourceforge/xine/xine-lib-0.9.13.tar.gz
/usr/bin/wget: error while loading shared libraries: libssl.so.0.9.6: cannot open shared object file                                                            : No such file or directory
>>> Downloading http://switch.dl.sourceforge.net/sourceforge/xine/xine-lib-0.9.13.tar.gz
/usr/bin/wget: error while loading shared libraries: libssl.so.0.9.6: cannot open shared object file                                                            : No such file or directory
>>> Downloading http://flow.dl.sourceforge.net/sourceforge/xine/xine-lib-0.9.13.tar.gz
/usr/bin/wget: error while loading shared libraries: libssl.so.0.9.6: cannot open shared object file                                                            : No such file or directory
!!! Couldn't download xine-lib-0.9.13.tar.gz. Aborting.

Any fix?


This works:
Code:
# emerge unmerge emerge-progress; emerge openssl
Im leaving this ebuild (emerge-progress) out of my system until it has matured a bit. :roll:
Back to top
View user's profile Send private message
bushwakko
Guru
Guru


Joined: 25 Mar 2003
Posts: 495

PostPosted: Tue Mar 25, 2003 1:48 pm    Post subject: oh my god! :) Reply with quote

It worked like a charm, i got 100% on the first emerge i did :)
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Tue Mar 25, 2003 8:05 pm    Post subject: Reply with quote

duff wrote:

AlterEgo wrote:
It would be even greater if the progress bar could run in a different window.
I run my emerges on a console; having the package-name and the progress in a tiny window/systray on my graphical desktop would be way cool 8)

Ehhh... would a comination of pipes and root-tail help? :|


Maybe my English is falling short :roll:
Are you suggesting to run the emerge from a terminal window and pipe the output to a file, that can in turn be viewed using "tail" from the graphical desktop?
That's actually a very simple idea, and worth trying, thanks! (although I feel a tiny bit stupid that I haven't thought of that myself :oops: )
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Tue Mar 25, 2003 10:39 pm    Post subject: Reply with quote

Something else: maybe related to the openssl-problem I just reproduced:

I use a home-made ebuild for lmule. It breaks without using emerge-progress , but is does not break when I emerge it using emerge-progress: it just seems to skip installing a whole bunch of files without producing error messages. This is worrying if this would also happen using official ebuilds.
Back to top
View user's profile Send private message
The Jaff
n00b
n00b


Joined: 14 Mar 2003
Posts: 26
Location: Sweden

PostPosted: Tue Mar 25, 2003 10:55 pm    Post subject: Reply with quote

Quote:
Quote:
The Jaff wrote:
NOPROGRESS="yes" is a bit.. backwards, innit?
Of course, this would mean that PROGRESS="yes" should be the default.


I agree with you, but to disable color in emerge you set the NOCOLOR variable to yes, I was going for consistancy over logic. :)

SCREW consistancy! Long live logic! :wink:
Back to top
View user's profile Send private message
The Jaff
n00b
n00b


Joined: 14 Mar 2003
Posts: 26
Location: Sweden

PostPosted: Tue Mar 25, 2003 11:01 pm    Post subject: Reply with quote

AlterEgo wrote:
duff wrote:

AlterEgo wrote:
It would be even greater if the progress bar could run in a different window.
I run my emerges on a console; having the package-name and the progress in a tiny window/systray on my graphical desktop would be way cool 8)

Ehhh... would a comination of pipes and root-tail help? :|


Maybe my English is falling short :roll:
Are you suggesting to run the emerge from a terminal window and pipe the output to a file, that can in turn be viewed using "tail" from the graphical desktop?
That's actually a very simple idea, and worth trying, thanks! (although I feel a tiny bit stupid that I haven't thought of that myself :oops: )


I think he means that you could
Code:
 # tail -f /var/log/emerge.log

and maybe run it in a transparent borderless Eterm on the root window for example (thats what I do.. :)). Piping the progress bar from emerge-progress.ebuild to a file wont work since it uses the \r (carrige return) which I believe also causes a \n (newline) to be written to a file.
Back to top
View user's profile Send private message
H-Pi
Apprentice
Apprentice


Joined: 26 Jun 2002
Posts: 175
Location: Delft (NL)

PostPosted: Wed Mar 26, 2003 12:15 pm    Post subject: Reply with quote

ok, changed the make a little to show what I meant:
the "# --> " parts need to be taken away
the strange thing is, when I tried it with just numbers instead of those 'date' things, the bar didn't show, but when I removed the startTime and currentTime initiations before the loop and used some ints in my eta count it did work
I don't understand that, because 'current=1' does work, why for example 'startTime=1' not?

part of /usr/lib/portage/bin/make I modified:

Code:

      # --> startTime=`date -somethingToShowSeconds`
      # --> currentTime=startTime

      while read token
      do
         [ "${token}" != "+" ] && continue
         let "percentage=100*current/total"
         P=`printf "%3d%%" ${percentage}`
         # --> let "eta=(total-current)/current*(currentTime-startTime)"
         # --> E=`printf "%3d%%" ${eta}`
         #echo "TOKEN: (${current}). ${token} = ${percentage}%"
     
         let "bar=50*current/total"
         B=""
         C=50
         while [ ${C} -gt 0 ]
         do
            if [ ${C} -le ${bar} ]
            then
               B="*${B}"
            else
               B=" ${B}"
            fi
            let "C=${C}-1"
         done
   
         echo -en "\r [${P}] [${B}]  "
         # --> echo -en "\r [${P}] [${B}] ETA: [${E}]  "
         let "current=1+${current}"
         # --> currentTime=`date -somethingToShowSeconds`
      done
Back to top
View user's profile Send private message
wbsoft
n00b
n00b


Joined: 26 Aug 2002
Posts: 73
Location: the Netherlands

PostPosted: Thu Mar 27, 2003 9:38 am    Post subject: Reply with quote

Wouldn't it be a better idea to have some indication of the needed CPU cycles in the ebuild script? It could be recorded during the first time the build script is used by the gentoo developers, taking the nice value and overall system load into account, of course.

Then on the user's system Portage could make a good guess, again taking into account the CPU freq and system load etc. about the time elapsed.
Back to top
View user's profile Send private message
frippz
Guru
Guru


Joined: 22 Aug 2002
Posts: 460
Location: Sweden

PostPosted: Thu Mar 27, 2003 10:04 am    Post subject: Reply with quote

duff wrote:
Gah! 11%! which one did that?

I'm sorry, I can't remember which one. I tried the progressbar with a small application and it only happened once. No biggie, really. :wink:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo Chat All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 2 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum