Commit graph

98 commits

Author SHA1 Message Date
Andrew Kelley
45a35d448e Merge remote-tracking branch 'origin/zstd' into wrangle-writer-buffering 2025-07-25 18:15:24 -07:00
Andrew Kelley
733b208256 std.posix.ftruncate: handle NonResizable properly 2025-07-25 14:15:33 -07:00
Andrew Kelley
da51e94d50 std.fs.File.end: account for streaming mode 2025-07-25 14:15:33 -07:00
Andrew Kelley
dfbb6e9879 Merge remote-tracking branch 'origin/master' into wrangle-writer-buffering 2025-07-23 09:13:52 -07:00
Andrew Kelley
5e6b8e17ef Merge remote-tracking branch 'origin/master' into wrangle-writer-buffering 2025-07-22 20:10:57 -07:00
Jacob Young
5060ab99c9 aarch64: add new from scratch self-hosted backend 2025-07-22 19:43:47 -07:00
Andrew Kelley
34d2778239 std.fs.File.Reader.sendFile: fix 32-bit freebsd 2025-07-22 09:39:24 -07:00
Andrew Kelley
76fe518d49 std.fs.File.Reader.sendFile: fix EndOfStream detection 2025-07-21 23:33:19 -07:00
Andrew Kelley
96cbdd145d std.fs.File.Reader: fix sendFile logic
it wasn't accounting for both writer and reader buffering
2025-07-21 20:00:45 -07:00
Andrew Kelley
b35c55e237 std.fs.File.Reader: fix seek position logic 2025-07-21 18:14:21 -07:00
Andrew Kelley
fe10c66d66 std.fs.File.Reader: only fcopyfile if size available 2025-07-21 12:32:37 -07:00
Andrew Kelley
f1576ef14c objcopy: delete most of it
this code is not up to zig project standards

tracked by #24522

oh, and fix not adjusting buffer seek position in std.fs.File.Reader
2025-07-21 12:32:37 -07:00
Andrew Kelley
f2a3ac7c05 std.fs.File: delete writeFileAll and friends
please use File.Writer for these use cases

also breaking API changes to std.fs.AtomicFile
2025-07-21 12:32:37 -07:00
Andrew Kelley
9abc3232a8 std.fs.File.Reader: fix missed advance writer positions 2025-07-21 13:08:43 +02:00
Andrew Kelley
ac8f757cb3 Merge remote-tracking branch 'origin/master' into wrangle-writer-buffering 2025-07-14 23:49:34 -07:00
Andrew Kelley
b510482525 std.fs.File.Reader.seekTo: add missing int cast 2025-07-14 00:21:20 -07:00
Atlas Yu
2cda4cfb39 std.posix.send: should expect ConnectionRefused
Closes: #20219
2025-07-11 13:06:13 +02:00
Andrew Kelley
6e6c68d889 Merge remote-tracking branch 'origin/master' into wrangle-writer-buffering 2025-07-10 16:11:10 -07:00
Andrew Kelley
55bced9563 std.fs.File.Writer: fix splat alias bug
same deal as previous commit
2025-07-09 20:01:15 -07:00
Andrew Kelley
5955ba4f53 std.fs.File.Writer: implement positional writing for Windows 2025-07-07 23:09:14 -07:00
Andrew Kelley
f2ad3bcc1c fix 32-bit compilation 2025-07-07 22:43:53 -07:00
Andrew Kelley
fd7feed04b std.fs.File.Writer: implement positional writing 2025-07-07 22:43:53 -07:00
Andrew Kelley
4ccc6f2b57 compiler: fix remaining build failures 2025-07-07 22:43:53 -07:00
Andrew Kelley
6489907662 std.zip: work around deprecated API 2025-07-07 22:43:53 -07:00
Andrew Kelley
cce32bd1d5 fix build runner 2025-07-07 22:43:52 -07:00
Andrew Kelley
f71d97e4cb update compiler source to new APIs 2025-07-07 22:43:52 -07:00
Andrew Kelley
4bca5faca6 std.Build.Cache: write manifest without heap allocating
Now that the buffered writing interface is not generic.
2025-07-07 22:43:52 -07:00
Andrew Kelley
435ccf706d std.fs.File.Writer: fix drain implementation
it didn't account for data.len can no longer be zero
2025-07-07 22:43:51 -07:00
Andrew Kelley
0e37ff0d59 std.fmt: breaking API changes
added adapter to AnyWriter and GenericWriter to help bridge the gap
between old and new API

make std.testing.expectFmt work at compile-time

std.fmt no longer has a dependency on std.unicode. Formatted printing
was never properly unicode-aware. Now it no longer pretends to be.

