Commit graph

34557 commits

Author SHA1 Message Date
Alexandre Blais
6eeceb4b14 docs(zon/stringify.zig): Added missing non-serializable type 2025-08-10 19:48:09 +02:00
Alex Rønne Petersen
6bb6013d3a
Merge pull request #24768 from alichraghi/spv5
spirv: remove prune_unused ISel
2025-08-10 19:45:16 +02:00
Techatrix
2983285815 zig fmt: flush stdout before exiting with error 2025-08-10 19:42:54 +02:00
Linus Groh
6a1d61d504 std.c: Remove serenity's internet_checksum() function
See: 59911d8da3
2025-08-10 18:21:47 +02:00
Andrew Kelley
0a1a738320
Merge pull request #24743 from ziglang/BufferedWriter
std.Io: delete BufferedWriter
2025-08-09 16:28:19 -07:00
kcbanner
95f57c3369 net: Always set WSA_FLAG_OVERLAPPED when creating Windows sockets. Rework send and receive logic to use overlapped I/O.
build-web: Remove the now-redundant supports_recv logic
2025-08-09 18:48:15 -04:00
kcbanner
125c4a265a Fix respondWebSocket, enable --webui on Windows
This commit re-enables the --webui functionality on windows, with the caveat that rebuild functionality is still disabled (due to deadlocks caused by reading to / writing from the same non-overlapped socket on multiple threads). I updated the UI to be aware of this, and hide the `Rebuild` button.

http.Server: Remove incorrect advance() call. This was causing browsers to disconnect the websocket, as we were sending undefined bytes.
build.WebServer: Re-enable on windows, but disable functionality that requires receiving messages from the client
build-web: Show total times in tables
2025-08-09 16:06:33 -04:00
Ali Cheraghi
64563e2fff
test: skip tests that were not meant to pass for spirv 2025-08-09 13:27:45 +03:30
Ali Cheraghi
bed99e1ecd
spirv: remove prune_unused ISel 2025-08-09 13:27:04 +03:30
Ian Johnson
14f11377cb Fetch.git: fix FetchStream packet reading
Progress towards #24732
2025-08-08 19:37:33 -07:00
Andrew Kelley
df46ee61c4 std.Io.Writer.Allocating: configurable bump amount 2025-08-08 19:22:08 -07:00
Andrew Kelley
045bb14897 zig std: fix build failures 2025-08-08 17:17:53 -07:00
Andrew Kelley
8c9dfcbd0f std.Io: remove BufferedWriter 2025-08-08 17:17:53 -07:00
mlugg
5f7a0bbabf Sema: fix unreasonable progress node numbers
The "completed" count in the "Semantic Analysis" progress node had
regressed since 0.14.0: the number got crazy big very fast, even on
simple cases. For instance, an empty `pub fn main` got to ~59,000 where
on 0.14 it only reached ~4,000. This was happening because I was
unintentionally introducing a node every time type resolution was
*requested*, even if (as is usually the case) it turned out to already
be done. The fix is simply to start the progress node a little later,
once we know we are actually doing semantic analysis. This brings the
number for that empty test case down to ~5,000, which makes perfect
sense. It won't exactly match 0.14, because the standard library has
changed, and also because the compiler's progress output does have some
*intentional* changes.
2025-08-08 23:14:26 +01:00
Andrew Kelley
2a8751e37f Fetch.git: replace a toss with discardAll
toss is only valid following a peek.
2025-08-08 15:03:05 -07:00
Andrew Kelley
91a81d3846 std.compress.flate.Decompress: fix buffer size in test 2025-08-08 15:03:05 -07:00
mlugg
1440519239 compiler: improve error reporting
The functions `Compilation.create` and `Compilation.update` previously
returned inferred error sets, which had built up a lot of crap over
time. This meant that certain error conditions -- particularly certain
filesystem errors -- were not being reported properly (at best the CLI
would just print the error name). This was also a problem in
sub-compilations, where at times only the error name -- which might just
be something like `LinkFailed` -- would be visible.

