There are several issues related to the functioning of TUP_CWD.

1.  The documentation is inadequate.  Specifically, the examples.  They are 
all trivial.  Are there any examples of usage where the variable in used in 
a file to reference a file in a distinct sub-tree?  For example, given top 
directory A, with sub-directories A1 and A2, and with sub-sub-directories 
A11, A12, A21, and A22, have a Tupfile in A11 refer to a tupfile in A22.

2.  Variants appear to have a bad influence on TUP_CWD in that they 
introduce a skew in the directory trees.  Each variant directory gets 
merged with the contents of the top-level directory, except for the variant 
directories.  So a reference to a source file in A11 as above from within a 
source file in A22 would be "../../A1/A11/<filename>".  But a reference to 
a source file in A11 from within a binary file in A22, which binary is one 
directory down from the source tree, would be "../../../A1/A11<filename>".

3.  There does not appear to be a mechanism to unambiguously refer to the 
root of the project tree -- the source directory containing the .ini file.  
In a test project I have a tup file in src/include/tup.  It contains a lot 
of standardized definitions and actions that are needed for the unit, 
specification, and acceptance testing directories.  So the local Tupfile in 
each testing directory contains only "include_rules".  The Tuprules.tup 
file a couple directories above the test directory contains a Tuprules.tup 
file with little more than an include statement of the form "include 
$(ROOT)/src/include/tup/std_test.tup".  At the root of the project is 
another TupRules.tup file containing the definitions and actions need to 
build everything within the build, particularly "ROOT=$(TUP_CWD)", which, 
from the documentation, is required to "fix" the definition of ROOT so that 
the directory agility of TUP_CWD is discarded.

But the definition of ROOT does not work.  It changes along with TUP_CWD, 
which contradicts the immediacy provisions stated in the documentation.

And at build time I get an error of the form:

    "Unable to find directory for include file 
'../../../../../include/tup/std_test.tup' relative to 'bin/infra/errmsg/T'".

The directory containing the Tupfile  doing the including is not 
bin/infra/errmsg/T.  It is src/infra/errmsg/T.  Due to the unification of 
the source and binary directories the name of the directory under the 
project's root may be irrelevant.  But the path int he error mesage has an 
extra "../" which makes the downward leg of the path start appear to start 
one directory above the root of the project.

Replacing ROOT with TUP_CWD produces the same result.

So how can I refer to the root of the project *without* using TUP_CWD?

-- 
-- 
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