Re: [Tack-devel] Prime Mover commands
Moved to https://github.com/davidgiven/ack
Brought to you by:
dtrg
From: David G. <dg...@co...> - 2006-08-03 10:08:02
|
tim kelly wrote: [...] > What happens in a large build, like a kernel or userland worldbuild, wh= ere > the .o files can number into the hundreds and even thousands of files, > normally distributed throughout the build tree? [...] > Using ls -a /tmp/ack-temp/pmcache > temp.txt and determining the number= of > lines in temp.txt, the pmcache directory for ACK appears to have 1931 > items. That's correct. In fact, current head-of-CVS ACK has (I just counted them) 6684 temporary files! In fact, this is not a problem. Modern filesystems cope just fine with lots of files in one directory (see http://www.namesys.com/faq.html#optimaldirstruct), but if this ever becomes a restriction it would be trivial to modify pm to use a hierarchical structure to reduce the number of files in the directory, in much the same way Squid does. pm actually keys its intermediate files against the command that was used to build them. An alternative implementation would be to replace the numerical ID with the command string itself (with slashes replaced); this would work just as well, although the pathnames would get rather big. (It might even be faster.) [...] > ext_cfile =3D simple_with_clike_dependencies { >=20 > class =3D "ext_cfile", > outputs =3D {o.."%U%-%I%.o"}, > inputs =3D inputs..".c", > inputs =3D d..inputs, > } [...] > which would allow building 4A and 4B seperately, without building defau= lt. > The ext_cfile won't run, of course, because the concatentation doesn't = work > (I'm not up to speed on modifying inputs yet), but overall the goal wou= ld > be to simplify specifying target source file and object file. Not that= > it's complicated; I'm just trying to reduce the amount of typing and nu= mber > of characters in the pmfile for ease of reading. Firstly, .. is a Lua operator that only has an effect when the pmfile is read. What your o.."%U%-%I%.o" will do above is to do the concatenation *while defining ext_cfile*, rather than when the ext_cfile rule runs. This sort of thing is what the {PARENT, "foo"} construction is for. Ugly, I know, but I couldn't come up with anything else. Secondly, you can't modify a rule's inputs, because they're not strings! They're references to other rules. This: cfile "foo.c" =2E..is actually syntactic sugar for: cfile { file {"foo.c"} } =2E..that is, a cfile rule that depends on a static reference to a file. If you want to do this kind of thing you have to pass the information into the rule in a variable, and then refer to a file via the variable name --- the example I posted a link to does this. (It's also possible to do this without subclassing a rule at all. The exported-o rule in the example could be written as: exported_o =3D group { class =3D "exported_o", cfile { CBUILDFLAGS =3D {PARENT, "-O%OPTIMISATION%"}, install =3D pm.install("%DESTDIR%%BASE%-O%OPTIMISATION%.o"), file "%SRCDIR%%BASE%.c" } } Does that make it clearer what's going on?) >> I also found a bug in c.pm, so you'll need a new version of that as we= ll if >> you want rebuilding to work properly.] >=20 > Ok, thanks for the heads up. Unfortunately, at least on NetBSD, Subver= sion > (svn) requires Apache Portable Runtime, which appears to require instal= ling > Apache httpd, which I don't see a need to do, so I have not yet been ab= le > to sync up to files committed to the subversion tree at sourceforge. I use Eclipse with the Subclipse plugin; it's got a pure-Java implementation of the Subversion protocol and works very well. Of course, this is probably a little heavyweight unless you're using Eclipse for other purposes... but in emergencies, you can always pull individual files out of Sourceforge's SVN browser: http://svn.sourceforge.net/viewvc/primemover BTW, I've created a Prime Mover mailing list to avoid spamming all the other people on the ACK list. See: http://sourceforge.net/mail/?group_id=3D157791 I think we'd probably better relocate there before everyone else unsubscribes from tack-devel... --=20 +- David Given --McQ-+ "You cannot truly appreciate _Atlas Shrugged_ | dg...@co... | until you have read it in the original Klingon." | (dg...@ta...) | --- Sea Wasp on r.a.sf.w +- www.cowlark.com --+ |