This commit makes the error handling here more disciplined by
introducing concrete error sets to these functions (and a few more as a
consequence). These error sets are small: errors in `update` are almost
all reported via compile errors, and errors in `create` are reported
through a new `Compilation.CreateDiagnostic` type, a tagged union of
possible error cases. This allows for better error reporting.

Sub-compilations also report errors more correctly in several cases,
leading to more informative errors in the case of compiler bugs.

Also fixes some race conditions in library building by replacing calls
to `setMiscFailure` with calls to `lockAndSetMiscFailure`. Compilation
of libraries such as libc happens on the thread pool, so the logic must
synchronize its access to shared `Compilation` state.
2025-08-08 22:37:27 +01:00
Andrew Kelley
3d25a9c1e0 std.Io.Writer.Allocating.sendFile: use logicalPos
fixes #24754

tested with `zig build test-std -Dskip-release`
2025-08-08 14:21:57 -07:00
Igor Anić
6219c015d8 Io.Writer fix dangling pointer
While underlying writer is Allocating writer buffer can grow in
vtable.drain call. We should not hold pointer to the buffer before that
call and use it after.
This remembers positions instead of holding reference.
2025-08-08 12:56:26 -07:00
Giuseppe Cesarano
3ee4252183 Fix: std.elf offset computation 2025-08-08 12:47:00 -07:00
Andrew Kelley
1ba6838bc3
Merge pull request #24740 from ziglang/http-plus-fixes
fetch, tls, and http fixes
2025-08-08 12:33:53 -07:00
Andrew Kelley
d2f7792039
Merge pull request #24742 from ziglang/CountingWriter
std.Io: delete CountingWriter
2025-08-08 12:30:09 -07:00
Igor Anić
3ea015db96 Io.Reader fix defaultReadVec
Running tar.pipeToFileSystem compressed_mingw_includes.tar file from #24732
finishes in infinite loop calling defaultReadVec with:
r.seek = 1024
r.end = 1024
r.buffer.len = 1024
first.len = 512
that combination calls vtable.stream with 0 capacity writer and loops
forever.

Comment is to use whichever has larger capacity, and this fix reflects that.
2025-08-08 12:28:00 -07:00
Ryan Liptak
23fff3442d flate: Handle invalid block type
Fixes `panic: invalid enum value` when the type bits had the u2 value of 3.

Contributes towards #24741
2025-08-08 12:27:25 -07:00
Alex Rønne Petersen
d984e7d2fa
ci: trigger ci-pr-riscv64-linux workflow on unlabeled events
This way, if the ci-riscv64-linux label was added to a PR previously, removing
it will cause the concurrency group of the workflow to cancel the runs triggered
by the label being added.
2025-08-08 17:15:44 +02:00
Alex Rønne Petersen
63b663a63b
ci: fix concurrency group for ci-pr-riscv64-linux workflow 2025-08-08 17:11:59 +02:00
Alex Rønne Petersen
87f2dadbf1
ci: run riscv64-linux jobs if ci-riscv64-linux label is applied
This needs to be a separate workflow so that it doesn't interfere with non-CI
labeling of pull requests.
2025-08-08 17:08:14 +02:00
Alex Rønne Petersen
ac3229a435
Revert "ci: run riscv64-linux jobs if ci-riscv64-linux label is applied"
This reverts commit 8101104db0.
2025-08-08 17:05:20 +02:00
Alex Rønne Petersen
8101104db0
ci: run riscv64-linux jobs if ci-riscv64-linux label is applied 2025-08-08 16:49:54 +02:00
Andrew Kelley
9a538e0d54 link.Dwarf: minimal changes to remove CountingWriter 2025-08-07 22:26:42 -07:00
Andrew Kelley
281f657377 Revert "random patches from another branch"
This reverts commit 76ed05523d6327789a8365571b67a214ac527ef9.

