Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
emerge sync is too long
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3, 4  
Reply to topic    Gentoo Forums Forum Index Gentoo Chat
View previous topic :: View next topic  
Author Message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Tue Oct 12, 2004 9:29 am    Post subject: Reply with quote

t011 wrote:
Roll your eyes all you want, but it doesn't change the FACT that ALL the shell scripting that exists in the ebuilds is unnecessary for determining dependencies.

With all due respect, you do not have a clue what you are talking about. Consider the following perfectly legal snippet:
Code:

inherit versionator
DEPEND="~dev-libs/libblah-$(get_major_version )"

Or the following:
Code:

IUSE="$IUSE selinux ncurses nls acl"

if [[ "${MY_PN}" == "vim-core" ]] ; then
   IUSE="$IUSE livecd"
else
   IUSE="$IUSE cscope gpm perl python ruby"
   DEPEND="$DEPEND
      cscope?  ( dev-util/cscope )
      gpm?     ( >=sys-libs/gpm-1.19.3 )
      perl?    ( dev-lang/perl )
      python?  ( dev-lang/python )
      selinux? ( sys-libs/libselinux )
      acl?     ( sys-apps/acl )
      ruby?    ( virtual/ruby )"
   RDEPEND="$RDEPEND
      cscope?  ( dev-util/cscope )
      gpm?     ( >=sys-libs/gpm-1.19.3 )
      perl?    ( dev-lang/perl )
      python?  ( dev-lang/python )
      selinux? ( sys-libs/libselinux )
      acl?     ( sys-apps/acl )
      ruby?    ( virtual/ruby )"

   if [[ "${MY_PN}" == "vim" ]] ; then
      IUSE="$IUSE vim-with-x minimal"
      DEPEND="$DEPEND vim-with-x? ( virtual/x11 )"
      RDEPEND="$RDEPEND vim-with-x? ( virtual/x11 )"
   elif [[ "${MY_PN}" == "gvim" ]] ; then
      IUSE="$IUSE gnome gtk gtk2 motif"
   fi

   # vim7 has some extra options. tcltk is working again, and mzscheme support
   # has been added. netbeans now has its own USE flag, but it's only available
   # under gvim (*not* kvim).
   if [[ $(get_major_version ) -ge 7 ]] ; then
      if [[ "${MY_PN}" != "vim-core" ]] ; then
         IUSE="${IUSE} tcltk mzscheme"
         DEPEND="$DEPEND
            tcltk?    ( dev-lang/tcl )
            mzscheme? ( dev-lisp/mzscheme )"
         RDEPEND="$RDEPEND
            tcltk?    ( dev-lang/tcl )
            mzscheme? ( dev-lisp/mzscheme )"
      fi
      if [[ "${MY_PN}" == "gvim" ]] ; then
         IUSE="$IUSE netbeans"
         DEPEND="$DEPEND   netbeans? ( dev-util/netbeans )"
         RDEPEND="$RDEPEND netbeans? ( dev-util/netbeans )"
      fi
   fi
fi

Global scope code is (sometimes under certain circumstances) perfectly ok.
Back to top
View user's profile Send private message
t011
Tux's lil' helper
Tux's lil' helper


Joined: 05 Sep 2002
Posts: 102

PostPosted: Tue Oct 12, 2004 3:23 pm    Post subject: Reply with quote

Ok, I'm not sure where our communication problems arise from. But I'm beginning to believe that it's simply because my idea of what portage could be is so different from its current incarnation. Before I get to the two examples you illustrated, let me take a step back and try to explain this in a different way. In many ways what I'm proposing is analagous to the changes that are going on within HTML. As web pages have become more sophisticated developers began adding scripting, css and a host of other elements to the page. That produced a page that served many purposes but was difficult to maintain and to read. Then comes along the idea to separate out everything into different files in a modular approach (XML,XSLT,etc.). That is what I'm suggesting here.

