zig/lib/std
Andrew Kelley 58edefc6d1 zig build: many enhancements related to parallel building
Rework std.Build.Step to have an `owner: *Build` field. This
simplified the implementation of installation steps, as well as provided
some much-needed common API for the new parallelized build system.

--verbose is now defined very concretely: it prints to stderr just
before spawning a child process.

Child process execution is updated to conform to the new
parallel-friendly make() function semantics.

DRY up the failWithCacheError handling code. It now integrates properly
with the step graph instead of incorrectly dumping to stderr and calling
process exit.

In the main CLI, fix `zig fmt` crash when there are no errors and stdin
is used.

Deleted steps:
 * EmulatableRunStep - this entire thing can be removed in favor of a
   flag added to std.Build.RunStep called `skip_foreign_checks`.
 * LogStep - this doesn't really fit with a multi-threaded build runner
   and is effectively superseded by the new build summary output.

build runner:
 * add -fsummary and -fno-summary to override the default behavior,
   which is to print a summary if any of the build steps fail.
 * print the dep prefix when emitting error messages for steps.

std.Build.FmtStep:
 * This step now supports exclude paths as well as a check flag.
 * The check flag decides between two modes, modify mode, and check
   mode. These can be used to update source files in place, or to fail
   the build, respectively.

Zig's own build.zig:
 * The `test-fmt` step will do all the `zig fmt` checking that we expect
   to be done. Since the `test` step depends on this one, we can simply
   remove the explicit call to `zig fmt` in the CI.
 * The new `fmt` step will actually perform `zig fmt` and update source
   files in place.

std.Build.RunStep:
 * expose max_stdio_size is a field (previously an unchangeable
   hard-coded value).
 * rework the API. Instead of configuring each stream independently,
   there is a `stdio` field where you can choose between
   `infer_from_args`, `inherit`, or `check`. These determine whether the
   RunStep is considered to have side-effects or not. The previous
   field, `condition` is gone.
 * when stdio mode is set to `check` there is a slice of any number of
   checks to make, which include things like exit code, stderr matching,
   or stdout matching.
 * remove the ill-defined `print` field.
 * when adding an output arg, it takes the opportunity to give itself a
   better name.
 * The flag `skip_foreign_checks` is added. If this is true, a RunStep
   which is configured to check the output of the executed binary will
   not fail the build if the binary cannot be executed due to being for
   a foreign binary to the host system which is running the build graph.
   Command-line arguments such as -fqemu and -fwasmtime may affect
   whether a binary is detected as foreign, as well as system
   configuration such as Rosetta (macOS) and binfmt_misc (Linux).
   - This makes EmulatableRunStep no longer needed.
 * Fix the child process handling to properly integrate with the new
   bulid API and to avoid deadlocks in stdout/stderr streams by polling
   if necessary.

