Commit Graph

12877 Commits

Author SHA1 Message Date
Andrew Kelley 83513ade35 std.compress: rework flate to new I/O API 2025-07-31 22:10:11 -07:00
Chinmay Dalal a2d21d6327 enable pwd.h functions for other OSes
also add the layout of `struct passwd` for DragonflyBSD
and FreeBSD:
 - https://github.com/DragonFlyBSD/DragonFlyBSD/blob/c267aac0072dae6cf4ae874605f3f0659a2fc820/include/pwd.h#L112
 - https://cgit.freebsd.org/src/tree/include/pwd.h?id=d66f9c86fa3fd8d8f0a56ea96b03ca11f2fac1fb#n114
2025-08-01 04:34:45 +02:00
Andrew Kelley 0294e91451 std.Io.Reader: fix readVec at end 2025-07-31 19:26:12 -07:00
mlugg ac1e73e249 std.enums: fix EnumIndexer branch quota
It's quite silly to have this override which nonetheless makes
assumptions about the input type. Encode the actual complexity of the
sort.

Also, simplify the sorting logic, and fix a bug (grab min and max
*after* the sort, not *before*!)
2025-07-31 22:10:22 +01:00
Matthew Lugg 04d7b491b4 Merge pull request #24632 from mlugg/lossy-int-to-float-coercion
Sema: compile error on lossy int to float coercion
2025-07-31 21:49:37 +01:00
Alex Rønne Petersen 1804251dfb glibc: update headers to 2.42 2025-07-31 22:02:37 +02:00
Alex Rønne Petersen cdd6e9ee3a glibc: update abilists file to 2.42 2025-07-31 21:47:02 +02:00
Andrew Kelley 982c387753 Merge pull request #24633 from linusg/more-serenity-fixes
std: A few more fixes for serenity
2025-07-31 09:56:26 -07:00
Alex Rønne Petersen 03facba496 std.Target: require libc for Android API levels prior to 29
Emulated TLS depends on libc pthread functions.

Closes #24589.
2025-07-31 17:08:25 +02:00
mlugg 64bf8bb146 std: stop relying on precision-losing coercions 2025-07-31 10:57:04 +01:00
Chinmay Dalal e941ce3e68 add grp.h functions to c.zig 2025-07-30 21:28:42 -07:00
Linus Groh ce776d3245 std: Add serenity to more OS checks 2025-07-30 23:28:58 +01:00
Linus Groh 813a0f125e std.posix: Default ACCMODE to NONE for serenity
Unlike all other platforms where RDONLY is 0 it does not work as a
default for the O flags on serenity - various syscalls other than
'open', e.g. 'pipe', return EINVAL if unexpected bits are set in the
flags.
2025-07-30 23:27:32 +01:00
Linus Groh f5e9384335 std.c: Fix MAP for serenity
I accidentally translated MAP_ constants representing the type as
individual fields. MAP_FILE is for compatibility only and not needed
here.
2025-07-30 23:22:06 +01:00
Linus Groh 467a1f4a1c std.c: Fix msghdr_const for serenity 2025-07-30 23:19:29 +01:00
Loris Cro de23ccfad1 build system: print captured stderr on Run step failure
when a Run step that captures stderr fails, no output from it is visible
by the user and, since the step failed, any downstream step that would
process the captured stream will not run, making it impossible for the
user to see the stderr output from the failed process invocation, which
makes for a frustrating puzzle when this happens in CI.
2025-07-30 22:40:36 +01:00
Alex Rønne Petersen 259b7c3f3f std.Target: pull Os.requiresLibC() up to Target 2025-07-30 18:58:47 +02: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
lumanetic afa66f6111 std.process.Child: fix double path normalization in spawnWindows
besides simply being redundant work, the now removed normalize call would cause
spawn to errantly fail (BadPath) when passing a relative path which traversed
'above' the current working directory. This case is already handled by leaving
normalization to the windows.wToPrefixedFileW call in
windowsCreateProcessPathExt
2025-07-26 01:34:19 -04: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