FS#16165 - [vim] fetch_patches.sh is very slow, should use gzipped bundles
Attached to Project:
Arch Linux
Opened by Devin Cofer (Ranguvar) - Sunday, 13 September 2009, 04:25 GMT
Last edited by Dan Griffiths (Ghost1227) - Saturday, 13 February 2010, 21:01 GMT
Opened by Devin Cofer (Ranguvar) - Sunday, 13 September 2009, 04:25 GMT
Last edited by Dan Griffiths (Ghost1227) - Saturday, 13 February 2010, 21:01 GMT
|
Details
The [vim] package downloads patches one by one, which takes
a very long time as there are often hundreds of them.
The makers of Vim, fortunately, bundle up each series of 100 patches into a gzipped patch, which is available at, e.g., ftp://ftp.vim.org/pub/vim/patches/7.2/7.2.101-200.gz The fetch_patches.sh script should use the patch bundles when possible, to minimize makepkg time. I'll work on a patch when I have some time, but it'd be great if someone else could take a crack at it too, as I am still a Bash novice. |
This task depends upon
Closed by Dan Griffiths (Ghost1227)
Saturday, 13 February 2010, 21:01 GMT
Reason for closing: Fixed
Additional comments about closing: Not using gzipped bundles, but we have cut the download time down significantly. Take a look at my comment for details.
Saturday, 13 February 2010, 21:01 GMT
Reason for closing: Fixed
Additional comments about closing: Not using gzipped bundles, but we have cut the download time down significantly. Take a look at my comment for details.
The vim build process is already very complex so I'm a little hesitant to make it even more complex. However, I will review the patches and we will go from there.
I'm working on rewriting the script now, first as just cleared up and working with e.g. nonstandard chars in the build path ("$srcdir" as opposed to $srcdir, etc.), and then I'll make a patch for THAT to make it have this feature, so you can only apply the former if you like.
This will teach me a fair bit about shell scripting, so it'll be fun.
The new script is a fair bit longer than the old one, but IMHO more readable and more logical.
http://bugs.archlinux.org/task/12440?getfile=3141
But now that I look a bit closer at that patch and your new script, I think yours is nicer.
Another thing which bothers me. Are we really the only ones doing that ? I would guess virtually any vim packagers would need something like this. So how is everyone else doing it ? Everyone is writing his custom script on his side, without looking at what all the others are doing ?
If you go back in history, that's what we did: download all, concatenate them put that file in the repository until I got sick of the manual labour.
The current approach was developed under the estimation that people who build it download the stuff once and cache it. And it works fine for me as packager. I always have to download just like 20 patches and that's it.
I will look through your file when I have some time, Thanks.
Anyway I am probably more blaming this crappy upstream distribution model than the fetch patch script.
Otherwise, as I said in bbs ( http://bbs.archlinux.org/viewtopic.php?id=80886 ) :
I am as old as CVS, and people still don't get the point of Version Control System ?
Why don't we just use vim-cvs / vim-svn / vim-git / whatever instead of manually fetching all these patches ?
That way should reduce the complexity of arch pkgbuild and fetch_patches a lot, by moving the complexity to the vcs.
We would get the same code, easy way to rebuild the same code, easy and efficient way to update. The way I see it, it would be a win-win situation.
The fetch_patches framework came a long way. It's a tribute to vims admittedly awkward, but functioning development model. It allows people to just enter the version number they want and build the proper package. It might not be pretty but it works. For the vim fols and for us.
cvs -z3 -d:pserver:anonymous@vim.cvs.sf.net:/cvsroot/vim checkout vim7 4,42s user 1,10s system 38% cpu 14,382 total
This is the time makepkg needs just to dowload the three sources : vim-7.2.tar.bz2 vim-7.2-extra.tar.gz vim-7.2-lang.tar.gz
(maybe -extra and -lang are still needed when using cvs, but anyway it doesn't change much)
And downloading all the patches took ... 6 minutes ! lol !
I suspect that even using the gzipped bundles, it would still be much slower than 14 seconds...
real 8m6.351s
user 0m3.166s
sys 0m1.097s
and I did use the comman you provided.
The resulting tree is 43MB. So since it is compressed (-z3), 14s looks very possible if my bandwidth is used (and apparently it is).
The resulting tree seems to contain vim-7.2.tar.bz2 + vim-7.2-extra.tar.gz + vim-7.2-lang.tar.gz + the hundred patches.
http://aur.archlinux.org/packages.php?ID=30507
So users who want to rebuild vim could use that alternative.
IMO Shining's PKGBUILD should be used for the official Vim package, and a similar setup for gVim, etc.
- we don't build files in extra from csv unless we need features from
development or have other sources available
- that the csv/svn is behind the patches in time
- the current approach allows to cache the source in the makepkg
cachedir instead of the build directory (which is no problem for
normal users but yields more work for me as maintainer who build
from fresh PKKBUILD checkouts in clean environments)
- while there was this impressive number for fast download presented,
I wasn't able on two different machines on two different connections
to reproduce that speedup over the current approach. All together they
clock in about the same.
2.) I don't think that this is a problem at all. Vim's CVS is not far behind at all -- Arch is much farther behind itself usually in its Vim packages.
3.) I don't understand, but OK.
4.) Really? The difference is massive, and should be apparent even without testing, just from looking at the process?
On a Q6600, 6GiB RAM, ext4 7,200rpm drive, 10Mb/s downstream:
(Informal, uses full makepkg time, 'sync' ran in between tests, 'vim-rang' is just normal Vim with the new fetch_patches.sh):
vim:
real 20m16.117s
user 1m33.994s
sys 0m33.162s
vim-rang:
real 5m8.494s
user 0m39.086s
sys 0m29.134s
vim-cvs:
real 1m3.011s
user 0m19.465s
sys 0m9.329s
PKGBUILD.part (0.5 KiB)