aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Step/WriteFile.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2025-08-08 15:07:03 +0100
committerMatthew Lugg <mlugg@mlugg.co.uk>2025-08-08 22:37:27 +0100
commit1440519239516f0b16a5cc7094aa3997f4b508f5 (patch)
treee82d2826665e5d1116c73d57b41432aa63d46813 /lib/std/Build/Step/WriteFile.zig
parent3d25a9c1e07cfcb72250760b2c1a1d9d4f6174ed (diff)
downloadzig-1440519239516f0b16a5cc7094aa3997f4b508f5.tar.gz
zig-1440519239516f0b16a5cc7094aa3997f4b508f5.zip
compiler: improve error reporting
The functions `Compilation.create` and `Compilation.update` previously returned inferred error sets, which had built up a lot of crap over time. This meant that certain error conditions -- particularly certain filesystem errors -- were not being reported properly (at best the CLI would just print the error name). This was also a problem in sub-compilations, where at times only the error name -- which might just be something like `LinkFailed` -- would be visible. This commit makes the error handling here more disciplined by introducing concrete error sets to these functions (and a few more as a consequence). These error sets are small: errors in `update` are almost all reported via compile errors, and errors in `create` are reported through a new `Compilation.CreateDiagnostic` type, a tagged union of possible error cases. This allows for better error reporting. Sub-compilations also report errors more correctly in several cases, leading to more informative errors in the case of compiler bugs. Also fixes some race conditions in library building by replacing calls to `setMiscFailure` with calls to `lockAndSetMiscFailure`. Compilation of libraries such as libc happens on the thread pool, so the logic must synchronize its access to shared `Compilation` state.
Diffstat (limited to 'lib/std/Build/Step/WriteFile.zig')
0 files changed, 0 insertions, 0 deletions