我正在尝试使用scons构建一个LaTeX文档,其中PDF目标的某些源是其他构建器的目标。这很好用,直到我尝试将它与变体目录结合起来。看起来,一旦我将变体目录添加到SConscript调用,所有构建的源都不再被正确扫描到PDF目标的依赖关系树中。
我在最小的工作示例中做错了什么来设置这种类型的构建?
>> scons --version
SCons by Steven Knight et al.:
script: v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED], 2016/11/03 14:02:02, by bdbaddog on mongodog
engine: v2.5.1.rel_2.5.1:3735:9dc6cee5c168[MODIFIED], 2016/11/03 14:02:02, by bdbaddog on mongodog
engine path: ['/usr/lib/scons/SCons']
Copyright (c) 2001 - 2016 The SCons Foundation
>> tree
.
├── SConstruct
└── src
├── document.tex
├── foo.in
└── SConscript
1 directory, 4 files
>> cat SConstruct
# SConscript('src/SConscript') # <- Works
SConscript('src/SConscript', variant_dir='build', duplicate=0) # <- Error
>> cat src/foo.in
Bar
>> cat src/document.tex
\documentclass{article}
\begin{document}
\input{foo}
\end{document}
>> cat src/SConscript
Command('foo.tex', 'foo.in', Copy('$TARGET', '$SOURCE'))
PDF('document.tex')
>> scons --tree=prune
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
cd build && pdflatex -interaction=nonstopmode -recorder document.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(/nfs/msdev/users/bellockk/Development/SConsMakoTeX/SOQ/src/document.tex
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 3 language(s) loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo)) (./document.aux)
! LaTeX Error: File `foo.tex' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: tex)
Enter file name:
! Emergency stop.
<read *>
l.3 \input{foo}
^^M
! ==> Fatal error occurred, no output PDF file produced!
Transcript written on document.log.
pdflatex returned an error, check the log file
scons: *** [build/document.pdf] Error 1
+-.
+-SConstruct
+-build
| +-src/SConscript
| +-build/document.acn
| | +-build/document.pdf
| | +-src/document.tex
| +-build/document.acr
| | +-[build/document.pdf]
| +-build/document.alg
| | +-[build/document.pdf]
| +-build/document.aux
| | +-[build/document.pdf]
| +-build/document.bbl
| | +-[build/document.pdf]
| +-build/document.bcf
| | +-[build/document.pdf]
| +-build/document.blg
| | +-[build/document.pdf]
| +-build/document.fls
| | +-[build/document.pdf]
| +-build/document.glg
| | +-[build/document.pdf]
| +-build/document.glo
| | +-[build/document.pdf]
| +-build/document.gls
| | +-[build/document.pdf]
| +-build/document.idx
| | +-[build/document.pdf]
| +-build/document.ilg
| | +-[build/document.pdf]
| +-build/document.ind
| | +-[build/document.pdf]
| +-build/document.lof
| | +-[build/document.pdf]
| +-build/document.log
| | +-[build/document.pdf]
| +-build/document.lot
| | +-[build/document.pdf]
| +-build/document.nav
| | +-[build/document.pdf]
| +-build/document.nlg
| | +-[build/document.pdf]
| +-build/document.nlo
| | +-[build/document.pdf]
| +-build/document.nls
| | +-[build/document.pdf]
| +-build/document.out
| | +-[build/document.pdf]
| +-[build/document.pdf]
| +-build/document.snm
| | +-[build/document.pdf]
| +-build/document.synctex.gz
| | +-[build/document.pdf]
| +-src/document.tex
| +-build/document.toc
| | +-[build/document.pdf]
| +-src/foo.in
| +-build/foo.tex
| +-src/foo.in
+-src
+-src/SConscript
+-src/document.tex
+-src/foo.in
scons: building terminated because of errors.