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

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


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

PostPosted: Wed Mar 19, 2003 2:36 pm    Post subject: Emerge progress bar Reply with quote

The other night I decided to try to get a progress bar into emerge...and I had some luck. It's not perfect, but if anybody wants it, its available here. Untar it, put it in your $PORTDIR_OVERLAY directory, and emerge it (it's a ~x86).
Just so there's no surprises, this is what the ebuild does. First, it's gets a copy of the make-3.80 sources and applies a small patch I wrote to it, and installs it as maketoo. Don't use program by itself, I've strip most of the output from it and removed some error checking. It's intened to only be used by portage, so I feel it's safe to assume the programs will make correctly. The second part of this ebuild installs a script called "make" into your /usr/lib/portage/bin/ directory. This is used to catch calls to make from ebuilds. If this script isn't called directly from emake or ebuild.sh, it will forward on to /usr/bin/make (ie. if it was invoked from a configure script).
The make script makes two calls to maketoo, the first to figure out how many commands it will execute, and the second performs the actual building while displaying the progress bar. The bar is mostly accurate, it's stopped at exactly 100% on almost every ebuild I tried...a few stopped at 99%, another went up to 101%. But even though its off by a little, I still find it useful.
One last thing, if for some reason it seems the new make script is screwing you over, set the NOPROGRESS variable to yes. (and please let me know about it!)
Code:
# NOPROGRESS="yes" emerge foo

If all goes well, you should see something like this:
[img:37c6f6c15c]http://www.ces.clemson.edu/~eduffy/prog.png[/img:37c6f6c15c]

Any and all comments are welcome, as are suggestions/fixes/improvements. I'm going away for a few days, so it may be a while before I respond. I'll keep working on it off and on to try to improve the accuracy.
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 19, 2003 2:58 pm    Post subject: Reply with quote

the build went fine, but I don't get to see any bar when I emerge something, do I need to config something?
Back to top
View user's profile Send private message
Lowspirit
Apprentice
Apprentice


Joined: 31 Jul 2002
Posts: 258
Location: Northern Sweden

PostPosted: Wed Mar 19, 2003 7:05 pm    Post subject: Reply with quote

This looks very interesting until someone tells me otherwise (got to be a reason it haven't been made before...or?). Especially for portage GUI like KPortage and Gnoportage, having access to current progress would make emerging stuff similar to you basic mozilla download, with progressbar and all.
_________________
Gentoo | AMD X2 3800+ 2GB RAM | Kernel 2.6.30 . ReiserFS . CFQ . GCC4.3.3 | Firefox 3.5 | Gnome 2.26 w/ Compiz-Fusion
"Penguins are the only fish that can fly"
Back to top
View user's profile Send private message
dev
Apprentice
Apprentice


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

PostPosted: Wed Mar 19, 2003 9:10 pm    Post subject: Reply with quote

Works great, thanks!
Back to top
View user's profile Send private message
frippz
Guru
Guru


Joined: 22 Aug 2002
Posts: 460
Location: Sweden

PostPosted: Wed Mar 19, 2003 9:13 pm    Post subject: Reply with quote

Work pretty great. Stopped at 11% once, but otherwise kinda nifty! :)
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 19, 2003 10:15 pm    Post subject: Reply with 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"
Back to top
View user's profile Send private message
dev
Apprentice
Apprentice


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

PostPosted: Wed Mar 19, 2003 10:20 pm    Post subject: Reply with quote

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. I'm about to test mozilla1.3 with it so I'll let you know.

edit:

Building Mozilla 1.3 does hang. Other than that everything else I've tested built fine.

Code:
creating pr/src/memory/Makefile
creating pr/src/misc/Makefile
creating pr/src/threads/Makefile
creating pr/tests/Makefile
creating pr/tests/dll/Makefile
creating pr/src/pthreads/Makefile
configure: warning: Recreating autoconf.mk with updated nspr-config output
 * Building Mozilla...
make WORKDIR=/var/tmp/portage/mozilla-1.3/work
Back to top
View user's profile Send private message
bleakcabal
Guru
Guru


Joined: 10 Oct 2002
Posts: 301
Location: Montreal, Québec, Canada

PostPosted: Wed Mar 19, 2003 10:35 pm    Post subject: Reply with quote

