Commit Graph

36906 Commits

Author SHA1 Message Date
Andrew Kelley e18ee3a93a std.Io.Threaded: introduce Thread.InterruptMethod
implements APC cancelation except for the actual call to NtCancelIoFileEx
2026-01-27 15:32:34 -08:00
Andrew Kelley 20c4211b6e std.Io.Threaded: add some temporary, choice panics 2026-01-27 15:32:34 -08:00
Andrew Kelley 693b2ffd5c std: back out the flags field of Io.File
For now, let us refrain from putting the sync mode into the Io.File
struct, and document that to do concurrent batch operations, any Windows
file handles must be in asynchronous mode. The consequences for
violating this requirement is neither illegal behavior, nor an error,
but that concurrency is lost. In other words, deadlock might occur. This
prevents the addition of flags field.

partial revert of 2faf14200f58ee72ec3a13e894d765f59e6483a9
2026-01-27 15:32:34 -08:00
Andrew Kelley de3a2c0ebb std.Io: give File a nonblocking bit on Windows
This tracks whether it is a file opened in synchronous mode, or
something that supports APC.

This will be needed in order to know whether concurrent batch operations
on the file should return error.ConcurrencyUnavailable, or use APC to
complete the batch.

This patch also switches to using NtCreateFile directly in
std.Io.Threaded for dirCreateFile, as well as NtReadFile for
fileReadStreaming, making it handle files opened in synchronous mode as
well as files opened in asynchronous mode.
2026-01-27 15:32:34 -08:00
Alex Rønne Petersen 0f51f663f0 musl: update some hexagon headers from the quic fork 2026-01-27 23:24:57 +01:00
just_some_entity 06cf86abeb Fix BootServices.locateHandleLen() (#30877)
Fixes https://codeberg.org/ziglang/zig/issues/30876

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30877
Reviewed-by: linus <mail@linusgroh.de>
Co-authored-by: just_some_entity <entity@jsentity.dev>
Co-committed-by: just_some_entity <entity@jsentity.dev>
2026-01-27 23:09:51 +01:00
Ryan Liptak 1655a666d5 windows_resources standalone test: Load a resource and check its data
Just a potential way to catch regressions and to ensure the resources actually make it into the binary correctly.
2026-01-27 20:48:59 +01:00
Ryan Liptak 29b7214027 Disentangle from error.CurrentWorkingDirectoryUnlinked
This error is actually only ever directly returned from `std.posix.getcwd` (and only on POSIX systems, so never on Windows). Its inclusion in almost all of the error sets its currently found in is a leftover from when `std.fs.path.resolve` called `std.process.getCwdAlloc` (https://github.com/ziglang/zig/issues/13613).
2026-01-27 20:48:25 +01:00
Andrew Kelley 3729a53eec Merge pull request 'libc: use common implementations for linux syscalls' (#30993) from GasInfinity/zig:libc-musl-syscalls into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30993
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-01-27 07:48:58 +01:00
Alex Rønne Petersen 5652288e5d zig fmt
oops
2026-01-27 07:05:14 +01:00
Alex Rønne Petersen f7df723a91 Merge branch 'prefer-io-futex' 2026-01-27 05:37:40 +01:00
Alex Rønne Petersen 2c7d3c8007 std.debug: use debug_io for the futex in waitForOtherThreadToFinishPanicking 2026-01-27 05:37:01 +01:00
Alex Rønne Petersen d4d210fb37 std.Build.WebServer: use Io futex operations instead of std.Thread.Futex 2026-01-27 05:37:01 +01:00
Robert Ancell 0af79e7b8c std.mem.readVarInt: Fix type name in doc comment (#31007)
Code used `ReturnType`, comment used `T` (which is what is used in similar functions).

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31007
Co-authored-by: Robert Ancell <robert.ancell@gmail.com>
Co-committed-by: Robert Ancell <robert.ancell@gmail.com>
2026-01-27 05:29:51 +01:00
Pablo Alessandro Santos Hugen 951ab1b18b std.Build.Step.Compile: pass target by pointer to isLibC*LibName 2026-01-27 05:29:04 +01:00
Alex Rønne Petersen 519f1eb361 musl: zero fp/lr registers in _start() and clone() on hexagon 2026-01-27 05:23:31 +01:00
Brian Orora 4e3fadd90e std.heap.DebugAllocator: fix account total_requested_bytes on resizeSmall 2026-01-27 00:09:48 +01:00
GasInfinity 73ed351022 fix(libzigc): export mincore 2026-01-27 00:06:18 +01:00
Carmen 5e9c484745 std.Io.Reader.takeStruct: dont assert buffer capacity is sizeOf(T) 2026-01-27 00:05:42 +01:00
Jay Petacat 97986184ca langref: Add table of largest integer types that can coerce to floats
Add vertical margin to the `.table-wrapper` class so that there's space
between the table and the test figures. It does not affect any of the
existing tables because the margin collapses with the adjacent `<p>`.
2026-01-26 23:52:30 +01:00
Andrew Kelley 1b235540c1 Revert "Io.Threaded: remove WSA_FLAG_OVERLAPPED from socket call"
The stated reason for this commit was cancelation didn't work. On
further review, we know why cancelation didn't work, and recent
enhancements on master branch make it easy to make it work.

Meanwhile, not using overlapped means that multiple threads cannot use
the same open socket handle. I also added line comments to explain the
choice in this revert commit.

This reverts commit fd3657bf8c.

closes #31011
reopens #30865
2026-01-26 14:16:28 -08:00
Andrew Kelley 5eb55ba866 Merge pull request 'compiler: use Io.MemoryMap' (#30961) from use-mmap into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30961
2026-01-26 22:58:01 +01:00
Alex Rønne Petersen 8d4b8ab6a5 Merge pull request 'glibc 2.43' (#31005) from alexrp/zig:glibc-2.43 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31005
2026-01-26 18:42:37 +01:00
jsentity b4c86c850d Fix std.uefi.protocol.DevicePath.next() and add utility function isEnd() (#30887)
Fix for https://codeberg.org/ziglang/zig/issues/30884 and https://codeberg.org/ziglang/zig/issues/30885

Co-authored-by: jsentity <jsentity@noreply.codeberg.org>
Co-committed-by: jsentity <jsentity@noreply.codeberg.org>
2026-01-26 11:41:22 +01:00
Alex Rønne Petersen ff8dbd010f libc: update glibc crt0 code to 2.43 2026-01-26 05:56:54 +01:00
Alex Rønne Petersen e4058f2c27 libc: update glibc abilists to 2.43 2026-01-26 05:56:54 +01:00
Alex Rønne Petersen 49afd7eee0 libc: update glibc headers to 2.43 2026-01-26 05:56:54 +01:00
Alex Rønne Petersen f6ed859cb0 std.zig.target: update glibc triples for loongarch64 targets 2026-01-26 05:56:53 +01:00
Michael Dusan f186809caf std: impl process.totalSystemMemory for netbsd 2026-01-25 13:03:22 -05:00
Frank Denis 8709f53d44 crypto.ff: allow seamless chaining regardless of representation (#30913)
Finite field elements can be in regular or Montgomery form, and
chaining different operations use to require manual and error-prone
conversions.

Now:

- `add`, `sub` and `mul` convert the second operand to match the
first operand's form
- `sq` and `pow` preserve the input's Montgomery form
- `toPrimitive` and `toBytes` return `UnexpectedRepresentation` if
the element is in Montgomery form, preventing incorrect serialization

This is fully backwards compatible and allows seamless chaining of
operations regardless of their representation.
2026-01-25 17:42:01 +01:00
Alex Rønne Petersen 99ec1ee353 ci: temporarily disable x86_64-netbsd while I investigate failures 2026-01-24 21:08:20 +01:00
GasInfinity 9cf34a8d81 feat(libzigc): move over some linux syscalls
* does not move all of them, only those which map almost 1:1
* also removes their musl implementation
2026-01-24 20:41:15 +01:00
GasInfinity b430cd62e4 feat(std.os.linux): add some missing syscalls 2026-01-24 20:41:15 +01:00
GasInfinity d5c3bf25dc feat(std.c): add _Exit 2026-01-24 20:41:15 +01:00
Andrew Kelley a2ea36a517 zig libc: modify errno helper to eliminate @intCast
The vast majority of libc functions return `c_int` for the return value,
when setting errno. This utility function is for those cases.

Other cases can hand-roll the logic, or additional helpers can be added.
2026-01-24 20:18:18 +01:00
Alex Rønne Petersen 9d63dfaa81 link.Lld: give better exit status information for the lld child process
It's not nice to just throw away useful information.
2026-01-24 18:30:55 +01:00
Alex Rønne Petersen cf48041b55 std.Thread.Condition: use pthread_cond_t impl when OS has no futex primitive
Same principle as #30835.
2026-01-24 16:44:55 +01:00
Lukas Lalinsky 5f950884a1 std.c: add IPPROTO_RAW for Darwin platforms
IPPROTO_RAW (255) was missing from the Darwin/macOS IPPROTO struct,
even though it is defined in system headers and supported by the platform.
This is a commonly used protocol for raw IP sockets.
2026-01-24 12:26:00 +01:00
Alex Rønne Petersen 1b544f447a Merge pull request 'enable thumb-windows-gnu module tests' (#30968) from alexrp/zig:windows-pic into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30968
2026-01-24 02:09:41 +01:00
Andrew Kelley 5c42193b17 std.Io.Threaded: rework cancelation
Now it can handle sync cancelation and alertable cancelation on Windows.

Also fix the API of NtCancelIoFileEx
2026-01-23 12:59:36 -08:00
Alex Rønne Petersen e437efd601 test: enable thumb-windows-gnu module tests
We use long calls for these just like thumb*-linux-* to prevent range issues as
the binaries grow larger over time.

We also need function and data sections due to the many __stack_chk_guard
references within the std test binary; without these options, the linker is not
able to insert range thunks in between functions because the std binary just has
one giant .text section that's opaque to the linker.

closes https://codeberg.org/ziglang/zig/issues/30923
2026-01-23 21:16:03 +01:00
Alex Rønne Petersen c699bb8134 zig cc: don't bother passing -fPIC to Clang for Windows and UEFI targets
It's completely ignored anyway, by design, for compatibility reasons.
2026-01-23 21:16:03 +01:00
Alex Rønne Petersen 909159ad8e compiler: don't enforce PIC for x86-windows and thumb-windows
Only x86_64-windows and aarch64-windows actually require PIC.
2026-01-23 21:16:01 +01:00
Alex Rønne Petersen 20fae334ac compiler: UEFI does not support dynamic linking 2026-01-23 19:50:51 +01:00
Alex Rønne Petersen 2774436a83 ci: bump riscv64-linux-debug timeout by 1 hour 2026-01-23 16:17:47 +01:00
Andrew Kelley 499ba5d55c compiler: use Io.MemoryMap
Also make setLength return error.OperationUnsupported when it cannot be
done atomically.
2026-01-22 21:25:53 -08:00
Andrew Kelley 193c747b03 link.MappedFile: refactor std.Io -> Io 2026-01-22 21:25:53 -08:00
Andrew Kelley 1badb2a840 std.Io.Threaded: dirCreateFileWindows uses NtCreateFile directly 2026-01-22 18:08:13 -08:00
InKryption 305fd06756 Build: check if dynamic lib installed for symlinks
If the library isn't actually installed, `generated_bin` will be null,
causing this to panic about a missing dependency for itself; checking
for this state avoids this.
2026-01-22 22:28:28 +01:00
bartimaeusnek 37288e53ae std.zig.system.loongarch: implement individual cpu feature bit tests (#30915)
closes #30902

Co-authored-by: bartimaeusnek <33183715+bartimaeusnek@users.noreply.github.com>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30915
Reviewed-by: Alex Rønne Petersen <alex@alexrp.com>
Co-authored-by: bartimaeusnek <bartimaeusnek@noreply.codeberg.org>
Co-committed-by: bartimaeusnek <bartimaeusnek@noreply.codeberg.org>
2026-01-22 19:18:47 +01:00