Commit Graph

632 Commits

Author SHA1 Message Date
Andrew Kelley 15e73c70ab build.zig: bump max_rss for windows module tests
observed error: memory usage peaked at 0.62GB (620556288 bytes),
exceeding the declared upper bound of 0.60GB (603070054 bytes).
2026-01-27 15:32:34 -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
Alex Rønne Petersen 2da956b84a build: bump compiler max_rss to 6_664_025_702 on x86_64-linux 2025-12-10 00:07:25 +01:00
Alex Rønne Petersen 5d96a58f1d build: bump test-compiler-rt max_rss to 868_445_388 on x86_64-linux 2025-12-07 11:28:06 +01:00
Alex Rønne Petersen a21d9408a3 build: bump test-zigc max_rss to 871_883_161 on x86_64-linux 2025-12-07 04:04:06 +01:00
Alex Rønne Petersen 1e616096d4 build: bump test-zigc max_rss to 767_483_904 on x86_64-linux 2025-12-06 01:51:01 +01:00
Alex Rønne Petersen 2728eb5d5e build: adjust max_rss on a per-CI-host basis
This avoids pessimizing concurrency on all machines due to e.g. the macOS
machine having high memory usage across the board due to 16K page size.

This also adds max_rss to test-unit and test-c-abi since those tend to eat a
decent chunk of memory too.
2025-12-04 20:06:12 +01:00
Alex Rønne Petersen e2a9e568b4 build: add -Dskip-spirv and -Dskip-wasm options 2025-12-04 03:46:35 +01:00
Alex Rønne Petersen ad9a5187ac build: add some missing darwin tags 2025-12-04 03:46:35 +01:00
Andrew Kelley 3f2cf1c002 CI: skip test-incremental on Windows
Tracked by #22510
2025-11-22 08:09:25 -08:00
Alex Rønne Petersen 35d87c4406 Merge pull request #25929 from alexrp/maccatalyst
`std.zig.target`: support `aarch64-maccatalyst` and `x86_64-maccatalyst` cross libc
2025-11-16 23:16:33 +01:00
Alex Rønne Petersen bbdf8eaf75 build: change -Dskip-macos to -Dskip-darwin and make it cover all darwin OSs 2025-11-15 14:23:34 +01:00
Matthew Lugg cd8fdd252d build.zig: use Step.UpdateSourceFiles for zig1.wasm
We were already using this for `stage1/zig.h`, but `stage1/zig1.wasm`
was being modified directly by the `wasm-opt` command. That's a bad idea
because it forces the build system to assume that `wasm-opt` has side
effects, so it is re-run every time you run `zig build update-zig1`,
i.e. it does not interact with the cache system correctly. It is much
better to create non-side-effecting `Run` steps (using `addOutput*Arg`)
where possible so that the build system has a more correct understanding
of the step graph.
2025-11-15 09:49:02 +00:00
Alex Rønne Petersen 8126e22756 build: bump libc-test max_rss from 1758181785 to 2253598720 2025-10-30 17:52:50 +01:00
Alex Rønne Petersen dba1bf9353 remove all Oracle Solaris support
There is no straightforward way for the Zig team to access the Solaris system
headers; to do this, one has to create an Oracle account, accept their EULA to
download the installer ISO, and finally install it on a machine or VM. We do not
have to jump through hoops like this for any other OS that we support, and no
one on the team has expressed willingness to do it.

As a result, we cannot audit any Solaris contributions to std.c or other
similarly sensitive parts of the standard library. The best we would be able to
do is assume that Solaris and illumos are 100% compatible with no way to verify
that assumption. But at that point, the solaris and illumos OS tags would be
functionally identical anyway.

For Solaris especially, any contributions that involve APIs introduced after the
OS was made closed-source would also be inherently more risky than equivalent
contributions for other proprietary OSs due to the case of Google LLC v. Oracle
America, Inc., wherein Oracle clearly demonstrated its willingness to pursue
legal action against entities that merely copy API declarations.

Finally, Oracle laid off most of the Solaris team in 2017; the OS has been in
maintenance mode since, presumably to be retired completely sometime in the 2030s.

For these reasons, this commit removes all Oracle Solaris support.

