39473 Commits
Author SHA1 Message Date
Alex Rønne Petersen f74dac70b0 Revert "ci: temporarily raise x86_64-freebsd timeout to 24h"
This reverts commit adba29b342.

I have a core file for the hang now.
2026-08-09 23:37:46 +02:00
Anshul Guptaandmlugg cb7c6e3918 std.Io.Threaded: respect options.family in netLookup
Previously `AF_UNSPEC` was passed unconditionally to `getaddrinfo`.
This specifies `AF_INET` or `AF_INET6` depending on the value of
HostName.LookupOptions.family.

`AF_UNSPEC` is still set by default (when family == null).
2026-08-09 15:49:05 +02:00
xeondevandmlugg b2c230df50 std.Io: change netClose to accept []const net.Socket 2026-08-09 15:42:33 +02:00
Jacob Young 821d122c82 bootstrap: change/enable c compiler optimizations for zig1/zig2 2026-08-09 15:24:42 +02:00
49e20bd9dd std.Io.Threaded: fix fileWriteFileStreaming error handling
If the `getSize` inside `fileWriteFileStreaming` returns an error, two cases can happen:

- If was canceled, it will return 0, which will make the calling function repeat it, in which case the cancellation is lost

- If it truly returned an error, it will return 0, in which case the calling function will repeat the call and most likely `getSize` will fail again, resulting in an infinite loop

Co-authored-by: Lukas Lalinsky <[email protected]>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36140
Reviewed-by: mlugg <[email protected]>
2026-08-09 12:01:21 +02:00
zirunisandmlugg 828a5414db Manually add shell command and output of float_mode_example.zig to langref as a workaround until autodoc supports linking object files 2026-08-09 10:43:51 +02:00
Krzysztof WolickiandAndrew Kelley c9dc9b798c Add missing step.clearFailedCommand to PkgConfig.run 2026-08-09 02:53:36 +02:00
Matthew Lugg 83b57947e3 link: don't include static libraries in other static libraries
Follow-up to 9aa93a045e, which fixed this
bug for *shared* library inputs, but not *static* library inputs.

Supersedes https://codeberg.org/ziglang/zig/pulls/31383 by fixing the
bug at the compiler level instead of working around it in the build
system. This seems preferable because it is useful to the compiler to
have full information about a compilation's link inputs---for instance
this could interact with https://github.com/ziglang/zig/issues/20654 in
the future by having the compiler learn about a static library's ABI
even if that static library does not ultimately contribute to the link.

Resolves: https://codeberg.org/ziglang/zig/issues/35624
2026-08-09 02:44:15 +02:00
Alex Rønne Petersen 8e741045bc std.fs.test: disable deleteDir on Windows due to flakiness
https://codeberg.org/ziglang/zig/issues/35686
2026-08-09 00:04:02 +02:00
Gereon VandRyan Liptak 5f2729a1a2 Fix O_NONBLOCK bug 2026-08-08 23:40:54 +02:00
Ryan LiptakandRyan Liptak c88f728528 Certificate: Fix panic/regression in EMSA_PSS_VERIFY
This logic was not properly implemented when switching to `@memmove` from `mem.copyForwards` in ab4028d579

