Commit graph

346 commits

Author SHA1 Message Date
Benjamin Jurk
4b5351bc0d
update deprecated ArrayListUnmanaged usage (#25958) 2025-11-20 14:46:23 -08:00
Matthew Lugg
8a73fc8d8e
Merge pull request #25981 from mlugg/macos-fuzz-2
make the fuzzer vaguely work on macOS
2025-11-20 17:48:35 +00:00
Andrew Kelley
a9568ed296
Merge pull request #25898 from jacobly0/elfv2-progress
Elf2: more progress
2025-11-20 04:33:04 -08:00
Matthew Lugg
a87b533231
std.Io.Writer: fix some bugs 2025-11-20 10:42:21 +00:00
Alex Rønne Petersen
5078acf3a3
std.Io.net: disable listen on a unix socket, send bytes, receive bytes on Windows
https://github.com/ziglang/zig/issues/25983
2025-11-19 21:51:57 +01:00
Jan200101
bd832ed39a std.Io.Threaded: add missing statx masks
statx does not guarantee that the values requested by the mask be
present and those not requested be absent which is why this worked.
2025-11-19 20:13:25 +01:00
Matthew Lugg
c6b5945356 std.Build: don't force all children to inherit color option
The build runner was previously forcing child processes to have their
stderr colorization match the build runner by setting `CLICOLOR_FORCE`
or `NO_COLOR`. This is a nice idea in some cases---for instance a simple
`Run` step which we just expect to exit with code 0 and whose stderr is
not being programmatically inspected---but is a bad idea in others, for
instance if there is a check on stderr or if stderr is captured, in
which case forcing color on the child could cause checks to fail.

Instead, this commit adds a field to `std.Build.Step.Run` which
specifies a behavior for the build runner to employ in terms of
assigning the `CLICOLOR_FORCE` and `NO_COLOR` environment variables. The
default behavior is to set `CLICOLOR_FORCE` if the build runner's output
is colorized and the step's stderr is not captured, and to set
`NO_COLOR` otherwise. Alternatively, colors can be always enabled,
always disabled, always match the build runner, or the environment
variables can be left untouched so they can be manually controlled
through `env_map`.

Notably, this fixes a failure when running `zig build test-cli` in a
TTY (or with colors explicitly enabled). GitHub CI hadn't caught this
because it does not request color, but Codeberg CI now does, and we were
seeing a failure in the `zig init` test because the actual output had
color escape codes in it due to 6d280dc.
2025-11-14 21:50:24 +01:00
Alex Rønne Petersen
9ab7eec23e represent Mac Catalyst as aarch64-maccatalyst-none rather than aarch64-ios-macabi
Apple's own headers and tbd files prefer to think of Mac Catalyst as a distinct
OS target. Earlier, when DriverKit support was added to LLVM, it was represented
a distinct OS. So why Apple decided to only represent Mac Catalyst as an ABI in
the target triple is beyond me. But this isn't the first time they've ignored
established target triple norms (see: armv7k and aarch64_32) and it probably
won't be the last.

While doing this, I also audited all Darwin OS prongs throughout the codebase
and made sure they cover all the tags.
2025-11-14 11:33:35 +01:00
0x4a61636f62
2e6f7d36b9 std.Io.net: fix off-by-one in HostName.expand
`HostName.expand` was including the null terminator in the slice passed to `HostName.init`, which caused `HostName.validate` to fail.
2025-11-13 21:04:21 -08:00
Jacob Young
8647e4d311 aarch64: cleanup register lock 2025-11-11 01:47:27 -05:00
Techatrix
8887346b53 std.Io: fix calls on functions that return an array type 2025-11-11 01:11:51 +01:00
Carl Åstholm
cca2d09950 io: Correctly align async closure contexts
This fixes package fetching on Windows.

Previously, `Async/GroupClosure` allocations were only aligned for the
closure struct type, which resulted in panics when `context_alignment`
(or `result_alignment` for that matter) had a greater alignment.
2025-11-11 01:11:45 +01:00
Carl Åstholm
ed7f2588e4 io: Translate Windows Clock.real timestamps to the POSIX/Unix epoch
This fixes `std.http.Client` TLS certificate validation on Windows.
2025-11-10 22:12:39 +01:00
Matthew Lugg
966809862f
Merge pull request #25839 from Rexicon226/socket-bind-fix
Io.net: fix compile error in `receive` and `receiveTimeout`
2025-11-10 14:38:54 +00:00
Petr Pučil
38d44404a5 Fix param name in doc comment for std.Io.Reader.peek()
The old doc comment mentioned a parameter `len` three times, but the
function does not accept such a parameter - it is actually called `n`.
2025-11-08 00:34:41 -08:00
David Rubin
71988d6719
Io.net: set receive{,Timeout} message to init
If we use `undefined`, then `netReceive` can `@intCast` the
control slice len to msghdr controllen, which is sometimes `u32`,
even on 64-bit platforms.

`init` just avoids this entirely by setting `control` to an empty
slice rather than undefined.
2025-11-06 17:44:28 -08:00
David Rubin
654a5b20d7
Io: fix compile error in receive and receiveTimeout
Correctly uses the `netReceive` API. If an error was
returned, we propagate that error, otherwise assert
we only received one message.
2025-11-06 17:42:19 -08:00
snoire
ffb0050d81 std.Io.Writer.print: support .enum_literal in 't' format specifier 2025-11-06 13:45:21 +08:00
Jacob Young
ea76946d2a Io.Queue: fix empty and full states being indistinguishable. 2025-11-04 04:24:32 -05:00
Linus Groh
afdd04356c std: serenity has preadv now
2a9154e77c
2025-11-02 14:45:32 -08:00
Alex Rønne Petersen
5db9eaa851
std.Io.Threaded: use ResetEventPosix on illumos
Like NetBSD, illumos has no futexes.

ref #25760
2025-11-01 16:18:56 +01:00
Jacob Young
5b060ef9d4
Merge pull request #25558 from jacobly0/elfv2-load-obj
Elf2: start implementing input object loading
2025-10-30 12:09:13 -04:00
John Benediktsson
74c23a237e
Merge pull request #25763 from mrjbq7/cancelled
rename Cancelled to Canceled
2025-10-30 04:40:13 +00:00
Jacob Young
1d80c9540a Threaded: fix safety crashes 2025-10-29 21:01:47 -04:00
Jacob Young
c4478e078b Elf2: load archives 2025-10-29 18:07:12 -04:00
Andrew Kelley
e8e1e2793a std.Io: make select unit test not depend on cancellation 2025-10-29 06:26:05 -07:00
Andrew Kelley
05b28409e7 std.Io.Threaded: install and cleanup signal handlers
rather than in start code. delete std.options.keep_sig_io and
std.options.keep_sig_pipe
2025-10-29 06:20:52 -07:00
Andrew Kelley
b863f2548b std.Io.Threaded: handle -fsingle-threaded in unit tests 2025-10-29 06:20:52 -07:00
Andrew Kelley
a45cafb7f0 std.Io: add unit test for select 2025-10-29 06:20:52 -07:00
Andrew Kelley
c40204a3e5 std.Io: add unit tests for Group and concurrent 2025-10-29 06:20:52 -07:00
Andrew Kelley
03fd132b1c std.Io: fix Group.wait unsoundness
Previously if a Group.wait was canceled, then a subsequent call to
wait() or cancel() would trip an assertion in the synchronization code.
2025-10-29 06:20:52 -07:00
Andrew Kelley
6c794ce7bc std.Io.Threaded.dirOpenFileWtf16: SHARING_VIOLATION
is the error code that needs the kernel bug workaround, not
ACCESS_DENIED.
2025-10-29 06:20:52 -07:00
Andrew Kelley
6f64c8b693 std.debug.SelfInfo.Windows: less invasive change
restores code closer to master branch in hopes of avoiding a regression
that was introduced when this was based on openSelfExe rather than
GetModuleFileNameExW.
2025-10-29 06:20:52 -07:00
Andrew Kelley
030b630829 std.Io.Threaded: fix EBADF error code on wasm32-wasi -lc when reading 2025-10-29 06:20:52 -07:00
Andrew Kelley
c4dc7d7c3d std.Io.Threaded: implement Unix sockets for Windows 2025-10-29 06:20:52 -07:00
Andrew Kelley
b39f3d294d std.Io.Threaded: implement dirMakeOpenPath for WASI
and fix error code when file operation occurs on director handle
2025-10-29 06:20:52 -07:00
Andrew Kelley
4114392369 std: fix definition of ws2_32.GetAddrInfoExW
There was a missing parameter.
2025-10-29 06:20:52 -07:00
Andrew Kelley
f5870b267e std.Io.Threaded: fix typo in panic message 2025-10-29 06:20:52 -07:00
Andrew Kelley
94b9874981 std.Io.Threaded: stub out netbsd mutex and condition 2025-10-29 06:20:52 -07:00
Andrew Kelley
a28d3059e6 std.Io.Threaded: implement ResetEvent in terms of pthreads
needed for NetBSD
2025-10-29 06:20:52 -07:00
Andrew Kelley
30448d92af std.Io.Threaded: fix netLookup for Windows
* respect address family option
* fix port number using wrong buffer
2025-10-29 06:20:52 -07:00
Andrew Kelley
135ec79f50 std.Io.File: fix stat for Windows 2025-10-29 06:20:51 -07:00
Andrew Kelley
cc4931b325 std.Io.Threaded: fix 32-bit overflow in lookupDns
be a little more careful with nanoseconds
2025-10-29 06:20:51 -07:00
Andrew Kelley
3de1b6c9a9 std.Io.Threaded: better clock lowering for BSDs 2025-10-29 06:20:51 -07:00
Andrew Kelley
8b269f7e18 std: make signal numbers into an enum
fixes start logic for checking whether IO/POLL exist
2025-10-29 06:20:51 -07:00
Andrew Kelley
cc751c01f1 std.Io.Threaded: correct clockToPosix for FreeBSD 2025-10-29 06:20:51 -07:00
Andrew Kelley
4e95c2eb1b std.Io.Threaded: implement futexes for freebsd 2025-10-29 06:20:51 -07:00
Andrew Kelley
0caf286a1a std.Io.Threaded: don't skip executing canceled group closures 2025-10-29 06:20:51 -07:00
Andrew Kelley
df4c30ca16 link: move the windows kernel bug workaround to Io implementation 2025-10-29 06:20:51 -07:00
Andrew Kelley
6ccb53bff1 std.Io.Threaded: fix openSelfExe for Windows
missing a call to wToPrefixedFileW
2025-10-29 06:20:51 -07:00