This should be included in the next version of portage !
Back to top
View user's profile Send private message
Sierra
n00b
n00b


Joined: 13 Mar 2003
Posts: 48

PostPosted: Thu Mar 20, 2003 1:23 am    Post subject: Reply with quote

Pretty neat! I'm impressed!
Back to top
View user's profile Send private message
whitenoise
Tux's lil' helper
Tux's lil' helper


Joined: 24 May 2002
Posts: 88
Location: Genoa , Italy

PostPosted: Thu Mar 20, 2003 1:12 pm    Post subject: Reply with quote

great!
_________________
Gentoo Linux running on TyanMPX, 2* 1600+ AthlonMP, 4*256 Mb Crucial Registered DDR, Adaptec 29160, 2*18GB Fujitsu SCSI 10krpm, Nvidia geforce, SB Live!, 3com905TX, Zyxel 645R.
Back to top
View user's profile Send private message
TheCoop
Veteran
Veteran


Joined: 15 Jun 2002
Posts: 1814
Location: Where you least expect it

PostPosted: Thu Mar 20, 2003 5:30 pm    Post subject: Reply with quote

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?
_________________
95% of all computer errors occur between chair and keyboard (TM)

"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler

Change the world - move a rock
Back to top
View user's profile Send private message
Jarjar
Apprentice
Apprentice


Joined: 21 Jul 2002
Posts: 265
Location: Sweden

PostPosted: Thu Mar 20, 2003 9:20 pm    Post subject: Reply with quote

Could use some bugfixing. 120% on compiling XFree86 and I'd guess about 2 hours remains. :)
Nice job though, I sure am gonna keep it if it continues working like it did on the other packages i tried. 8)
Back to top
View user's profile Send private message
Schmolch
l33t
l33t


Joined: 16 Jun 2002
Posts: 746
Location: Germany

PostPosted: Thu Mar 20, 2003 9:55 pm    Post subject: Reply with quote

Wow,

I have no idea how this thing works so i hope you dont mind if im just greenly impressed :D
Back to top
View user's profile Send private message
weijia
n00b
n00b


Joined: 14 Sep 2002
Posts: 57

PostPosted: Fri Mar 21, 2003 2:27 am    Post subject: Reply with quote

Very nice program. Compiled it and installing KDE using this right now.
Back to top
View user's profile Send private message
H-Pi
Apprentice
Apprentice


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

PostPosted: Fri Mar 21, 2003 10:24 am    Post subject: Reply with quote

ah, it works indeed, I think I just had but luck with the wrong packages, like mozilla, very nice!

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?
Back to top
View user's profile Send private message
TheCoop
Veteran
Veteran


Joined: 15 Jun 2002
Posts: 1814
Location: Where you least expect it

PostPosted: Fri Mar 21, 2003 1:14 pm    Post subject: Reply with quote

for that you would have to do a test compile to determin how fast the system can compile a 1MB piece of C/C++ code then extrapolate that to the xMB compiles, although I suspect it would be a little more complicated than that
_________________
95% of all computer errors occur between chair and keyboard (TM)

"One World, One web, One program" - Microsoft Promo ad.
"Ein Volk, Ein Reich, Ein Führer" - Adolf Hitler

Change the world - move a rock
Back to top
View user's profile Send private message
H-Pi
Apprentice
Apprentice


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

PostPosted: Fri Mar 21, 2003 1:24 pm    Post subject: Reply with quote

TheCoop wrote:
for that you would have to do a test compile to determin how fast the system can compile a 1MB piece of C/C++ code then extrapolate that to the xMB compiles, although I suspect it would be a little more complicated than that


I thought the following:
every second (or some other interval, whatever), show 100 / n * t, where 'n' is the number of % in the bar and 't' is the time make has been busy on those n %

then after a couple %s, the ETA could be quite realistic I think

then you don't need test compiles, but it is only realistic when make is a bit linear, I don't know if that's the case
Back to top
View user's profile Send private message
ViCToR:
n00b
n00b


Joined: 16 Aug 2002
Posts: 46
Location: Barcelona, ES

PostPosted: Fri Mar 21, 2003 1:44 pm    Post subject: Reply with quote

