zig/lib/std
Matthew Lugg c6b5945356 std.Build: don't force all children to inherit color option
The build runner was previously forcing child processes to have their
stderr colorization match the build runner by setting `CLICOLOR_FORCE`
or `NO_COLOR`. This is a nice idea in some cases---for instance a simple
`Run` step which we just expect to exit with code 0 and whose stderr is
not being programmatically inspected---but is a bad idea in others, for
instance if there is a check on stderr or if stderr is captured, in
which case forcing color on the child could cause checks to fail.

Instead, this commit adds a field to `std.Build.Step.Run` which
specifies a behavior for the build runner to employ in terms of
assigning the `CLICOLOR_FORCE` and `NO_COLOR` environment variables. The
default behavior is to set `CLICOLOR_FORCE` if the build runner's output
is colorized and the step's stderr is not captured, and to set
`NO_COLOR` otherwise. Alternatively, colors can be always enabled,
always disabled, always match the build runner, or the environment
variables can be left untouched so they can be manually controlled
through `env_map`.

Notably, this fixes a failure when running `zig build test-cli` in a
TTY (or with colors explicitly enabled). GitHub CI hadn't caught this
because it does not request color, but Codeberg CI now does, and we were
seeing a failure in the `zig init` test because the actual output had
color escape codes in it due to 6d280dc.
2025-11-14 21:50:24 +01:00
..
Build std.Build: don't force all children to inherit color option 2025-11-14 21:50:24 +01:00
builtin std.builtin.assembly: add Clobbers for kvx 2025-11-10 09:40:42 +01:00
c remove all Oracle Solaris support 2025-10-27 07:35:38 -07:00
compress add deflate compression, simplify decompression 2025-09-30 18:28:47 -07:00
crypto represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
debug represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
dwarf fix compiler ftbfs from std.macho and std.dwarf changes 2025-09-30 13:44:51 +01:00
fmt
fs represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
hash
heap std: fix compilation errors on Windows 2025-10-29 06:20:50 -07:00
http Revert "std.http: disable failing test on 32-bit arm" 2025-11-01 11:21:28 -04:00
Io std.Build: don't force all children to inherit color option 2025-11-14 21:50:24 +01:00
json std.debug.lockStderrWriter: also return ttyconf 2025-10-30 09:31:28 +00:00
math represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
mem std.mem.Allocator: fix resize doc comment 2025-10-22 11:41:16 +02:00
meta
os posix: reduce the number of assumptions made by dl_iterate_phdr 2025-11-09 03:31:26 -05:00
posix represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
process represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
Random
sort
tar compiler: update for introduction of std.Io 2025-10-29 06:20:49 -07:00
Target std.Target.x86: refresh from update_cpu_features.zig 2025-11-13 22:29:28 +01:00
testing fix compile errors and minor bugs 2025-09-30 13:44:54 +01:00
Thread std.os.windows: eliminate forwarder function in kernel32 (#25766) 2025-10-31 13:54:50 +00:00
time
tz
unicode
valgrind
zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
zon coerce vectors to arrays rather than inline for 2025-09-20 18:33:00 -07:00
array_hash_map.zig Coff2: create a new linker from scratch 2025-10-02 17:44:52 -04:00
array_list.zig std.ArrayList: actaully memset to undefined in shrinkRetainingCapacity and clearRetainingCapacity 2025-11-06 05:30:41 -08:00
ascii.zig std: Skip element comparisons if mem.order args point to same memory 2025-10-31 18:34:33 -07:00
atomic.zig std.atomic: define cache line size for alpha, hppa, microblaze, sh 2025-10-23 09:27:17 +02:00
base64.zig Base64DecoderWithIgnore.calcSizeUpperBound cannot return an error (#25834) 2025-11-07 08:16:34 +01:00
bit_set.zig
BitStack.zig
buf_map.zig
buf_set.zig
Build.zig std.debug.lockStderrWriter: also return ttyconf 2025-10-30 09:31:28 +00:00
builtin.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
c.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
coff.zig Coff: implement threadlocal variables 2025-10-10 22:47:47 -07:00
compress.zig
crypto.zig Add ML-DSA post-quantum signatures (#25862) 2025-11-10 14:11:30 +01:00
debug.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
deque.zig std: remove loop from growCapacity 2025-09-20 14:34:18 -07:00
DoublyLinkedList.zig *LinkedList.remove() assumes node is in the list 2025-10-25 21:10:02 -07:00
dwarf.zig
dynamic_library.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
elf.zig posix: reduce the number of assumptions made by dl_iterate_phdr 2025-11-09 03:31:26 -05:00
enums.zig
fmt.zig test: add test case for enum-literal with '{t}' format 2025-11-06 13:45:21 +08:00
fs.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
gpu.zig
hash.zig
hash_map.zig std.hash_map: tune slow unit tests 2025-10-29 06:20:52 -07:00
heap.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
http.zig
Io.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
json.zig
leb128.zig
log.zig std.log: colorize output in default implementation 2025-10-30 09:31:30 +00:00
macho.zig std: fixes 2025-09-30 13:44:51 +01:00
math.zig
mem.zig std: Skip element comparisons if mem.order args point to same memory 2025-10-31 18:34:33 -07:00
meta.zig std: disable a few failing tests on hexagon 2025-10-16 22:11:51 +02:00
multi_array_list.zig std: remove loop from growCapacity 2025-09-20 14:34:18 -07:00
once.zig
os.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
pdb.zig
pie.zig std.pie: add missing clobbers on alpha and sparc 2025-11-14 12:19:38 +01:00
posix.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
priority_dequeue.zig
priority_queue.zig
process.zig std.Build: don't force all children to inherit color option 2025-11-14 21:50:24 +01:00
Progress.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
Random.zig std.Io.net: progress towards DNS resolution 2025-10-29 06:20:48 -07:00
SemanticVersion.zig
simd.zig std.simd: suggest 1024-bit vectors for kvx 2025-11-10 09:40:44 +01:00
SinglyLinkedList.zig SinglyLinkedList.remove docs: Assumes -> asserts 2025-10-25 21:28:54 -07:00
sort.zig
start.zig std.start: add kvx support 2025-11-10 09:40:44 +01:00
static_string_map.zig
std.zig std.Io.Threaded: install and cleanup signal handlers 2025-10-29 06:20:52 -07:00
tar.zig std.Io: add dirOpenDir and WASI impl 2025-10-29 06:20:50 -07:00
Target.zig Merge pull request #25917 from alexrp/target-features 2025-11-14 12:23:09 +01:00
testing.zig std.debug.lockStderrWriter: also return ttyconf 2025-10-30 09:31:28 +00:00
Thread.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
time.zig represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi 2025-11-14 11:33:35 +01:00
treap.zig
tz.zig
unicode.zig std: move some windows path checking logic 2025-10-29 06:20:50 -07:00
Uri.zig compiler: update for introduction of std.Io 2025-10-29 06:20:49 -07:00
valgrind.zig
wasm.zig
zig.zig Move/coalesce RcIncludes enum to std.zig.RcIncludes 2025-11-07 19:16:52 -08:00
zip.zig
zon.zig