Commit Graph
686 Commits
Author SHA1 Message Date
Ryan Liptak 55d429e0ba Threaded.fileStatWindows: disambiguate between files and named pipes 2026-10-09 23:35:36 -07:00
Alex Rønne Petersen 5e754304de remove support for wasi-libc
closes https://github.com/ziglang/zig/issues/9342
closes https://github.com/ziglang/zig/issues/15005
closes https://github.com/ziglang/zig/issues/20747
closes https://github.com/ziglang/zig/issues/22570
closes https://codeberg.org/ziglang/zig/issues/30977
2026-10-04 18:23:18 +02:00
Jacob Young 2cdf284af9 Threaded: implement new process spawning API for windows 2026-09-26 19:08:50 -04:00
K4 d08989840e std.fs.path: update doc comment for extension
resolves https://github.com/ziglang/zig/issues/20347
2026-09-13 10:35:46 +03:00
Andrew Kelley 9db2a97c0d std.fs.path: append variants for resolve and relative
* introduce resolveAppend variants
* introduce relativeAppend variants
* deprecated resolve in favor of resolveAlloc
* deprecated relative in favor of relativeAlloc
* flesh out the documentation more
* rewrite alloc variants in terms of append variants
2026-09-08 20:45:22 +02:00
Krzysztof Wolicki 36dd7e9c37 Change usages of fmt.bufPrint* to mem.print* (#36263)
This PR doesn't touch usages inside `lib/compiler/aro`

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36263
Reviewed-by: Ryan Liptak <squeek502@noreply.codeberg.org>
2026-09-01 02:21:28 +02:00
Andrew Kelley 73b010e221 Merge pull request 'make frontend and build system more resistant to absolute paths' (#36548) from absolutely-not into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36548
Reviewed-by: mlugg <mlugg@mlugg.co.uk>
2026-08-20 11:25:43 +02:00
Ryan Liptak efd227eca2 File.Reader.seekBy: Fix erroneously tossing the buffer in streaming mode
The discard already handles updating the state, so the toss was redundant in the best case and would erroneously drop data in the worst case.

Closes #36568
2026-08-20 08:29:34 +02:00
Andrew Kelley 414641eb95 std.fs.path.resolvePosix: avoid deprecated managed array list API 2026-08-19 12:39:36 -07:00
Alex Rønne Petersen 8e741045bc std.fs.test: disable deleteDir on Windows due to flakiness
https://codeberg.org/ziglang/zig/issues/35686
2026-08-09 00:04:02 +02:00
Daniel Kareh 03ab508214 std.Io.Dir.path: make the behavior of stem match its documentation 2026-08-04 19:12:22 -07:00
Krzysztof Wolicki ab4028d579 Update usages of most deprecated APIs
In particular renames of `std.mem.indexOf` family to `std.mem.find`
and generic unmanaged containers
2026-08-05 03:40:30 +02:00
Jacob Young 865f329e4f cbe: update for compiler_rt abi changes
* `tools/generate_c_size_and_align_checks.zig`: superceded by any cbe
   output artifact
 * `cTypePreferredAlignment`: no uses, if brought back, cbe should be
   updated to verify `__alignof`

Closes #19991
Closes #20881
Closes #35523
2026-07-27 14:35:12 -04:00
Ryan Liptak aad9870a28 Io.Threaded: Decouple follow_symlinks and asynchronous IO on Windows
The logic around follow_symlinks and asynchronous IO was first introduced in 66bbe4ec4c, and then cemented in 390194431e with the added comment:

> If we're not following symlinks, we need to ensure we don't pass in any synchronization flags such as FILE_SYNCHRONOUS_IO_NONALERT.

As far as I can tell, this comment is erroneous. There is no documented incompatibility between OPEN_REPARSE_POINT and SYNCHRONOUS_IO_NONALERT, and empirically everything works fine when using SYNCHRONOUS_IO_NONALERT. In fact, in 68ed787751 the ReadLink implementation (a main usage of OPEN_REPARSE_POINT) was specifically switched to *not* use asynchronous IO (although that was effectively reverted during the move to std.Io).

This also fixes a bug with `.follow_symlinks = false` since, before this commit, the returned File would always have `.nonblocking = false` even though that was not correct when `.follow_symlinks` was false.
2026-07-22 20:12:57 +02:00
EJ c11d6e716d std.Io.Dir: support renamePreserve on Darwin systems (#35358)
Related to #35340.

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35358
2026-06-12 23:30:44 +02:00
Alex Rønne Petersen 21b7ceb5e5 std.fs.test: disable Dir.renamePreserve onto existing test on Windows
https://codeberg.org/ziglang/zig/issues/35359
2026-05-19 20:11:28 +02:00
EJ 5b647b792c std.Io.Dir: doc comment for renamePreserve and tests (#35317)
Right now the comment specifies what will happen when "renaming a file _over_ ... or a directory _over_...". But the whole point of `renamePreserve` is not writing over anything.

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35317
Reviewed-by: Ryan Liptak <squeek502@noreply.codeberg.org>
2026-05-19 03:12:32 +02:00
Linus Groh fcc0a5a913 std.mem.Allocator: Remove dupeZ() in favor of dupeSentinel() 2026-05-03 21:42:16 +01:00
Matthew Lugg fdac89d6cd remove uses of array multiplication
In preparation for its removal as accepted in
https://github.com/ziglang/zig/issues/24738.
2026-04-30 08:57:51 +01:00
GasInfinity 1deb029a66 std: rename bit_set variants and deprecate the managed one.
* aliases and deprecates the previous names.
* also update callsites to use the non-deprecated declarations.
2026-04-27 16:46:26 +02:00
Mason Remaley e2c3920fb1 Renames buffer first allocator in compiler and std 2026-04-18 14:51:49 -07:00
Mason Remaley 8c96487bb9 Updates all uses of StackFallbackAllocator 2026-04-18 14:51:49 -07:00
Andrew Kelley bd05d13d5f std: make file locking tests use io not threads
This will allow the tests to also run in single-threaded evented mode.
2026-04-01 02:54:25 -07:00
Alex Rønne Petersen f40eb50157 std.fs.test: disable '.' and '..' in Dir functions test on *-windows
https://codeberg.org/ziglang/zig/issues/31561
2026-03-27 02:24:23 +01:00
Alex Rønne Petersen 36b28050f4 std.fs.test: disable AtomicFile test on windows
https://codeberg.org/ziglang/zig/issues/31389
2026-03-27 02:24:21 +01:00
Matthew Lugg 64f1c27332 compiler,std: fix never-mutated local variables 2026-03-15 18:22:13 +00:00
samy007 a5dd6444c3 Add test for calling statFile on a symlink 2026-03-10 00:10:49 -07:00
DivergentClouds 416ef983c4 add test for Lock.none 2026-03-10 00:10:48 -07:00
Andrew Kelley b191e50be5 std.Thread: remove ResetEvent and WaitGroup
* std.Thread.ResetEvent -> Io.Event
* std.Thread.WaitGroup -> Io.Group
2026-02-02 00:09:48 -08:00
Andrew Kelley b1d1806fef std.process: currentDir -> currentPath
In Zig standard library, Dir means an open directory handle. path
represents a file system identifier string. This function is better
named after "current path" than "current dir". "get" and "working" are
superfluous.
2026-01-29 18:47:58 -08:00
Andrew Kelley 649aaf4814 std: migrate getcwd to Io
progress towards #30150
2026-01-29 18:40:55 -08:00
Alex Rønne Petersen 9f33c339c7 std.fs.test: fix file operations on directories on NetBSD
As noted earlier in this test, reading directories does not fail on NetBSD.
2026-01-21 16:42:02 +01:00
Alex Rønne Petersen a3ea3bd31d std: NetBSD doesn't have a reliable F_GETPATH
It can fail arbitrarily with ENOENT if the kernel happens to not have the FD in
its name cache. That makes it useless for our purposes.

closes https://codeberg.org/ziglang/zig/issues/30843
2026-01-21 16:41:51 +01:00
Michael Dusan 32f977a4b7 std.fs.test: fix tests using Dir.realPath
* add fn isRealPathSupported
* incorporate into tests that depends on Dir.realPath
2026-01-21 16:41:37 +01:00
Andrew Kelley c4df980ac2 std.fs: fix test cases regarding error.IsDir on WASI
why were we testing for shitty behavior?
2026-01-15 14:18:20 -08:00
Ryan Liptak 4cf7dc22fa Expand the errors that act as "sym links can't be created" on Windows
Previously, the errors that are now mapped to AccessDenied, PermissionDenied, and FileSystem were all mapped to AccessDenied.
2026-01-11 02:08:18 -08:00
Ryan Liptak b4831403c9 fileRead functions: handle INVALID_FUNCTION on Windows and map it to error.IsDir
INVALID_FUNCTION may be possible in other scenarios as well, but it is verifiably returned when the handle refers to a directory.
2026-01-11 02:08:18 -08:00
Alex Rønne Petersen d1be8b138e Merge pull request 'enable x86_64-openbsd CI' (#30733) from alexrp/zig:openbsd-ci into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30733
2026-01-08 12:35:11 +01:00
Andrew Kelley 7248b4a4e4 std.fs: deprecate base64 APIs
100% of std.fs is now deprecated.
2026-01-07 17:33:06 -08:00
Andrew Kelley c44e12dcd3 std: find a better home for the "preopens" concept 2026-01-07 17:33:06 -08:00
Andrew Kelley ee574f665c std.Io.Dir: introduce renamePreserve and use it in File.Atomic.link
breaking change: the error for renaming over a non-empty directory now
returns error.DirNotEmpty rather than error.PathAlreadyExists.
2026-01-07 11:03:37 -08:00
Andrew Kelley 1eddc1737c std: add test coverage for Io.File.Atomic.link 2026-01-07 11:03:37 -08:00
Andrew Kelley 1f1381a866 update API usage of std.crypto.random to io.random 2026-01-07 11:03:36 -08:00
Alex Rønne Petersen 9db475de70 std.fs.test: skip executablePath and openExecutable on OpenBSD
processExecutablePath() is unsupported.
2026-01-07 05:06:12 +01:00
Andrew Kelley 4365b0df88 std.Io.Threaded: add File.hardLink 2026-01-05 20:28:58 -08:00
Andrew Kelley 1070c2a71a rename env_map to environ_map
For naming consistency with `std.process.Environ.Map`.
2026-01-04 00:27:09 -08:00
Andrew Kelley 60447ea97c std: fix windows compilation errors 2026-01-04 00:27:08 -08:00
Andrew Kelley 08447ca47e std.fs.path: make relative a pure function
Instead of querying the operating system for current working directory
and environment variables, this function now accepts those things as
inputs.
2026-01-04 00:27:08 -08:00
Andrew Kelley e956948f99 std: remove fs.getAppDataDir with no replacement
This API is a bit too opinionated for the Zig standard library.
Applications should contain this logic instead.
2025-12-30 16:21:25 -08:00
Michael Dusan 4b26c49076 dragonfly: make test lib/std/std.zig pass 2025-12-29 22:29:56 -05:00