Commit graph

12461 commits

Author SHA1 Message Date
Andrew Kelley
8703053296 std.crypto: support for hashes without options 2025-07-30 17:22:42 -07:00
Andrew Kelley
18bc688471 std.crypto.Sha1: make it a Writer 2025-07-30 16:23:22 -07:00
Andrew Kelley
cf7a28febb std.Io.Reader: introduce readVec back into the VTable
simplifies and fixes things

addresses a subset of #24608
2025-07-30 09:26:34 -07:00
Kurt Wagner
135a34c963 Update doc comment for ptr_type and ptr_type_bit_range to data of .extra_and_node
The other pointer types are `.opt_node_and_node` but `ptr_type` and `ptr_type_bit_range` contain `.extra_and_node` in their `data` field
2025-07-30 10:02:41 +01:00
Andrew Kelley
1fcaf90dd3 std.Io.Reader: make fillUnbuffered respect prexisting buffer
addresses only one usage pattern in #24608
2025-07-29 23:10:50 -07:00
mlugg
08f1d63be1
disable more failing tests
Wow, *lots* of backends were reliant on Sema doing the heavy lifting for
them. CBE, Wasm, and SPIR-V have all regressed in places now that they
actually need to, like, initialize unions and such.
2025-07-29 22:44:01 +01:00
Kendall Condon
ecd3ea9bd2 DeprecatedReader.Adapted: fix EndOfStream handling 2025-07-28 21:41:19 -07:00
Jacob Young
c334956a54 aarch64: workaround some optional/union issues 2025-07-28 09:03:17 -07:00
Andrew Kelley
bb29846732 std.compress.xz: eliminate dependency on std.Io.bitReader 2025-07-27 22:08:52 -07:00
Andrew Kelley
da408bd6fc
Merge pull request #24585 from jacobly0/aarch64
aarch64: more progress
2025-07-27 00:17:19 -07:00
A cursed quail
e12dc4947c std.zig: fmtId returns a FormatId
Changes fmtId to return the FormatId type directly, and renames the
FormatId.render function to FormatId.format, so it can be used in a
format expression directly.

Why? Since `render` is private, you can't create functions that wrap
`fmtId` or `fmtIdFlags`, since you can't name the return type of those
functions outside of std itself.

The current setup _might_ be intentional? In which case I can live with
it, but I figured I'd make a small contrib to upstream zig :)
2025-07-26 21:53:23 -07:00
Andrew Kelley
04614d6ea1 std.Io.Reader: add rebase to the vtable
This eliminates a footgun and special case handling with fixed buffers,
as well as allowing decompression streams to keep a window in the output
buffer.
2025-07-26 20:00:25 -07:00
Jacob Young
7894703ee7 aarch64: implement more optional/error union/union support 2025-07-26 21:39:50 -04:00
Carl Åstholm
413179ccfc std.Build: Deprecate Step.Compile APIs that mutate the root module
Not only are `Step.Compile` methods like `linkLibC()` redundant because
`Module` exposes the same APIs, it also might not be immediately obvious
to users that these methods modify the underlying root module, which can
be a footgun and lead to unintended results if the module is exported to
package consumers or shared by multiple compile steps.

Using `compile.root_module.link_libc = true` makes it more clear to
users which of the compile step and the module owns which options.
2025-07-26 12:06:42 +02:00
Andrew Kelley
fc4b7c968a
Merge pull request #24564 from ziglang/terminal-progress-bar
std.Progress: support progress bar escape codes
2025-07-25 21:49:25 -07:00
Andrew Kelley
66e49d93b7
Merge pull request #24559 from ziglang/zstd
std: rework zstd for new I/O API
2025-07-25 20:02:53 -07:00
Andrew Kelley
9e11727c7c
Merge pull request #23340 from castholm/pass-null-to-b-dependency
Add support for passing null, string literals, enum lists and more to `b.dependency()`
2025-07-25 18:00:46 -07:00
Andrew Kelley
b22b9ebfe0 std.Progress: introduce Status 2025-07-25 17:33:11 -07:00
Andrew Kelley
799206a3ad std.Progress: support progress bar escape codes 2025-07-25 16:00:19 -07:00
Andrew Kelley
733b208256 std.posix.ftruncate: handle NonResizable properly 2025-07-25 14:15:33 -07:00
Andrew Kelley
8752d80c84 std.compress.zstd.Decompress: fix bytes_written tracking 2025-07-25 14:15:33 -07:00
Andrew Kelley
da51e94d50 std.fs.File.end: account for streaming mode 2025-07-25 14:15:33 -07:00
Andrew Kelley
7f43f78b5b std.compress.zstd: keep frame state between blocks 2025-07-25 14:15:33 -07:00
Andrew Kelley
13e08ea6f0 std.compress.zstd: fix endianness issue
instead of manually bitcast, use the handy dandy takeStruct function.
2025-07-25 14:15:33 -07:00
Andrew Kelley
ee4f5b3f92 std.compress.zstd: respect the window length 2025-07-25 14:15:33 -07:00
Andrew Kelley
7f1c04423e std.Io: add "preserve" variants to Reader/Writer 2025-07-25 14:15:33 -07:00
Andrew Kelley
3687eada6a std: rework zstd for new I/O API
This passes tests but it doesn't provide as big a window size as is
required to decompress larger streams.