From a practical standpoint it appears that the point you are trying to make from your two examples is that dependencies are difficult to deal with and many different flavors of a package can be made. If that is your point, I agree with you. But it's my opinion that this is a shortcoming of portage, it doesn't have the ability to resolve complicated dependencies. Rather than each package maintainer having to cobble together their own scripting mechanism to deal with the various dependency and flavor headaches, that should be implemented within portage. Let the ebuilds serve as merely the list of dependencies and options that, in a sense, get parsed by portage. Then portage calls individual scripts that are downloaded like distfiles when the package is built for the installation pre and post processing.

Right now ebuilds basically serve 3 purposes.
1) They store all the dependency and flavor info
2) They contain the logic to sort out USE flag conflicts
3) They contain a lot of pre and post installation scripting

My suggestion is to leave #1 in the ebuilds. Move the logic for #2 into portage in a standardized way. And move #3 into subordinate scripts that are downloaded at build time. In this way ebuilds will only do one task, outlining dependencies.

I won't waste any more of your or my time trying to explain this. It's possible that we're simply on such different pages that I can't communicate this to you.
Back to top
View user's profile Send private message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Tue Oct 12, 2004 3:27 pm    Post subject: Reply with quote

t011 wrote:

1) They store all the dependency and flavor info
<snip>
My suggestion is to leave #1 in the ebuilds.

That's already in the metadata cache, in effect...
Back to top
View user's profile Send private message
Chaosite
Guru
Guru


Joined: 13 Dec 2003
Posts: 540
Location: Right over here.

PostPosted: Tue Oct 12, 2004 7:58 pm    Post subject: Reply with quote

This is a moot point you're arguing.

Its been agreed already that the major problem with 'emerge sync's is not downloading ebuilds, its generating the cache.

So making ebuilds smaller won't help much, since you still need to cache all the dependencies. Using a database to store the cache is a good idea, even though reiser4 for /usr/portage still works better.

BTW, the problem also when trying to calculate "emerge world -uDav" with a decently large and complex worldfile...
Back to top
View user's profile Send private message
itsr0y
Tux's lil' helper
Tux's lil' helper


Joined: 22 Dec 2002
Posts: 81

PostPosted: Tue Oct 12, 2004 8:23 pm    Post subject: Reply with quote

Thank you, Chaosite. This is the kind of explanation I am looking for. A simple, straightforward reason is all I want and now I have.

Thanks,
itsr0y
Back to top
View user's profile Send private message
star.dancer
Tux's lil' helper
Tux's lil' helper


Joined: 18 Sep 2004
Posts: 93

PostPosted: Sat Oct 16, 2004 6:11 pm    Post subject: so... what does it do? Reply with quote

So what does the updating of the cache do? I tried to figure it out from the portage code but it's not very clear what's happening to me.

Here's my understanding of it:
- We emerge sync, getting all the ebuilds.
- We use emerge *pkg*, emerge -u *pkg*, etc. it looks at the ebuild, then takes a while to calculate all the dependencies, etc., and then it proceeds to download and build the ebuild(s).

What the heck is the cache used for? What is actually happening when it says "updating portage cache"? Maybe a more important question, does every user need to do this time-consuming step every single time they sync? Maybe there could be a "emerge sync --nocacheupdate" if the "cache" only helps with the searching feature or something... I don't understand what it has to do with getting the new ebuilds and emerging new packages.

If there's documentation somewhere on this, please point it out. I couldn't find it and the portage code isn't documented.
Back to top
View user's profile Send private message
ciaranm
Retired Dev
Retired Dev


Joined: 19 Jul 2003
Posts: 1719
Location: In Hiding

PostPosted: Sat Oct 16, 2004 6:47 pm    Post subject: Reply with quote

The cache is used to speed up dep calculation by about an order of magnitude. When you do emerge -pv blah, it *doesn't* hit the actual ebuilds. Instead, it goes via the metadata cache and gets it from there.

Which is why, if you're really wanting to speed up sync, you're almost certainly better off just syncing the cache and then writing some clever bulk-fetch-on-demand stuff off that. It is not, however, anything like as easy as I make it sound.

