Commit graph

34040 commits

Author SHA1 Message Date
Andrew Kelley
a98dcbfbb9 std.Io.Writer: fix writeStruct 2025-07-16 13:08:33 -07:00
Silver
d772c06272 fix splatBytesAll and writeSplatAll 2025-07-16 20:37:38 +02:00
DubbleClick
c7bcdb4802 fix glibc version for single_threaded.h (2.32 instead of 2.35) 2025-07-16 19:18:15 +02:00
Alex Kladov
7d63e777a4 fix memory leak
closes #24421
2025-07-16 18:34:34 +02:00
Alex Rønne Petersen
6002514b72
test: mark riscv soft float targets as extra targets
Soft float is a very rare use case for riscv*-linux. No point wasting CI
resources on these targets, especially since our arm and mips soft float
coverage is already likely to catch most soft float bugs.
2025-07-16 16:54:12 +02:00
Alex Rønne Petersen
89ab6b161d
Merge pull request #24470 from alexrp/fix-tools
Fix bitrot in tools
2025-07-16 13:15:35 +02:00
Alex Rønne Petersen
11a49868a1
test: actually build the tools! 2025-07-16 06:38:53 +02:00
Alex Rønne Petersen
2ffa63acef
tools: fix some bitrot 2025-07-16 06:37:48 +02:00
Alex Rønne Petersen
9a69aede0e
ci: add riscv workflow with manual trigger for experimentation 2025-07-16 03:25:10 +02:00
Andrew Kelley
dbe0e0c1bc
Merge pull request #24464 from ziglang/fixes
std.Io fixes, docs, and tests
2025-07-16 02:54:45 +02:00
dweiller
94e0c85b6b update dump-cov for alignment and writergate changes 2025-07-15 23:57:56 +02:00
Andrew Kelley
5f6e3245d1 std.os.windows: restore sendmsg, sendto, recvfrom
These regressed with 1a998886c8

I'm not ready to tackle std.posix quite yet
2025-07-15 14:24:06 -07:00
Andrew Kelley
d4a191fc0a CI: disable RISC-V runners for now
these are taking too long. let's use a different workflow for now until
these runs are not holding up the pipeline, then they can be
reintroduced on master branch
2025-07-15 13:54:12 -07:00
Andrew Kelley
6d39c29564 std.Io.Writer.Allocating: fix sendFile EndOfStream 2025-07-15 11:43:55 -07:00
Andrew Kelley
c7f332a260 std.Io.Writer.Discarding: fix sendFile EndOfStream 2025-07-15 11:32:40 -07:00
Andrew Kelley
f521aa0520 std.io.Reader: add more docs for rebase
closes #24418
2025-07-15 10:04:45 -07:00
Andrew Kelley
0cb558ba3a better default min versions for freebsd and netbsd
Without this change, by default you get a failure when trying to cross
compile for these targets.

freebsd was error: undefined symbol: __libc_start1
netbsd was warning: invalid target NetBSD libc version: 9.4.0
error: unable to build NetBSD libc shared objects: InvalidTargetLibCVersion

now they work by default
2025-07-15 15:32:18 +02:00
Alex Rønne Petersen
9dc4759902 zig std: link ws2_32.dll on windows
Closes #24450.
2025-07-15 13:53:22 +02:00
Andrew Kelley
a5dbb656b1
Merge pull request #24454 from ziglang/packed-struct-streams
std.Io: handle packed structs better
2025-07-15 13:43:08 +02:00
Andrew Kelley
d3cd0b2714
Merge pull request #24448 from matklad/matklad/inline
langref: make example more interesting.
2025-07-15 08:51:56 +02:00
Travis Staloch
294db62d92 memory safety fix for Io.Writer.Allocating.toOwnedSlice*()
don't forget to save the list.  this allows a
`testing.checkAllAllocationFailures()` test to pass in one of my
projects which newly failed since #24329 was merged.
2025-07-15 08:49:54 +02:00
Andrew Kelley
4f5fa959aa std.Io.Reader.streamDelimiterEnding docs clarification 2025-07-14 21:01:40 -07:00
Andrew Kelley
deb9f3e88f std.Io: handle packed structs better
Rather than having the endian-suffixed functions be the preferred ones
the unsuffixed ones are the preferred ones and the tricky functions get
a special suffix.

Makes packed structs read and written the same as integers.

closes #12960
2025-07-14 18:43:56 -07:00
Andrew Kelley
34d7cf075e std.posix: skip flaky test
tracked by #24380
2025-07-14 18:38:50 -07:00
Alex Rønne Petersen
3473e6dc26
ci: skip building and checking stage4 on riscv64-linux 2025-07-15 02:37:26 +02:00
Alex Rønne Petersen
96ad898ab8
ci: skip some test steps on riscv64-linux
Specifically:

* test-fmt
* test-translate-c
* test-run-translated-c
* test-cli
* test-incremental
2025-07-15 02:36:46 +02:00
Alex Rønne Petersen
a885e8370a
ci: partial revert of f3f2a56859
While I experiment with ways to cut down run times, run on master only.
2025-07-15 02:27:58 +02:00
Andrew Kelley
148befdaa3
Merge pull request #24409 from ziglang/net
std.net: update to new I/O API
2025-07-15 01:42:40 +02:00
Alex Rønne Petersen
f3f2a56859 ci: make changes to riscv64-linux to try to avoid timeouts
The idea is to have 2 runners per machine, since a lot of time is spent building
stage3 and stage4, both of which are largely single-core affairs. This will make
the test steps take longer, however, so the timeouts have been bumped a bit, and
max RSS for the test step has been lowered from 64G to 32G to prevent OOM.
Finally, we now only run a single ReleaseSafe job on PRs; Debug and Release jobs
are limited to pushes.
2025-07-15 01:30:46 +02:00
Andrew Kelley
d66f13c90d
Merge pull request #24433 from Justus2308/switch-label-halt
Sema: Fix invalid AIR generation for switch loop with comptime discarded tag
2025-07-14 19:04:19 +02:00
Andrew Kelley
b993728f10 make it a behavior test instead
It's important to check for correct runtime behavior, rather than only
checking that the compiler does not crash.
2025-07-14 10:02:37 -07:00
Justus Klausecker
29ac68b253 Sema: Fix invalid AIR generation for switch loop with comptime discarded tag
Add an additional check before emitting `.loop_switch_br` instead
of `.switch_br` in a tagged switch statement for whether any of the
continues referencing its tag are actually runtime reachable.
This fixes triggering an assertion in Liveness caused by the invalid
assumption that every tagged switch must be a loop if its tag is
referenced in any way even if this reference is not runtime reachable.
2025-07-14 09:59:13 -07:00
Andrew Kelley
e4ebbdb354 std.c: add missing netbsd and freebsd MSG flags 2025-07-14 09:35:38 -07:00
Alex Kladov
d90646d8fb langref: remove dead code 2025-07-14 17:34:52 +01:00
Alex Kladov
96bb1137c2 langref: don't encourage printing to stderr in tests
The rule: `pub fn main` owns file descriptors 0, 1, and 2. If you didn't
write `pub fn main()` it is, in general, not your business to print to
stderr.
2025-07-14 17:32:50 +01:00
Alex Kladov
d045eb7a4a langref: make example more interesting.
As written, I think langref's example is actually a poor reason to use
`inline`.

If you have

     if (foo(1200, 34) != 1234) {
         @compileError("bad");
     }

and you want to make sure that the call is executed at compile time, the
right way to fix it is to add comptime

     if (comptime foo(1200, 34) != 1234) {
         @compileError("bad");
     }

and not to make the function `inline`. I _think_ that inlining functions
just to avoid `comptime` at a call-site is an anti-pattern. When the
reader sees `foo(123)` at the call-site, they _expect_ this to be a
runtime call, as that's the normal rule in Zig.

Inline is still necessary when you can't make the _whole_ call
`comptime`, because it has some runtime effects, but you still want
comptime-known result.

A good example here is

    inline fn findImportPkgHashOrFatal(b: *Build, comptime asking_build_zig: type, comptime dep_name: []const u8) []const u8 {

from Build.zig, where the `b` argument is runtime, and is used for
side-effects, but where the result is comptime.

I don't know of a good small example to demonstrate the subtelty here,
so I went ahead with just adding a runtime print to `foo`. Hopefully
it'll be enough for motivated reader to appreciate the subtelty!
2025-07-14 16:20:33 +01:00
Ali Cheraghi
f43f89a705 spirv: snake-case the spec 2025-07-14 15:16:17 +02:00
Andrew Kelley
2f3cd175d3 compiler: raise the bar for backend contributions 2025-07-14 09:26:24 +02:00
Andrew Kelley
b510482525 std.fs.File.Reader.seekTo: add missing int cast 2025-07-14 00:21:20 -07:00
Andrew Kelley
524e2e19a5 std.Io.Writer.Discarding: fix drain calculation 2025-07-14 00:18:13 -07:00
Andrew Kelley
0c0d94a6da std.net: wasi does not have unix sockets 2025-07-14 00:16:49 -07:00
Andrew Kelley
36f356254c align those @fieldParentPtr casts 2025-07-14 00:16:49 -07:00
Andrew Kelley
890f1fa848 make msghdr.iovlen unsigned
I don't care what C headers say. This value is never supposed to be
negative.
2025-07-14 00:16:49 -07:00
Andrew Kelley
9a1f4cb011 std.net: update to new I/O API 2025-07-14 00:16:49 -07:00
Andrew Kelley
5496901e71 std.Io.Reader.appendRemaining: add missing assert 2025-07-14 00:14:21 -07:00
Andrew Kelley
093fe02b75 add adaptToNewApi to std.Io.Reader as well 2025-07-14 00:14:21 -07:00
Andrew Kelley
96a4e9b866 std.crypto: fix Sha1 namespace 2025-07-14 00:14:21 -07:00
xdBronch
5a8acc9115 fix some llvm ir printer bugs 2025-07-14 08:31:54 +02:00
Brandon Black
e8a4e47d38 Add setsid to std.(c|posix)
The interface and errors for this seem to be very universal and
generic. Note Linux already has this defined as a syscall as well.
2025-07-14 07:26:49 +02:00
Alex Rønne Petersen
c6a18e9534 libcxx: fix building for wasm32-wasi by disabling exceptions
I accidentally regressed this in the LLVM 20 upgrade.

Closes #24437.
2025-07-14 07:12:34 +02:00