Andrew Kelley
e9cb8a777b
Merge remote-tracking branch 'origin/master' into wrangle-writer-buffering
2025-07-15 20:52:56 -07: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 1a998886c863a1829d649f196093f1058cd9cf13
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
87be80f6e9
Merge remote-tracking branch 'origin/master' into wrangle-writer-buffering
2025-07-15 10:05:00 -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
ac8f757cb3
Merge remote-tracking branch 'origin/master' into wrangle-writer-buffering
2025-07-14 23:49:34 -07: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 f3f2a56859f96cee6f9bc8e8fe14b99ec653abaf
...
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
Andrew Kelley
5696bbb307
Merge pull request #23552 from alichraghi
...
Progress towards support for running LLVM backend in a separate thread
2025-07-14 04:19:13 +02:00
Andrew Kelley
a558885321
LLVM backend: fixes
...
* delete dead code
* don't access stack trace too early
* revert unintended edit
2025-07-13 12:16:31 -07:00
Ali Cheraghi
041bcbd109
Do not store StackTrace type
2025-07-13 12:16:31 -07:00
antlilja
e3b79d65d8
LLVM: Move pt field from Object to NavGen
...
* LLVM: Pass correct tid to emit
* Store stack trace type in Zcu
* Don't use pt.errorIntType in LLVM backend
2025-07-13 12:16:17 -07:00
Andrew Kelley
e7b18a7ce6
std.crypto: remove inline from most functions
...
To quote the language reference,
It is generally better to let the compiler decide when to inline a
function, except for these scenarios:
* To change how many stack frames are in the call stack, for debugging
purposes.
* To force comptime-ness of the arguments to propagate to the return
value of the function, as in the above example.
* Real world performance measurements demand it. Don't guess!
Note that inline actually restricts what the compiler is allowed to do.
This can harm binary size, compilation speed, and even runtime
performance.
`zig run lib/std/crypto/benchmark.zig -OReleaseFast`
[-before-] vs {+after+}
md5: [-990-] {+998+} MiB/s
sha1: [-1144-] {+1140+} MiB/s
sha256: [-2267-] {+2275+} MiB/s
sha512: [-762-] {+767+} MiB/s
sha3-256: [-680-] {+683+} MiB/s
sha3-512: [-362-] {+363+} MiB/s
shake-128: [-835-] {+839+} MiB/s
shake-256: [-680-] {+681+} MiB/s
turboshake-128: [-1567-] {+1570+} MiB/s
turboshake-256: [-1276-] {+1282+} MiB/s
blake2s: [-778-] {+789+} MiB/s
blake2b: [-1071-] {+1086+} MiB/s
blake3: [-1148-] {+1137+} MiB/s
ghash: [-10044-] {+10033+} MiB/s
polyval: [-9726-] {+10033+} MiB/s
poly1305: [-2486-] {+2703+} MiB/s
hmac-md5: [-991-] {+998+} MiB/s
hmac-sha1: [-1134-] {+1137+} MiB/s
hmac-sha256: [-2265-] {+2288+} MiB/s
hmac-sha512: [-765-] {+764+} MiB/s
siphash-2-4: [-4410-] {+4438+} MiB/s
siphash-1-3: [-7144-] {+7225+} MiB/s
siphash128-2-4: [-4397-] {+4449+} MiB/s
siphash128-1-3: [-7281-] {+7374+} MiB/s
aegis-128x4 mac: [-73385-] {+74523+} MiB/s
aegis-256x4 mac: [-30160-] {+30539+} MiB/s
aegis-128x2 mac: [-66662-] {+67267+} MiB/s
aegis-256x2 mac: [-16812-] {+16806+} MiB/s
aegis-128l mac: [-33876-] {+34055+} MiB/s
aegis-256 mac: [-8993-] {+9087+} MiB/s
aes-cmac: 2036 MiB/s
x25519: [-20670-] {+16844+} exchanges/s
ed25519: [-29763-] {+29576+} signatures/s
ecdsa-p256: [-4762-] {+4900+} signatures/s
ecdsa-p384: [-1465-] {+1500+} signatures/s
ecdsa-secp256k1: [-5643-] {+5769+} signatures/s
ed25519: [-21926-] {+21721+} verifications/s
ed25519: [-51200-] {+50880+} verifications/s (batch)
chacha20Poly1305: [-1189-] {+1109+} MiB/s
xchacha20Poly1305: [-1196-] {+1107+} MiB/s
xchacha8Poly1305: [-1466-] {+1555+} MiB/s
xsalsa20Poly1305: [-660-] {+620+} MiB/s
aegis-128x4: [-76389-] {+78181+} MiB/s
aegis-128x2: [-53946-] {+53495+} MiB/s
aegis-128l: [-27219-] {+25621+} MiB/s
aegis-256x4: [-49351-] {+49542+} MiB/s
aegis-256x2: [-32390-] {+32366+} MiB/s
aegis-256: [-8881-] {+8944+} MiB/s
aes128-gcm: [-6095-] {+6205+} MiB/s
aes256-gcm: [-5306-] {+5427+} MiB/s
aes128-ocb: [-8529-] {+13974+} MiB/s
aes256-ocb: [-7241-] {+9442+} MiB/s
isapa128a: [-204-] {+214+} MiB/s
aes128-single: [-133857882-] {+134170944+} ops/s
aes256-single: [-96306962-] {+96408639+} ops/s
aes128-8: [-1083210101-] {+1073727253+} ops/s
aes256-8: [-762042466-] {+767091778+} ops/s
bcrypt: 0.009 s/ops
scrypt: [-0.018-] {+0.017+} s/ops
argon2: [-0.037-] {+0.060+} s/ops
kyber512d00: [-206057-] {+205779+} encaps/s
kyber768d00: [-156074-] {+150711+} encaps/s
kyber1024d00: [-116626-] {+115469+} encaps/s
kyber512d00: [-181149-] {+182046+} decaps/s
kyber768d00: [-136965-] {+135676+} decaps/s
kyber1024d00: [-101307-] {+100643+} decaps/s
kyber512d00: [-123624-] {+123375+} keygen/s
kyber768d00: [-69465-] {+70828+} keygen/s
kyber1024d00: [-43117-] {+43208+} keygen/s
2025-07-13 18:26:13 +02:00