35361 Commits

Author SHA1 Message Date
Matthew Lugg
8f86ed78da
ci: final bump to all unit test timeouts
The last commit passed CI, so this final bump is just to allow for
deviation caused by different loads on the runner machines. With this
change, I don't expect any current unit test to ever time out, even when
CI is under extreme load.
2025-10-18 09:32:49 +01:00
Matthew Lugg
3d0009b9c6
ci: bump test timeouts to stupid numbers on Windows
Unfortunately, Windows' scheduler means that test timeouts get hit very
easily, because it seems the system can refuse to schedule a waiting
process for *upwards of 10 minutes*. We should look for a better
solution for this problem going forwards, but for now, just give Windows
a very high test timeout.

The 30 minute timeout set here is around the duration of a *full CI run*
on Windows, so it should be impossible to hit normally, but it means
that if a test gets stuck we'll at least get told (eventually).
2025-10-18 09:28:44 +01:00
Matthew Lugg
f4315a0a57
ci: bump unit test timeouts
i am in purgatory as a punishment bestowed upon me for daring to
question the sanctity of windows' scheduler
2025-10-18 09:28:44 +01:00
Matthew Lugg
50056a5b3a
compiler: rename --test-timeout-ms to --test-timeout
The unit can now be specified in the argument.
2025-10-18 09:28:43 +01:00
Matthew Lugg
db8330adaf
ci: add unit test timeouts to loongarch and x86_64-freebsd 2025-10-18 09:28:43 +01:00
Matthew Lugg
1881ee4587
std: split up ecdsa tests 2025-10-18 09:28:43 +01:00
Frank Denis
e77a7c5c45
crypto.ecdsa: trim the number of tests we perform
The Wycheproof test suite is extensive, but takes a long time to
complete on CI.

Keep only the most relevant ones and take it as an opportunity to describe
what they are.

The remaining ones are still available for manual testing when required.
2025-10-18 09:28:43 +01:00
mlugg
a7251e4191
ci: bump unit test timeouts 2025-10-18 09:28:43 +01:00
mlugg
b866c14328
std: make RwLock test less intensive
This test called `yield` 80,000 times, which is nothing on a system with
little load, but murder on a CI system. macOS' scheduler in particular
doesn't seem to deal with this very well. The `yield` calls also weren't
even necessarily doing what they were meant to: if the optimizer could
figure out that it doesn't clobber some memory, then it could happily
reorder around the `yield`s anyway!

The test has been simplified and made to work better, and the number of
yields have been reduced. The number of overall iterations has also been
reduced, because with the `yield` calls making races very likely, we
don't really need to run too many iterations to be confident that the
implementation is race-free.
2025-10-18 09:28:43 +01:00
mlugg
7a5d2a196f
tweak tests to avoid timeouts 2025-10-18 09:28:42 +01:00
mlugg
d0b92a8022
std.Build: do not expect server protocol for tests using immature backends
For instance, when running a Zig test using the self-hosted aarch64
backend, this logic was previously expecting `std.zig.Server` to be
used, but the default test runner intentionally does not do this because
the backend is too immature to handle it. On 'master', this is causing
sporadic failures; on this branch, they became consistent failures.
2025-10-18 09:28:42 +01:00
mlugg
b43bb3a32a
ci: set unit test timeouts 2025-10-18 09:28:42 +01:00
mlugg
263e7fe87a
build runner: final tweaks to output 2025-10-18 09:28:42 +01:00
mlugg
75adbf40ca
build runner: remove --prominent-compile-errors, introduce --error-style
The new `--error-style` option decides how build failures are printed.
The default mode "verbose" prints all context including the step graph
fragment and the failed command (if any). The alternative mode "minimal"
prints only the failed step itself, and does not print the failed
command. There are also "verbose_clear" and "minimal_clear" modes, which
have the distinction that the output is cleared (through ANSI escape
codes) between updates, preventing different updates from being confused
in the output. If `--error-style` is not specified, the environment
variable `ZIG_BUILD_ERROR_STYLE` is checked before falling back to the
default of "verbose"; this means the value can effectively be chosen
system-wide since it is generally a personal preference.

Also introduced is a `--multiline-errors` option which decides how to
print errors which span multiple lines. By default, non-initial lines
are indented to align with the first. Alternatively, a leading newline
can be printed to align everyting on the first column, or no special
treatment can be applied, resulting in misaligned output. Again, there
is an environment variable (`ZIG_BUILD_MULTILINE_ERRORS`) to specify a
preferred default if the option is not explicitly provided.

