Commit Graph

36606 Commits

Author SHA1 Message Date
Ryan Liptak 858716aa4d resinator: a few more updates/fixes
Just enough to get things working correctly again
2025-08-07 10:04:52 -07:00
Andrew Kelley 5a743be6b4 resinator: just enough fixes to make it compile 2025-08-07 10:04:52 -07:00
Andrew Kelley 262bfc5826 std.Io: delete LimitedReader 2025-08-07 10:04:52 -07:00
Andrew Kelley e061445fc2 std.Io: delete BufferedReader 2025-08-07 10:04:52 -07:00
Andrew Kelley 366884ab06 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-07 10:04:52 -07:00
Andrew Kelley 3f8ed5504e std.net: fix windows build 2025-08-07 10:04:52 -07:00
Andrew Kelley 3837862e52 fix 32-bit builds 2025-08-07 10:04:52 -07:00
Andrew Kelley abd76938cb std.Io.Reader: fix appendRemainingUnlimited
Now it avoids mutating `r` unnecessarily, allowing the `ending` Reader
to work.
2025-08-07 10:04:52 -07:00
Andrew Kelley 9e5048c3a5 fetch: update for new http API
it's not quite finished because I need to make it not copy the Resource
2025-08-07 10:04:51 -07:00
Andrew Kelley fef41c66db update build system to new http.Server API 2025-08-07 10:04:29 -07:00
Andrew Kelley e2d81bf6c0 http fixes 2025-08-07 10:04:29 -07:00
Andrew Kelley 28190cc404 std.crypto.tls: rework for new std.Io API 2025-08-07 10:04:29 -07:00
Andrew Kelley 02908a2d8c std.http: rework for new std.Io API 2025-08-07 10:04:28 -07:00
Alex Rønne Petersen 8843631f7e Merge pull request #24709 from rootbeer/24380-fstatat-race-fix 2025-08-07 16:36:52 +02:00
Meghan Denny 63c5329156 std: fix std.c._msize signature 2025-08-07 16:02:52 +02:00
Justus Klausecker aaee26bb19 remove unnecessary discard 2025-08-07 14:34:05 +02:00
Justus Klausecker 0ecbd5a0e1 address comments 2025-08-07 13:58:49 +02:00
Justus Klausecker ba549a7d67 Add support for both '_' and 'else' prongs at the same time in switch statements
If both are used, 'else' handles named members and '_' handles
unnamed members. In this case the 'else' prong will be unrolled
to an explicit case containing all remaining named values.
2025-08-07 13:58:47 +02:00
Justus Klausecker 1d9b1c0212 Permit explicit tags with '_' switch prong
Mainly affects ZIR representation of switch_block[_ref]
and special prong (detection) logic for switch.
Adds a new SpecialProng tag 'absorbing_under' that allows
specifying additional explicit tags in a '_' prong which
are respected when checking that every value is handled
during semantic analysis but are not transformed into AIR
and instead 'absorbed' by the '_' branch.
2025-08-07 13:57:57 +02:00
Matthew Lugg fd9cfc39f5 Merge pull request #24199 from Justus2308/24106-fmt-casts
zig fmt: canonicalize nested cast builtin order
2025-08-07 10:55:03 +01:00
Pat Tullmann cf47d283d1 lib/std/posix/test.zig: don't compare blksize in "fstatat"
In trying to reproduce the race in #24380, my system tripped over the stat
"blocks" field changing in this test.  The value was almost always 8
(effectively 4k) or very infrequently 0 (I saw the 0 from both `fstat` and
`fstatat`).  I believe the underlying filesystem is free to asynchronously
change this value. For example, if it migrates a file between some
"inline" or maybe journal storage, and actual on-disk blocks.  So it seems
plausible that its allowed to change between stat calls.

Breaking up the struct comparison this way means we also don't compare any
of the padding or "reserved" fields, too.  And we can narrow down the
s390x-linux work-around.
2025-08-06 22:12:42 -07:00
Pat Tullmann caf80e90b8 linux/mips.zig: Use i32 for stat nsec fields
The `atime()`, etc wrappers here expect to create a `std.linux.timespec`
(defined in `linux.zig` to have `isize` fields), so the u32 causes errors:

   error: expected type 'isize', found 'u32'
   .nsec = self.atim_nsec,

Make the nsec fields signed for consistency with all the other structs,
with and with `std.linux.timespec`.

Also looks like the comment on `__pad1` was copied from `__pad0`, but it
only applies to `__pad0`.
2025-08-06 22:12:41 -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 b461d07a54.

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
Ali Cheraghi cd4b03c5ed spirv: define and use extended instruction set opcodes 2025-08-04 07:05:00 +03:30
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 fa445d86a1.

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