Anyone who still wishes to use Zig on Solaris can try their luck by simply using
illumos instead of solaris in target triples - chances are it'll work. But there
will be no effort from the Zig team to support this use case; we recommend that
people move to illumos instead.
2025-10-27 07:35:38 -07:00
Alex Rønne Petersen 4edebf40d5 Merge pull request #25402 from alexrp/libc-test-ci
`ci`: enable running libc-test on `x86_64-linux-release`
2025-10-14 21:29:57 +02:00
Andrew Kelley c383cd50d5 build.zig: rename -Dtest-default-only to -Dno-matrix
because it's more memorable
2025-10-09 09:59:55 -07:00
Andrew Kelley 8964737ffc build.zig: add -Dtest-default-only option
handy during development when it is already known that not all tests
will pass.
2025-10-08 16:43:42 -07:00
Ryan Liptak 98dd8856ef std.mem: Add countScalar 2025-10-03 16:29:09 -07:00
Alex Rønne Petersen f049ae6d57 libc-test: set a 1.6G max_rss for each test case
1.4G was the highest value I observed for any test case on x86_64-linux. This
change should prevent OOM conditions in CI.
2025-10-01 03:25:13 +02:00
mlugg 1a8a8c610d tests: split up and enhance stack trace tests
Previously, the `test-stack-traces` step was essentially just testing
error traces, and even there we didn't have much coverage. This commit
solves that by splitting the "stack trace" tests into two separate
harnesses: the "stack trace" tests are for actual stack traces (i.e.
involving stack unwinding), while the "error trace" tests are
specifically for error return traces.

The "stack trace" tests will test different configurations of:

* `-lc`
* `-fPIE`
* `-fomit-frame-pointer`
* `-fllvm`
* unwind tables (currently disabled)
* strip debug info (currently disabled)

The main goal there is to test *stack unwinding* under different
conditions. Meanwhile, the "error trace" tests will test different
configurations of `-O` and `-fllvm`; the main goal here, aside from
checking that error traces themselves do not miscompile, is to check
whether debug info is still working even in optimized builds. Of course,
aggressive optimizations *can* thwart debug info no matter what, so as
before, there is a way to disable cases for specific targets / optimize
modes.

The program which converts stack traces into a more validatable format
by removing things like addresses (previously `check-stack-trace.zig`,
now `convert-stack-trace.zig`) has been rewritten and simplified. Also,
thanks to various fixes in this branch, several workarounds have become
unnecessary: for instance, we don't need to ignore the function name
printed in stack traces in release modes, because `std.debug.Dwarf` now
uses the correct DIE for inlined functions!

Neither `test-stack-traces` nor `test-error-traces` does general foreign
architecture testing, because it seems that (at least for now) external
executors often aren't particularly good at handling stack tracing
correctly (looking at you, Wine). Generally, they just test the native
target (this matches the old behavior of `test-stack-traces`). However,
there is one exception: when on an x86_64 or aarch64 host, we will also
test the 32-bit version (x86 or arm) if the OS supports it, because such
executables can be trivially tested without an external executor.

Oh, also, I wrote a bunch of stack trace tests. Previously there was,
erm, *one* test in `test-stack-traces` which wasn't for error traces.
Now there are a good few!
2025-09-30 13:44:53 +01:00
Andrew Kelley 79d9997d22 delete @cImport tests
These are now maintained in a separate repository: ziglang/translate-c
2025-09-24 20:01:19 -07:00
Veikka Tuominen e7a622fb33 update aro and translate-c sources 2025-09-24 20:01:18 -07:00
Andrew Kelley 1bdcdbd996 delete all the translate-c tests
the ziglang/translate-c package has its own test suite, so these are
redundant
2025-09-24 20:01:17 -07:00
Andrew Kelley f49a54745b compiler: update aro and translate-c to latest; delete clang translate-c 2025-09-24 19:57:28 -07:00
rpkak 9b3b7aa911 Integrate libc-test cases into the build system
zig build test-libc -Dlibc-test-path=/path/to/libc-test
2025-09-24 16:05:18 -07:00
Jacob Young f58200e3f2 Elf2: create a new linker from scratch
This iteration already has significantly better incremental support.

Closes #24110
2025-09-21 14:09:14 -07:00
Alex Rønne Petersen 9095a7fefd test: respect -Dskip-translate-c in test-standalone 2025-09-18 12:42:24 +02:00