Commit Graph

8096 Commits

Author SHA1 Message Date
Andrew Kelley 60e2ea0bfb windows: use ProcessPrng from bcryptprimitives.dll
rather than SystemFunction036 from advapi32. This has the advantage that
the code is loaded preemptively, preventing random numbers from
failing when they are needed for the first time on a system under heavy
load.
2026-01-05 00:36:11 -08:00
Andrew Kelley 36044a0e81 test-standalone: explicitly link to advapi32 sometimes
Now, nearly every object produced by zig has a dependency on
advapi32.dll due to the dependency on RtlGenRandom due to the
implementation of dirCreateFileAtomic which is now analyzed whether or
not it is used.
2026-01-05 00:19:16 -08:00
Andrew Kelley b4dbe483a7 std.Build: adjust temp files API
Remove the RemoveDir step with no replacement. This step had no valid
purpose. Mutating source files? That should be done with
UpdateSourceFiles step. Deleting temporary directories? That required
creating the tmp directories in the configure phase which is broken.
Deleting cached artifacts? That's going to cause problems.

Similarly, remove the `Build.makeTempPath` function. This was used to
create a temporary path in the configure place which, again, is the
wrong place to do it.

Instead, the WriteFile step has been updated with more functionality:

tmp mode: In this mode, the directory will be placed inside "tmp" rather
than "o", and caching will be skipped. During the `make` phase, the step
will always do all the file system operations, and on successful build
completion, the dir will be deleted along with all other tmp
directories. The directory is therefore eligible to be used for
mutations by other steps. `Build.addTempFiles` is introduced to
initialize a WriteFile step with this mode.

mutate mode: The operations will not be performed against a freshly
created directory, but instead act against a temporary directory.
`Build.addMutateFiles` is introduced to initialize a WriteFile step with
this mode.

`Build.tmpPath` is introduced, which is a shortcut for
`Build.addTempFiles` followed by `WriteFile.getDirectory`.

* give Cache a gpa rather than arena because that's what it asks for
2026-01-04 17:23:45 -08:00
Andrew Kelley 854c076ff7 std.Io.Threaded: improve posix spawning
* avoid unreachable when the OS does something unexpected
* make waiting for the fork/exec error report cancelable
2026-01-04 00:27:09 -08:00
Andrew Kelley e2c04a4651 fix some windows compilation errors 2026-01-04 00:27:09 -08:00
Andrew Kelley 2fee64ceb0 update init template for new main API 2026-01-04 00:27:09 -08:00
Andrew Kelley e55fa3d525 fix two standalone tests on windows 2026-01-04 00:27:09 -08:00
Andrew Kelley 84da158afb test-stack-traces: update to new main API 2026-01-04 00:27:09 -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 f25de4c7a2 fix native path lookup on macOS 2026-01-04 00:27:08 -08:00
Andrew Kelley 4afed3e9ef test-standalone: update the rest of the cases to new API 2026-01-04 00:27:08 -08:00
Andrew Kelley bf74827ddb test-standalone: update more cases to new main API 2026-01-04 00:27:08 -08:00
Andrew Kelley 1b56686012 test-standalone: update cases to new main API 2026-01-04 00:27:08 -08:00
Andrew Kelley f28802a9c6 zig libc: fix subcommand
This branch regressed the child process "run" mechanism because it
didn't pass the correct stdin, stdout, stderr values to process.spawn

Fixed now.
2026-01-04 00:27:08 -08:00
Andrew Kelley 960c512efd compiler: update std lib API usage 2026-01-04 00:27:08 -08:00
Andrew Kelley f9585ad01f update tests and tools to new main API 2026-01-04 00:27:08 -08:00
Andrew Kelley 32af0f6154 std: move child process APIs to std.Io
this gets the build runner compiling again on linux

