Commit graph

36638 commits

Author SHA1 Message Date
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
e226df2ed5 Merge pull request 'add OpenBSD libc cross-compilation support' (#30064) from alexrp/zig:openbsd into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30064
Reviewed-by: Andrew Kelley <andrewrk@noreply.codeberg.org>
2026-01-06 16:12:54 +01:00
Matthew Lugg
be0a77efd2
std: re-enable some disabled tests
I believe these tests may have been flaky as a result of the bug fixed
in the previous commit. A big hint is that they were all crashing with
SIGSEGV with no stack trace. I suspect that some lingering SIGIOs from
cancelations were being delivered to a thread after its `munmap` call,
which was happening because the test runner called `Io.Threaded.deinit`
to cause all of the (detached) worker threads to exit.

If this passes, I'll re-run the x86_64-linux CI jobs on this commit a
few times before merge to try and be sure there are no lingering
failures.

Resolves: https://codeberg.org/ziglang/zig/issues/30096
Resolves: https://codeberg.org/ziglang/zig/issues/30592
Resolves: https://codeberg.org/ziglang/zig/issues/30682
2026-01-06 11:15:47 +00:00
Matthew Lugg
073ef0f393
std.Thread: mask all signals before unmapping stack
As the comment explains, if a signal were to arrive between a detached
thread's `munmap` and `exit` calls, the signal handler would immediately
trigger SIGSEGV due to the stack being unmapped. To solve this, we need
to block all signals before entering this logic. The musl implementation
which this logic was ported from does this exact thing; that logic was
just lost when porting.

Notably, this would lead to a crash with no stack trace, because the
SIGSEGV handler would itself crash due to the missing stack.
2026-01-06 11:15:33 +00:00
Matthew Lugg
1111655131
std: block cancelation in default panic and segfault handlers
It doesn't make any sense for a task to be canceled while it's
panicking.

As a happy accident, this also solves some cases where safety panics in
`Io.Threaded` would cause stack traces not to print due to invalid
thread-local state: when cancelation is blocked, `Io.Threaded` doesn't
consult said thread-local state at all. For instance, try inserting a
panic just after a call to `Syscall.start()` in `Io.Threaded`, and then
call the `Io` function in question from a `concurrent` task. Before this
PR, the stack trace fails to print, because the panic handler sees the
thread-local cancelation state in an unexpected state, leading to a
recursive panic. After this PR, the stack trace prints fine.
2026-01-06 10:50:45 +00:00
Alex Rønne Petersen
9d08eba2e1
std.crypto.argon2: skip flaky argon2d test
https://codeberg.org/ziglang/zig/issues/30074
2026-01-06 10:02:09 +01:00
Alex Rønne Petersen
b0da914ae6
std.crypto.argon2: disable flaky phc format hasher test
https://codeberg.org/ziglang/zig/issues/30682
2026-01-06 10:01:16 +01:00
Alex Rønne Petersen
d757d5e6b2 Merge pull request 'some CI script improvements' (#30177) from alexrp/zig:ci-stuff into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30177
2026-01-06 09:56:15 +01:00
Alex Rønne Petersen
435b8411b5 ci: update to qemu 10.2.0 2026-01-06 09:55:09 +01:00
Andrew Kelley
c906f7d2e7 Merge pull request 'std: rework atomic file / temp file API' (#30686) from std.Io.File.Atomic into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30686
2026-01-06 05:32:16 +01:00
Andrew Kelley
06130c5e61 std.Io.Threaded: set O_DIRECTORY along with O_TMPFILE 2026-01-05 20:31:31 -08:00
Andrew Kelley
f9a5b34e67 std.Io.Threaded: fix compilation on s390x, hexagon, or1k, m68k
Apparently the O_TMPFILE flag is split across two bits on these
architectures and missing on m68k.
2026-01-05 20:28:58 -08:00
Andrew Kelley
3859250c4d std.Io.Threaded: only linux supports fileHardLink 2026-01-05 20:28:58 -08:00
Andrew Kelley
39605bd6bc compiler: update to new createFileAtomic API 2026-01-05 20:28:58 -08:00
Andrew Kelley
4365b0df88 std.Io.Threaded: add File.hardLink 2026-01-05 20:28:58 -08:00
Andrew Kelley
81bfd28974 std.Io.Dir: rework atomic file 2026-01-05 20:28:58 -08:00
Michael Dusan
6ab1159e81 netbsd: use correct symbol for lwp_park 2026-01-06 05:27:54 +01:00
Andrew Kelley
d3d6761e43 std: depend on NtDll rather than advapi32.dll for entropy 2026-01-05 12:16:54 -08:00
Ryan Liptak
52141fe85f standalone tests: Delete all ad hoc TmpDir instances, use the build system instead 2026-01-05 20:41:18 +01:00
Alex Rønne Petersen
b318ee6cda
ci: pass -Dskip-openbsd on x86_64-freebsd and x86_64-linux-debug(-llvm) 2026-01-05 16:50:46 +01:00
Alex Rønne Petersen
00dc4d000f
test: add openbsd targets to module test matrix 2026-01-05 16:50:46 +01:00
Alex Rønne Petersen
25e348973a
std.zig.target: add openbsd libc support 2026-01-05 16:50:46 +01:00
Alex Rønne Petersen
a78f891d05
compiler: support building openbsd crt0 and stub shared libraries
closes #2878
2026-01-05 16:50:46 +01:00
Alex Rønne Petersen
00e6895bde
compiler: don't error on explicit link_libc=false on requiresLibC() targets
There are various reasons why one might want to still create libc-less
compilations on these targets. Case in point: Compiling our bundled crt0 for
OpenBSD.

We will still default to linking libc on these targets, though.
2026-01-05 16:50:46 +01:00
Alex Rønne Petersen
d0ad76c03c
update_openbsd_libc: add tool for updating openbsd libc startup code 2026-01-05 16:50:44 +01:00
Alex Rønne Petersen
50422d5c37 Merge pull request 'libc: remove most symbols already present in compiler_rt' (#30648) from mercenary/zig:2879-rt into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30648
Reviewed-by: Andrew Kelley <andrewrk@noreply.codeberg.org>
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
2026-01-05 15:49:55 +01:00
Alex Rønne Petersen
6f2e7afc30
ci: build stage4 and run behavior tests with it on aarch64-macos-debug
We do this in most other debug jobs, so seems sensible to do here too.
2026-01-05 15:41:16 +01:00
Alex Rønne Petersen
faa485e630
ci: build stage4 and run behavior tests with it on x86_64-linux-debug(-llvm)
This was removed in 125a9aa82b. But now that our
x86_64-linux machines have had their resources properly allocated, resulting in
runs taking 1-3 hours rather than 4-8, we can add this back.
2026-01-05 15:41:16 +01:00
Alex Rønne Petersen
4d3a847cd1
libc: add openbsd libc startup code for 7.8 2026-01-05 14:52:48 +01:00
Alex Rønne Petersen
9f16886536
compiler: define ___OpenBSD and OpenBSDX_Y when targeting openbsd libc 2026-01-05 14:52:48 +01:00
Alex Rønne Petersen
2c42b85529
std.zig.target: handle openbsd libc names 2026-01-05 14:52:48 +01:00
Alex Rønne Petersen
395145d3b0
std.zig.LibCDirs: add openbsd support 2026-01-05 14:52:48 +01:00
Alex Rønne Petersen
504de5c887
std.Target: bump baseline openbsd version from 7.7 to 7.8
Since this is the first version we support cross-compiling for.
2026-01-05 14:52:48 +01:00
Alex Rønne Petersen
39bb452d96
std.Target: factor arch/abi into openbsd minimum version logic 2026-01-05 14:52:48 +01:00
Alex Rønne Petersen
32b250109f
std.Target: add isOpenBSDLibC() 2026-01-05 14:52:48 +01:00
Alex Rønne Petersen
de13923d69
libc: add openbsd 7.8 abilists 2026-01-05 14:52:48 +01:00
Alex Rønne Petersen
66d97267c7
libc: add openbsd 7.8 headers
This excludes all headers in /usr/include/dev because that directory is bonkers
huge (18M). We can add these on an as-needed basis.
2026-01-05 14:52:48 +01:00
Alex Rønne Petersen
834ac8122b
process_headers: add openbsd support 2026-01-05 14:52:48 +01:00
Alex Rønne Petersen
962903e0fa
ci: bump riscv64-linux timeouts by 2 hours
Fixing this perf regression is tracked by: https://codeberg.org/ziglang/zig/issues/30595
2026-01-05 12:54:27 +01:00
Alex Rønne Petersen
ccc78252f1
std.Io.test: disable flaky recancel test on linux w/o libc
https://codeberg.org/ziglang/zig/issues/30592
2026-01-05 12:52:25 +01:00
Alex Rønne Petersen
bbacf42837
std.Io.test: disable flaky Group.concurrent test on linux w/o libc
https://codeberg.org/ziglang/zig/issues/30096
2026-01-05 12:52:18 +01:00
Michael Dusan
31a6e83a7c openbsd: fix Io.Threaded bitrot 2026-01-05 11:28:57 +01:00
Gregory Mullen
29b9e24df7 add tls.ExtensionType.quic_transport_parameters = 57 2026-01-05 11:26:17 +01:00
Jacob Young
ac64c75876 Dwarf: implement pointers to more comptime values
Closes #30600
Closes #30602
2026-01-05 11:24:48 +01:00
Andrew Kelley
8669898819 disable flaky test: aarch64-macos stage3/4 nondeterminism check
tracked by #30687
2026-01-04 23:43:19 -08:00
Andrew Kelley
435cd6f129 Merge pull request 'std.Build: adjust temp files API' (#30683) from std.Build-temp into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30683
2026-01-05 06:02:25 +01:00
Jake Greenfield
8e091047b5 std.Io.Threaded: fix Windows env var mapping
Windows environment variables are case-insensitive, so the special Wtf16
comparison needs to be used, or PATH/PATHEXT might be missed.
2026-01-04 23:32:36 -05:00
Andrew Kelley
c8ecfad41a build runner: clean up tmp dirs 2026-01-04 17:46:44 -08:00
Andrew Kelley
b4dbe483a7 std.Build: adjust temp files API
Remove the RemoveDir step with no replacement. This step had no valid
purpose. Mutating source files? That should be done with
UpdateSourceFiles step. Deleting temporary directories? That required
creating the tmp directories in the configure phase which is broken.
Deleting cached artifacts? That's going to cause problems.

Similarly, remove the `Build.makeTempPath` function. This was used to
create a temporary path in the configure place which, again, is the
wrong place to do it.

Instead, the WriteFile step has been updated with more functionality:

tmp mode: In this mode, the directory will be placed inside "tmp" rather
than "o", and caching will be skipped. During the `make` phase, the step
will always do all the file system operations, and on successful build
completion, the dir will be deleted along with all other tmp
directories. The directory is therefore eligible to be used for
mutations by other steps. `Build.addTempFiles` is introduced to
initialize a WriteFile step with this mode.

mutate mode: The operations will not be performed against a freshly
created directory, but instead act against a temporary directory.
`Build.addMutateFiles` is introduced to initialize a WriteFile step with
this mode.

`Build.tmpPath` is introduced, which is a shortcut for
`Build.addTempFiles` followed by `WriteFile.getDirectory`.

* give Cache a gpa rather than arena because that's what it asks for
2026-01-04 17:23:45 -08:00