The next commit in this branch will work towards that, without
introducing an additional buffer.
2025-07-25 14:15:33 -07:00
mlugg
bb71a18ede init: replace '--strip' with '--minimal'
This option never worked properly (it emitted wrongly-formatted code),
and it doesn't seem particularly *useful* -- someone who's proficient
enough with `std.Build` to not need explanations probably just wants to
write their own thing. Meanwhile, the use case of writing your own
`build.zig` was extremely poorly served, because `build.zig.zon` *needs*
to be generated programmatically for a correct `fingerprint`, but the
only ways to do that were to a) do it wrong and get an error, or b) get
the full init template and delete the vast majority of it. Both of these
were pretty clunky, and `-s` didn't really help.

So, replace this flag with a new one, `--minimal`/`-m`, which uses a
different template. This template is trivial enough that I opted to just
hardcode it into the compiler for simplicity. The main job of
`zig init -m` is to generate a correct `build.zig.zon` (if it is unable
to do this, it exits with a fatal error). In addition, it will *attempt*
to generate a tiny stub `build.zig`, with only an `std` import and an
empty `pub fn build`. However, if `build.zig` already exists, it will
avoid overwriting it, and doesn't even complain. This serves the use
case of writing `build.zig` manually and *then* running `zig init -m`
to generate an appropriate `build.zig.zon`.
2025-07-25 16:24:02 +01:00
Ian Johnson
f0fec952d2 zig std: fix sources.tar generation
Analogous to #24576 for `-femit-docs`
2025-07-24 19:44:19 -07:00
Andrew Kelley
a189335ea2 zig std: update std.Io.poll API usage
fixes FTBFS
2025-07-24 19:15:40 -07:00
Andrew Kelley
4236ca40cd
Merge pull request #24561 from linusg/serenity-fixes
Small fixes for SerenityOS
2025-07-23 23:04:52 -07:00
Andrew Kelley
b8955a2e0a std.Io.poll: update to new I/O API 2025-07-23 21:25:34 -07:00
Linus Groh
26bd74e87f std.posix: Fix ACCMODE values for serenity 2025-07-24 00:54:40 +01:00
Linus Groh
ea90ec4d88 std.c: Fix dirent.name size for serenity
The null terminator is added to the buffer size.
2025-07-24 00:24:55 +01:00
Andrew Kelley
bc8e1a74c5
Merge pull request #24523 from ziglang/fifno
std.tar: update to new I/O API
2025-07-23 10:02:52 +02:00
Jacob Young
5060ab99c9 aarch64: add new from scratch self-hosted backend 2025-07-22 19:43:47 -07:00
Andrew Kelley
4fcb479de9 don't forget to advance in the deprecated adapter 2025-07-22 18:42:54 -07:00
Andrew Kelley
6038192fad std.tar: delete function redundant with std.mem 2025-07-22 17:40:12 -07:00
Andrew Kelley
2e8dbcac9a zig std: update for new tar I/O API 2025-07-22 17:07:19 -07:00
Andrew Kelley
11a81bc659 std.tar.Writer: delete ill-advised API
dependency on time is sus
2025-07-22 17:07:03 -07:00
Andrew Kelley
ec5cdb2fe3 std: fix deprecated writer not handling the buffer 2025-07-22 17:06:25 -07:00
Andrew Kelley
91640f5f81 give the Reader API adapter a buffer
it needs one or else it always asserts
2025-07-22 09:41:44 -07:00
Andrew Kelley
6ae1bcd8bd fix docs wasm std.tar API usage 2025-07-22 09:41:44 -07:00
Andrew Kelley
cc334b4ee2 std.tar.Writer: fix 32-bit 2025-07-22 09:41:44 -07:00
Andrew Kelley
1dcea220a4 std.tar: update to new I/O API 2025-07-22 09:41:44 -07:00
Andrew Kelley
2ac81c76e3 std.Io: add deprecation warnings 2025-07-22 09:41:43 -07:00
Andrew Kelley
af0a02a2de std.Io: delete FindByteWriter
dead
2025-07-22 09:41:43 -07:00
Andrew Kelley
03a6892189 std.Io: delete ChangeDetectionStream
dead code
2025-07-22 09:41:43 -07:00
Andrew Kelley
d9a5a3e8c5 std.Io: delete MultiWriter
nah
2025-07-22 09:41:43 -07:00
Andrew Kelley
abed0f5129 std.Io: delete BufferedAtomicFile
this is now redundant
2025-07-22 09:41:43 -07:00