aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build
AgeCommit message (Collapse)Author
2025-11-06Step.Run: Fix for `convertPathArg` when cwd and path args are on different ↵Ryan Liptak
drives Fixes #25805
2025-10-30Merge pull request #25558 from jacobly0/elfv2-load-objJacob Young
Elf2: start implementing input object loading
2025-10-30std.Build: fix '--webui' crashMatthew Lugg
Using '--webui' without '--time-report' when there are Run steps in the graph was regressed by https://github.com/ziglang/zig/pull/25029.
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-30Merge pull request #25763 from mrjbq7/cancelledJohn Benediktsson
rename Cancelled to Canceled
2025-10-29Elf2: start implementing dynamic linkingJacob Young
2025-10-29std: back out the StackTrace byval changesAndrew Kelley
Let's keep passing this thing by pointer
2025-10-29std: fix compilation errors on WindowsAndrew Kelley
2025-10-29std.fs: use BadPathName rather than InvalidWtf8 on WindowsAndrew Kelley
2025-10-29std: accessZ -> accessAndrew Kelley
2025-10-29std.Io: implement dirStatPathAndrew Kelley
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-29WIP: hack at std.Io on a planeAndrew Kelley
2025-10-29WIP land the std.Io interfaceAndrew Kelley
fix std lib compilation errors caused by introducing std.Io
2025-10-18compiler: rename `--test-timeout-ms` to `--test-timeout`Matthew Lugg
The unit can now be specified in the argument.
2025-10-18ci: bump unit test timeoutsmlugg
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- Rework common translate-c and cImport logic into `Compilation.translateC`kcbanner
- Add std.zig.Server.allocErrorBundle, replace duplicates
2025-09-30std: fixesmlugg
2025-09-30replace usages of old std.debug APIsmlugg
src/crash_handler.zig is still TODO though, i am planning bigger changes there
2025-09-30yet moremlugg
2025-09-26Merge pull request #25342 from ziglang/fuzz-limitAndrew Kelley
fuzzing: implement limited fuzzing
2025-09-25web ui: fix not sending initial context sometimesAndrew Kelley
This would cause the web ui to crash in js or wasm.
2025-09-25implement review suggestionsLoris Cro
2025-09-24std.Build.Cache: clarify parameter is sub path, not basenameAndrew Kelley
2025-09-24fuzzing: implement limited fuzzingLoris Cro
Adds the limit option to `--fuzz=[limit]`. the limit expresses a number of iterations that *each fuzz test* will perform at maximum before exiting. The limit argument supports also 'K', 'M', and 'G' suffixeds (e.g. '10K'). Does not imply `--web-ui` (like unlimited fuzzing does) and prints a fuzzing report at the end. Closes #22900 but does not implement the time based limit, as after internal discussions we concluded to be problematic to both implement and use correctly.
2025-09-21Elf2: create a new linker from scratchJacob Young
This iteration already has significantly better incremental support. Closes #24110
2025-09-19std.Build.Step.Run: Enable passing (generated) file content as argsJustus Klausecker
Adds `addFileContentArg` and `addPrefixedFileContentArg` to pass the content of a file with a lazy path as an argument to a `std.Build.Step.Run`. This enables replicating shell `$()` / cmake `execute_process` with `OUTPUT_VARIABLE` as an input to another `execute_process` in conjuction with `captureStdOut`/`captureStdErr`. To also be able to replicate `$()` automatically trimming trailing newlines and cmake `OUTPUT_STRIP_TRAILING_WHITESPACE`, this patch adds an `options` arg to those functions which allows specifying the desired handling of surrounding whitespace. The `options` arg also allows to specify a custom `basename` for the output. e.g. to add a file extension (concrete use case: Zig `@import()` requires files to have a `.zig`/`.zon` extension to recognize them as valid source files).
2025-09-18greatly improve capabilities of the fuzzerKendall Condon
This PR significantly improves the capabilities of the fuzzer. The changes made to the fuzzer to accomplish this feat mostly include tracking memory reads from .rodata to determine fresh inputs, new mutations (especially the ones that insert const values from .rodata reads and __sanitizer_conv_const_cmp), and minimizing found inputs. Additionally, the runs per second has greatly been increased due to generating smaller inputs and avoiding clearing the 8-bit pc counters. An additional feature added is that the length of the input file is now stored and the old input file is rerun upon start. Other changes made to the fuzzer include more logical initialization, using one shared file `in` for inputs, creating corpus files with proper sizes, and using hexadecimal-numbered corpus files for simplicity. Furthermore, I added several new fuzz tests to gauge the fuzzer's efficiency. I also tried to add a test for zstandard decompression, which it crashed within 60,000 runs (less than a second.) Bug fixes include: * Fixed a race conditions when multiple fuzzer processes needed to use the same coverage file. * Web interface stats now update even when unique runs is not changing. * Fixed tokenizer.testPropertiesUpheld to allow stray carriage returns since they are valid whitespace.
2025-09-04std.elf: change STV enum from u2 to u3Alex Rønne Petersen
In gABI 4.3, st_other was changed such that the lower 3 bits are reserved for the visibility, up from the previous 2 bits.
2025-08-31std.fmt: delete deprecated APIsAndrew Kelley
std.fmt.Formatter -> std.fmt.Alt std.fmt.format -> std.Io.Writer.print
2025-08-30upgrade more old API usesAndrew Kelley
2025-08-30rework std.Io.Writer.Allocating to support runtime-known alignmentAndrew Kelley
Also, breaking API changes to: * std.fs.Dir.readFileAlloc * std.fs.Dir.readFileAllocOptions
2025-08-29std.Io: delete GenericReaderAndrew Kelley
and delete deprecated alias std.io
2025-08-29std.Io: delete CountingReaderAndrew Kelley
2025-08-28std.Io: delete GenericWriterAndrew Kelley
2025-08-26std.Build.WebServer: fix racemlugg
Just a typo: I wasn't actually using the duped message, so the message I sent could be freed in this interval.
2025-08-26std.Build.Step.Compile: fix race condition in args file creationIan Johnson
Fixes #23993 Previously, if multiple build processes tried to create the same args file, there was a race condition with the use of the non-atomic `writeFile` function which could cause a spawned compiler to read an empty or incomplete args file. This commit avoids the race condition by first writing to a temporary file with a random path and renaming it to the desired path.
2025-08-26std.Build.Step.TranslateC: forward --cache-dir and --global-cache-dir flagsAdamGoertz
2025-08-16Build.Step.Run: fix missing stdin buffer and flushIsaac Freund
Writer.sendFileAll() asserts non-zero buffer capacity in the case that the fallback is hit. It also requires the caller to flush. The buffer may be bypassed as an optimization but this is not a guarantee. Also improve the Writer documentation and add an earlier assert on buffer capacity in sendFileAll().
2025-08-16Compilation: remove last instance of deprecatedReaderAndrew Kelley
This also makes initStreaming preemptively disable file size checking.
2025-08-15std.Build: improve error for peak RSS exceeding declared valuemlugg
As well as the exact byte count, include a human-readable value so it's clearer what the error is actually telling you. The exact byte count might not be worth keeping, but I decided I would in case it's useful in any scenario.
2025-08-13build runner: fix single-threaded buildmlugg
Resolves: #24723
2025-08-13std.io.Writer.Allocating: rename getWritten() to written()Isaac Freund
This "get" is useless noise and was copied from FixedBufferWriter. Since this API has not yet landed in a release, now is a good time to make the breaking change to fix this.
2025-08-11std.ArrayList: make unmanaged the defaultAndrew Kelley