Would it be wrong to think that if a machine with 4000 Bogomips takes 4 hours to compile a certain package, a machine with 2000 Bogomips will take around the double of time? I know many other factors like hard disk speed, memory installed, etc have also something to say. But wouldn't it also be a good starting point? Correct me if I'm wrong.
_________________
.:: ViCToR ::.
Back to top
View user's profile Send private message
The Jaff
n00b
n00b


Joined: 14 Mar 2003
Posts: 26
Location: Sweden

PostPosted: Fri Mar 21, 2003 1:45 pm    Post subject: Pretty cool. A few suggestions tho.. Reply with quote

First off, a very kool (read geeky) hack.

I have a (picky) suggestion:
Would'nt it be more intiutive to have the 'noprogress'-switch like this instead:
Code:

# PROGRESS="no" emerge foo

alt.
Code:

# PROGRESSBAR="no" emerge foo


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

I can also verify that it hangs when building mozilla (1.3).
Back to top
View user's profile Send private message
H-Pi
Apprentice
Apprentice


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

PostPosted: Fri Mar 21, 2003 2:02 pm    Post subject: Reply with quote

ViCToR: wrote:
Would it be wrong to think that if a machine with 4000 Bogomips takes 4 hours to compile a certain package, a machine with 2000 Bogomips will take around the double of time? I know many other factors like hard disk speed, memory installed, etc have also something to say. But wouldn't it also be a good starting point? Correct me if I'm wrong.


now just read what I said, and you see that you don't have to calculate in any factors
Back to top
View user's profile Send private message
H-Pi
Apprentice
Apprentice


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

PostPosted: Fri Mar 21, 2003 3:39 pm    Post subject: Reply with quote

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

[img:62d5ddff86]http://elektron.its.tudelft.nl/~piguil09/Screenshot-1.jpg[/img:62d5ddff86]


I'm interested in which technique you used for the bar to calculate the percentages
Back to top
View user's profile Send private message
iKiddo
Guru
Guru


Joined: 27 Jun 2002
Posts: 341
Location: Europe?

PostPosted: Fri Mar 21, 2003 4:13 pm    Post subject: Reply with quote

H-Pi wrote:
I'm interested in which technique you used for the bar to calculate the percentages

duff wrote:
The make script makes two calls to maketoo, the first to figure out how many commands it will execute, and the second performs the actual building while displaying the progress bar.
Back to top
View user's profile Send private message
H-Pi
Apprentice
Apprentice


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

PostPosted: Fri Mar 21, 2003 4:45 pm    Post subject: Reply with quote

iKiddo wrote:
H-Pi wrote:
I'm interested in which technique you used for the bar to calculate the percentages

duff wrote:
The make script makes two calls to maketoo, the first to figure out how many commands it will execute, and the second performs the actual building while displaying the progress bar.


duh

read my post again: which technique to calculate the percentages, not to split the make proces
Back to top
View user's profile Send private message
Lowspirit
Apprentice
Apprentice


Joined: 31 Jul 2002
Posts: 258
Location: Northern Sweden

PostPosted: Sat Mar 22, 2003 10:46 am    Post subject: Reply with quote

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). Sure, I still haven't had a single compile end at 100% but they are usually very close, which is more then enough for me.

And if a compile fail I just recompile it with noprogress to see the error, no biggie. Hope it get merged into officiall portage, could be off by default until they had it working to their liking.
_________________
Gentoo | AMD X2 3800+ 2GB RAM | Kernel 2.6.30 . ReiserFS . CFQ . GCC4.3.3 | Firefox 3.5 | Gnome 2.26 w/ Compiz-Fusion
"Penguins are the only fish that can fly"
Back to top
View user's profile Send private message
Jarjar
Apprentice
Apprentice


Joined: 21 Jul 2002
Posts: 265
Location: Sweden

PostPosted: Sat Mar 22, 2003 11:15 am    Post subject: Reply with quote

H-Pi wrote:
iKiddo wrote:
H-Pi wrote:
I'm interested in which technique you used for the bar to calculate the percentages

duff wrote:
The make script makes two calls to maketoo, the first to figure out how many commands it will execute, and the second performs the actual building while displaying the progress bar.


duh

read my post again: which technique to calculate the percentages, not to split the make proces

It tries to "figure out how many commands it will execute" and count the commands executed, I guess.
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 1, 2, 3, 4  Next
Page 1 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