Before this commit, these lines were guaranteed to panic with `source and destination arguments have non-equal lengths`
2026-08-08 22:49:10 +02:00
Andrew Kelley 8380531aec Merge pull request 'Serialize packages and root dependencies into configuration file' (#36419) from hemisputnik/zig:work/36387-configuration-deps into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36419
Reviewed-by: Andrew Kelley <[email protected]>
2026-08-08 21:48:00 +02:00
Bernard AssanandAlex Rønne Petersen 6fd38ce13f Use iouring probing over kernel version checks
this will enable test passing on all linux kernels (particularly WSL)
without version checks and making `skipKernelLessThan` redundant

closes https://github.com/ziglang/zig/pull/24042

Signed-off-by: Bernard Assan <[email protected]>
2026-08-08 20:33:19 +02:00
Andrew Kelley 8dfddf95fe std.meta: deprecate fieldInfo, fieldNames, fieldTypes
Technically there is one valid use case for `fieldNames` which is use
with an enum or union so that those types can be used interchangeably.
But in practice these functions are mainly abused, because the callsites
always know what kind of type it is.

This commit encourages Zig users to embrace using `@typeInfo` directly
when doing type reflection.
2026-08-08 19:15:10 +02:00
Anthon van der Neutandmlugg 3239f672d2 Add compare() to Io.Timestamp
this makes it possible to compare e.g. file stat results without
knowing implementation details for Timestamp
2026-08-08 14:43:12 +02:00
Alex Rønne Petersen 9daad52a12 std.os.linux.tls: export __tls_get_offset instead of __tls_get_addr on s390x
This needs to return the offset from TP for the variable, which will be negative
because this is TLS variant II. This ABI does not use __tls_get_addr at all, so
it's best not to even export it, as that will help catch bad code.
2026-08-08 14:38:56 +02:00
Perry FraserandAlex Rønne Petersen c9c97ee845 Fix tryLockStderr compilation error
Fixes #36430. Thanks to kavika13 for the suggested fix!
2026-08-08 13:56:37 +02:00
agaveandAlex Rønne Petersen 2785bc3823 llvm: workaround to export associated .kd symbol for kernels on amdgcn 2026-08-08 13:48:58 +02:00
Alex Rønne Petersen cc6f42302a std.os.linux: fix F.{SETSIG,GETSIG} values for non-hppa architectures
closes https://codeberg.org/ziglang/zig/issues/36432
2026-08-08 13:45:45 +02:00
Michael Farber Brodskyandmlugg 637504176b Sema: handle OPV types in zirSelect and analyzeShuffle
Fixes: https://codeberg.org/ziglang/zig/issues/35969
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35996
Reviewed-by: mlugg <[email protected]>
2026-08-08 10:21:31 +02:00
02c49f2911 Sema: fix crash on @as(comptime_int, @floatFromInt(1))
Fixes: https://codeberg.org/ziglang/zig/issues/32147
Co-authored-by: rue04 <[email protected]>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35663
Reviewed-by: mlugg <[email protected]>
2026-08-08 09:54:04 +02:00
94bdde8327 Sema: fix incorrect compile error for @as(u32, @trunc(@floor(runtime_float)))
If I had to guess, `Sema.zirRoundOpType` was probably written when `@trunc` etc. could only have a float as their destination type. As a result, for the ints they can cast to now, they'd expect the expression inside them to be a `comptime_float`, which made `@trunc(@floor(runtime_float))` or `@trunc(@floatFromInt(runtime_int))` impossible.
By changing the returned type in this case to be generic poison, showing we don't know the expected type as *any* float can be converted to an int, `@trunc(@floor(runtime_float))` lowers to effectively `@floor(runtime_float)` and `@trunc(@floatFromInt(runtime_int))` throws the expected error that `@floatFromInt`'s result type is unknown here.

Fixes: https://codeberg.org/ziglang/zig/issues/32111
Co-authored-by: rue04 <[email protected]>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35664
2026-08-08 09:49:12 +02:00
Andrew Kelley 276f2e1b81 Merge pull request 'fix: Allocator contract should allow *[len]T in more places' (#36113) from robbielyman/zig:push-oxmuzrvppsyx into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36113
Reviewed-by: Andrew Kelley <[email protected]>
2026-08-08 09:43:59 +02:00
Andrew Kelley 5152987072 Merge pull request 'finish incomplete rework of build system integration with qemu, wine, darling, wasmtime, and rosetta' (#36409) from build-third-party-toggles into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36409
2026-08-08 09:01:25 +02:00
hemisputnik 0f332fd536 std.Build.Configuration: serialize packages and their dependencies
The serializer now traverses the builder's available_deps and their
dependencies recursively, and serializes them into Configuration.packages.
2026-08-08 09:02:31 +03:00
Alex Rønne Petersen 2597da0254 Merge pull request 'std.Io: minor Timeout-related things' (#35299) from blblack/zig:io-minor-stuff into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35299
2026-08-08 01:32:04 +02:00
Brandon Black 47825d7de3 Io.operateTimeout: if timeout == .none, operate
It's far simpler for the same effective outcome (no Batch
instantiation, no quick-success attempt + infinite poll first)
2026-08-07 17:50:25 -05:00
Brandon Black 1182f06c14 Io: Fix Threaded.sleep(.none), doc Timeout.none
Timeout.none implicitly seems to mean indefinitely nearly
everywhere I can see.  However, Io.Threaded.sleep() has a
short-circuit at the top which treats Timeout.none as effectively
zero (no sleep at all), even though the per-target functions it
calls afterwards would otherwise would honor .none correctly.

This patch removes this (presumably erronenous) short-circuit and
documents Timeout.none's meaning explicitly.
2026-08-07 17:50:12 -05:00
Andrew Kelley 8b2949e372 simplify stack trace and error trace tests
by explicitly listing out the combinations of parameters we would like
to check.
2026-08-07 13:28:16 -07:00
Andrew Kelley 0f1c478db3 tests: remove "compiler has package manager" logic
This is simplified now that package fetching is moved to Maker
executable.
2026-08-07 12:32:58 -07:00
eff54d672b docs: Remove the unused native_endian declaration from test_packed_structs.zig (#36425)
Co-authored-by: lx <[email protected]>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36425
2026-08-07 20:33:51 +02:00
Andrew Kelley 750294aa1f Maker: introduce transitive_skip 2026-08-07 11:19:55 -07:00
Andrew Kelley d9d308f624 Maker: skipped steps skip dependants too 2026-08-07 11:19:55 -07:00
Andrew Kelley d3a7e7528d stack trace tests: this check runs on host always 2026-08-07 11:19:55 -07:00
Andrew Kelley 127e2d8088 ability to forward third party integration arguments to child processes
This provides a way to forward, e.g. the `-fqemu` argument from
`zig build` to a child process during Maker execution without providing
the information to the configuration logic.
2026-08-07 11:19:55 -07:00
Andrew Kelley 5228c8902f tests: use skip_foreign_checks rather than dead branch
Configuration logic, in general, should not try to guess whether an
executable will be able to be run on the host. This can only be
determined by trying to, and encountering failure, for example because
binfmt_misc might be installed. OS might handle illegal instruction
traps and emulate CPU features not available, etc.

skip_foreign_checks is the mechanism intended to handle this use case.
2026-08-07 11:19:55 -07:00
Andrew Kelley 3a8984f254 delete standalone test: debug_io_color
This test has a workaround in it (setting has_side_effects=true) which
made it problematic to maintain. Delete the test instead.
2026-08-07 11:19:55 -07:00
Andrew Kelley 8bf3941f6b std.Build: remove dead fields
These were originally intended to tell the configure script whether or
not those third party integrations were enabled.

This is now a problem because we want to produce a configuration file
that is indendent of whether such external integrations will be enabled,
so that the logic does not need to be re-executed when those flags are
changed on the command line.

If we wish to make this feature interact with the configure script, let
us consider carefully how to add it in a future enhancement, and not
leave these dead fields sitting around in the meantime.

closes #35607
2026-08-07 11:19:55 -07:00
mlugg 3d35188fe8 Merge pull request 'remove haiku from defaultSingleThreaded' (#32137) from ypsvlq/zig:master into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/32137
Reviewed-by: mlugg <[email protected]>
2026-08-07 19:24:07 +02:00
Robbie Lyman c092484274 fix(Allocator): test leak 2026-08-07 11:54:36 -04:00
9d27b6289b std.http: add QUERY method (#35956)
as per [rfc10008](https://datatracker.ietf.org/doc/html/rfc10008), QUERY is a safe, cacheable and idempotent method with body

ref: ziglang/zig#35955

Co-authored-by: Henry Kupty <[email protected]>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35956
2026-08-07 16:45:28 +02:00
K4andAlex Rønne Petersen ce02115365 make lib/std/crypto/benchmark.zig compile
resolves https://codeberg.org/ziglang/zig/issues/36054
2026-08-07 16:41:48 +02:00
Amilia MacIntyreandAlex Rønne Petersen d5bd19d471 std.Io: handle EACCES in calls to bind 2026-08-07 16:32:50 +02:00
Corentin Kerisitandmlugg fafbc70ac5 std.debug.MachOFile: support loading DWARF from adjacent dSYM (#35582)
Fixes #31797

I finally had time to work on this.

I've implemented it so that, when an adjacent dSYM exist and its uuid match that of the current binary, we load its DWARF and use that for all getDwarfForAddress requests.
All of this is done eagerly at `MachOFile.load` for simplicity rather than later and lazier. Happy to change that to whatever you think is best.

This implementation is quite minimal and makes dSYM support "best-effort" as in, it treats dSYM parsing error as non-fatal and fallbacks using the current stabs/ofiles mechanism.

You can test it that way on macOS:

```
zig build-exe panic.zig
dsymutil panic -o panic.dSYM
strip -S panic
./panic
```

with panic.zig:
```
pub fn main() void {
    @panic("panic");
}
```

Before:
```
thread 57569166 panic: panic
???:?:?: 0x103071c2b in _panic.main (/private/tmp/panic)
???:?:?: 0x103071bb3 in _main (/private/tmp/panic)
???:?:?: 0x180d5ab97 in start (/usr/lib/dyld)
fish: Job 1, './panic' terminated by signal SIGABRT (Abort)
```

After:
```
thread 57569653 panic: panic
/private/tmp/panic.zig:2:5: 0x1029d771b in main (panic)
    @panic("panic");
    ^
/Users/cerisier/code/codeberg.org/ziglang/zig/lib/std/start.zig:698:59: 0x1029d76a3 in callMain (panic)
    if (fn_info.params.len == 0) return wrapMain(root.main());
                                                          ^
???:?:?: 0x180d5ab97 in start (/usr/lib/dyld)
fish: Job 1, './panic' terminated by signal SIGABRT (Abort)
```

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35582
Reviewed-by: mlugg <[email protected]>
2026-08-07 16:14:05 +02:00
Noam RothschildandAlex Rønne Petersen 1ebc455715 std: fixed a doc comment on IoUring.copy_cqes (#35175) 2026-08-07 16:12:44 +02:00
drex_vkandAlex Rønne Petersen 7b720ad26b bootstrap.c: fix __WIN32__ macro -> _WIN32
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35963
2026-08-07 15:49:15 +02:00
ilovapplesandAlex Rønne Petersen 340e53a65e compiler_rt: downgrade ARMv6 Thumb instructions to ARMv4-valid variants 2026-08-07 15:44:32 +02:00
Ryan Mehriandmlugg b9852d2308 Legalize: fix packed struct with OPV and multiple other fields
In legalization for packed struct init with an OPV field, we first try 
to see if any field accounts for the entire bit size of the struct and
otherwise fall back to a sequence of bitcasts and shifts on each field
(added in fc1c83a363). However, OPV fields are not accounted for
in the fallback case, which means that codegen eventually panics when
seeing the bit size of 0.

This change makes it so that we ignore all OPV fields in
`packedAggregateInitBlockPayload` since they have no runtime bits.
2026-08-07 15:29:04 +02:00
Matthew Luggandmlugg 17e07ffc63 llvm: represent bool as i8 in memory
Follow-up to https://codeberg.org/ziglang/zig/pulls/35711
2026-08-07 09:32:22 +02:00
21f2381438 std.ArrayListUnmanaged: last and lastPtr methods (#36318)
ArrayList:

- `getLastOrNull` has been deprecated and renamed to `last`
- `getLast` has been removed in favor of `last` combined with `.?`
- `lastPtr` has been added which returns `?*T`

Upgrade guide:

```zig
if (list.getLastOrNull()) |foo| {
    // ...
}
const foo = list.getLast();
```
⬇️
```zig
if (list.last()) |foo| {
    // ...
}
const foo = list.last().?;
```

Co-authored-by: Ryan Liptak <[email protected]>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36318
Reviewed-by: Ryan Liptak <[email protected]>
2026-08-07 07:30:10 +02:00