std.Build.RemoveDirStep now uses the open build_root directory handle
instead of an absolute path.
2023-03-15 10:48:13 -07:00
..
atomic update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
Build zig build: many enhancements related to parallel building 2023-03-15 10:48:13 -07:00
c netbsd: use versioned __msync13 from libc 2023-01-28 19:05:38 -05:00
compress std.compress.zstandard: fix error sets for streaming API 2023-02-21 22:06:25 +11:00
crypto Add Kyber post-quantum key encapsulation mechanism (#14902) 2023-03-15 03:50:45 +00:00
dwarf
event update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
fmt update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
fs add doc comments to std.fs.File.default_mode 2023-03-03 01:00:44 -05:00
hash std.hash: use std.math.rotl in Xxhash64 and Xxhash32 2023-02-21 12:09:27 +11:00
heap add std.heap.ThreadSafeAllocator 2023-03-15 10:48:12 -07:00
http Fix to use '/' for a empty path (#14884) 2023-03-14 13:07:25 +02:00
io std: restrict mem.span() and mem.len() to sentinel terminated pointers 2023-01-29 15:07:06 -05:00
json update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
math CBE: implement big integer literals 2023-03-05 02:59:01 -05:00
mem split @qualCast into @constCast and @volatileCast 2023-02-15 01:43:57 +02:00
meta update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
net update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
os hot code swapping PoC working 2023-03-15 10:48:12 -07:00
rand update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
target update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
testing std.mem.Allocator: allow shrink to fail 2022-11-29 23:30:38 -07:00
Thread zig build: add a -j<N> option for limiting concurrency 2023-03-15 10:48:12 -07:00
time
tz
unicode update usages of @call 2022-12-13 13:14:20 +02:00
valgrind
zig integrate the build runner and the compiler server 2023-03-15 10:48:13 -07:00
array_hash_map.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
array_list.zig std: Add ArrayList.insertAssumeCapacity() 2023-03-12 11:02:53 +00:00
ascii.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
atomic.zig all: rename i386 to x86 2022-11-04 00:09:27 +03:30
base64.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
bit_set.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
bounded_array.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
buf_map.zig
buf_set.zig
Build.zig zig build: many enhancements related to parallel building 2023-03-15 10:48:13 -07:00
builtin.zig Sema: implement for_len 2023-02-18 19:17:21 -07:00
c.zig std: add fchmodat 2023-03-03 02:37:45 -05:00
child_process.zig stage2: hot code swapping PoC 2023-03-15 10:48:12 -07:00
coff.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
compress.zig std.compress.zstd: renamed from std.compress.zstandard 2023-02-22 00:11:20 +11:00
comptime_string_map.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
crypto.zig Add Kyber post-quantum key encapsulation mechanism (#14902) 2023-03-15 03:50:45 +00:00
cstr.zig std: restrict mem.span() and mem.len() to sentinel terminated pointers 2023-01-29 15:07:06 -05:00
debug.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
dwarf.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
dynamic_library.zig update usages of @call 2022-12-13 13:14:20 +02:00
elf.zig run zig fmt on everything checked by CI 2022-11-18 19:22:42 +00:00
enums.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
event.zig
fifo.zig std.fifo: add toOwnedSlice method 2023-03-15 10:48:13 -07:00
fmt.zig std.fmt: add bytesToHex() to encode bytes as hex digits 2023-03-07 17:45:31 -05:00
fs.zig std: add fchmodat 2023-03-03 02:37:45 -05:00
hash.zig std.hash: add XxHash64 and XxHash32 2023-02-20 09:09:05 +11:00
hash_map.zig tools: implement more lldb pretty printers 2023-02-27 05:37:03 -05:00
heap.zig add std.heap.ThreadSafeAllocator 2023-03-15 10:48:12 -07:00
http.zig std.http: split Client's parts into their own files 2023-03-09 14:55:20 -06:00
Ini.zig add std.Ini for basic .ini file parsing 2023-01-11 15:39:48 -08:00
io.zig std.io.poll: remove done function 2023-03-01 12:21:53 -05:00
json.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
leb128.zig update uses of overflow arithmetic builtins 2022-12-27 15:13:14 +02:00
linked_list.zig
log.zig std: collect all options under one namespace 2023-01-05 02:31:29 -07:00
macho.zig std.macho: add OLD = 0 as valid mode for both arm64 and x86_64 2023-01-21 13:18:14 +01:00
math.zig math: implement absInt for integer vectors 2023-01-03 13:30:24 +02:00
mem.zig std.mem.copy: update to new for loop syntax 2023-03-15 10:48:12 -07:00
meta.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
multi_array_list.zig tools: add lldb pretty printer for std.MultiArrayList.Slice 2023-03-06 05:58:46 -05:00
net.zig std.http: handle relative redirects 2023-03-09 14:55:13 -06:00
once.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
os.zig eliminate posix_spawn from the standard library 2023-03-10 15:41:07 -05:00
packed_int_array.zig Merge pull request #14671 from ziglang/multi-object-for 2023-02-19 10:10:59 -05:00
pdb.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
priority_dequeue.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
priority_queue.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
process.zig std.process.Child: remove pid and handle, add id 2023-03-03 07:49:05 -05:00
Progress.zig std.Progress: add lock_stderr and unlock_stderr 2023-03-15 10:48:12 -07:00
rand.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
RingBuffer.zig std.RingBuffer: add (non-concurrent) RingBuffer implementation 2023-02-21 12:58:34 +11:00
segmented_list.zig behavior: add test coverage for slicing zero length array field of struct 2022-12-10 12:33:17 +01:00
SemanticVersion.zig api(std.ascii): remove deprecated decls 2022-12-09 21:57:17 +01:00
simd.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
sort.zig Relax std.sort.binarySearch requirements 2023-02-21 12:28:43 -05:00
start.zig ignore SIGPIPE by default 2023-02-17 09:08:41 -07:00
start_windows_tls.zig cbe: fixes for tls, support for not linking libc, and enabling tests 2023-01-29 15:04:13 -05:00
std.zig Move std.crypto.config options to std.options (#14906) 2023-03-14 06:40:23 +00:00
tar.zig zig build: add executable bit and file path to package hash 2023-02-01 18:42:29 -07:00
target.zig std: reenable vectorized code with the C backend 2023-03-06 08:09:32 -05:00
testing.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
Thread.zig extract ThreadPool and WaitGroup from compiler to std lib 2023-03-15 10:48:12 -07:00
time.zig std.time: add microTimestamp() (#13327) 2022-11-02 23:20:19 +01:00
treap.zig
tz.zig
unicode.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
Uri.zig std.http: handle relative redirects 2023-03-09 14:55:13 -06:00
valgrind.zig LLVM: add valgrind integration for x86 and aarch64 2022-11-19 19:32:45 -07:00
wasm.zig update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
zig.zig integrate the build runner and the compiler server 2023-03-15 10:48:13 -07:00