aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler
AgeCommit message (Collapse)Author
2025-10-30std.debug.lockStderrWriter: also return ttyconfMatthew Lugg
`std.Io.tty.Config.detect` may be an expensive check (e.g. involving syscalls), and doing it every time we need to print isn't really necessary; under normal usage, we can compute the value once and cache it for the whole program's execution. Since anyone outputting to stderr may reasonably want this information (in fact they are very likely to), it makes sense to cache it and return it from `lockStderrWriter`. Call sites who do not need it will experience no significant overhead, and can just ignore the TTY config with a `const w, _` destructure.
2025-10-29Merge pull request #25592 from ziglang/init-std.IoAndrew Kelley
std: Introduce `Io` Interface
2025-10-29remove all IBM AIX and z/OS supportAlex Rønne Petersen
As with Solaris (dba1bf935390ddb0184a4dc72245454de6c06fd2), we have no way to actually audit contributions for these OSs. IBM also makes it even harder than Oracle to actually obtain these OSs. closes #23695 closes #23694 closes #3655 closes #23693
2025-10-29resinator: update for Io APIAndrew Kelley
2025-10-29objcopy: update for std.Io APIAndrew Kelley
2025-10-29fix some std.Io compilation failuresAndrew Kelley
2025-10-29std: back out the StackTrace byval changesAndrew Kelley
Let's keep passing this thing by pointer
2025-10-29resinator: update for new Io APIsAndrew Kelley
2025-10-29std: fix compilation errors on WindowsAndrew Kelley
2025-10-29std.fs: use BadPathName rather than InvalidWtf8 on WindowsAndrew Kelley
2025-10-29aro: avoid asking for the timeAndrew Kelley
this value should be calculated earlier and passed in
2025-10-29fix miscellaneous compilation errorsAndrew Kelley
- ILSEQ -> error.BadPathName - implement dirStatPath for WASI
2025-10-29std: fix compilation errors on macosAndrew Kelley
2025-10-29compiler: update for introduction of std.IoAndrew Kelley
only thing remaining is using libc dns resolution when linking libc
2025-10-29std.Io: bring back Timestamp but also keep Clock.TimestampAndrew Kelley
this feels better
2025-10-29std: updating to std.Io interfaceAndrew Kelley
got the build runner compiling
2025-10-29std.zig.system: upgrade to std.Io.ReaderAndrew Kelley
2025-10-29add std.testing.ioAndrew Kelley
2025-10-27remove all Oracle Solaris supportAlex Rønne Petersen
There is no straightforward way for the Zig team to access the Solaris system headers; to do this, one has to create an Oracle account, accept their EULA to download the installer ISO, and finally install it on a machine or VM. We do not have to jump through hoops like this for any other OS that we support, and no one on the team has expressed willingness to do it. As a result, we cannot audit any Solaris contributions to std.c or other similarly sensitive parts of the standard library. The best we would be able to do is assume that Solaris and illumos are 100% compatible with no way to verify that assumption. But at that point, the solaris and illumos OS tags would be functionally identical anyway. For Solaris especially, any contributions that involve APIs introduced after the OS was made closed-source would also be inherently more risky than equivalent contributions for other proprietary OSs due to the case of Google LLC v. Oracle America, Inc., wherein Oracle clearly demonstrated its willingness to pursue legal action against entities that merely copy API declarations. Finally, Oracle laid off most of the Solaris team in 2017; the OS has been in maintenance mode since, presumably to be retired completely sometime in the 2030s. For these reasons, this commit removes all Oracle Solaris support. Anyone who still wishes to use Zig on Solaris can try their luck by simply using illumos instead of solaris in target triples - chances are it'll work. But there will be no effort from the Zig team to support this use case; we recommend that people move to illumos instead.
2025-10-18compiler: rename `--test-timeout-ms` to `--test-timeout`Matthew Lugg
The unit can now be specified in the argument.
2025-10-18std.Build: do not expect server protocol for tests using immature backendsmlugg
For instance, when running a Zig test using the self-hosted aarch64 backend, this logic was previously expecting `std.zig.Server` to be used, but the default test runner intentionally does not do this because the backend is too immature to handle it. On 'master', this is causing sporadic failures; on this branch, they became consistent failures.
2025-10-18build runner: final tweaks to outputmlugg
2025-10-18build runner: remove `--prominent-compile-errors`, introduce `--error-style`mlugg
The new `--error-style` option decides how build failures are printed. The default mode "verbose" prints all context including the step graph fragment and the failed command (if any). The alternative mode "minimal" prints only the failed step itself, and does not print the failed command. There are also "verbose_clear" and "minimal_clear" modes, which have the distinction that the output is cleared (through ANSI escape codes) between updates, preventing different updates from being confused in the output. If `--error-style` is not specified, the environment variable `ZIG_BUILD_ERROR_STYLE` is checked before falling back to the default of "verbose"; this means the value can effectively be chosen system-wide since it is generally a personal preference. Also introduced is a `--multiline-errors` option which decides how to print errors which span multiple lines. By default, non-initial lines are indented to align with the first. Alternatively, a leading newline can be printed to align everyting on the first column, or no special treatment can be applied, resulting in misaligned output. Again, there is an environment variable (`ZIG_BUILD_MULTILINE_ERRORS`) to specify a preferred default if the option is not explicitly provided. Resolves: #23472
2025-10-18std.Build: separate errors from failed commandsmlugg
Recording the command in a separate field will give the build runner more freedom to choose how and when the command should be printed.
2025-10-18std.Build.Step.Run: many enhancementsmlugg
This is a major refactor to `Step.Run` which adds new functionality, primarily to the execution of Zig tests. * All tests are run, even if a test crashes. This happens through the same mechanism as timeouts where the test processes is repeatedly respawned as needed. * The build status output is more precise. For each unit test, it differentiates pass, skip, fail, crash, and timeout. Memory leaks are reported separately, as they do not indicate a test's "status", but are rather an additional property (a test with leaks may still pass!). * The number of memory leaks is tracked and reported, both per-test and for a whole `Run` step. * Reporting is made clearer when a step is failed solely due to error logs (`std.log.err`) where every unit test passed.
2025-10-18std.Build: implement unit test timeoutsmlugg
For now, there is a flag to `zig build` called `--test-timeout-ms` which accepts a value in milliseconds. If the execution time of any individual unit test exceeds that number of milliseconds, the test is terminated and marked as timed out. In the future, we may want to increase the granularity of this feature by allowing timeouts to be specified per-step or even per-test. However, a global option is actually very useful. In particular, it can be used in CI scripts to ensure that no individual unit test exceeds some reasonable limit (e.g. 60 seconds) without having to assign limits to every individual test step in the build script. Also, individual unit test durations are now shown in the time report web interface -- this was fairly trivial to add since we're timing tests (to check for timeouts) anyway. This commit makes progress on #19821, but does not close it, because that proposal includes a more sophisticated mechanism for setting timeouts. Co-Authored-By: David Rubin <david@vortan.dev>
2025-10-09- aroDiagnosticsToErrorBundle: fixup not clearing notes after flushing the ↵kcbanner
current error - Compilation: renameTmpIntoCache doesn't need to be pub after the `translateC` change
2025-10-09- Rework common translate-c and cImport logic into `Compilation.translateC`kcbanner
- Add std.zig.Server.allocErrorBundle, replace duplicates
2025-10-09- Move aroDiagnosticsToErrorBundle to compiler/util.zigkcbanner
2025-10-09- aro: fixup `toErrorBundle` not emitting the last error if it was followed ↵kcbanner
by .off or .warning - translate-c: emit `file_system_inputs` even in the case of failure, if available - translate-c: fixup emitting zero-length `file_system_inputs`
2025-10-09- Rework translate-c to integrate with the build system (by outputing error ↵kcbanner
bundles on stdout) via --zig-integration - Revive some of the removed cache integration logic in `cmdTranslateC` now that `translate-c` can return error bundles - Fixup inconsistent path separators (on Windows) when building the aro include path - Move some error bundle logic from resinator into aro.Diagnostics - Add `ErrorBundle.addRootErrorMessageWithNotes` (extracted from resinator)
2025-10-02resinator: Update for std.coff changesRyan Liptak
2025-10-01resinator: Sync with upstream, fix an alignment problemRyan Liptak
2025-09-30fix compile errors and minor bugsmlugg
2025-09-27Merge pull request #25362 from alexrp/aro-valistAlex Rønne Petersen
`aro`: `TypeStore`: synchronize `__va_list_tag` logic with Zig's `std.builtin.VaList`
2025-09-26aro: TypeStore: synchronize __va_list_tag logic with Zig's std.builtin.VaListAlex Rønne Petersen
https://github.com/Vexu/arocc/pull/893 closes #25361
2025-09-26Merge pull request #25342 from ziglang/fuzz-limitAndrew Kelley
fuzzing: implement limited fuzzing
2025-09-25implement review suggestionsLoris Cro
2025-09-24resinator: work around error VARARGS not implemented for this compilerAndrew Kelley
2025-09-24resinator: fix compile errorsAndrew Kelley
2025-09-24update aro & translate-cVeikka Tuominen
2025-09-24aro: updateAndrew Kelley
This is f5fb720a5399ee98e45f36337b2f68a4d23a783c plus ehaas's nonnull attribute pull request currently at 4b26cb3ac610a0a070fc43e43da8b4cdf0e9101b with zig patches intact.
2025-09-24zig fmtAndrew Kelley
2025-09-24aro: fix dep file logicAndrew Kelley
also add ability to omit main source file from dep file as it messes up caching strategy
2025-09-24translate-c: update for array list defaultsAndrew Kelley
2025-09-24fix rebase conflictsAndrew Kelley
2025-09-24aro: avoid BoundedArrayAndrew Kelley
2025-09-24update aro and translate-c sourcesVeikka Tuominen
2025-09-24resinator: Update for latest aroRyan Liptak
2025-09-24simplify diagnosticsAndrew Kelley