Besides, this thread really needs to die. The whole thing was already solved on the gentoo-dev list anyway.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9532
Location: beyond the rim

PostPosted: Sun Oct 17, 2004 3:48 am    Post subject: Reply with quote

Ideas are nice, implementations are better.
Back to top
View user's profile Send private message
jmz2
Guru
Guru


Joined: 13 Jan 2004
Posts: 421
Location: Finland

PostPosted: Sun Oct 17, 2004 6:04 am    Post subject: Reply with quote

IMO the speed of syncing is not a problem. If we're supposed to sync no more often than one a day, the speed of the process hardly matters. Besides, using Gentoo requires a bit more knowledge of Linux than the simple point-and-click skills Windows converts have. If people don't want to wait for sync before emerging stuff, what keeps them from using emerge sync && emerge app and leave it running in the background, like they would have to do anyways.
Back to top
View user's profile Send private message
Vidar
Apprentice
Apprentice


Joined: 09 Apr 2003
Posts: 239
Location: Washington, USA

PostPosted: Sun Oct 17, 2004 3:24 pm    Post subject: Reply with quote

syncing is not really a problem unless it's the first sync (during installation). That takes forever. Maybe we can have weekly/monthly snapshots of the portage tree in tarball form. When you emerge sync, it scans your timestamp, and it if is older than a week/month, it grabs the tarball instead of rsyncing it. The net effect would be that people that choose to keep their portage tree get the speed of rsync, while you don't spend needless time rsyncing during the first installation.
_________________
"Vidar, Odin's mighty son, he will come to slay the wolf
The sword runs into the heart of Hverdrungs son
So he avenges his father" -- Amon Amarth - Burning Creation
Back to top
View user's profile Send private message
Chaosite
Guru
Guru


Joined: 13 Dec 2003
Posts: 540
Location: Right over here.

PostPosted: Sun Oct 17, 2004 3:50 pm    Post subject: Reply with quote

Vidar wrote:
syncing is not really a problem unless it's the first sync (during installation). That takes forever. Maybe we can have weekly/monthly snapshots of the portage tree in tarball form. When you emerge sync, it scans your timestamp, and it if is older than a week/month, it grabs the tarball instead of rsyncing it. The net effect would be that people that choose to keep their portage tree get the speed of rsync, while you don't spend needless time rsyncing during the first installation.


Oh, you mean something like (Well, except doing it automagically for you):

Code:
emerge-webrsync


(Which is mentioned in the handbook. And in this thread. Several times, I believe)

:evil:
Back to top
View user's profile Send private message
Vidar
Apprentice
Apprentice


Joined: 09 Apr 2003
Posts: 239
Location: Washington, USA

PostPosted: Sun Oct 17, 2004 3:51 pm    Post subject: Reply with quote

Oh... sorry. I always figured that was something entirely different.
_________________
"Vidar, Odin's mighty son, he will come to slay the wolf
The sword runs into the heart of Hverdrungs son
So he avenges his father" -- Amon Amarth - Burning Creation
Back to top
View user's profile Send private message
colonel_dolphin
n00b
n00b


Joined: 12 Jan 2004
Posts: 39

PostPosted: Wed Oct 27, 2004 10:59 pm    Post subject: Reply with quote

Genone wrote:
Ideas are nice, implementations are better.


Well said.

http://sourceforge.net/projects/portage-c/

BTW, I don't think using a different filesystem (e.g. Reiser vs Ext3 with hash table support via dir_index) will solve all the types of relevant performance issues that a relational database system can solve, given a reasonable schema.

Whatever bytes are consumed by the ext3_inode_cache (or Reiser) for /usr/portage/* are obviously not being used for other purposes.

From slabtop

Code:
OBJS ACTIVE  USE OBJ SIZE  SLABS OBJ/SLAB CACHE SIZE NAME
166338 137509  82%    0.44K  18482        9     73928K ext3_inode_cache


/usr has a block size of 1 Kilobyte, and I use dir_index (hashed b-tree support) 2.6.7 kernel with everything else pretty much up to date
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
Page 4 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