34588 Commits

Author SHA1 Message Date
Andrew Kelley
b9e1fef562 Merge remote-tracking branch 'origin/http' into wrangle-writer-buffering 2025-08-06 22:52:19 -07:00
Andrew Kelley
aac26f3b31 TLS, HTTP, and package fetching fixes
* TLS: add missing assert for output buffer length requirement
* TLS: add missing flushes
* TLS: add flush implementation
* TLS: finish drain implementation
* HTTP: correct buffer sizes for TLS
* HTTP: expose a getReadError method on Connection
* HTTP: add missing flush on sendBodyComplete
* Fetch: remove unwanted deinit
* Fetch: improve error reporting
2025-08-06 22:42:43 -07:00
Andrew Kelley
ac18b98aa3 std.fs.File.Reader: fix readVec fill
respect the case when there is existing buffer
2025-08-06 22:42:43 -07:00
Andrew Kelley
2c82d1c03a std.http: remove custom method support
let's see if anybody notices it missing
2025-08-06 22:42:43 -07:00
Andrew Kelley
1596aed1fd fetch: avoid copying Resource 2025-08-06 22:42:42 -07:00
Andrew Kelley
59ba197308 std.http: address review comments
thank you everybody
2025-08-06 22:42:42 -07:00
Andrew Kelley
995bfdf0ff std.http.Server: add safety for invalidated Head strings
and fix bad unit test API usage that it finds
2025-08-06 22:42:42 -07:00
Ryan Liptak
063d87132a resinator: a few more updates/fixes
Just enough to get things working correctly again
2025-08-06 22:42:42 -07:00
Andrew Kelley
4395f512c9 resinator: just enough fixes to make it compile 2025-08-06 22:42:42 -07:00
Andrew Kelley
4d4251c9f9 std.Io: delete LimitedReader 2025-08-06 22:42:42 -07:00
Andrew Kelley
499bf2a1c7 std.Io: delete BufferedReader 2025-08-06 22:42:42 -07:00
Andrew Kelley
8b571723fa remove std.fifo
I never liked how this data structure took its API as a parameter.

This use case is now served by std.Io buffering.
2025-08-06 22:42:42 -07:00
Andrew Kelley
75ddb62a2e std.net: fix windows build 2025-08-06 22:42:42 -07:00
Andrew Kelley
fe0ff7f718 fix 32-bit builds 2025-08-06 22:42:42 -07:00
Andrew Kelley
18c4a500b6 std.Io.Reader: fix appendRemainingUnlimited
Now it avoids mutating `r` unnecessarily, allowing the `ending` Reader
to work.
2025-08-06 22:42:42 -07:00
Andrew Kelley
b757d7f941 fetch: update for new http API
it's not quite finished because I need to make it not copy the Resource
2025-08-06 22:42:42 -07:00
Andrew Kelley
fdf0e4612e update build system to new http.Server API 2025-08-06 22:42:42 -07:00
Andrew Kelley
98ee936055 http fixes 2025-08-06 22:42:42 -07:00
Andrew Kelley
8f06754a06 std.crypto.tls: rework for new std.Io API 2025-08-06 22:42:42 -07:00
Andrew Kelley
6e671d4c77 std.http: rework for new std.Io API 2025-08-06 22:42:42 -07:00
Andrew Kelley
04fe1bfe3c std.Io.Reader: use readVec for fill functions
readVec has two updated responsibilities:
1. it must respect any existing already buffered data.
2. it must write to the buffer if data is empty
2025-08-06 21:23:06 -07:00
mlugg
e17a050bc6 link: prevent deadlock when prelink tasks fail
If an error occured which prevented a prelink task from being queued,
then `pending_prelink_tasks` would never be decremented, which could
cause deadlocks in some cases. So, instead of calculating ahead of time
the number of prelink tasks to expect, we use a simpler strategy which
is much like a wait group: we add 1 to a value when we spawn a worker,
and in the worker function, `defer` decrementing the value. The initial
value is 1, and there's a decrement after all of the workers are
spawned, so once it hits 0, prelink is done (be it with a failure or a
success).
2025-08-06 21:50:16 +01:00
mlugg
3de8bbd3d4 Sema: fix initializing comptime-known constant with OPV union field
Resolves: #24716
2025-08-06 20:47:03 +01:00
kj4tmp@gmail.com
44ea11d71f #24471: add mlock syscalls to std.os.linux 2025-08-06 12:18:45 +02:00
Alex Rønne Petersen
7ee6dab39f Revert "Sema: Stop adding Windows implib link inputs for extern "..." syntax."
This reverts commit b461d07a5464aec86c533434dab0b58edfffb331.

