Kendall Condon
d26b532647
sendFileAll: use stream instead of sendFileReading
...
This is a simpler implementation and allows file_reader to do more
optimal streaming.
2025-09-04 17:26:52 -04:00
Kendall Condon
58dda3b10b
fix sendFile implementations bypassing interface buffer
...
Also removes `File.Reader.read` since it is otherwise unused and is a
footgun.
2025-09-04 17:26:49 -04:00
Kendall Condon
7687b916fd
File.Writer.sendFile: properly update reader pos
...
seekBy affects the reader's physical position, not its logical
position.
2025-09-04 16:38:50 -04:00
Alex Rønne Petersen
d94e061ade
Merge pull request #25137 from alexrp/elf-gabi-4.3
...
ELF updates for gABI 4.3
2025-09-04 10:58:28 +02:00
Luna Schwalbe
9649ff37ef
BitcodeReader: parse blockinfo inside block
...
Call start/endBlock before/after `parseBlockInfoBlock` in order to not
use the current block context, which is wrong and leads to e.g. incorrect
abbrevlen being used.
2025-09-03 21:47:32 -07:00
whatisaphone
ae518dcb41
Add allocator that always fails
2025-09-03 21:46:01 -07:00
Brandon Black
76c62e509b
Fix cmsghdr struct for the *nixes
...
Previously we had a single definition of std.c.cmsghdr for all
libc-linking platforms which aliased from the Solaris definition,
a superfluous matching one in std.os.dragonfly, and no others.
The existing definition from std.c didn't actually work for Linux,
as Linux's "len" field is usize in the kernel's definition.
Emscripten follows the Linux model of course (but uses the
binary-compatible musl definition, which has an endian-sensitive
padding scheme to make the len type "socklen_t" even though the
kernel uses a usize, which is fair).
This unifies and documents all the known *nix-ish cases (I'm not
sure if wasi or windows really has cmsghdr support? Could be added
later, void for now), such that c.cmsghdr and posix.system.cmsghdr
should work correctly for all the known cases here, libc or
otherwise.
2025-09-03 21:45:03 -07:00
Josh GM Walker
b1189ab038
fix: std.fs.File.Writer.seekTo does not flush ( #25135 )
...
* add failing test case
* perform flush and allow error
* dont over constrain flush error
* reset seek error during conversion
2025-09-03 21:43:47 -07:00
Alex Rønne Petersen
32a34b64ca
Merge pull request #25125 from alexrp/loongarch-qemu-crashes
...
`std.debug`: disable stack traces on loongarch
2025-09-04 04:06:47 +02:00
Alex Rønne Petersen
a82f446d91
std.elf: change STV enum from u2 to u3
...
In gABI 4.3, st_other was changed such that the lower 3 bits are reserved for
the visibility, up from the previous 2 bits.
2025-09-04 01:16:23 +02:00
Alex Rønne Petersen
9e076d8c75
std.elf: add new EM values from gABI 4.3
2025-09-04 01:16:22 +02:00
Alex Rønne Petersen
1ca446abc3
std.elf: document which EM values are not assigned in gABI
2025-09-04 01:13:59 +02:00
Alex Rønne Petersen
1c090d3d67
std.elf: document which OSABI values are not assigned in gABI
2025-09-04 01:13:59 +02:00
Brandon Black
048f9126b8
Return runtime err for EISCONN when connecting
...
Fixes #25063
2025-09-03 22:01:45 +02:00
doclic
18bdd0e9a4
std.c: add getresuid & getresgid
2025-09-03 21:28:07 +02:00
Alex Rønne Petersen
a11dfaf61a
Merge pull request #25122 from linusg/fix-getrandombytesdevurandom
...
std.posix: Fix getRandomBytesDevURandom()
2025-09-03 19:55:46 +02:00
Alex Rønne Petersen
d8d0a3e5c7
std.debug: disable stack traces on loongarch
...
Observed to ~randomly crash during FP-based unwinding.
The path forward here will be DWARF-based unwinding.
2025-09-03 11:27:42 +02:00
binarycraft007
35f013db11
lzma2: fix premature finish
...
lzma2 Decoder already checks if decoding is finished or not inside the
process function, `range_decoder`finish does not mean the decoder has
finished, also need to check `ld.rep[0] == 0xFFFF_FFFF`, which was
already done inside the proccess function. This fix delete the redundant
`isFinish()` check for `range_decoder`.
2025-09-03 01:48:46 -07:00
Linus Groh
79f60302d6
std.c: Enable arc4random_buf for serenity
2025-09-03 02:24:47 +01:00
Linus Groh
deb46e1dd3
std.posix: Fix getRandomBytesDevURandom()
...
This is not exercised in CI because most platforms have a dedicated
implementation in getrandom().
2025-09-03 02:23:19 +01:00
Andrew Kelley
d51d18c986
Merge pull request #25105 from binarycraft007/lzma2-fix
...
lzma2: fix array list looping logic in appendLz
2025-09-02 13:16:09 -07:00
Andrew Kelley
90ac62cc75
std.compress.lzma2: optimize appendLz
...
make the hot loop be a for loop without any failures or allocation.
change a O(N) addition into O(1)
2025-09-02 12:00:43 -07:00
Ryan Liptak
f872dd03da
zstd.Decompress: Assert buffer length requirements as early as possible
...
Without this assert, providing a buffer that's smaller than required results in more cryptic assertion failures later on.
2025-09-02 11:34:46 -07:00
binarycraft007
00b0beb682
lzma2: fix array list looping logic in appendLz
2025-09-01 17:01:54 +08:00
Travis Staloch
1ec8a7ab4c
Io.Writer.Allocating: test new *Aligned methods
...
* added initAligned()
* added missing @alignCast in toArrayListAligned()
2025-08-31 19:29:02 -07:00
Andrew Kelley
4c01a6553a
Merge pull request #25088 from ziglang/delete-deprecated-fmt
...
std.fmt: delete deprecated APIs
2025-08-31 19:28:21 -07:00
Tadej Gašparovič
3aa31ffd86
Fix regression: std.http.Client basic authorization sending user:user instead of user:password when passed in URI
2025-08-31 15:48:47 -07:00
Andrew Kelley
ec36e0609f
delete behavior test that depends on std.fmt
...
behavior tests should have minimal dependency on std
2025-08-31 12:49:18 -07:00
Andrew Kelley
150169f1e0
std.fmt: delete deprecated APIs
...
std.fmt.Formatter -> std.fmt.Alt
std.fmt.format -> std.Io.Writer.print
2025-08-31 12:49:18 -07:00
Brandon Mercer
7fdd60df1c
Populate MSG struct for OpenBSD ( #25076 )
...
* update the MSG struct with the correct values for openbsd
* add comment with link to sys/sys/socket.h
---------
Co-authored-by: Brandon Mercer <bmercer@eutonian.com>
2025-08-30 22:04:32 +00:00
Andrew Kelley
b7104231af
Merge pull request #25077 from ziglang/GenericReader
...
std.Io: delete GenericReader, AnyReader, FixedBufferStream; and related API breakage
2025-08-30 12:43:52 -07:00
Alex Rønne Petersen
151314346d
Merge pull request #25055 from ziglang/llvm21
...
LLVM 21
2025-08-30 21:00:53 +02:00
Andrew Kelley
e2fdaea0b3
Revert "std.Io.Reader: work around llvm backend bug"
...
This reverts commit 530cc2c1111699d9d02ad9ebef94efa6b99f5205.
The compiler bug has been fixed.
2025-08-30 06:04:25 -07:00
Alex Rønne Petersen
66b43234bb
std: disable sha3-512 single test on RISC-V with V support
...
https://github.com/ziglang/zig/issues/25083
2025-08-30 13:27:25 +02:00
Andrew Kelley
07da9567e6
compiler: fix macos build
2025-08-30 00:48:50 -07:00
Andrew Kelley
fadd268a60
upgrade more old API uses
2025-08-30 00:48:50 -07:00
Andrew Kelley
9a0970a12b
rework std.Io.Writer.Allocating to support runtime-known alignment
...
Also, breaking API changes to:
* std.fs.Dir.readFileAlloc
* std.fs.Dir.readFileAllocOptions
2025-08-30 00:48:50 -07:00
Alex Rønne Petersen
f6879c35af
std.posix.test: fix mmap() test to use actual page size instead of 4096
2025-08-30 06:36:41 +02:00
Alex Rønne Petersen
59ee4e8e54
std.hash.xxhash: disable xxhash3 test on all mips64 targets
...
See also dd1de18f9629904b5d97d5791a47244ac63385da.
https://github.com/ziglang/zig/issues/23807
2025-08-30 06:36:41 +02:00
Alex Rønne Petersen
af78c55676
std: skip some failing tests on hexagon
2025-08-30 06:36:41 +02:00
Alex Rønne Petersen
367be3777c
std.Thread: make unreachable errors in sleep() clearer
2025-08-30 06:36:41 +02:00
Alex Rønne Petersen
5b80900a5d
std.zig.system: update aarch64 and powerpc cpu detection for LLVM 21
2025-08-30 06:36:41 +02:00
Alex Rønne Petersen
0b9f5e2549
std.Target: fix alignment for int/long types on m68k
2025-08-30 06:36:41 +02:00
Alex Rønne Petersen
fdd32a2257
std.Target: add managarm OS tag
2025-08-30 06:36:41 +02:00
Alex Rønne Petersen
464eef390b
std.Target: make ultrasparc3 the baseline for sparc64-solaris
...
https://github.com/llvm/llvm-project/pull/149990
2025-08-30 06:36:41 +02:00
Alex Rønne Petersen
978555eea4
std.Target.x86: purge avx10.n-256, rename avx10.n_512 to avx10.n, require evex512 for avx512f
...
Intel has abandoned AVX10.N/128,256; AVX10.N is now always 512-bit.
2025-08-30 06:36:41 +02:00
Alex Rønne Petersen
2c0cc81e74
std.Target: bump feature bit count from 288 to 317
...
/lib/std/debug.zig:559:14: error: reached unreachable code
if (!ok) unreachable; // assertion failure
^~~~~~~~~~~
/lib/std/Target/riscv.zig:335:21: note: called at comptime here
std.debug.assert(len <= CpuFeature.Set.needed_bit_count);
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2025-08-30 06:36:41 +02:00
Alex Rønne Petersen
587eddda28
std.Target: update CPU features to LLVM 21
2025-08-30 06:36:41 +02:00
Andrew Kelley
79f267f6b9
std.Io: delete GenericReader
...
and delete deprecated alias std.io
2025-08-29 17:14:26 -07:00
Andrew Kelley
558bea2a76
std.Io: delete CountingReader
2025-08-29 11:11:59 -07:00