Resolves: #23472
2025-10-18 09:28:42 +01:00
mlugg
a388a8e5a7
std.Build: separate errors from failed commands
Recording the command in a separate field will give the build runner
more freedom to choose how and when the command should be printed.
2025-10-18 09:28:42 +01:00
mlugg
e4456d03f3
std.Build.Step.Run: many enhancements
This is a major refactor to `Step.Run` which adds new functionality,
primarily to the execution of Zig tests.

* All tests are run, even if a test crashes. This happens through the
  same mechanism as timeouts where the test processes is repeatedly
  respawned as needed.
* The build status output is more precise. For each unit test, it
  differentiates pass, skip, fail, crash, and timeout. Memory leaks are
  reported separately, as they do not indicate a test's "status", but
  are rather an additional property (a test with leaks may still pass!).
* The number of memory leaks is tracked and reported, both per-test and
  for a whole `Run` step.
* Reporting is made clearer when a step is failed solely due to error
  logs (`std.log.err`) where every unit test passed.
2025-10-18 09:28:41 +01:00
mlugg
7e7d7875b9
std.Build: implement unit test timeouts
For now, there is a flag to `zig build` called `--test-timeout-ms` which
accepts a value in milliseconds. If the execution time of any individual
unit test exceeds that number of milliseconds, the test is terminated
and marked as timed out.

In the future, we may want to increase the granularity of this feature
by allowing timeouts to be specified per-step or even per-test. However,
a global option is actually very useful. In particular, it can be used
in CI scripts to ensure that no individual unit test exceeds some
reasonable limit (e.g. 60 seconds) without having to assign limits to
every individual test step in the build script.

Also, individual unit test durations are now shown in the time report
web interface -- this was fairly trivial to add since we're timing tests
(to check for timeouts) anyway.

This commit makes progress on #19821, but does not close it, because
that proposal includes a more sophisticated mechanism for setting
timeouts.

