aboutsummaryrefslogtreecommitdiff
path: root/lib/std
AgeCommit message (Collapse)Author
2025-08-05Merge pull request #24699 from ziglang/boundedAndrew Kelley
remove RingBuffer; remove BoundedArray; use `@memmove`
2025-08-05std.elf: buffer header iterator API (#24691)Giuseppe Cesarano
Closes #24666.
2025-08-05std: delete RingBufferAndrew Kelley
Progress towards #19231
2025-08-05std.base64: delete encodeFromReaderToWriterAndrew Kelley
this function is wacky, should not have been merged
2025-08-05std: remove BoundedArrayAndrew Kelley
This use case is handled by ArrayListUnmanaged via the "...Bounded" method variants, and it's more optimal to share machine code, versus generating multiple versions of each function for differing array lengths.
2025-08-05std.array_list: add bounded methodsAndrew Kelley
2025-08-05std: replace various mem copies with `@memmove`Andrew Kelley
2025-08-05std.c: fix utsname array sizesVeikka Tuominen
2025-08-05crypto: fix typo in ecdsa commentDavid Rubin
2025-08-05std.Target.Query: fix `WindowsVersion` format in `zigTriple()`KNnut
2025-08-04std.compress.flate.Decompress: return correct size for unbuffered decompressionIan Johnson
Closes #24686 As a bonus, this commit also makes the `git.zig` "testing `main`" compile again.
2025-08-04Merge pull request #24629 from alexrp/android-requires-libcAlex Rønne Petersen
`std.Target`: require libc for Android API levels prior to 29
2025-08-03std.Target: bump watchos min version to 8.0.0Alex Rønne Petersen
2025-08-03std.Target: bump driverkit min version to 20.0.0Alex Rønne Petersen
2025-08-03std.Target: bump max versions for Apple targetsAlex Rønne Petersen
2025-08-03std.Target: bump amdhsa max version to 6.4.2Alex Rønne Petersen
2025-08-03std.Target: bump vulkan max version to 1.4.321Alex Rønne Petersen
2025-08-03std.Target: bump cuda max version to 12.9.1Alex Rønne Petersen
2025-08-03std.Target: bump freebsd max version to 14.3.0Alex Rønne Petersen
2025-08-03std.Target: bump linux max version to 6.16.0Alex Rønne Petersen
2025-08-03std.Target: bump fuchsia max version to 27.0.0Alex Rønne Petersen
2025-08-03zig fmt: apply new cast builtin orderJustus Klausecker
2025-08-03zig fmt: canonicalize nested cast builtin orderJustus Klausecker
2025-08-03Watch: do not fail when file is removedAli Cheraghi
before this we would get a crash
2025-08-03Merge pull request #24562 from h57624paen/fix-win-spawn-double-normalizeAlex Rønne Petersen
std.process.Child: fix double path normalization in spawnWindows
2025-08-03Merge pull request #22997 from Rexicon226/align-0-reifyMatthew Lugg
sema: compile error on reifying align(0) fields and pointers
2025-08-02disallow alignment on packed union fieldsDavid Rubin
2025-08-02std.Build: keep compiler alive under `-fincremental --webui`mlugg
Previously, this only applied when using `-fincremental --watch`, but `--webui` makes the build runner stay alive just like `--watch` does, so the same logic applies here. Without this, attempting to perform incremental updates with `--webui` performs full rebuilds. (I did test that before merging the PR, but at that time I was passing `--watch` too -- which has since been disallowed -- so I missed that it doesn't work as expected without that option!)
2025-08-02std.Build.Watch: add macOS implementation based on FSEventStreammlugg
Resolves: #21905
2025-08-01Merge pull request #24614 from ziglang/flateAndrew Kelley
std.compress.flate: rework decompression and delete compression
2025-08-01build system: replace fuzzing UI with build UI, add time reportmlugg
This commit replaces the "fuzzer" UI, previously accessed with the `--fuzz` and `--port` flags, with a more interesting web UI which allows more interactions with the Zig build system. Most notably, it allows accessing the data emitted by a new "time report" system, which allows users to see which parts of Zig programs take the longest to compile. The option to expose the web UI is `--webui`. By default, it will listen on `[::1]` on a random port, but any IPv6 or IPv4 address can be specified with e.g. `--webui=[::1]:8000` or `--webui=127.0.0.1:8000`. The options `--fuzz` and `--time-report` both imply `--webui` if not given. Currently, `--webui` is incompatible with `--watch`; specifying both will cause `zig build` to exit with a fatal error. When the web UI is enabled, the build runner spawns the web server as soon as the configure phase completes. The frontend code consists of one HTML file, one JavaScript file, two CSS files, and a few Zig source files which are built into a WASM blob on-demand -- this is all very similar to the old fuzzer UI. Also inherited from the fuzzer UI is that the build system communicates with web clients over a WebSocket connection. When the build finishes, if `--webui` was passed (i.e. if the web server is running), the build runner does not terminate; it continues running to serve web requests, allowing interactive control of the build system. In the web interface is an overall "status" indicating whether a build is currently running, and also a list of all steps in this build. There are visual indicators (colors and spinners) for in-progress, succeeded, and failed steps. There is a "Rebuild" button which will cause the build system to reset the state of every step (note that this does not affect caching) and evaluate the step graph again. If `--time-report` is passed to `zig build`, a new section of the interface becomes visible, which associates every build step with a "time report". For most steps, this is just a simple "time taken" value. However, for `Compile` steps, the compiler communicates with the build system to provide it with much more interesting information: time taken for various pipeline phases, with a per-declaration and per-file breakdown, sorted by slowest declarations/files first. This feature is still in its early stages: the data can be a little tricky to understand, and there is no way to, for instance, sort by different properties, or filter to certain files. However, it has already given us some interesting statistics, and can be useful for spotting, for instance, particularly complex and slow compile-time logic. Additionally, if a compilation uses LLVM, its time report includes the "LLVM pass timing" information, which was previously accessible with the (now removed) `-ftime-report` compiler flag. To make time reports more useful, ZIR and compilation caches are ignored by the Zig compiler when they are enabled -- in other words, `Compile` steps *always* run, even if their result should be cached. This means that the flag can be used to analyze a project's compile time without having to repeatedly clear cache directory, for instance. However, when using `-fincremental`, updates other than the first will only show you the statistics for what changed on that particular update. Notably, this gives us a fairly nice way to see exactly which declarations were re-analyzed by an incremental update. If `--fuzz` is passed to `zig build`, another section of the web interface becomes visible, this time exposing the fuzzer. This is quite similar to the fuzzer UI this commit replaces, with only a few cosmetic tweaks. The interface is closer than before to supporting multiple fuzz steps at a time (in line with the overall strategy for this build UI, the goal will be for all of the fuzz steps to be accessible in the same interface), but still doesn't actually support it. The fuzzer UI looks quite different under the hood: as a result, various bugs are fixed, although other bugs remain. For instance, viewing the source code of any file other than the root of the main module is completely broken (as on master) due to some bogus file-to-module assignment logic in the fuzzer UI. Implementation notes: * The `lib/build-web/` directory holds the client side of the web UI. * The general server logic is in `std.Build.WebServer`. * Fuzzing-specific logic is in `std.Build.Fuzz`. * `std.Build.abi` is the new home of `std.Build.Fuzz.abi`, since it now relates to the build system web UI in general. * The build runner now has an **actual** general-purpose allocator, because thanks to `--watch` and `--webui`, the process can be arbitrarily long-lived. The gpa is `std.heap.DebugAllocator`, but the arena remains backed by `std.heap.page_allocator` for efficiency. I fixed several crashes caused by conflation of `gpa` and `arena` in the build runner and `std.Build`, but there may still be some I have missed. * The I/O logic in `std.Build.WebServer` is pretty gnarly; there are a *lot* of threads involved. I anticipate this situation improving significantly once the `std.Io` interface (with concurrency support) is introduced.
2025-08-01remove usages of `.alignment = 0`David Rubin
2025-08-01std.compress.flate.Decompress: use 64 buffered bitsAndrew Kelley
will have to find out why usize doesn't work for 32 bit targets some other time
2025-07-31std.Io.Writer.Hashed: fix bad assertAndrew Kelley
2025-07-31fetch: More Git fixesIan Johnson
2025-07-31std.compress.flate.Decompress: respect stream limitAndrew Kelley
2025-07-31std.Io.Writer: fix wrong return value from fixedDrainAndrew Kelley
2025-07-31std.compress.flate.Decompress: be in indirect or direct modeAndrew Kelley
depending on whether buffered
2025-07-31std.compress.flate.Decompress: allow users to swap out WriterAndrew Kelley
2025-07-31std.debug.Dwarf: work around API deficiencyAndrew Kelley
need to supply a big enough buffer when working with decompression
2025-07-31std.compress: fix discard impl and flate error detectionAndrew Kelley
2025-07-31std.Io.Reader: don't set end to zeroAndrew Kelley
because it may be used as a ring buffer
2025-07-31std: match readVec fn prototype exactlyAndrew Kelley
this is not necessary according to zig language, but works around a flaw in the C backend
2025-07-31fetch: update API usageAndrew Kelley
2025-07-31std.compress.zstd.Decompress: implement discard and readVecAndrew Kelley
2025-07-31fix test failures by adding readVecAndrew Kelley
2025-07-31std.compress.flate.Decompress: implement readVec and discardAndrew Kelley
2025-07-31compiler: fix unit test compile errorsAndrew Kelley
sorry, zip file creation has regressed because std lib no longer has a deflate compression implementation
2025-07-31fix 32-bit compilationAndrew Kelley
2025-07-31std.compress.flate.Decompress: delete bad unit testsAndrew Kelley
if I remove the last input byte from "don't read past deflate stream's end" (on master branch), the test fails with error.EndOfStream. what, then, is it supposed to be testing?