On 11/03/2014 10:34 PM, [email protected] wrote:

    Yes, I understand all of that, hence my wording about "you can't
    guarantee the order in which they are *read* and hence the order
    in which things are *added to the database*." I do basically
    understand how tup works.


Take the example in the manual for example, "Multiple directories". There is an implicit dependency between the two Tupfiles. One defines a library "newmath" and the other links against it.
This may be pedantic, but there is no dependency between the Tupfiles, only the rules defined by the Tupfiles. See my comment below for the explanation.

Tupfiles can have dependencies - for instance if one Tupfile includes another. I think this information is also graphed somewhere.


My question is, how does Tup ensure that it read the Tupfile that has the effect of creating the newmath node in the database before it reads the Tupfile that requires that node to exist? It would appear to rely on parsing newmath/Tupfile first, and then ./Tupfile. So there appears to be an implicit parse order dependency beween the two files. If that's the case, how does Tup ensure that it parses them in the right order? If the two Tupfiles were in sibling directories, it would *appear* to rely on the directory traversal order which one gets parsed first. If it gets the order wrong it will give you a parse error that would be very difficult to resolve.

Either Tupfile can create the node in the database if it does not exist. I'm not sure, but I think there may be a "ghost" node or something similar for nodes created for dependencies before it is known if it is a generated or pre-existing file. When the rule that creates the node is parsed, the database information is updated.

Take this with a grain of salt though, I haven't dug too deeply into that part of the code.

--
--
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
--- You received this message because you are subscribed to the Google Groups "tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to