aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2025-08-22Merge pull request #24926 from mrjbq7/http-fetchJohn Benediktsson
http.Client: don't forget to flush
2025-08-22chore(std.Target): explicitly set baseline only to `arm` with 3ds GasInfinity
* `arm` is the only supported tag for 3ds Co-authored-by: Alex Rønne Petersen <alex@alexrp.com>
2025-08-22chore(std.Target): document the 3ds version rangeGasInfinity
2025-08-22feat(std.Target): add 3ds osGasInfinity
2025-08-22std: remove lossy int to float coercion on json parseRaiden1411
2025-08-21Merge pull request #24921 from Justus2308/messy-machAndrew Kelley
std.c.darwin: cleanup, expose everything in std.c
2025-08-21zig reduce: adapt to new Writer APIJustus Klausecker
2025-08-21langref: sync with zig-spec grammar.pegIsaac Freund
2025-08-21drop NameTooLong from sysctlbynameZ error set (#24909)Sardorbek Imomaliev
2025-08-21make some compile errors aliases insteadJustus Klausecker
2025-08-21std.os.uefi: Fix typo that causes compile time error #22809"Lwazi Dube
2025-08-20Add mlock syscalls to std.c and std.posixBrandon Black
Linux already gained the relevant syscalls and consts in #24473 The basic mlock() and munlock() are fairly universal across the *nix world with a consistent interface, but are missing on wasi and windows. The mlockall() and munlockall() calls are not as widely supported as the basic ones. Notable non-implementers include darwin, haiku, and serenity (and of course wasi and windows again). mlock2() is Linux-only, as are its MLOCK flags.
2025-08-20Use readStreaming, not readPositional, for streaming file readVec on WindowsCarl Åstholm
2025-08-20wasi-libc: update to c89896107d7b57aef69dcadede47409ee4f702eeAlex Rønne Petersen
2025-08-20std.c.darwin: cleanup, expose everything in std.cJustus Klausecker
This mainly just moves stuff around. Justifications for other changes: * `KEVENT.FLAGS` is backed by `c_uint` because that's what the `kevent64` flags param takes (according to the 'latest' manpage from 2008) * `MACH_RCV_NOTIFY` is a legacy name and `MACH_RCV_OVERWRITE` is deprecated (xnu/osfmk/mach/message.h), so I removed them. They were 0 anyway and thus couldn't be represented as a packed struct field. * `MACH.RCV` and `MACH.SEND` are technically the same 'type' because they can both be supplied at the same time to `mach_msg`. I decided to still keep them separate because naming works out better that way and all flags except for `MACH_MSG_STRICT_REPLY` aren't shared anyway. Both are part of a packed union `mach_msg_option_t` which supplies a helper function to combine the two types. * `PT` is backed by `c_int` because that's what `ptrace` takes as a request arg (according to the latest manpage from 2015)
2025-08-19expose darwin.PT in std.cJustus Klausecker
2025-08-19Fix bugs in Windows readVec implementationsCarl Åstholm
2025-08-19std.Io.Writer: fix upper case hex float formattingTemariVirus
2025-08-19never advance seek position in `std.Io.Reader.peekDelimiterExclusive` (#24899)Rohlem
* extend std.Io.Reader.peekDelimiterExclusive test to repeat successful end-of-stream path (fails) * fix std.Io.Reader.peekDelimiterExclusive to not advance seek position in successful end-of-stream path
2025-08-18std.http.Client: discard response body when reusing connectionAndrew Kelley
When an error response was encountered, such as 404 not found, the body wasn't discarded, leading to the string "404 not found" being incorrectly interpreted as the next request's response. closes #24732
2025-08-18Expanded std.os.linux perf-related definitions (#24264)Giuseppe Cesarano
* Added perf_event_header definition * Added perf_event_mmap_page definition * Removed default values for perf_event_header * Fixed comments typos * Updated perf_event_attr definition * Explicit packet struct type * PERF.RECORD from struct to enum * fix typo: miscs to misc * misc as packed struct * cpu_mode as named enum * Rescoping CPU_MODE
2025-08-17http.BodyWriter: improve clarity of chunked state machineIsaac Freund
This is theoretically a bugfix as well, since it enforces the correct limit on the first write after writing the header. This theoretical bug hasn't been hit in practice though as far as I know.
2025-08-16Merge pull request #24864 from ifreund/fix-std-cmdAndrew Kelley
http.BodyWriter: handle EOF in chunkedSendFile, simplify
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-16Merge pull request #24874 from ziglang/tls-clientAndrew Kelley
std: more reliable HTTP and TLS networking
2025-08-16Compilation: remove last instance of deprecatedReaderAndrew Kelley
This also makes initStreaming preemptively disable file size checking.
2025-08-16http.BodyWriter: handle EOF in chunkedSendFile, simplifyIsaac Freund
With these changes, the `zig std` command now works again and doesn't trigger assertion failures or mess up the chunked transfer encoding.
2025-08-16std-docs: improve error message on write failureIsaac Freund
2025-08-16[std] fix compile error in std.Io.Writer.failingJosh Wolfe
2025-08-16implement registering NAPI on IoUring (#24850)Özgür Akkurt
2025-08-16std: more reliable HTTP and TLS networkingAndrew Kelley
* std.Io.Reader: fix confused semantics of rebase. Before it was ambiguous whether it was supposed to be based on end or seek. Now it is clearly based on seek, with an added assertion for clarity. * std.crypto.tls.Client: fix panic due to not enough buffer size available. Also, avoid unnecessary rebasing. * std.http.Reader: introduce max_head_len to limit HTTP header length. This prevents crash in underlying reader which may require a minimum buffer length. * std.http.Client: choose better buffer sizes for streams and TLS client. Crucially, the buffer shared by HTTP reader and TLS client needs to be big enough for all http headers *and* the max TLS record size. Bump HTTP header size default from 4K to 8K. fixes #24872 I have noticed however that there are still fetch problems
2025-08-15zstd: Protect against index out-of-bounds when decoding sequencesRyan Liptak
Previously, index out-of-bounds could occur when copying match_length bytes while decoding whatever sequence happened to overflow `dest`. Now, each sequence checks that there is enough room for the full sequence_length (literal_length + match_length) before doing any copying. Fixes the failing inputs found here: https://github.com/ziglang/zig/issues/24817#issuecomment-3192927715
2025-08-16re-enable std.math.modf vector tests (#24786)Rue
* re-enable std.math.modf vector tests * re-disable std.math.modf vector tests for `aarch64-macos` * re-disable for s390x architecture
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-15std.math: Add splat for vectors of u0s in rotl/rotr (#24822)Fri3dNstuff
2025-08-15zon: Add anonymous struct literal in the exampleManlio Perillo
2025-08-15std.compress.zstd.Decompress fixesAndrew Kelley
* std.Io.Reader: appendRemaining no longer supports alignment and has different rules about how exceeding limit. Fixed bug where it would return success instead of error.StreamTooLong like it was supposed to. * std.Io.Reader: simplify appendRemaining and appendRemainingUnlimited to be implemented based on std.Io.Writer.Allocating * std.Io.Writer: introduce unreachableRebase * std.Io.Writer: remove minimum_unused_capacity from Allocating. maybe that flexibility could have been handy, but let's see if anyone actually needs it. The field is redundant with the superlinear growth of ArrayList capacity. * std.Io.Writer: growingRebase also ensures total capacity on the preserve parameter, making it no longer necessary to do ensureTotalCapacity at the usage site of decompression streams. * std.compress.flate.Decompress: fix rebase not taking into account seek * std.compress.zstd.Decompress: split into "direct" and "indirect" usage patterns depending on whether a buffer is provided to init, matching how flate works. Remove some overzealous asserts that prevented buffer expansion from within rebase implementation. * std.zig: fix readSourceFileToAlloc returning an overaligned slice which was difficult to free correctly. fixes #24608
2025-08-15crypto/aes_ocb.zig: actually check against test vectors (#24835)Frank Denis
And use the correct bit endianness for padding
2025-08-14std.fs.File.Reader: fix freestanding build failuresAndrew Kelley
This should be enough to unblock people for now. We'll revisit the way these things are organized with the upcoming std.Io interface. fixes #24685
2025-08-15Merge pull request #24702 from The-King-of-Toasters/syscall-tablesAlex Rønne Petersen
Rewrite Linux syscalls generation
2025-08-14zstd.Decompress.stream: Fix handling of skippable frames in new_frame stateRyan Liptak
The previous code assumed that `initFrame` during the `new_frame` state would always result in the `in_frame` state, but that's not always the case. `initFrame` can also result in the `skippable_frame` state, which would lead to access of union field 'in_frame' while field 'skipping_frame' is active. Now, the switch is re-entered with the updated state so either case is handled appropriately. Fixes the crashes from https://github.com/ziglang/zig/issues/24817
2025-08-14Merge pull request #24847 from squeek502/zstd-partial-magicAndrew Kelley
zstd.Decompress: Treat a partial magic number as a failure
2025-08-14zig fmt: add tests for cast builtin canonicalizationJustus Klausecker
2025-08-14zstd.Decompress: Delete unused/impossible "end" stateRyan Liptak
2025-08-14zstd.Decompress: Treat a partial magic number as a failureRyan Liptak
Previously, the "allow EndOfStream" part of this logic was too permissive. If there are a few dangling bytes at the end of the stream, that should be treated as a bad magic number. The only case where EndOfStream is allowed is when the stream is truly at the end, with exactly zero bytes available.
2025-08-14Merge pull request #24845 from alexrp/netbsd-fixesAlex Rønne Petersen
Update NetBSD system headers; make TSan cross-compilable for NetBSD
2025-08-14std.Io.Writer: introduce rebase to the vtableAndrew Kelley
fixes #24814
2025-08-14Validate wildcard TLS certificates correctly (#24829)Frank Denis
Validate wildcard certificates as specified in RFC 6125. In particular, `*.example.com` should match `foo.example.com` but NOT `bar.foo.example.com` as it previously did.
2025-08-14netbsd: add some missing system headersAlex Rønne Petersen
The Lua headers are needed because, yes, NetBSD has a kernel module for Lua support. soundcard.h is technically a system header but is installed by libossaudio and so was missed previously. This also removes some riscv headers that shouldn't have been added because NetBSD does not yet officially support the riscv32/riscv64 ports. Closes #24737.
2025-08-13std.fs.File.Writer.sendFile: handle sendfile errorsAndrew Kelley
fixes #24842