Justus Klausecker
c7c4e8d802
Sema: harden switch logic against undef IB
...
Most places where `undefined` was previously (intentionally) passed across
function calls now use `Air.Inst.Ref.none` instead to ensure that these
`undefined` references don't accidentally outlive the `switch` logic they
belong to.
2026-01-31 06:36:07 +01:00
mercenary
fa988e88ed
zstd.Decompress: smarter rebase when discarding ( #30891 )
...
The call to `rebase` in `discardIndirect` and `discardDirect` was inappropriate. As `rebase` expects the `capacity` parameter to exclude the sliding window, this call was asking for ANOTHER `d.window_len` bytes. This was impossible to fulfill with a buffer smaller than 2*`d.window_len`, and caused [#25764 ](https://github.com/ziglang/zig/issues/25764 ).
This PR adds a basic test to do a discard (which does trigger [#25764 ](https://github.com/ziglang/zig/issues/25764 )), and rebases only as much as is required to make the discard succeed ([or no rebase at all](https://github.com/ziglang/zig/issues/25764#issuecomment-3484716253 )). That means: ideally rebase to fit `limit`, or if the buffer is too small, as much as possible.
I must say, `discardDirect` does not make much sense to me, but I replaced it anyway. `rebaseForDiscard` works fine with `d.reader.buffer.len == 0`. Let me know if anything should be changed.
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30891
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
Co-authored-by: mercenary <mercenary@noreply.codeberg.org >
Co-committed-by: mercenary <mercenary@noreply.codeberg.org >
2026-01-30 20:19:19 +01:00
Andrew Kelley
aa38f07c51
Merge pull request 'add std.Io.net.Socket.createPair + handful of std.posix removals' ( #31056 ) from std.posix-removals into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31056
2026-01-30 14:30:25 +01:00
Andrew Kelley
6a3226c43c
std.Io: add net.Socket.createPair
...
and remove the following from std.posix:
- socketpair
- fcntl
2026-01-30 02:07:26 -08:00
Andrew Kelley
0c67d9ebde
std.posix: goodbye gettimeofday
2026-01-30 01:58:49 -08:00
Andrew Kelley
36eb8dec98
std.posix: goodbye to some functions
...
- fstat
- inotify_init1
- inotify_add_watch, inotify_add_watchZ
- inotify_rm_watch
- sysctlbynameZ
2026-01-30 01:58:49 -08:00
Andrew Kelley
e7e168727e
std.posix: goodbye connect, eventfd
2026-01-30 01:58:49 -08:00
rpkak
b9819fce69
Io.Threaded: limit copy_file_range len to prevent EOVERFLOW
2026-01-30 08:19:50 +01:00
Andrew Kelley
380ea6fb5e
Merge pull request 'Compilation: make libzigc share zcu if possible' ( #31037 ) from GasInfinity/zig:libc-share-zcu into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31037
2026-01-30 08:16:39 +01:00
Andrew Kelley
377bb8f237
Merge pull request 'std: migrate getcwd to Io' ( #31047 ) from getcwd into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31047
2026-01-30 06:38:08 +01:00
lzm-build
ccd82ae7cc
Add f16, f80 and f128 support for atan
2026-01-30 06:20:14 +01:00
Pablo Alessandro Santos Hugen
ad0458f582
std.Build: Fix wrong error enum
...
Signed-off-by: Pablo Alessandro Santos Hugen <phugen@redhat.com >
2026-01-30 06:19:49 +01:00
Brandon Black
ecb9ddf267
Threaded.sleepPosix: fix libc error handling
...
Confusingly, the POSIX spec for clock_nanosleep() says it returns
*positive* error values directly and does not touch `errno`. Not
detecting EINTR properly here was breaking the cancellation of
threads blocked in this call when linking libc.
2026-01-30 06:19:31 +01:00
Andrew Kelley
b1d1806fef
std.process: currentDir -> currentPath
...
In Zig standard library, Dir means an open directory handle. path
represents a file system identifier string. This function is better
named after "current path" than "current dir". "get" and "working" are
superfluous.
2026-01-29 18:47:58 -08:00
Andrew Kelley
0a37ad2ec4
std.Io.File: handle DISK_FULL on windows
2026-01-29 18:40:56 -08:00
Andrew Kelley
3cc5dda756
fix RtlGetCurrentDirectory_U parameter
...
it's the byte length not number of wchars
2026-01-29 18:40:56 -08:00
Andrew Kelley
649aaf4814
std: migrate getcwd to Io
...
progress towards #30150
2026-01-29 18:40:55 -08:00
Andrew Kelley
9b415761dd
std.os.windows: delete unused APIs
...
Intention is to go through std.Io for these things.
2026-01-30 03:39:46 +01:00
Andrew Kelley
5571c08e66
add behavior test for i96 operations
2026-01-29 19:57:36 +01:00
Andrew Kelley
4d6f4e9cfd
behavior: add coverage for extern struct field overalignment
2026-01-29 19:56:46 +01:00
GasInfinity
ed93f0d70f
fix(libzigc): always apply strong linkage, even when testing
...
* libzigc may be linked into a different test compilation
Co-authored-by: Matthew Lugg <mlugg@mlugg.co.uk >
2026-01-29 10:39:38 +01:00
GasInfinity
e7baa09ce4
feat(Compilation): make libzigc share zcu if possible
2026-01-29 10:31:56 +01:00
Andrew Kelley
37a9ca7163
Merge pull request 'std: finish moving os.windows.ReadLink logic to Io.Threaded' ( #31044 ) from windows-OpenFile into master
...
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31044
2026-01-29 08:40:37 +01:00
Andrew Kelley
18c6abc0ba
std: finish moving os.windows.ReadLink logic to Io.Threaded
...
- remove error.SharingViolation from all error sets since it has the
same meaning as FileBusy
- add error.FileBusy to CreateFileAtomicError and ReadLinkError
- update dirReadLinkWindows to use NtCreateFile and NtFsControlFile and
integrate with cancelation properly.
- move windows CTL_CODE constants to the proper namespace
- delete os.windows.ReadLink
2026-01-28 17:02:17 -08:00
Andrew Kelley
5774248041
std.os.windows: delete unused CreateSymbolicLink
2026-01-28 15:33:04 -08:00
lzm-build
757ec185f0
Add f16, f80 and f128 support for acos and asin ( #30997 )
...
The software impl of `acos` and `asin` depends on the `sqrt` op. Since support for `sqrt` in `f16`, `f80`, and `f128` has been added, the impl of `acos` and `asin` for `f16`, `f80`, and `f128` is now being supplemented.
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30997
Reviewed-by: Andrew Kelley <andrew@ziglang.org >
Co-authored-by: lzm-build <3575188313@qq.com >
Co-committed-by: lzm-build <3575188313@qq.com >
2026-01-28 23:33:35 +01:00
Andrew Kelley
3b10383114
std.meta: delete declList
...
dubious. if people want this logic they should take responsibility for
it in their own code.
2026-01-28 00:43:20 -08:00
Krzysztof Wolicki
204fa8959a
Make functions on EnumMap always take a pointer to avoid copies of big EnumMaps
2026-01-28 03:13:37 +01:00
llogick
11c3b4bd41
Fix std.process.run leaking memory if child.wait returned an error
2026-01-28 03:12:00 +01: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