Co-Authored-By: David Rubin <david@vortan.dev>
2025-10-18 09:28:39 +01:00
Jon Parise
337762114f std.Uri: test file URIs without an authority field
Some environments (such as KDE) form file URIs without an authority
field (e.g. file:/etc/fstab). Also test this case for completeness.
2025-10-17 17:40:25 -07:00
Brandon Black
d18f1dde41 os.linux.timeval: use same field names as std.c
Otherwise, the field names in std.posix.timeval vary by target os.
I think this was an accidental change during the work of #25610
2025-10-18 01:51:44 +02:00
Alex Rønne Petersen
798f6b85e3
Merge pull request #25617 from alexrp/libcxx-libunwind-backports
`libcxx`, `libunwind`: backport llvm/llvm-project#162867, llvm/llvm-project#160182, llvm/llvm-project#158347
2025-10-18 00:37:37 +02:00
Ryan Liptak
2ab0ca13bb langref: Bump 0.15.1 to 0.15.2 2025-10-17 15:03:51 +02:00
Alex Rønne Petersen
751375f3ca
libcxx: backport llvm/llvm-project#158347
https://github.com/llvm/llvm-project/pull/158347
2025-10-17 15:02:04 +02:00
Alex Rønne Petersen
2357ae06dd
libcxx: backport llvm/llvm-project#160182
https://github.com/llvm/llvm-project/pull/160182
2025-10-17 15:02:04 +02:00
Alex Rønne Petersen
671428359e
libunwind: backport llvm/llvm-project#162867
https://github.com/llvm/llvm-project/pull/162867
2025-10-17 15:02:02 +02:00
Alex Rønne Petersen
1f8a72175b
Merge pull request #25610 from alexrp/std-os-linux-cleanup
`std.os.linux`: some miscellaneous cleanup in arch bits
2025-10-17 12:07:51 +02:00
Alex Rønne Petersen
3091efaa18
Merge pull request #25609 from alexrp/test-targets
`test`: put some niche targets behind `-Dtest-extra-targets`
2025-10-17 10:53:46 +02:00
Alex Rønne Petersen
54b5087760
Merge pull request #25607 from alexrp/hexagon
Some `hexagon-linux` fixes + enable std tests in CI
2025-10-17 10:48:35 +02:00
Alex Rønne Petersen
29fb9e4da7
std.os.linux.tls: don't unnecessarily use std.posix 2025-10-17 02:46:47 +02:00
Alex Rønne Petersen
9ae8c48fdf
test: put soft float powerpc targets behind -Dtest-extra-targets 2025-10-17 02:15:48 +02:00
Alex Rønne Petersen
7215249aa9
test: put all n32 and x32 targets behind -Dtest-extra-targets 2025-10-17 02:13:31 +02:00
Alex Rønne Petersen
ca2da421dd
test: put all dynamic musl targets behind -Dtest-extra-targets 2025-10-17 02:03:02 +02:00
Alex Rønne Petersen
d5481e6536
std.os.linux: add incomplete x32 arch bits file
This is very likely full of wrong stuff. It's effectively just a copy of the
x86_64 file - needed because the former stopped using usize/isize. To be clear,
this is no more broken than the old situation was; this just makes the
brokenness explicit.
2025-10-17 01:20:33 +02:00
Alex Rønne Petersen
502eca7b09
std.os.linux: add incomplete mipsn32 arch bits file
This is very likely full of wrong stuff. It's effectively just a copy of the
mips64 file - needed because the former stopped using usize/isize. To be clear,
this is no more broken than the old situation was; this just makes the
brokenness explicit.
2025-10-17 01:20:33 +02:00
Alex Rønne Petersen
aa8e53908a
std.os.linux: clean up a bunch of dead consts 2025-10-17 01:20:33 +02:00
Alex Rønne Petersen
dc1bc52dd6
std.os.linux: retranslate F_* constants and Flock struct, and move out of arch bits
Flock is now equivalent to struct flock64, and the related F.* constants map to
the 64-bit variants on 32-bit systems.
2025-10-17 01:20:33 +02:00
Alex Rønne Petersen
cfdc0f0e34
std.os.linux: replace usize/isize in arch bits with fixed types for clarity 2025-10-17 01:20:33 +02:00
Alex Rønne Petersen
fc7a5f2ae4
std.os.linux: move some generic decls out of the arch bits 2025-10-17 01:20:31 +02:00
Alex Rønne Petersen
8970d80355
std.os.linux.thumb: remove some @setRuntimeSafety(false) with no clear purpose 2025-10-16 23:17:25 +02:00
Alex Rønne Petersen
d84faceebd
std.os.linux: remove some pointless asm clobbers in naked fns 2025-10-16 23:15:23 +02:00
Alex Rønne Petersen
92b555a4ed
test: enable std tests for hexagon 2025-10-16 22:13:10 +02:00
Alex Rønne Petersen
05b52da15e
std.os.linux: fix a bunch of syscall and time ABI issues on hexagon
I'm not particularly happy with sprinkling this check everywhere, but the
situation should improve once we complete the time64 migration.
2025-10-16 22:12:42 +02:00
Alex Rønne Petersen
3b5376eff5
std: disable a few failing tests on hexagon 2025-10-16 22:11:51 +02:00
xdBronch
f785e4745d detect invalid @bitCast with arrays 2025-10-16 19:36:11 +01:00
bnuuydev
173f497e29 llvm-backend: fix uefi data layout
the old logic caused the uefi case to fall through which caused an
assertion assertion in llvm to fail, as the data layout was wrong.
2025-10-16 13:59:02 +02:00
Alex Rønne Petersen
48f8133bea
Merge pull request #25569 from alexrp/std-debug-sparc
`std.debug`: implement `sparc*-linux` unwinding
2025-10-16 10:14:05 +02:00
Alex Rønne Petersen
493ad58ff7
Revert "ci: enable running libc-test on x86_64-linux-release"
This reverts commit fcfdf99122b17a928c144c3d70418b35e6b1620e.

This added too much load to the x86_64-linux machines, resulting in timeouts
pretty much across the board.
2025-10-15 21:30:25 +02:00
Frank Denis
6669885aa2
Faster BLAKE3 implementation (#25574)
This is a rewrite of the BLAKE3 implementation, with vectorization.

On Apple Silicon, the new implementation is about twice as fast as the previous one.

With AVX2, it is more than 4 times faster.

With AVX512, it is more than 7.5x faster than the previous implementation (from 678 MB/s to 5086 MB/s).
2025-10-15 14:03:56 +02:00
Alex Rønne Petersen
e0f10da270
std.debug: FP-based unwinding is ideal on SPARC
The way SPARC works due to its ABI built around register windows means that we
can always do fast FP-based unwinding.
2025-10-15 13:59:17 +02:00
Alex Rønne Petersen
dd7819220a
std.debug: fix return addresses being off on SPARC
The return address points to the call instruction on SPARC, so the actual return
address is 8 bytes after. This means that we shouldn't do the return address
adjustment that we normally do.
2025-10-15 13:59:17 +02:00
Alex Rønne Petersen
912fed3380
std.debug: use the SP as the initial FP on SPARC
The FP would point to the register save area for the previous frame, while the
SP points to the register save area for the current frame. So use the latter.
2025-10-15 13:59:17 +02:00