658 Commits

Author SHA1 Message Date
Alex Rønne Petersen a83aad152b Merge pull request 'LLVM 22' (#32013) from llvm22 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32013
2026-04-26 07:03:38 +02:00
Andrew Kelley e7d74e49b0 declare linker test bankruptcy
The active contributors and maintainers of Zig's linker code have
generally found the current linker test harness to be cumbersome. The
tests require a lot of maintenance, but do not provide a lot of
coverage, and when they fail it is painful to troubleshoot.

Furthermore, as part of working on #31691, I don't want to port over the
CheckObject step, because I don't like the code anyway.

The plan forward is to start enhancing `zig objdump` to assist in
linker development, as well as using it as the basis for snapshot
testing.

We absolutely need linker test coverage, but we need to try to improve
these things about the next attempt:
* less effort to create and maintain tests
* less CPU overhead - we should be able to add a lot of tests without
  adding a lot of CI time.
* more helpful failures. A failed linker test should provide the next
  steps a developer can take to understand why the test failed.
* a goal of porting over all of LLD's test suite, or at least the good
  ones.

I'm not going to open an issue to track the lost linker test coverage,
because there was already so much lack of coverage for linker stuff.

However I will open issues to track this lost coverage:
* the deleted checks from test/standalone/glibc_compat/build.zig
* the deleted checks from test/standalone/compiler_rt_panic/build.zig
* the deleted checks from test/standalone/ios/build.zig
2026-04-26 00:15:07 +02:00
Alex Rønne Petersen 2b6ab59435 cmake: update to LLVM 22
closes https://codeberg.org/ziglang/zig/issues/30558
2026-04-25 21:49:39 +02:00
Jacob Young ea45895a2d tests: cleanup c abi test runner 2026-04-22 13:19:44 -04:00
Alex Rønne Petersen 7ea8f842bc libzigc: move all unit tests from lib/c/ to test/c/
Before:

* test-zigc: run libzigc unit tests (part of test-modules)
* test-libc: run libc-test cases

Now:

* test-libc: run libc API unit tests (part of test-modules)
* test-libc-nsz: run libc-test cases

libc API unit tests (previously referred to as libzigc unit tests) now run for
all supported targets, even those we don't provide libzigc for. The idea is that
this will help us catch bad assumptions in the unit tests, as well as bugs in
other libcs.

I considered this setup:

* test-c: run libc API unit tests (part of test-modules)
* test-libc-nsz: run libc-test cases
* test-libc: both of the above

However, I do not like it because it gives a false sense of security; the full
module and C ABI test suites are still liable to catch libzigc bugs that test-c
and test-libc-nsz might not. So contributors should just run the test steps
outlined in https://codeberg.org/ziglang/zig/issues/30978.

Co-authored-by: rpkak <rpkak@noreply.codeberg.org>
2026-04-17 12:10:37 +02:00
Andrew Kelley 7977ef80f9 start the 0.17.0 release cycle 2026-04-13 11:19:29 -07:00
Andrew Kelley 523cfabcdf build.zig: hard cap on compiler max_rss at 8G
This number should never be raised. If the value is exceeded, then it is
considered a bug in the Zig project that building the compiler takes
more than 8G of memory.

Partial revert of 1293f080fd

Deprioritizes #31510
2026-03-27 18:05:59 +01:00
Andrew Kelley a388b88ed4 Merge pull request 'std.heap.ArenaAllocator: add fuzz test + some optimizations' (#31407) from justusk/zig:fuzz-arena into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31407
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-03-11 03:00:07 +01:00
Matthew Lugg 1293f080fd build.zig: bump max_rss values 2026-03-10 10:38:50 +00:00
Justus Klausecker 933bfd4282 tests: pass on -Dsanitize-thread to unit tests 2026-03-06 10:09:06 +01:00
Alex Rønne Petersen 852c5d2824 build: bump some max_rss values 2026-03-03 22:50:48 +01:00
Alex Rønne Petersen 2d867223be build: use -ffunction-sections -fdata-sections for the Zig compiler on ARM
See 7daf0b6f4660245ac518c663f8971aad7e540da8; builds for ARM can run into the
same problems due to limited branch range.
2026-02-26 20:48:29 +01:00
Kendall Condon 5b9bb0a404 add -Dfuzz-only
Runs only one configuration suitable for fuzzing.
2026-02-13 17:58:09 -05:00
Andrew Kelley 6296924214 build: bump behavior max_rss 2026-02-12 16:30:24 -08:00
Andrew Kelley 6d52678a6c zig libc malloc: skip export when unit testing
These functions can only be exported when external libc components are
available due to the errno location dependency. Note that even when zig
libc is complete, on Windows, errno location will always be external (in
ucrtbase.dll).
2026-02-12 13:14:51 -08:00
Andrew Kelley 0a61eca22c bump max_rss for module tests 2026-02-12 13:14:51 -08:00
Andrew Kelley ea30f86113 bump maxrss for compiler_rt, libc, and c-abi tests 2026-02-11 23:37:31 +01:00
Jacob Young 7e8ee985e2 tracy: add fiber integration 2026-02-09 10:47:21 -05:00
Jacob Young a28d57292f IoUring: update to new Io APIs 2026-02-09 10:47:21 -05:00
Jacob Young 2961cf1dac tracy: update API 2026-02-09 02:24:56 -05:00
Alex Rønne Petersen f150759953 Merge pull request 'ci: run test-libc on x86_64-linux-release' (#30221) from alexrp/zig:ci-libc-test into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30221
2026-02-05 13:35:49 +01:00
Andrew Kelley b49dc5eb70 build: bump max_rss for C ABI tests on Windows 2026-02-04 16:24:48 -08:00
Jacob Young ffc6da29e3 std.Io.Threaded: implement and cleanup windows codepaths 2026-02-04 14:15:41 -05:00
Alex Rønne Petersen 02599bccb5 build: bump test-libc max_rss to 3_500_000_000
error: memory usage peaked at 3.11GB (3105054720 bytes), exceeding the declared upper bound of 2.90GB (2900000000 bytes)
2026-02-03 17:19:03 +01:00
Andrew Kelley 43866f7439 build.zig: bump max_rss
encountered error: memory usage peaked at 0.66GB (656060416 bytes),
exceeding the declared upper bound of 0.64GB (639565414 bytes)
2026-01-30 22:03:39 -08:00
Andrew Kelley b2816f2698 build.zig: only-c implies no-lib 2026-01-30 22:03:14 -08:00
Andrew Kelley 276ca77bf0 build: adjust max_rss for behavior tests
observed error: memory usage peaked at 0.70GB (699138048 bytes),
exceeding the declared upper bound of 0.66GB (659809075 bytes)
2026-01-30 22:03:14 -08:00
Michael Dusan a8002a8564 build: avoid pkg-config when statically linking LLVM
Fixes stage4 build on NetBSD with pkg-config installed.
2026-01-19 13:16:33 +01:00
Alex Rønne Petersen 4e806f2521 build: bump test-libc max_rss to 2_496_066_355 2026-01-11 05:55:46 +01:00
Andrew Kelley 9aaecde63f build: bump freebsd max_rss
error: memory usage peaked at 0.75GB (751378432 bytes), exceeding the
declared upper bound of 0.74GB (743802470 bytes)
2026-01-09 13:52:00 -08:00
Andrew Kelley e23bec700c build: delete some wrong max_rss values
these aren't even checking the correct target, it's checking based on
the host so when cross compiling the numbers don't even make sense.
2026-01-07 11:03:37 -08:00
Alex Rønne Petersen 6a1fecea67 build: bump max_rss for test-behavior on powerpc64le-linux to 627_431_833 2026-01-06 21:15:35 +01:00
Alex Rønne Petersen 7daf0b6f46 build: use -ffunction-sections -fdata-sections for the Zig compiler on PowerPC
It has been observed in practice on powerpc64(le)-linux that zig.o (in various
stages and build modes) is large enough that the +/- 32MB branch range of
PowerPC is insufficient to reach from one end of the code section to the other.
With LLVM 21, this leads to silent miscompiles that then crash at runtime. With
LLVM 22, it will at least lead to branch range errors that fail the compilation,
but that gets us no closer to a working compiler.

By using these options, we give the linker much greater flexibility to move code
and data around to satisfy these range constraints; without them, the linker is
not allowed to split up the huge code and data sections of zig.o to do so.

Similar issues have also been observed on powerpc-linux (32-bit), hexagon-linux,
and some variations of mips(64)(el)-linux. But let's be conservative for now;
those other targets can be added to the condition later.

As a data point to support this change, it's worth noting that LLD started
enabling these options for LTO precisely because the resulting large compilation
units ran into these range issues. In some abstract sense, Zig can be seen as
doing a limited form of "LTO" in the frontend, so it's not surprising that we
would hit the same issues.
2026-01-06 21:15:02 +01:00
Alex Rønne Petersen 219624111b build: bump max_rss for zig exe to 7_900_000_000
Needed for riscv64-linux. Overkill for everything else, but: e19c686c22.
2026-01-06 20:55:23 +01:00
Alex Rønne Petersen 018da9662d build: bump max_rss for test-std on riscv64-linux to 4_052_670_054 2026-01-06 20:54:21 +01:00
Alex Rønne Petersen 378b4d3d3a build: bump max_rss for test-behavior on riscv64-linux to 827_043_430 2026-01-06 20:54:06 +01:00
Alex Rønne Petersen 00dc4d000f test: add openbsd targets to module test matrix 2026-01-05 16:50:46 +01:00
Andrew Kelley 420a9aed4c build: bump freebsd max_rss
solves error: memory usage peaked at 1.10GB (1102852096 bytes),
exceeding the declared upper bound of 1.06GB (1060217241 bytes)
2026-01-04 00:27:09 -08:00
Andrew Kelley e19c686c22 build: bump max_rss for zig
this was exceeded on CI. this value is not meant to be so precisely
tweaked per OS and arch
2026-01-04 00:27:09 -08:00
Andrew Kelley 0b856d12a0 build: remove freebsd max_rss special casing
error: memory usage peaked at 6.05GB (6047436800 bytes), exceeding the
declared upper bound of 6.04GB (6044158771 bytes)

This value isn't meant to be OS-specific anyway.
2026-01-04 00:27:09 -08:00
Andrew Kelley 32af0f6154 std: move child process APIs to std.Io
this gets the build runner compiling again on linux

this work is incomplete; it only moves code around so that environment
variables can be wrangled properly. a future commit will need to audit
the cancelation and error handling of this moved logic.
2026-01-04 00:27:08 -08:00
Andrew Kelley e08837b0fe build.zig: simplify max_rss compiler_rt on windows
I observed this take more memory than the previous declaration
2025-12-26 19:58:56 -08:00
Andrew Kelley 0126e71903 build.zig: adjust max_rss for zig libc
this isn't meant to be a precisely measured thing that is different per
operating system. it's meant to have some room for growth but not too
much.
2025-12-26 19:58:56 -08:00
Andrew Kelley 66da6773eb build: make test-incremental respect -Dtest-filter 2025-12-26 19:58:56 -08:00
Andrew Kelley 02e560d9ef build.zig: adjust max_rss for unit tests
this isn't meant to be a precisely measured thing that is different per
operating system. it's meant to have some room for growth but not too
much.
2025-12-24 11:37:51 -08:00
Andrew Kelley aafddc2ea1 update all occurrences of close() to close(io) 2025-12-23 22:15:07 -08:00
Andrew Kelley d1d2c37af2 std: all Dir functions moved to std.Io 2025-12-23 22:15:07 -08:00
Alex Rønne Petersen f9419c81cf build: bump test-c-abi max_rss to 2_389_779_251 on x86_64-linux 2025-12-18 13:01:35 +01:00
Alex Rønne Petersen 6b77bb3f91 build: bump test-compiler-rt max_rss to 978_463_129 on x86_64-linux 2025-12-18 11:42:42 +01:00
Alex Rønne Petersen 00220a5ea1 build: add max_rss values observed on powerpc64le-linux 2025-12-16 06:23:20 +01:00