slang
slang copied to clipboard
slanc fails silently if host prelude doesn't compile
For example, put the following in prelude/slang-cpp-host-prelude.h
#if defined(__SLANG_COMPILER__)
#error
#endif
Make and run the following command
./bin/linux-x64/debug/slangc tests/bugs/interface-lvalue.slang -o a.exe
Observe that this finishes with exit code 0 and nothing on stderr, however a.exe is not created.
After a cursory look, it seems that GCCDownstreamCompilerUtil::parseOutput, hence CommandLineDownstreamCompiler::compile fails.
The error is converted to a nullptr return by TargetProgram::_createWholeProgramResult and then ignored by EndToEndCompileRequest::generateOutput
Because the gcc output parsing failed there are no diagnostics, so the check if (getSink()->getErrorCount() != 0) doesn't detect any errors.
We should have a --verbose option to say what we're calling downstream compilers with, and what their output is.
Silent failures bad, language hardening, Q3.