35345 Commits

Author SHA1 Message Date
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
Alex Rønne Petersen
6de2d61a0c
std.debug: work around latest SPARC register window not being spilled on signal
I have no idea if this is a QEMU bug or real kernel behavior. Either way, the
register save area specifically exists for asynchronous spilling of incoming and
local registers, so there should be no harm in doing this.
2025-10-15 13:59:17 +02:00
Alex Rønne Petersen
78bc5d46e0
std.debug: the SPARC stack bias is only used on the 64-bit ABI 2025-10-15 13:59:17 +02:00
Alex Rønne Petersen
ebc0b90eb7
std.debug: rename some constants for clarity 2025-10-15 13:59:17 +02:00
Alex Rønne Petersen
62a8cfd5fe
std.debug: fix an invalid read in StackIterator.next()
We're overwriting the memory that unwind_context sits in, so we need to do the
getFp() call earlier.
2025-10-15 13:59:17 +02:00
Alex Rønne Petersen
a36dab2f90
std.debug.Dwarf: add SPARC register number mappings 2025-10-15 13:59:17 +02:00
Alex Rønne Petersen
b2732645b7
std.debug.cpu_context: add sparc*-linux context conversion support
It's not really a ucontext_t at all. Lovely stuff.
2025-10-15 13:59:17 +02:00
Alex Rønne Petersen
b8dd40fde8
std.debug.cpu_context.Sparc: flush register windows in current()
It's better to do this here than in StackIterator.init() so that
std.debug.cpu_context.Native.current() isn't a footgun on SPARC.
2025-10-15 13:59:17 +02:00
Alex Rønne Petersen
12b1d57df1
std.debug.cpu_context: add Sparc context 2025-10-15 13:59:17 +02:00
Alex Rønne Petersen
3d3aff0da9
std.debug: flush SPARC register windows from a new window
flushw and ta 3 flush all windows *except* the current one. So we need to do
this in a new register window to get all of the ones we care about.
2025-10-15 13:59:17 +02:00
Alex Rønne Petersen
f21a78b5a3
std.debug.SelfInfo.Elf: don't support DWARF unwinding for Hexagon and PowerPC
As for SPARC, FP-based unwinding is superior on these.
2025-10-15 13:59:17 +02:00
Alex Rønne Petersen
0ace906477
std.os.windows.CONTEXT: add sp field to getRegs() result for x86 2025-10-15 13:59:17 +02:00
Alex Rønne Petersen
70c21fdbab
libc-test: disable utime.c
Fails under heavy load in CI; futimens() effects aren't reflected in the
subsequent fstat() call for some reason.
2025-10-15 10:58:30 +02:00
Jacob Young
cc3c4d1069 windows: workaround kernel race condition in more places 2025-10-14 23:16:36 -04:00
Alex Rønne Petersen
595cd8935a ci: update to QEMU 10.1.1 2025-10-15 01:33:52 +02:00
Alex Rønne Petersen
27a396db4f
Merge pull request #25572 from alexrp/libcxx-backports
`libcxx`: backport llvm/llvm-project#155476, llvm/llvm-project#147389, llvm/llvm-project#155786
2025-10-15 00:24:35 +02: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