aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-09-18Remove usages of deprecatedWriterandrewkraevskii
2025-09-19std.fmt: migrate bufPrintZ to bufPrintSentinel (#25260)John Benediktsson
2025-09-19std.simd: suggest more sensible vector sizes across the boardAlex Rønne Petersen
2025-09-18zig fmt help: mention that the argument can be a directoryFrank Denis
I’ve been typing `zig fmt **/.zig` for a long time, until I discovered that the argument can actually be a directory. Mention this feature explicitly in the help message.
2025-09-17Merge pull request #25195 from blblack/netdefsAndrew Kelley
std: Add several sockopt-related constants and structs
2025-09-17fix handling of comptime-only union fields in `Type.getUnionLayout` (#25182)Silver
Fixes #25180
2025-09-17Merge pull request #25197 from rootbeer/24380-flaky-sigset-testAndrew Kelley
Re-enable std.posix "sigset_t bits" test
2025-09-17Elf: implement `linksection`Jacob Young
Closes #24330
2025-09-17Merge pull request #25201 from jacobly0/x86_64-addsatAndrew Kelley
x86_64: fix strictness edge cases in `+|`
2025-09-17Merge pull request #25217 from blblack/setsiderrAndrew Kelley
std.os.linux.setsid(): return raw syscall0 result
2025-09-17Merge pull request #25225 from Justus2308/darwin-fixesAndrew Kelley
std.*.ptrace: support more platforms and features more correctly
2025-09-17mem.replace: Document that input/output cannot overlapRyan Liptak
2025-09-17langref: mention union support of `@fieldParentPtr`rohlem
2025-09-17Merge pull request #25249 from jedisct1/sivAndrew Kelley
std.crypto: add AES-SIV and AES-GCM-SIV
2025-09-17std.crypto: add Ascon-AEAD, Ascon-Hash, Ascon-CHash (#25239)Frank Denis
Ascon is the family of cryptographic constructions standardized by NIST for lightweight cryptography. The Zig standard library already included the Ascon permutation itself, but higher-level constructions built on top of it were intentionally postponed until NIST released the final specification. That specification has now been published as NIST SP 800-232: https://csrc.nist.gov/pubs/sp/800/232/final With this publication, we can now confidently include these constructions in the standard library.
2025-09-17std.sort.pdq: fix out-of-bounds access in partialInsertionSort (#25253)Frank Denis
* std.sort.pdq: fix out-of-bounds access in partialInsertionSort When sorting a sub-range that doesn't start at index 0, the partialInsertionSort function could access indices below the range start. The loop condition `while (j >= 1)` didn't respect the arbitrary range boundaries [a, b). This changes the condition to `while (j > a)` to ensure indices never go below the range start, fixing the issue where pdqContext would access out-of-bounds indices. Fixes #25250
2025-09-17use block break instead of returnmarko
2025-09-17Merge pull request #25257 from linusg/bump-macos-headersAlex Rønne Petersen
libc: Update macOS headers to SDK 26.0
2025-09-17Avoid logic where we return success in case of an error (#25251)Frank Denis
In ed25519.zig, we checked if a test succeeds, in which case we returned an error. This was confusing, and Andrew pointed out that Zig weights branches against errors by default.
2025-09-17Some miscellaneous test suite cleanups (#25256)Alex Rønne Petersen
* test: remove test-compare-output and test-asm-link tests These were low value and unfocused tests. We already have coverage of the important aspects of these tests elsewhere. Additionally, there was really no need for these to have their own test harness. * test: rename issue_8550 standalone test to compile_asm * test: rename backend=stage2 to backend=selfhosted, and add backend=auto backend=auto (now the default if backend is omitted) means to let the compiler pick whatever backend it wants as the default. This is important for platforms where we don't yet have a self-hosted backend, such as loongarch64. Also purge a bunch of redundant target=native. * test: delete old stage1 compile_errors tests generic_function_returning_opaque_type.zig was salvaged as it's still worth having. * test: pull tests in test/cases/llvm/ up to test/cases/ There is nothing inherently LLVM-specific about any of these. * test: remove @cImport usage in interdependent_static_c_libs * test: move glibc_compat from link to standalone tests This is not really testing the linker. * build: -Dskip-translate-c now implies -Dskip-run-translated-c * build: skip test-cimport when -Dskip-translate-c is given
2025-09-16build: skip test-cimport when -Dskip-translate-c is givenAlex Rønne Petersen
2025-09-16build: -Dskip-translate-c now implies -Dskip-run-translated-cAlex Rønne Petersen
2025-09-16test: move glibc_compat from link to standalone testsAlex Rønne Petersen
This is not really testing the linker.
2025-09-16test: remove @cImport usage in interdependent_static_c_libsAlex Rønne Petersen
2025-09-16test: pull tests in test/cases/llvm/ up to test/cases/Alex Rønne Petersen
There is nothing inherently LLVM-specific about any of these.
2025-09-16test: delete old stage1 compile_errors testsAlex Rønne Petersen
generic_function_returning_opaque_type.zig was salvaged as it's still worth having.
2025-09-16test: rename backend=stage2 to backend=selfhosted, and add backend=autoAlex Rønne Petersen
backend=auto (now the default if backend is omitted) means to let the compiler pick whatever backend it wants as the default. This is important for platforms where we don't yet have a self-hosted backend, such as loongarch64. Also purge a bunch of redundant target=native.
2025-09-16Parallelize deriveKeysFrank Denis
2025-09-16Import crypto/aes_gcm_siv.zigFrank Denis
2025-09-16libc: Update macOS headers to SDK 26.0Linus Groh
2025-09-16tools: Update fetch_them_macos_headers.zig for macOS 26Linus Groh
2025-09-16llvm: fix tagged union payload size in debug infomlugg
Resolves: #24415
2025-09-16test: rename issue_8550 standalone test to compile_asmAlex Rønne Petersen
2025-09-16test: remove test-compare-output and test-asm-link testsAlex Rønne Petersen
These were low value and unfocused tests. We already have coverage of the important aspects of these tests elsewhere. Additionally, there was really no need for these to have their own test harness.
2025-09-16std.crypto: add AES-SIV and AES-GCM-SIVFrank Denis
The Zig standard library lacked schemes that resist nonce reuse. AES-SIV and AES-GCM-SIV are the standard options for this. AES-GCM-SIV can be very useful when Zig is used to target embedded systems, and AES-SIV is especially useful for key wrapping. Also take it as an opportunity to add a bunch of test vectors to modes.ctr and make sure it works with block ciphers whose size is not 16.
2025-09-15bpf: use bitCast instead of intCast in ld_imm_implGeorge Huebner
Any 32 bit immediate is allowed in a BPF instruction, including those greater than the largest positive i32 value.
2025-09-15frontend: fix reference tracking through coerced function bodiesmlugg
This bug was manifesting for user as a nasty link error because they were calling their application's main entry point as a coerced function, which essentially broke reference tracking for the entire ZCU, causing exported symbols to silently not get exported. I've been a little unsure about how coerced functions should interact with the unit graph before, but the solution is actually really obvious now: they shouldn't! `Sema` is now responsible for unwrapping possibly-coerced functions *before* queuing analysis or marking unit references. This makes the reference graph optimal (there are no redundant edges representing coerced versions of the same function) and simplifies logic elsewhere at the expense of just a few lines in Sema.
2025-09-15std.net.Ip6Address: format numerical scope iddatabase64128
2025-09-13std.math.big.int: normalize zero result for small multiplicationsmlugg
Resolves: #25221
2025-09-13std.os.linux.ptrace: add PTRACE_EVENT_* and PTRACE_O_* valuesJustus Klausecker
2025-09-13std.posix.ptrace: support more platforms more correctlyJustus Klausecker
2025-09-12linux: Doc and check retval for no-fail pid callsBrandon Black
The switch from @bitCast() to @intCast() here safety-checks Linux's assertion that these 3 calls never return errors (negative values as pid_t). getppid() can legally return 0 if the parent is in a different pid namespace, but this is not an error.
2025-09-12std.os.linux.setsid(): return raw syscall0 resultBrandon Black
When not linking libc on 64-bit Linux and calling posix.setsid(), we get a type error at compile time inside of posix.errno(). This is because posix.errno()'s non-libc branch expects a usize-sized value, which is what all the error-returning os.linux syscalls return, and linux.setsid() instead returned a pid_t, which is only 32 bits wide. This and the other 3 pid-related calls just below it (getpid(), getppid(), and gettid()) are the only Linux syscall examples here that are casting their return values to pid_t. For the other 3 this makes sense: those calls are documented to have no possible errors and always return a valid pid_t value. However, setsid() actually can return the error EPERM, and therefore needs to return the raw value from syscall0 for posix.errno() to process like normal. Additionally, posix.setsid() needs an @intCast(rc) for the success case as a result, like most other such cases.
2025-09-12std.os.linux.socketpair(): switch to unsigned argsBrandon Black
We need std.os.linux and std.c to agree on the types here, or else we'd have to pointlessly cast across the difference up in the std.posix wrapper. I ran into this as a type error the first time I tried to compile my code that calls posix.socketpair() on Linux without libc. All of our existing socket calls with these kinds of arguments in std (including the existing c.socketpair as well as os.linux.socket in this same file) use unsigned for all of these parameters, and so this brings linux.socketpair() into alignment with everything else.
2025-09-11compiler-rt: export __aeabi_read_tp for arm-freebsdAlex Rønne Petersen
FreeBSD normally provides this symbol in libc, but it's in the FBSDprivate_1.0 namespace, so it doesn't get included in our abilists file. Fortunately, the implementation is identical for Linux and FreeBSD, so we can just provide it in compiler-rt. It's interesting to note that the same is not true for NetBSD where the implementation is more complex to support older Arm versions. But we do include the symbol in our abilists file for NetBSD libc, so that's fine. closes #25215
2025-09-11Fix standalone test simple/cat/main.zig after Writergate update (#25188)Sardorbek Imomaliev
* Make cat in test/standalone/simple working again - Fixes: zig/0.15.1/lib/zig/std/Io/Writer.zig:939:11: 0x1049aef63 in sendFileAll (nclip) assert(w.buffer.len > 0); - because we are no using non zero buffers for stdout - "do not forget to flush" * replace std.fs with fs because we are already importing it
2025-09-11use pointer subtractionmarko
2025-09-10x86_64: fix `@splat` typoJacob Young
2025-09-10x86_64: delete usages of avx2 `vpack?s??`Jacob Young
This instruction actually has fairly useless semantics, and even the cases that were semantically correct could save 1 cycle of latency by using a different sequnce involving the avx version instead. Closes #25174
2025-09-10x86_64: fix strictness edge cases in `+|`Jacob Young
Closes #25145