Open
Description
Describe the bug
At the top of SCons/Tool/__init__.py
, five scanners are configured with default file extensions, with no regard for their respective backend program's presence.
CScanner = SCons.Scanner.C.CScanner()
DScanner = SCons.Scanner.D.DScanner()
JavaScanner = SCons.Scanner.Java.JavaScanner()
LaTeXScanner = SCons.Scanner.LaTeX.LaTeXScanner()
PDFLaTeXScanner = SCons.Scanner.LaTeX.PDFLaTeXScanner()
ProgramScanner = SCons.Scanner.Prog.ProgramScanner()
SourceFileScanner = SCons.Scanner.ScannerBase({}, name='SourceFileScanner')
SWIGScanner = SCons.Scanner.SWIG.SWIGScanner()
CSuffixes = [".c", ".C", ".cxx", ".cpp", ".c++", ".cc",
".h", ".H", ".hxx", ".hpp", ".hh",
".F", ".fpp", ".FPP",
".m", ".mm",
".S", ".spp", ".SPP", ".sx"]
DSuffixes = ['.d']
IDLSuffixes = [".idl", ".IDL"]
LaTeXSuffixes = [".tex", ".ltx", ".latex"]
SWIGSuffixes = ['.i']
for suffix in CSuffixes:
SourceFileScanner.add_scanner(suffix, CScanner)
for suffix in DSuffixes:
SourceFileScanner.add_scanner(suffix, DScanner)
for suffix in SWIGSuffixes:
SourceFileScanner.add_scanner(suffix, SWIGScanner)
# FIXME: what should be done here? Two scanners scan the same extensions,
# but look for different files, e.g., "picture.eps" vs. "picture.pdf".
# The builders for DVI and PDF explicitly reference their scanners
# I think that means this is not needed???
for suffix in LaTeXSuffixes:
SourceFileScanner.add_scanner(suffix, LaTeXScanner)
SourceFileScanner.add_scanner(suffix, PDFLaTeXScanner)
For at least the LaTeXScanner, this can lead to an error if AllowSubstExceptions()
has been set to disallow undefined env variables, because LaTeXScanner is looking for a $LATEXSUFFIXES
variable, which gets a default definition from the LaTeX tool.
Required information
- Link to SCons Users thread discussing your issue.
- Version of SCons
- 4.7.0
- Version of Python
- 3.11.0
- What Platform are you on? (Linux/Windows and which version)
- Linux RHEL7
- How to reproduce your issue? Please include a small self contained reproducer. Likely a SConstruct should do for most issues.
env = Environment(tools=[])
AllowSubstExceptions()
env.Command('file2.tex', 'file1.tex', 'cp $SOURCE $TARGET')
- How you invoke scons
scons