Breakage/deprecations:
* std.fs.File.reader -> std.fs.File.deprecatedReader
* std.fs.File.writer -> std.fs.File.deprecatedWriter
* std.io.GenericReader -> std.io.Reader
* std.io.GenericWriter -> std.io.Writer
* std.io.AnyReader -> std.io.Reader
* std.io.AnyWriter -> std.io.Writer
* std.fmt.format -> std.fmt.deprecatedFormat
* std.fmt.fmtSliceEscapeLower -> std.ascii.hexEscape
* std.fmt.fmtSliceEscapeUpper -> std.ascii.hexEscape
* std.fmt.fmtSliceHexLower -> {x}
* std.fmt.fmtSliceHexUpper -> {X}
* std.fmt.fmtIntSizeDec -> {B}
* std.fmt.fmtIntSizeBin -> {Bi}
* std.fmt.fmtDuration -> {D}
* std.fmt.fmtDurationSigned -> {D}
* {} -> {f} when there is a format method
* format method signature
  - anytype -> *std.io.Writer
  - inferred error set -> error{WriteFailed}
  - options -> (deleted)
* std.fmt.Formatted
  - now takes context type explicitly
  - no fmt string
2025-07-07 22:43:51 -07:00
Andrew Kelley
9f27d770a1 std.io: deprecated Reader/Writer; introduce new API 2025-07-07 22:43:51 -07:00
Andrew Kelley
bc9db143c9 std.fs.File.Reader: fix wrong calculation when reading 2025-07-01 16:35:30 -07:00
Andrew Kelley
d4545f216a std.io: start removing context from Reader/Writer
rely on the field parent pointer pattern
2025-07-01 16:35:30 -07:00
Andrew Kelley
c27ab8b45d std: update zstd to new API 2025-07-01 16:35:30 -07:00
Andrew Kelley
25a0648176 std: move copy_file_range, fcopyfile impls and usage 2025-07-01 16:35:30 -07:00
Andrew Kelley
7926081ec3 fix std.fs.File.Reader 2025-07-01 16:35:30 -07:00
Andrew Kelley
af24e722fb update some stuff to std.io API 2025-07-01 16:35:29 -07:00
Andrew Kelley
ef8d7aa251 std: fix a couple compilation errors 2025-07-01 16:35:29 -07:00
Andrew Kelley
084e45fd86 std.io.Reader: implement readVec
and specify that data.len == 0 means "flush"
2025-07-01 16:35:29 -07:00
Andrew Kelley
9d163c7ac3 std.net: update to new IO API 2025-07-01 16:35:29 -07:00
Andrew Kelley
1e2aab2f97 std: combine BufferedWriter into Writer 2025-07-01 16:35:29 -07:00
Andrew Kelley
3c98e2c826 std: combine BufferedReader into Reader 2025-07-01 16:35:29 -07:00
Andrew Kelley
2ed47f1ed8 std: update AtomicFile to new API 2025-07-01 16:35:29 -07:00
Andrew Kelley
ba684a18ca std: upgrade more API to use File.Reader 2025-07-01 16:35:29 -07:00
Andrew Kelley
3650cd3e8e std.fs.File: update for new writeFile API 2025-07-01 16:35:29 -07:00
Andrew Kelley
7b417c6caf std: improve the discarding writer
by making the vtable use File.Reader instead of File and Offset
2025-07-01 16:35:29 -07:00
Andrew Kelley
74c56376ee std: update http.WebSocket to new API 2025-07-01 16:35:29 -07:00
Andrew Kelley
06b44a0afa update git fetching logic to new reader/writer API
- flatten std.crypto.hash.Sha1 and give it a writable interface that
  optimizes splats
- flatten std.hash.crc and give it a writable interface that optimizes
  splats
- remove old writer impls from std.crypto
- add fs.File.Writer.moveToReader
- add fs.File.Writer.seekTo
- add std.io.Reader.Hashed and std.io.Writer.Hashed which are
  passthrough streams. Instead of passing through to null writer, use
  the writable interface implemented directly on hashers which doesn't
  have to account for passing through the data.
- add std.io.BufferedWriter.writeSplatAll
2025-07-01 16:35:29 -07:00
Andrew Kelley
d603121dc3 std.crypto.Certificate.Bundle.macos: rework
- use ArrayList strategically to reduce allocations
- use a BufferedReader to avoid unnecessary memcpy of the certs
- use for loops
- skip certs with invalid magic instead of asserting
2025-07-01 16:35:29 -07:00
Andrew Kelley
b0d825948a std.fs.File: fix missing end of stream 2025-07-01 16:35:28 -07:00
Andrew Kelley
396464ee6b update std.net and nail down delimiter APIs
"exclusive" functions still need to report EndOfStream after the last
returned slice
2025-07-01 16:35:28 -07:00