this work is incomplete; it only moves code around so that environment
variables can be wrangled properly. a future commit will need to audit
the cancelation and error handling of this moved logic.
2026-01-04 00:27:08 -08:00
Andrew Kelley d6a1e73142 std: start wrangling environment variables and process args
this commit is unfinished. It marks a spot where I wanted to start
moving child process stuff below the std.Io.VTable
2026-01-04 00:27:07 -08:00
Ryan Liptak e3f36d0d81 Fix a few standalone tests on Windows 2025-12-26 19:58:56 -08:00
Ryan Liptak ec5c2d4ce3 Skip posix-specific standalone test on Windows 2025-12-26 19:58:56 -08:00
Ryan Liptak 447f80c0cc Delete test_symlink in standalone/posix, it's fully redundant
See readlink tests in std/fs/test.zig
2025-12-26 19:58:56 -08:00
Andrew Kelley a7d2cb7045 test-incremental: ignore .swp files 2025-12-26 19:58:56 -08:00
Andrew Kelley 66da6773eb build: make test-incremental respect -Dtest-filter 2025-12-26 19:58:56 -08:00
Andrew Kelley a72c411fdb disable self-hosted aarch64 tests
These can be re-enabled when the assertion failures in the backend are
fixed, which does not need to block this branch.
2025-12-26 19:58:56 -08:00
Andrew Kelley 2708a3c1ac fix the guess number game example 2025-12-23 22:40:17 -08:00
Andrew Kelley c9a609a61a test-cases: disable self-hosted aarch64 backend coverage 2025-12-23 22:15:12 -08:00
Andrew Kelley 6dbc95fb1f update test cases 2025-12-23 22:15:12 -08:00
Andrew Kelley fa79d34674 std: add changing cur dir back
There's a good argument to not have this in the std lib but it's more
work to remove it than to leave it in, and this branch is already
20,000+ lines changed.
2025-12-23 22:15:12 -08:00
Andrew Kelley 7788fd6233 update test API usage 2025-12-23 22:15:12 -08:00
Andrew Kelley b45984ec80 test-incremental: respect the wine, qemu, etc build flags 2025-12-23 22:15:12 -08:00
Andrew Kelley 669dae140c test-standalone: fix most compilation errors 2025-12-23 22:15:12 -08:00
Andrew Kelley 6ece10f63d update test-link to new std.Io API 2025-12-23 22:15:12 -08:00
Andrew Kelley 33e302d67a update remaining calls to std.Io.Threaded.init 2025-12-23 22:15:12 -08:00
Andrew Kelley 70e19ea353 update more "realpath" callsites 2025-12-23 22:15:11 -08:00
Andrew Kelley debf307594 update all incremental tests to new std API
they're still not passing on windows for some reason though
2025-12-23 22:15:11 -08:00
Andrew Kelley 77d2ad8c92 std: consolidate all instances of std.Io.Threaded into a singleton
It's better to avoid references to this global variable, but, in the
cases where it's needed, such as in std.debug.print and collecting stack
traces, better to share the same instance.
2025-12-23 22:15:11 -08:00
Andrew Kelley 7423d6a404 fix "hello world"
14K -> 57K
2025-12-23 22:15:11 -08:00
Andrew Kelley 6e0c7ed865 std: rename makeDir to createDir for consistency with createFile 2025-12-23 22:15:11 -08:00
Andrew Kelley 16f8af1b9a compiler: update various code to new fs API 2025-12-23 22:15:09 -08:00
Andrew Kelley bee8005fe6 std.heap.DebugAllocator: never detect TTY config
instead, allow the user to set it as a field.

this fixes a bug where leak printing and error printing would run tty
config detection for stderr, and then emit a log, which is not necessary
going to print to stderr.

however, the nice defaults are gone; the user must explicitly assign the
tty_config field during initialization or else the logging will not have
color.

related: https://github.com/ziglang/zig/issues/24510
2025-12-23 22:15:08 -08:00
Andrew Kelley 4a53e5b0b4 fix a handful of compilation errors related to std.fs migration 2025-12-23 22:15:08 -08:00
Andrew Kelley ebdbbd20ac update makeDir() sites to specify permissions 2025-12-23 22:15:08 -08:00
Andrew Kelley 3725f72293 update std.process.Child.run occurences to use io 2025-12-23 22:15:08 -08:00
Andrew Kelley 9e3bda5eff tests: close() -> close(io) 2025-12-23 22:15:08 -08:00
Andrew Kelley a91c6dc71d test: std.fs.File -> std.Io.File 2025-12-23 22:15:08 -08:00
Prokop Randáček 442592855c change placeholder pattern in deduplicated type errors 2025-12-20 08:06:59 +01:00
Alex Rønne Petersen b9eefe17af test: fix up c3ee8078b4
Oops, accidentally didn't run the tests for 32-bit powerpc.
2025-12-16 09:01:51 +01:00
Alex Rønne Petersen 447d6a0dd3 test: remove some nonsensical openbsd targets from llvm_targets 2025-12-16 06:25:32 +01:00
Alex Rønne Petersen 423d117251 test: skip bitcast nan float does not modify signaling bit on powerpc
This fails on a pwr10 machine.
2025-12-16 06:23:06 +01:00
Alex Rønne Petersen c3ee8078b4 test: skip some C ABI vector tests on powerpc
These fail on a pwr10 machine.
2025-12-16 06:23:01 +01:00