SDK: compilation errors are only printed to console
- Dominant language
- C#
- Stars
- 451
- Forks
- 49
- Avg merge
- 13h 59m
- Merged PRs (30d)
- 6
Description
Try to compile a broken program with Cesium SDK.
**Expected result:** it should print compilation errors as errors, compilation should be stopped.
**Actual result:** errors seem to be ignored and are only printed to MSBuild console stream; the build proceeds as if there were no errors, and only breaks when it tries to find the Cesium-compiled assembly.
A compilation log:
```
0>------- Started building project: Tabularius.Interop.Dto
CONSOLE: Generating assembly "obj\Debug\net10.0\Tabularius.Interop.Dto.dll".
CONSOLE: Processing source file "G:\Projects\tabularius\Tabularius.Interop.Dto\lib.c".
CONSOLE: Unhandled exception. Cesium.Core.CompilationException: Cannot resolve type Side
CONSOLE: at Cesium.CodeGen.Contexts.TranslationUnitContext.ResolveType(IType type, ImmutableArray`1 resolutionStack) in /_/Cesium.CodeGen/Contexts/TranslationUnitContext.cs:line 187
CONSOLE: at Cesium.CodeGen.Contexts.TranslationUnitContext.<>c__DisplayClass35_1.b__2(LocalDeclarationInfo structMember) in /_/Cesium.CodeGen/Contexts/TranslationUnitContext.cs:line 264
CONSOLE: at System.Linq.Enumerable.ListSelectIterator`2.Fill(ReadOnlySpan`1 source, Span`1 destination, Func`2 func)
CONSOLE: at System.Linq.Enumerable.ListSelectIterator`2.ToList()
CONSOLE: at Cesium.CodeGen.Contexts.TranslationUnitContext.<>c__DisplayClass35_0.g__ResolveStructMembers|0(StructType structType) in /_/Cesium.CodeGen/Contexts/TranslationUnitContext.cs:line 261
CONSOLE: at Cesium.CodeGen.Contexts.TranslationUnitContext.ResolveType(IType type, ImmutableArray`1 resolutionStack) in /_/Cesium.CodeGen/Contexts/TranslationUnitContext.cs:line 237
CONSOLE: at Cesium.CodeGen.Contexts.TranslationUnitContext.ResolveType(IType type) in /_/Cesium.CodeGen/Contexts/TranslationUnitContext.cs:line 180
CONSOLE: at Cesium.CodeGen.Contexts.GlobalConstructorScope.ResolveType(IType type) in /_/Cesium.CodeGen/Contexts/GlobalConstructorScope.cs:line 63
CONSOLE: at Cesium.CodeGen.Ir.Lowering.BlockItemLowering.Lower(IDeclarationScope scope, IBlockItem blockItem)
CONSOLE: at Cesium.CodeGen.Ir.Lowering.BlockItemLowering.LowerDeclaration(IDeclarationScope scope, IBlockItem blockItem) in /_/Cesium.CodeGen/Ir/Lowering/BlockItemLowering.cs:line 75
CONSOLE: at Cesium.CodeGen.Contexts.AssemblyContext.<>c__DisplayClass29_0.b__0(IBlockItem node) in /_/Cesium.CodeGen/Contexts/AssemblyContext.cs:line 68
CONSOLE: at System.Linq.Enumerable.IteratorSelectIterator`2.ToListNoPresizing()
CONSOLE: at System.Linq.Enumerable.IteratorSelectIterator`2.ToList()
CONSOLE: at Cesium.CodeGen.Contexts.AssemblyContext.EmitTranslationUnit(String name, TranslationUnit translationUnit) in /_/Cesium.CodeGen/Contexts/AssemblyContext.cs:line 68
CONSOLE: at Cesium.Compiler.Compilation.GenerateCode(AssemblyContext context, AbsolutePath inputFile) in /_/Cesium.Compiler/Compilation.cs:line 165
CONSOLE: at Cesium.Compiler.Compilation.Compile(IEnumerable`1 inputFilePaths, LocalPath outputFile, CompilationOptions compilationOptions) in /_/Cesium.Compiler/Compilation.cs:line 82
CONSOLE: at Cesium.Compiler.Program.<>c.<b__0_0>d.MoveNext() in /_/Cesium.Compiler/Main.cs:line 62
CONSOLE: --- End of stack trace from previous location ---
CONSOLE: at Cesium.Compiler.CommandLineParser.<>c__DisplayClass0_0.<b__1>d.MoveNext() in /_/Cesium.Compiler/CommandLineParser.cs:line 41
CONSOLE: --- End of stack trace from previous location ---
CONSOLE: at Cesium.Compiler.CommandLineParser.ParseCommandLineArgs(String[] args, ICompilerReporter reporter, Func`2 worker) in /_/Cesium.Compiler/CommandLineParser.cs:line 22
CONSOLE: at Cesium.Compiler.Program.Main(String[] args) in /_/Cesium.Compiler/Main.cs:line 18
CONSOLE: at Cesium.Compiler.Program.(String[] args)
0>Microsoft.Common.CurrentVersion.targets(4919,5): Error MSB3030 : Could not copy the file "obj\Debug\net10.0\Tabularius.Interop.Dto.dll" because it was not found.
0>------- Finished building project: Tabularius.Interop.Dto. Succeeded: False. Errors: 1. Warnings: 0
```
Contributor guide
Research direction
Reproduce the broken C program with the Cesium SDK and start by tracing the compiler entry points shown in Cesium.Compiler/Main.cs and Compilation.cs. Check how the CompilationException is surfaced to the MSBuild integration. Done means compilation errors are reported as errors, compilation stops, and no later missing-assembly error masks the original failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, csharp
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100