0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
Commit graph

37,583 commits

Author SHA1 Message Date
Alex Rønne Petersen
a85495ca22
ci: update more system deps comments 2026-03-27 05:11:53 +01:00
Alex Rønne Petersen
142703ba51
ci: x86_64-linux-release requires cc 2026-03-27 04:42:05 +01:00
Jacob Young
49a258c0e0 std.Build.Step.Run: improve syscalls while running zig test executables
Previously, each message requires an unseekable error to be returned
from a syscall before proceeding.  Ideally, the code would just pass
around `*std.Io.Writer` instead of `std.Io.File` in the first place, but
even then, you could argue for saving a syscall with `writerStreaming`.
2026-03-27 03:28:50 +01:00
Alex Rønne Petersen
49fa67d826
fixup 58490f588c 2026-03-27 02:49:12 +01:00
Alex Rønne Petersen
58490f588c
test: disable standalone test run_output_caching on windows
https://codeberg.org/ziglang/zig/issues/31564
2026-03-27 02:24:23 +01:00
Alex Rønne Petersen
f40eb50157
std.fs.test: disable '.' and '..' in Dir functions test on *-windows
https://codeberg.org/ziglang/zig/issues/31561
2026-03-27 02:24:23 +01:00
Alex Rønne Petersen
36b28050f4
std.fs.test: disable AtomicFile test on windows
https://codeberg.org/ziglang/zig/issues/31389
2026-03-27 02:24:21 +01:00
Alex Rønne Petersen
c3d474bf6f Merge pull request 'link.MachO.Dylib: allow aarch64-macos to match arm64e-macos TBD entries' (#31673) from alexrp/zig:thanks-apple into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31673
2026-03-27 01:30:00 +01:00
Linus Groh
f19be20912 libc: Update macOS headers to SDK 26.4 2026-03-26 19:25:56 +00:00
Alex Rønne Petersen
13b1050d4c
link.MachO.Dylib: allow aarch64-macos to match arm64e-macos TBD entries
closes https://codeberg.org/ziglang/zig/issues/31658
2026-03-26 08:48:38 +01:00
Alex Rønne Petersen
6bdb45beaf
test: don't run test-zigc on targets that don't support libzigc 2026-03-26 08:48:38 +01:00
Alex Rønne Petersen
a216c74131
test: partial revert of ac793232ee
This is just obviously wrong?! I'm fairly certain I didn't intend to push that
commit in that state.
2026-03-26 05:50:51 +01:00
Alex Rønne Petersen
cef16b5130
std.Target: don't claim that OpenBSD requires libc
https://codeberg.org/ziglang/zig/issues/30982
2026-03-26 05:50:51 +01:00
Alex Rønne Petersen
e4a977f9e4
compiler: do not enforce PIC for Android
This requirement was put here many years ago in stage1 and I have no idea why
because Android does not actually require PIC.
2026-03-26 05:50:51 +01:00
Alex Rønne Petersen
4219037faf
compiler: default to PIC if the target defaults to PIE
Otherwise, by default and with no special flags, we produce objects and static
libraries that cannot be linked into executables.
2026-03-26 05:50:51 +01:00
Andrew Kelley
abd131e336 zig cc: make --version use the full clang CLI lowering code path
because clang wants to parse the -target argument with clang -target
syntax.

closes #30178
2026-03-25 18:29:19 -07:00
Alex Rønne Petersen
54b3484256 Revert "disable flaky test: aarch64-macos stage3/4 nondeterminism check"
This reverts commit 8669898819.
2026-03-25 20:40:29 +01:00
Alex Rønne Petersen
5e0e1841c0 Compilation: close the linker output file before writing whole cache manifest
Otherwise a different process may get a cache hit on the file while we still
have a writable fd open for it. This isn't actually a real problem in the sense
that running the file should just work as expected if the OS allows it. But
until very recently[0], the Linux kernel would give ETXTBSY in this case. So
make sure we close the file before letting other processes know that it's
usable.

closes https://codeberg.org/ziglang/zig/issues/31563

[0] 2a010c4128
2026-03-25 19:33:43 +01:00
Alex Rønne Petersen
8a517285ce Merge pull request 'std.heap.ArenaAllocator/std.heap.FixedBufferAllocator: fix end_index memory ordering' (#31647) from justusk/zig:arena-mem-ord into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31647
Reviewed-by: jacobly <jacobly@noreply.codeberg.org>
2026-03-25 18:27:03 +01:00
Justus Klausecker
5363a81a57 std.heap.FixedBufferAllocator: fix end_index memory ordering
This prevents a race between `alloc` and `free` where T1 receives memory
from `alloc` that is semantically about to be freed by T2 and still being
accessed, but the `free` is already visible to T1. Using acquire-release
here guarantees that any `free` is only published after all accesses to
the memory being freed have already happened.

Co-authored-by: Jacob Young <amazingjacob@gmail.com>
2026-03-25 11:48:45 +01:00
Justus Klausecker
3af5f81e11 std.heap.ArenaAllocator: fix end_index memory ordering
This prevents a race between `alloc` and `free` where T1 receives memory
from `alloc` that is semantically about to be freed by T2 and still being
accessed, but the `free` is already visible to T1. Using acquire-release
here guarantees that any `free` is only published after all accesses to
the memory being freed have already happened.

Co-authored-by: Jacob Young <amazingjacob@gmail.com>
2026-03-25 11:48:43 +01:00
Justus Klausecker
9bfe827ade Revert "std.heap.ArenaAllocator: Make resize and free check whether allocation is within current node more rigorously"
This reverts commit 589bcb2544.

The scenario presented in the reverted commit cannot actually happen.
Even if there are two contiguous arena nodes N1 and N2 and the `end_index`
of N1 points to somewhere in N2, a `resize` can never lead to an increase
of the `end_index` of N1 since it checks whether it's `<= size` first.
A `resize`/`free` *can* decrease `end_index`, but even if it is wrongly
assumed that some allocation that belongs to N2 actually belongs to N1
based on the `end_index` of N1, it can only ever be decreased to the start
of the buffer of N2. That's because a valid allocation of N2 logically
cannot be at any lower address than N2 itself. And any point still in N2
can never also be in N1, so there's no danger of overwriting any other
allocations of N1.
2026-03-25 11:20:21 +01:00
Andrew Kelley
94355f1920 README: add information about installation via bootstrap.c
closes #31650
2026-03-25 01:43:12 -07:00
rpkak
8f6bad065e std.Thread.setName/getName: remove wrong error handling
std.posix.prctl already does error handling.
According to the man page PR_SET_NAME(2const), 0 is returned on success.
2026-03-25 08:10:25 +01:00
Jake Greenfield
4431ca28b8 fix Windows clock handling
Address two separate but related issues:
- Return value of `RtlQueryPerformanceFrequency` was used inconsistently; it
  returns a nonzero value to indicate success.
- `timeoutToWindowsInterval` wasn't converting absolute deadlines back to the
  Windows epoch before passing them to the system, which meant that values (in
  the Unix epoch) were always in the distant past, so sleeps would return
  immediately.

Fixes #31653
2026-03-24 21:33:27 -04:00
akhildevelops
eec244c5a2 std.crypto.tls.Client: expose InitError (#31610)
Fixes: https://codeberg.org/ziglang/zig/issues/31581
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31610
Co-authored-by: akhildevelops <akhildevelops@noreply.codeberg.org>
Co-committed-by: akhildevelops <akhildevelops@noreply.codeberg.org>
2026-03-25 00:56:22 +01:00
Justus Klausecker
589bcb2544 std.heap.ArenaAllocator: Make resize and free check whether allocation is within current node more rigorously
This prevents the following scenario where an allocation is wrongly assumed
to be part of the current head node (`node0`):

```
| node0 - - - - | node1 - - - - - - - - - - - - |
          |   |         |   |           |
          |   |         |   end_index0  end_index1
          |   |         |   |
          alloc0        alloc1

free(alloc1):
    load node0
    buf0.ptr + end_index0 == alloc1.ptr + alloc1.len ? yes!
    end_index0 -= alloc1.len

| node0 - - - - | node1 - - - - - - - - - - - |
          | | |                         |
          | end_index0                  end_index1
          |   |
          alloc0
```

which could move `end_index0` *into* `alloc0` and make it possible for any
subsequent calls to `alloc` to overwrite its contents!
2026-03-25 00:54:44 +01:00
Karol Kosek
5861afb189 langref: make float mode fields lowercase
Reflects the change made in aab84a3dec.
2026-03-25 00:53:36 +01:00
Alex Rønne Petersen
3de16858f7 ci: update to qemu 10.2.2 2026-03-25 00:51:40 +01:00
Alex Rønne Petersen
b0ab55b8ea Merge pull request 'Add psp os' (#31609) from IridescentRose/zig:psp-os-target into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31609
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
2026-03-25 00:51:01 +01:00
Alex Rønne Petersen
558a5c7913
std.c: audit some time types for non-Linux OSs
Some initial work towards https://codeberg.org/ziglang/zig/issues/31414.

Conclusion from this: Only x86-freebsd, x86-haiku, and x86-illumos remain time32
and are currently unfixable. I don't think the upstreams for any of these
targets actually care about them anymore (probably why they weren't migrated to
time64), so this is not a particularly big concern.

I split UTIME constants out from timespec because they were causing unreasonable
code duplication by being there.
2026-03-24 09:42:32 +01:00
Evgenii Orlov
0ee6a79da5 std.Io.net.HostName.netLookup: make canonical_name_buffer optional 2026-03-23 11:02:47 +01:00
Alex Rønne Petersen
c7d69f0160 std.mem: delete illegal code in findSentinel()
I understand the temptation to exploit page size knowledge to make this function
faster, but I don't think this code can ever be compatible with any reasonable
set of pointer provenance/aliasing rules. At the very least, I don't believe it
is compatible with LLVM's.

closes https://github.com/ziglang/zig/issues/23184
2026-03-23 05:35:04 +01:00
Techatrix
029719cf47 std.Uri: reject invalid URI schemes according to RFC3986 2026-03-23 05:22:46 +01:00
Kendall Condon
1708da2c71 libfuzzer: fix SkipZigTest with new inputs
It is now ignored for inputs from the corpus to ensure the filesystem
and process corpus stay in sync. For other (nondeterministic) inputs the
input builder is now reset.
2026-03-23 05:19:04 +01:00
Frank Denis
b2c2b4d063 Merge pull request 'crypto: correct aes-siv s2v' (#31623) from sinon/zig:fix-aes-siv into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31623
Reviewed-by: Frank Denis <jedisct1@noreply.codeberg.org>
2026-03-23 03:11:13 +01:00
GasInfinity
1311880eea fix: use no_builtin when including zigc in the Zcu
* oops
2026-03-22 21:11:41 +01:00
rpkak
9857dabfea std.c.MFD: support linux 2026-03-22 18:06:00 +01:00
David Rubin
8efd539305
crypto: correct aes-siv s2v
The first issue is that when len(Sn) >= 128,
we perform Sn xor D instead of the Sn xorend D
that is specified in RFC 5297.

The second issue is that we truncate the Sn
if it is larger than 4096 bytes, which could
lead to collisions between inputs. We solve
this by absoring the Sn into the CMAC state
perform the last 16 bytes, xoring those 16
bytes with D as described in the first issue,
and then updating and squeezing the CMAC.
2026-03-22 07:21:41 -07:00
Jacob Young
ccf8e223f4 std.Io.net: disable unix socket test due to presumed windows kernel bug
Tracked by #31499
2026-03-22 09:37:12 -04:00
Nathan Bourgeois
164d01c1dc codegen: notraps on mips causes break and infinite loop on @trap() 2026-03-21 21:32:22 -04:00
Nathan Bourgeois
c824ce954e misc: Add allegrex CPU & features, run tool, update semver 2026-03-21 19:39:04 -04:00
Alex Rønne Petersen
cb7d2b0563
Revert "std.Progress: use cmpxchgStrong instead of cmpxchgWeak for locking/unlocking IPC"
This reverts commit b6f99a59a3.

https://codeberg.org/ziglang/zig/pulls/31608#issuecomment-11875362
2026-03-21 14:04:24 +01:00
Nathan Bourgeois
2037dba90f std.posix: Minimal set to build an Io on PSP 2026-03-21 06:34:45 -04:00
Matthew Lugg
36c390bf14 Zcu: correctly handle tid when main thread recurses
Resolves: https://codeberg.org/ziglang/zig/issues/31380
2026-03-21 09:56:05 +01:00
Nathan Bourgeois
fdf19984b8 std.Target: add psp os 2026-03-21 02:56:24 -04:00
Alex Rønne Petersen
b4d134a0d2 Merge pull request 'std: audit (most) usages of cmpxchgWeak' (#31608) from justusk/zig:cmpxchg-xchg into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31608
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
2026-03-21 04:14:44 +01:00
Justus Klausecker
1f78e34de0 std.Io.Threaded: make mutexLock() use cmpxchgStrong instead of cmpxchgWeak
As established in 048e38624e and d70bd0b37e, mutexes should use a strong
cmpxchg when attempting to lock to guarantee that they actually succeed
if they aren't locked yet.

Also deletes an unused near-duplicate of `mutexLock()`.
2026-03-21 03:00:50 +01:00
Justus Klausecker
b6f99a59a3 std.Progress: use cmpxchgStrong instead of cmpxchgWeak for locking/unlocking IPC
The `cmpxchgWeak` in `setIpcFile` could lead to the IPC file not being set
even though there's still a slot available because one or more slots were
spuriously skipped.

The `cmpxcheWeak` in `serialize` could lead to an unused IPC slot not
being locked and used even though it could be.
2026-03-21 03:00:50 +01:00
Andrew Kelley
e938344100 Merge pull request 'linux: fix handling of O_TMPFILE flag on filesystems that do not support it' (#31543) from eshom/zig:tmpfile-not-supported into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31543
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-03-21 00:04:10 +01:00