Closed arosenbe closed 7 years ago
To start, I check if an empty directory created before the first scons
run can be specified as a source or target by following these steps.
scons
I repeat but specify the directory as a target in step 2. SCons throws a nearly identical error.
I got the same errors after putting an empty file in source/paper/test and rerunning scons
.
I'll pass this off to you @yuchuan2016. It will be good to check how scons handles full directories as sources and targets. Also feel free to check anything else you can think of!
@gentzkow, I have a quick follow-up (two comments above) to our conversation at lunch today about specifying directories as sources and targets in the SCons framework. It seems that SCons' default position is that directories should not be sources or targets. I didn't go through the documents or code to try to figure out why this is the case or to look for some possible workaround. We can invest the time if you think it's something valuable to explore further.
@gentzkow , a simple test uses the following structure:
source/data/build.R
generates 10 files data*.txt
and stored in build/data/
source/analysis/analysis.do
uses 10 files in build/data/
If we change:
SConscript
in source/data/
:
target = ['#build/data/']
-> error as abovetarget = ['#build/data/*']
or
target = ['#build/data/*.txt']
or
target = ['#build/data/data*.txt']
-> rebuild 10 files in each runSConscript
in source/analysis/
:
source = ['#source/analysis/analysis.do', '#build/data/']
-> error as abovesource = ['#source/analysis/analysis.do', '#build/data/*']
or
source = ['#source/analysis/analysis.do', '#build/data/*.txt']
or
source = ['#source/analysis/analysis.do', '#build/data/data*.txt']
-> Error
scons: ** [build/analysis/plot.eps] Source `build/data/' not found, needed by target build/analysis/plot.eps'.
Let me know if you think @arosenbe 's suggestion to go through the documents or code is worth doing.
Thanks guys. I think this is enough investigation on this for now. We can revisit when we wrap up other template
tasks and take an overall look at the system.
Summary: Currently we have not found a good way to specify directories as sources or targets in SCons.
It can simplify dependency tracking if SCons allows directories to be tracked as sources and targets, not just files within directories. In this issue, I'll explore how feasible a setup like this is.
Followup task to the lunch discussion with @gentzkow on January 24, 2017.