Commit Graph

15436 Commits

Author SHA1 Message Date
Siddharth Sinha 284ab0ad86 std.Io.Uring: handle ReadOnlyFileSystem in dirOpenDir and dirRealPathFile
f4eecf8d7d added ROFS handling to openat but missed these two read-only
callers, breaking compilation of any Io.Evented program.
2026-05-27 09:42:02 +02:00
Alex Rønne Petersen 333724ff77 Maker.Step.Run: set WASMTIME_BACKTRACE_DETAILS=1 by default for Wasmtime
Similar in spirit to what we do with WINEDEBUG when using Wine, i.e. provide
more helpful defaults.
2026-05-27 07:52:49 +02:00
zacoons be7065f7f5 std.Io: fix openSocketPosix ignoring ip6_only option 2026-05-27 03:12:49 +02:00
Andrew Kelley d0c6ed189b Maker: fix Target deserialization
more disciplined Target / Query separation even though they're both
serialized in the same struct
2026-05-27 03:04:31 +02:00
Alan Cocanour 9c56550931 Respect environment variable preference for color in all zig commands
This makes all commands in the zig executable that support color
output respect the user's preference for color output based on the
NO_COLOR and CLICOLOR_FORCE environment variables. Setting color
preference via command line option still overrides preferences set via
environment variables.
2026-05-26 17:56:40 -07:00
pentuppup e4512531d5 fix some missed errors from build system rework 2026-05-27 02:18:25 +02:00
Andrew Kelley 4d56c66362 Merge pull request 'Maker: memory usage optimizations' (#35471) from build-runner-process into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35471
2026-05-27 00:48:11 +02:00
Alex Rønne Petersen 197ba11787 std.debug.SelfInfo.Elf: update lists of supported architectures 2026-05-27 00:28:15 +02:00
Alex Rønne Petersen 5c64311fab std.debug.cpu_context: add mcontext_t for x86-freebsd 2026-05-27 00:28:00 +02:00
Alex Rønne Petersen 833c6d9792 std.debug.cpu_context: add missing align(16) on x86_64-freebsd mcontext_t 2026-05-27 00:28:00 +02:00
Alex Rønne Petersen 6aa6a07955 std.debug.cpu_context: add mcontext_t for hppa-linux and hppa64-linux 2026-05-27 00:28:00 +02:00
Alex Rønne Petersen 12790e69a7 std.debug.cpu_context: add mcontext_t for hppa-netbsd 2026-05-27 00:27:06 +02:00
Alex Rønne Petersen 7d5e400911 std.debug.cpu_context: sheb-openbsd doesn't exist 2026-05-26 23:30:48 +02:00
Alex Rønne Petersen f3a7a4c5e2 Merge pull request 'NetBSD 11.0 cross libc support' (#35464) from alexrp/zig:netbsd-11 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35464
2026-05-26 20:55:53 +02:00
Carl Åstholm fc3406a961 std.debug.Pdb: deduplicate inline source locations
Previously, if the same inline function was called multiple times
by the same caller, the inline function's frame would be repeated
multiple times, once for each prior call.
2026-05-26 20:37:09 +02:00
Jacob Young 5940f65503 lldb: update for upcoming hash map rename 2026-05-26 19:32:01 +02:00
Andrew Kelley fd63f57cd8 build system: update more usize to u64 for maxrss
makes the build system compile on 32 bit systems

bonus, also fix incorrectly passing advanced debug options to the maker
process which doesn't care about them
2026-05-26 09:50:48 -07:00
Sertonix 8455563ed8 Fix build script compilation when usize is u32
On 32-bit systems usize is not u64 but it was assumed in multiple places
of the build script.

Sometimes using u64 instead of usize since available and used memory can
exceed usize on 32-bit systems (just like totalSystemMemory)

Example errors:

lib/compiler/build_runner.zig:508:26: error: expected type 'usize', found 'u64'
        .available_rss = max_rss,
                         ^~~~~~~
lib/compiler/build_runner.zig:508:26: note: unsigned 32-bit int cannot represent all possible unsigned 64-bit values
referenced by:
    callMain [inlined]: lib/std/start.zig:699:88
    callMainWithArgs [inlined]: lib/std/start.zig:638:20
    posixCallMainAndExit: lib/std/start.zig:590:38
    2 reference(s) hidden; use '-freference-trace=5' to see all references
lib/std/Build/WebServer.zig:849:38: error: expected type 'usize', found 'u64'
    const buf = gpa.realloc(old_buf, new_len) catch @panic("out of memory");
                                     ^~~~~~~
lib/std/Build/WebServer.zig:849:38: note: unsigned 32-bit int cannot represent all possible unsigned 64-bit values
lib/std/mem/Allocator.zig:399:58: note: parameter type declared here
pub fn realloc(self: Allocator, old_mem: anytype, new_n: usize) Error!@TypeOf(old_mem) {
                                                         ^~~~~
build.zig:548:10: error: type 'usize' cannot represent integer value '9300000000'
        .max_rss = 9_300_000_000,
        ~^~~~~~~~~~~~~~~~~~~~~~~
build.zig:778:10: error: type 'usize' cannot represent integer value '8000000000'
        .max_rss = 8_000_000_000,
        ~^~~~~~~~~~~~~~~~~~~~~~~
2026-05-26 09:43:39 -07:00
Andrew Kelley 349053e322 Maker: memory usage optimizations
- choose smp_allocator depending on optimization mode
- organize the globals
- avoid pessimistically allocating failed command string
- recover the PkgConfig memory
- recover the memory from captureChildProcess
- make Step.result_stderr gpa-owned so it doesn't leak when a step that
  fails with stderr is re-run
- recover memory from evalZigTest and evalGeneric child process stdio
  streams
2026-05-26 09:03:34 -07:00
Andrew Kelley 0ff175b69e Merge pull request 'zig build: separate the maker process from the configurer process' (#35428) from build-runner-process into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35428
2026-05-26 18:00:16 +02:00
Alex Rønne Petersen 6ed30064d3 std.debug.cpu_context: add mcontext_t for riscv32-netbsd and riscv64-netbsd 2026-05-26 15:40:42 +02:00
Alex Rønne Petersen 7c2efe5000 std.zig.target: add riscv32-netbsd-none and riscv64-netbsd-none 2026-05-26 15:40:42 +02:00
Alex Rønne Petersen b2dd1469da std.Target: add dynamic linker path for riscv32-netbsd and riscv64-netbsd 2026-05-26 15:40:42 +02:00
Alex Rønne Petersen 912dd0b451 std.Target: bump max NetBSD version to 11.0 2026-05-26 15:40:42 +02:00
Alex Rønne Petersen 1e2bac6153 libc: update NetBSD headers to 11.0 2026-05-26 15:40:40 +02:00
Huang Zhichao c84f0f49d6 std.os.linux: fix dirfd type in mknodat() 2026-05-26 20:49:56 +08:00
Alex Rønne Petersen 0511b3cc9b libc: update NetBSD abilists to 11.0 2026-05-26 14:35:39 +02:00
Alex Rønne Petersen dbfeb07a17 libc: update NetBSD crt0 to 11.0 2026-05-26 14:35:39 +02:00
Alex Rønne Petersen 66bcba6b9d drop powerpc-netbsd-eabi target support
Turns out this target is very poorly supported upstream and doesn't even build
in NetBSD 11, so let's not pretend to support it.
2026-05-26 14:35:23 +02:00
Alex Rønne Petersen 84a100b3e0 std.os: no longer require libc for xtensa-linux
Not that any of our vendored libcs support xtensa anyway.
2026-05-26 08:11:04 +02:00
Alex Rønne Petersen b0bda2d744 std.Thread: implement LinuxThreadImpl.freeAndExit() for xtensa 2026-05-26 08:11:04 +02:00
Alex Rønne Petersen ecc47695ef std.os.linux: add xtensa arch bits
closes https://codeberg.org/ziglang/zig/issues/30947
2026-05-26 08:11:04 +02:00
Alex Rønne Petersen 0142405f86 std.os.linux.tls: add xtensa support 2026-05-26 08:11:04 +02:00
Alex Rønne Petersen a6ab353532 std.pie: add xtensa support
This might need more work to handle the DT_XTENSA_GOT_LOC_{OFF,SZ} insanity,
but this is at least a start.
2026-05-26 08:11:04 +02:00
Alex Rønne Petersen 5143239e2b std.start: add xtensa support 2026-05-26 08:11:04 +02:00
Alex Rønne Petersen 68d2bef8c0 std.debug: FP unwinding is useless on xtensa
Like MIPS, we'd have to do backwards code scanning for it to be useful, and at
least for now, we're not willing to do that.
2026-05-26 08:11:04 +02:00
Alex Rønne Petersen c96d1cc0c1 std.elf: add DT_XTENSA_GOT_LOC_{OFF,SZ} 2026-05-26 08:11:04 +02:00
Andrew Kelley c9619d7086 Maker: print amount of arena memory used only when --debug-maker-leaks 2026-05-25 20:44:51 -07:00
Andrew Kelley 1d750d7067 Maker.Step.Run: fix leak in evalGeneric 2026-05-25 20:34:44 -07:00
Andrew Kelley 5b022623cf Maker.Step.Compile: fix memory leak in checkCompileErrors 2026-05-25 20:17:41 -07:00
Andrew Kelley f3dd10d40f Maker: add --debug-maker-leaks flag and fix some leaks 2026-05-25 20:14:34 -07:00
Alex Rønne Petersen 2625e42a68 std.os: no longer require libc for alpha-linux 2026-05-26 05:12:29 +02:00
Andrew Kelley a9e0eb5340 std.Build.Step.Compile: deprecate out_filename 2026-05-25 19:27:16 -07:00
Andrew Kelley 66f0564c3a Maker.Watch: clean up a couple error logs 2026-05-25 19:27:16 -07:00
Andrew Kelley cb1f3e0ac4 Maker.Step.Compile: leak into the global arena less 2026-05-25 19:27:16 -07:00
Andrew Kelley 198f35c98c Maker: restore commit: clear step inputs when resetting the step
I'm a bit confused because my understanding is that each step is
supposed to make its own decision about whether to clear its watch
inputs and start over, or retain them from the previous update. However,
without this fix in place, the problem from #35224 manifests itself
again.

Since this fix is in place in master branch, I'll leave it for now and
audit the file watching logic later.
2026-05-25 18:54:37 -07:00
Andrew Kelley 19c63406d4 LazyPath: store relative paths as actual strings 2026-05-25 18:54:37 -07:00
Andrew Kelley 860d5ab9c4 Maker: implement relativePath with non-empty subpath for zig_exe 2026-05-25 18:54:36 -07:00
Andrew Kelley 35ee3747eb Maker.Step: avoid unnecessary compilation failure
On s390x the cache line size is 256 so this check was failing. That's
not useful, just check only for more common cache line sizes.
2026-05-25 18:54:36 -07:00
Andrew Kelley bd1b47733b zig build: remove --build-runner CLI parameter
There is no concept of a "build runner" any more; it has been split in two:
configurer and maker.

Users of this feature will likely want to no longer override any logic, and
instead consume the configuration file produced by configurer.

If overriding one or the other of these is desired, the feature will need to be
re-introduced (as --override-maker or --override-configurer).
2026-05-25 18:54:36 -07:00