Commit Graph

37860 Commits

Author SHA1 Message Date
Sam Connelly fa684bf42f Make *24 and *48 extern-compatible for ez80 2026-04-17 20:32:17 +02:00
Justus Klausecker a43973b336 std.Io.Semaphore: add waitTimeout
Returns `error.Timeout` if provided timeout expires before a permit is available.
Also adds/reworks tests for all wait functions.
2026-04-17 19:19:02 +02:00
Andrew Kelley 21980c82f4 Merge pull request 'Implement Condition.waitTimeout' (#31278) from lukasl/zig:condition-timeout into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31278
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-17 19:02:38 +02:00
Alex Rønne Petersen adb1f3efc2 Merge pull request 'test: reinstate compiler-rt and zigc tests with different LLVM bug workarounds' (#31909) from alexrp/zig:reinstate-tests into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31909
2026-04-17 12:04:30 +02:00
Alex Rønne Petersen dcd9ddc7cf Merge pull request 'std.c: Two small fixes for serenity' (#31916) from linus/zig:serenity-fixes into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31916
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
2026-04-17 12:01:38 +02:00
Linus Groh 8abb14141e std.c: Fix serenity's futex() declaration
Two mistakes I made when translating from the C header:

- The timeout and userspace_address2 pointers should be nullable.
- futex_wait() and futex_wake() are defined as static functions and
  therefore not available as exported symbols. They're just thin
  wrappers around futex() anyway so that's fine.
2026-04-16 23:48:05 +01:00
Linus Groh 92ec9fa3d0 std.c: Remove serenity's serenity_{open,readlink}() functions
See: https://github.com/SerenityOS/serenity/commit/e4c989e45f0d30b7049b3f1d001cf4a87104d277
2026-04-16 23:48:05 +01:00
Andrew Kelley c0763b5e25 std.Io.Condition: separate wait impls for clarity
also:
* add docs
* add test coverage for waitUncancelable
* explicit error set declaration WaitTimeoutError
2026-04-16 14:52:48 -07:00
Andrew Kelley 078185a54b std.Io: still run Condition test on single-threaded
this will still work under Evented for example
2026-04-16 13:59:40 -07:00
Lukas Lalinsky d821446cf9 Implement Condition.waitTimeout
I'd have preferred if `vtable.futexWait` returned `error.Timeout`, since
all the OS-level APIs provide it. However, if I keep the vtable untouched,
I had to determine the timeout case by post-checking the deadline.
It's fine functionally, but one extra syscall that be avoided at
cost of changing the vtable and all the futex implementations.
2026-04-16 13:37:23 -07:00
Andrew Kelley a8226cd536 Merge pull request 'Haiku fixes' (#31851) from ypsvlq/zig:master into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31851
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-16 22:18:58 +02:00
xeondev 2b48f559f4 std.Io: move netRead to become an Operation 2026-04-16 22:13:29 +02:00
Andrew Kelley bea4ea5ff8 Merge pull request 'zigc: long double: call double function if long double and double are equivalent' (#31775) from rpkak/zig:zigc-long-double into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31775
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-16 19:57:54 +02:00
glowsquid 0177cb57c0 std.http.Client: make mutexes cancelable (#31880)
Makes most of the mutexes cancelable with the exception of the ones in deinit functions. I also fixed the compilation errors with `ConnectionPool.resize`.

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31880
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: glowsquid <sachabarsayuracko@gmail.com>
Co-committed-by: glowsquid <sachabarsayuracko@gmail.com>
2026-04-16 19:47:46 +02:00
Richard Levitte ffcfeb919f Fix std.fmt.hex() to work with unsigned ints of all multiples of 8 bits
@SizeOf(@typeInfo(T)) for any u{n} seems to give sizes of u32, u64, u128
and so on, depending on what size x fits into.  This causes problems with
'>>' if x isn't exactly one of those sizes.

@typeInfo(@TypeOf(x)).int.bits gives a more accurate size.
2026-04-16 19:44:40 +02:00
Andrew Kelley 29532177c1 CI: add coverage for fuzzer compiling
From mlugg: this commit originally also added the same coverage to the
aarch64-linux-release script, but that caused the aarch64-linux-release
job to time out, so that change has been omitted for now.
2026-04-16 19:42:23 +02:00
zacoons ebc8fe4899 std.sort: clarify description of equalRange 2026-04-16 19:42:00 +02:00
Alex Rønne Petersen 504ebf85c4 test: reinstate compiler-rt and zigc tests with different LLVM bug workarounds
ref https://codeberg.org/ziglang/zig/issues/31701
ref https://codeberg.org/ziglang/zig/issues/31702
2026-04-16 19:28:59 +02:00
Sam Connelly 17e0afd0e5 feat: init eZ80 arch via CBE 2026-04-16 19:21:16 +02:00
Andrew Kelley d092c752f3 std.Io.Writer.print: fix wrong fn signature in docs
closes #25963
2026-04-16 10:07:22 -07:00
Alex Rønne Petersen 9125e24909 compiler-rt: disable some limb64 tests on some big-endian targets
https://codeberg.org/ziglang/zig/issues/31905
2026-04-16 17:46:29 +02:00
Alex Rønne Petersen a283ca76fe cbe: don't emit zig_no_builtin on every function with -fno-builtin 2026-04-16 17:46:29 +02:00
Matthew Lugg 84c2d809ec llvm: workaround crash on large inline memset
See https://codeberg.org/ziglang/zig/issues/31701 for details. I am not
re-enabling the disabled compiler-rt module tests here because they are
also affected by https://codeberg.org/ziglang/zig/issues/31702.
2026-04-16 17:00:04 +02:00
Alex Rønne Petersen cfa0ada9e1 Merge pull request 'std.os.linux: fix syscall argument width for mipsn32 and x32' (#31894) from alexrp/zig:mipsn32-x32-fixes into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31894
2026-04-16 16:08:04 +02:00
Alex Rønne Petersen 6315c1a190 std.os.linux: remove vfork()
It's a bad API with better alternatives on Linux, and is near-impossible to use
safely in Zig code.

closes https://codeberg.org/ziglang/zig/issues/31882
2026-04-16 16:00:21 +02:00
Alex Rønne Petersen 67023fc4bd std.os.linux: fix syscall argument width for mipsn32 and x32
This required a thorough audit of every syscall wrapper in std.os.linux, so
while I was here, I fixed some minor arch-specific bugs, improved some types,
simplified some casts, and deleted some dead code.

Note that lseek() in particular is still broken for n32 and x32 after this
commit; this wrapper will require some special-casing in the arch bits due to
its unusual return type width.

closes https://github.com/ziglang/zig/issues/22464
closes https://codeberg.org/ziglang/zig/issues/31597
2026-04-16 16:00:21 +02:00
Alex Rønne Petersen ab2f9ca503 std.os.linux: csky and xtensa also use aligned register pairs 2026-04-16 16:00:21 +02:00
Alex Rønne Petersen deb9b58cbc std.os.linux.loongarch32: remove a leftover FIXME comment 2026-04-16 16:00:21 +02:00
Alex Rønne Petersen e7ee61cd64 musl: fix syscall argument width for mipsn32
https://www.openwall.com/lists/musl/2026/04/16/1
2026-04-16 16:00:18 +02:00
mlugg d0226ac301 Merge pull request 'incremental: fix tracking of nested container declarations (and of opaque types)' (#31889) from dont-track-children-if-lost-parent into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31889
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-16 09:50:26 +02:00
rpkak f564a7733c remove code, which is only reached if c_longdouble is only 16 or 32 bits big 2026-04-16 07:05:31 +02:00
rpkak e74b98227e zigc: long double: call double function if long double and double are equivalent
For some of these functions and most targets this changes nothing,
either because long double and double are not equivalent or because
llvm did function deduplication.

But e.g. on aarch64-windows-gnu, ucrt provides hypot, but not hypotl.
Now hypotl calls hypot from ucrt instead of including the std.math.hypot
implementation in zigc.

Very trivial functions (like nanl) are not changed, because a function call would probably make this function more complex.
2026-04-16 07:05:30 +02:00
Andrew Kelley 67a5b6e5e8 delete @cImport from the language
closes #20630
2026-04-15 17:43:53 -07:00
Andrew Kelley 0dd99c37cc std.Io.Writer.print: update doc comments
notably, removes incorrect mention of {D} format specifier
2026-04-15 16:40:19 -07:00
badayvedat a05a25e2bb zig libc: export fdiml and fdimf (#31759)
Exports `fdiml` and `fdimf` in zig libc and removes from from musl and mingw libc.

Contributes to: https://codeberg.org/ziglang/zig/issues/30978

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31759
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Co-authored-by: badayvedat <badayvedat@gmail.com>
Co-committed-by: badayvedat <badayvedat@gmail.com>
2026-04-16 01:11:04 +02:00
K4 bf40264941 add test for comptime-only functions 2026-04-16 01:04:41 +02:00
Matthew Lugg 6608b65100 incremental: fix tracking of nested container declarations
...but not in the way you'd expect. We were actually tracking them in
cases where we shouldn't have been! We cannot track a declaration if its
parent namespace has been lost, because that will cause analysis
failures immediately, but if we excluded a type from the mapping due to
a major change (such as a struct turning into a union, or a field being
added), we were still including any trackable instructions inside the
container's field expressions (e.g. struct field type expressions). This
meant we were tracking a type declaration while losing tracking on its
parent namespace, with predictably disastrous results.

Oh, also, tracking for opaque types was just totally wrong (I think this
was a typo from a while back). We could map it to things other than
opaque declarations, and we never mapped declarations inside opaques.
So, uh, I fixed that too.
2026-04-16 00:00:44 +01:00
Matthew Lugg 794edc81d0 Zcu.PerThread: make debug logs less noisy
I often go through these logs when debugging issues with incremental
compilation, but the first thing I do is always comment out some of
these lines, because they're just way too noisy. I don't need to know
every time Sema checks that a unit is up-to-date, I only care when
things actually get analyzed! This decreases the size of
`--debug-log zcu` by an order of magnitude (or more) in most cases.
2026-04-16 00:00:44 +01:00
Christophe Delage a999fc9059 Add @exp(f128) and @exp2(f128) 2026-04-16 00:55:54 +02:00
Andrew Kelley e00b5daa1f Merge pull request 'stage2-wasm: finish bigint support' (#31784) from pavelverigo/zig:wasm-bigint-finish into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31784
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-15 23:07:40 +02:00
Pavel Verigo c32f7a4513 stage2-wasm: support assembly 2026-04-15 22:57:41 +02:00
Mason Remaley 5984d5dbde Fixes compiler error in fuzz tester due to stack trace and error trace separation 2026-04-15 22:52:57 +02:00
Alex Rønne Petersen 08850cfcb2 compiler-rt: export __stack_chk_guard as __guard_local on OpenBSD
closes https://codeberg.org/ziglang/zig/issues/31867
2026-04-15 16:22:54 +02:00
Carl Åstholm 046002d1a5 Correct std.os.emscripten.W.STOPSIG return type 2026-04-15 11:53:58 +02:00
Alex Rønne Petersen 3016f875c3 Merge pull request 'compiler: disable warnings in all vendored code' (#31868) from alexrp/zig:disable-vendor-warnings into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31868
2026-04-15 11:19:47 +02:00
Alex Rønne Petersen 18964c0865 libcxx: disable all warnings 2026-04-15 02:13:26 +02:00
Alex Rønne Petersen 575e21c61a mingw: disable all warnings 2026-04-15 02:02:51 +02:00
Alex Rønne Petersen 9115aee6d7 glibc: disable all warnings 2026-04-15 02:02:37 +02:00
Alex Rønne Petersen ff21acc4ed libunwind: disable all warnings 2026-04-15 02:00:25 +02:00
Matthew Lugg 291addadf8 tests: move incremental target matrix out of manifests
Having the matrix of test targets for incremental compilation in the
individual test manifests has turned out to be inconvenient for a few
reasons: the tests are almost certain to accidentally get out of sync,
disabling targets entirely is annoying to do, and incr-check needs to
take care to print the target in all error messages (which currently
does not always happen).

If I recall correctly, I originally designed it this way because it
allows targets to be disabled at the granularity of individual tests,
but there's an easier approach to that: just let a test manifest that it
should be *skipped* on a certain target! As skipping is the rare case,
and also the case you want readers to notice, it makes sense for *it* to
be explicitly specified, like how unit tests use `error.SkipZigTest`.

So, `incr-check` no longer runs through a list of targets specified in
the manifest. Instead, it accepts (and, in fact, requires) a single
target on the command line, and runs the test for that specific target.
If the file contains a `#skip_target` directive for that target, then
`incr-check` exits immediately, so we can still disable targets at
individual test granularity, but you can also disable a target for all
tests by just commenting it out of the matrix in `test/tests.zig`.

As a nice bonus, this also allows the build system to run different
incremental test targets in parallel, because the targets are now
different steps.

This definitely seems like a better way to split the work between the
build system and incr-check---sorry for getting this wrong initially!
2026-04-15 00:06:18 +02:00