they don't work
2025-08-07 22:26:42 -07:00
Andrew Kelley
c5a5983150 random patches from another branch 2025-08-07 22:26:42 -07:00
Andrew Kelley
94dd28b7f7 std.Io: delete CountingWriter 2025-08-07 22:26:42 -07:00
Alex Rønne Petersen
0d0f09fb0e std.os.windows: map RtlGenRandom() failure to error.SystemResources
Closes #23666.
2025-08-08 07:25:26 +02:00
Andrew Kelley
3fb86841cc
Merge pull request #24661 from alichraghi/spv4
spirv: refactor and remove deduplication ISel
2025-08-07 20:55:50 -07:00
Andrew Kelley
8da645c883 Fetch: fix FetchStream logic 2025-08-07 19:55:40 -07:00
Andrew Kelley
8721efece4 std.crypto.tls.Client: always write to buffer
simplifies the logic & makes it respect limit
2025-08-07 19:55:40 -07:00
Andrew Kelley
d7bf608821 Fetch: make FetchStream live longer 2025-08-07 19:55:40 -07:00
Andrew Kelley
6244f5c6cb std.http.bodyReader: add missing flush in endUnflushed
It's a bit counter-intuitive, but there are two streams here: the
implementation here, and the connected output stream.

When we say "unflushed" we mean don't flush the connected output stream
because that's managed externally. But an "end" operation should always
flush the implementation stream.
2025-08-07 19:55:40 -07:00
Andrew Kelley
af2ac24333 Fetch: handle compressed git+http 2025-08-07 19:55:40 -07:00
Andrew Kelley
5ce8e9325b std.http.Client: fix fetching by adding a buffer 2025-08-07 19:54:39 -07:00
Andrew Kelley
5998a8cebe
Merge pull request #24698 from ziglang/http
std: rework HTTP and TLS for new I/O API
2025-08-07 19:54:25 -07:00
TibboddiT
2cf15bee03
Fix some libc version checks for Bionic 2025-08-08 01:26:00 +00:00
Frank Denis
242102f9d1 std/zip.zig: perform backslash-to-forward-slash before isBadFilename()
Previously, when extracting a ZIP file, isBadFilename(), which is
designed to reject ../ patterns to prevent directory traversal, was
called before normalizing backslashes to forward slashes.

This allowed path traversal sequences like ..\\..\\..\\etc\\passwd
which pass validation but are then converted to ../../../etc/passwd
for file extraction.
2025-08-07 14:42:48 -07:00
Igor Anić
6de2310035
flate change bit reader Bits to usize (#24719)
Don't see why byte returned from specialPeek needs to be shifted by
remaining_needed_bits.
I believe that decision in specialPeek should be done on the number of
the remaining bits not of the content of that bits.

Some test result are changed, but they are now consistent with the
original state as found in:
5f790464b0/lib/std/compress/flate/Decompress.zig

Changing Bits from usize to u32 or u64 now returns same results.

* flate: simplify peekBitsEnding

`peekBits` returns at most asked number of bits. Fails with EndOfStream
when there are no available bits. If there are less bits available than
asked still returns that available bits.
Hopefully this change better reflects intention. On first input stream
peek error we break the loop.
2025-08-07 14:40:08 -07:00
Andrew Kelley
46b34949c3 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-07 10:04:52 -07:00
Andrew Kelley
172d31b0e2 std.fs.File.Reader: fix readVec fill
respect the case when there is existing buffer
2025-08-07 10:04:52 -07:00
Andrew Kelley
163a827826 std.http: remove custom method support
let's see if anybody notices it missing
2025-08-07 10:04:52 -07:00
Andrew Kelley
4567241d8d fetch: avoid copying Resource 2025-08-07 10:04:52 -07:00
Andrew Kelley
6b411f147c std.http: address review comments
thank you everybody
2025-08-07 10:04:52 -07:00