After some discussion in the team, we've decided that this is too disruptive,
especially because the linker errors are less than helpful. That's a fixable
problem, so we might reconsider this in the future, but revert it for now.
2025-08-06 06:15:13 +02:00
massi
9a158c1dae
autodoc: Use the search input's value on load (#24467)
Co-authored-by: massi <git@massi.world>
2025-08-06 03:23:24 +00:00
Igor Anić
d2149106a6 flate zlib fix end of block reading
`n` is wanted number of bits to toss
`buffered_n` is actual number of bytes in `next_int`
2025-08-05 17:09:41 -07:00
Andrew Kelley
d8cecffe31
Merge pull request #24699 from ziglang/bounded
remove RingBuffer; remove BoundedArray; use `@memmove`
2025-08-05 16:24:28 -07:00
Giuseppe Cesarano
3914eaf357
std.elf: buffer header iterator API (#24691)
Closes #24666.
2025-08-05 10:00:33 -07:00
Andrew Kelley
8c11ada66c std: delete RingBuffer
Progress towards #19231
2025-08-05 09:56:02 -07:00
Andrew Kelley
b6f84c47c4 std.base64: delete encodeFromReaderToWriter
this function is wacky, should not have been merged
2025-08-05 09:56:02 -07:00
Andrew Kelley
196e36bbb2 std: remove BoundedArray
This use case is handled by ArrayListUnmanaged via the "...Bounded"
method variants, and it's more optimal to share machine code, versus
generating multiple versions of each function for differing array
lengths.
2025-08-05 09:56:02 -07:00
Andrew Kelley
c47ec4f3d7 std.array_list: add bounded methods 2025-08-05 09:56:02 -07:00
Andrew Kelley
6f545683f3 std: replace various mem copies with @memmove 2025-08-05 09:56:02 -07:00
Veikka Tuominen
82961a8c9f std.c: fix utsname array sizes 2025-08-05 00:18:14 -07:00
David Rubin
def25b9189 crypto: fix typo in ecdsa comment 2025-08-05 07:51:39 +01:00
KNnut
fcb088cb6a std.Target.Query: fix WindowsVersion format in zigTriple() 2025-08-05 06:08:42 +02:00
Ian Johnson
96be6f6566 std.compress.flate.Decompress: return correct size for unbuffered decompression
Closes #24686

As a bonus, this commit also makes the `git.zig` "testing `main`" compile again.
2025-08-04 19:32:14 -07:00
Alex Rønne Petersen
163e9ce7d9
Merge pull request #24629 from alexrp/android-requires-libc
`std.Target`: require libc for Android API levels prior to 29
2025-08-04 17:59:47 +02:00
Matthew Lugg
9b509dad30
Merge pull request #24689 from mlugg/build-no-watch-regression
build runner: fix FTBFS on targets without `--watch` implementation
2025-08-04 16:23:58 +01:00
Loris Cro
70c6a9fba6 init: small fix to zig init template
it was placing the current zig version in the wrong field
2025-08-04 14:25:08 +02:00
Alex Rønne Petersen
65db19a289
Merge pull request #24680 from alexrp/target-os-versions
`std.Target`: Bump min/max OS versions for 0.15.0
2025-08-04 11:02:50 +02:00
mlugg
422e8d476c
build runner: fix FTBFS on targets without --watch implementation
This was a regression in #24588.

I have verified that this patch works by confirming that with the
downstream patches SerenityOS apply to the Zig source tree (sans the one
working around this regression), I can build the build runner for
SerenityOS.

Resolves: #24682
2025-08-04 09:47:56 +01:00
mlugg
32a069f909
cli: add --debug-libc to zig build
This option is similar to `--debug-target` in letting us override
details of the build runner target when debugging the build system.
While `--debug-target` lets us override the target query, this option
lets us override the libc installation. This option is only usable in a
compiler built with debug extensions.

I am using this to (try to) test the build runner targeting SerenityOS.
2025-08-04 09:47:56 +01:00
Andrew Kelley
dabae3f9dc linker: remove dependency on std.fifo 2025-08-03 19:22:28 -07:00
Alex Rønne Petersen
493265486c
Revert "ci: target baseline instead of spacemit_x60 on riscv64-linux"
This reverts commit fa445d86a110f1171b75824fe5ec139089fa4733.

Narrator: It did, in fact, make a difference.

For whatever reason, building LLVM against spacemit_x60 or baseline makes no
noticeable difference in terms of performance, but building the Zig compiler
against spacemit_x60 does. Also, the miscompilation that was causing
riscv64-linux-debug to fail was in the LLVM libraries, not in the Zig compiler,
so we may as well take the win here.
2025-08-03 22:40:13 +02:00
Alex Rønne Petersen
ba7cc72c47
std.Target: bump watchos min version to 8.0.0 2025-08-03 20:08:19 +02:00
Alex Rønne Petersen
71722df4ab
std.Target: bump driverkit min version to 20.0.0 2025-08-03 20:08:07 +02:00
Alex Rønne Petersen
e9093b8d18
std.Target: bump max versions for Apple targets 2025-08-03 20:05:21 +02:00
Alex Rønne Petersen
5b74d33471
std.Target: bump amdhsa max version to 6.4.2 2025-08-03 20:00:32 +02:00