Commit Graph
921 Commits
Author SHA1 Message Date
Andrew Kelley f6a00a4751 Maker: guard project id construction with have_manifest 2026-10-14 19:00:42 -07:00
Andrew Kelley 6cecad145d Maker: fix use case when --fork matches 2 or more pkgs
Previously this always caused a compilation failure because it would
correctly substitute multiple packages with the provided forked package,
however, this ends up constructing a zig build-exe command line for the
configurer that included multiple differnt modules that used the same
files.

Closes #31677
2026-10-14 17:42:15 -07:00
Andrew Kelley 5b4e91bc39 Maker: --print-tree supports paths and forks 2026-10-14 17:42:15 -07:00
Andrew Kelley 35c2541cf9 Maker: exempt forked packages from validateFingerprints
because they intentionally override multiple packages hashes to have the
forked contents.
2026-10-14 17:42:15 -07:00
Andrew Kelley 4a0cadf85b Fetch: slightly more helpful debug log when forking 2026-10-14 17:42:15 -07:00
Elaine Gibson d893812013 Maker: fix build when Watch.have_impl is false 2026-10-14 20:49:25 +02:00
Andrew Kelley 32534ecae6 Merge pull request 'package management: --help enhancement, --print-tree, and validate package hash consistency' (#37214) from build-print-tree into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/37214
2026-10-13 20:45:10 +02:00
Andrew Kelley 0c54ae3c0e zig build: validate package hash consistency
Any time the same package (based on fingerprint) appears in the
dependency tree, if the semantic version compares equal, the hash must
be identical, otherwise one of three things has gone wrong and the
maintainer must address it.
2026-10-12 20:34:17 -07:00
Andrew Kelley 89ec7145f1 Maker: check for --fetch after --print-tree 2026-10-12 18:46:50 -07:00
Andrew Kelley 2551cf283f zig build: add --configure flag, change --fetch flag
--fetch is changed to mean:
> Fetch all dependencies including lazy ones; exit without configuration

--configure is introduced (replaces old `--fetch` semantics):
> Exit after the configuration phase
2026-10-12 18:28:07 -07:00
Andrew Kelley 2f60a88308 zig build: add --print-tree CLI option
for writing the current state of package dependencies to stdout, without
running configuration.
2026-10-12 18:05:37 -07:00
Andrew Kelley c8160b8a2e Maker: --help works even when configuration fails 2026-10-12 17:45:44 -07:00
Alex Rønne Petersen 963d4466d5 std.Target: remove contiki OS tag
Contiki-NG is really more like a freestanding library for driving MCUs and
peripherals; it's not an OS with an ABI as such. So a dedicated OS tag isn't
really doing anything useful over `freestanding`.
2026-10-12 14:43:32 +02:00
Alex Rønne Petersen 7a7b944ef8 std.Target: remove hermit OS tag
Hermit is a unikernel with no stable syscall ABI; you must link its syscall
library statically to perform syscalls. Due to the way the project's build
system works, that means using Rust/Cargo. As such, it makes essentially zero
sense for Zig to support this target.
2026-10-12 14:35:23 +02:00
David Rubin 712055f324 Maker: properly add directories to watch list 2026-10-10 19:04:45 +02:00
xtex b90b080836 objcopy: call seekTo after setLength
Previously, --pad-to is implemented using
File.setLength which does a ftruncate syscall
immediately. However, for positional writers,
setLength will be called again in out.end(),
truncating the file back to out.pos bytes.

Therefore, seekTo should be called after setLength
to update out.pos.
2026-10-09 23:55:16 +02:00
Robbie Lyman d69634c10d chore(MultiArrayList): update .{} to .empty
This change brings initiailization of MultiArrayList within the compiler and the
standard library in line with other std containers in preferring the
`.empty` decl literal over `.{}` initialization.
2026-10-09 23:13:33 +02:00
Alex Rønne Petersen 53173d25ab std.Target: update CPU models and features to LLVM 23 2026-10-07 00:30:51 +02:00
Frank Denis ca72563248 WebServer: fix double free in releaseConfigured
configured.step_names_trailing was free'd at the beginning.
2026-10-04 08:12:27 +02:00
Andrew Kelley 230a1a0ac2 Maker: add missing help text to usage 2026-09-30 23:28:13 -07:00
Jacob Young a7aec00feb Maker.Step.Run: fix copy paste typo 2026-09-29 15:54:41 -04:00
Andrew Kelley d8aab4878d Merge pull request 'Rewrite incr-check into a more general purpose compiler test runner' (#36967) from compiler-test-runner into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36967
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-09-28 07:13:35 +02:00
Ryan Liptak da561521dd WriteFile: populate open_dir_cache regardless of mode
operate assumes that `open_dir_cache` is populated, but that wasn't the case when the mode was .tmp/.mutate

Fixes https://codeberg.org/ziglang/zig/issues/36958
2026-09-27 12:16:04 +02:00
Veikka Tuominen b46a7f3a25 sync aro & translate-c 2026-09-27 02:49:10 +02:00
Jacob Young aa3dd5d5d9 Maker.Step.Run: fix resource deallocation order on windows
The inherited file descriptors need to be closed before attempting to
rename the output directory.
2026-09-26 19:08:50 -04:00
Jacob Young 4dd645fddd Runner: add --libc-runtimes support 2026-09-26 19:08:50 -04:00
Jacob Young 00b59eb18a Runner: implement error reporting 2026-09-26 19:08:50 -04:00
Jacob Young 146d0529ca Maker.Step.Run: watch even in the face of skip/failure 2026-09-26 19:08:50 -04:00
Jacob Young b6f68ca4ba Runner: implement cbe backend 2026-09-26 19:08:50 -04:00
Jacob Young 488c15320b runner: spawn compiler process 2026-09-26 19:08:50 -04:00
Jacob Young f63e8e802f Build: implement discovered inputs 2026-09-26 19:08:50 -04:00
Jacob Young 11958a306f test: implement new runner 2026-09-26 19:08:50 -04:00
Alex Rønne Petersen 476efc5b70 remove internal and link_once global linkages
These have no clear use case, no coherent definition, and incomplete/broken
compiler and linker support.

If actually needed, they can be reintroduced if someone can present a reasonable
use case along with a plan for how they should be implemented consistently in
all backends and linkers.
2026-09-26 19:12:48 +02:00
Andrew Kelley 50cf87f8fc update callsites to std.zig.Client.serveErrorBundle
now it has to include the message tag
2026-09-25 12:07:52 -07:00
Andrew Kelley d09c1aef02 maker: serialize compilation errors of configurer over the build protocol
serves an ErrorBundle as a configuration_failed message instead of
configuration message upon connection. at this point the protocol enters
an invalid state and the process will need to be restarted in order to
reconfigure. in the future, build server should outlive
reconfigurations.

closes #36389
2026-09-25 11:47:25 -07:00
Andrew Kelley 480e3f89b2 Maker.Fuzz: fix memory leaks 2026-09-25 02:05:02 -07:00
Andrew Kelley aaa314f6b2 Maker.Fuzz: fix computation of rebuilt exe path 2026-09-25 01:56:12 -07:00
Andrew Kelley 3d2207fc79 build server protocol: send generated file paths
closes #36403
2026-09-24 23:10:27 -07:00
Andrew Kelley 01eff30056 Maker: fix Step.FindProgram 2026-09-24 23:10:27 -07:00
Andrew Kelley 4853ea1bda Maker: store generated files differently
in preparation for sending them over the build server protocol (#36403),
they are now stored in the same format in memory: one byte for prefix
followed by the relative path.
2026-09-24 23:10:27 -07:00
Andrew Kelley 2a03d6b007 Maker: properly deinit compiler child procs
Problem was that when Maker.Step.Compile was deinitialized, it would
reap the memory for the child process, but not actually kill & wait for
the termination of the process. Leaving the extra processes running
caused "Reusing Cache Artifacts" deadlocks, not to mention wasting
resources.

closes #36513
2026-09-24 23:53:46 +02:00
rpkak 665fc1417e zig fetch: init parent_package_root
used in Fetch.initResource
2026-09-23 01:58:48 +02:00
Andrew Kelley b844605c52 build system: translate-c supports arbitrary c flags
closes #35568
2026-09-22 08:57:25 +02:00
Ten Eugene 230c63650f std.Io.Reader: add readAllocShort, mirror readAlloc* with readSlice* (#36807)
Closes #36767

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36807
Reviewed-by: Ryan Liptak <squeek502@noreply.codeberg.org>
2026-09-21 07:53:28 +02:00
llogick abe2216699 Maker: Fmt (step): add a deinit method
fixes Maker leaking Fmt's argv
2026-09-21 07:51:39 +02:00
Andrew Kelley 6f2109384d Maker: add build.zig.zon files to configuration cache manifest
closes #36255

follow-up enhancement: only add the root build.zig.zon file as an input
to the cache manifest. Do a cache check *before* fetching, that has the
ability to skip fetching. If fetching needs to be run, then add the
build.zig.zon files as discovered files, keeping the stat and contents
around from the fetch process rather than redundantly doing the file
system operations.
2026-09-21 07:50:11 +02:00
kcbanner 3bfb299947 Merge pull request 'Coff: Miscellaneous fixes' (#36887) from kcbanner/zig:coff_fixes into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36887
2026-09-20 02:20:35 +02:00
kcbanner 5dab6a4533 objdump: instead of crashing when using --strings and there is no string table, print a message 2026-09-19 15:35:47 -04:00
Andrew Kelley c8ffaf62e8 Maker: fix Run step fuzz test list memory leak 2026-09-19 19:08:25 +02:00
Andrew Kelley c106e27595 std.Build.Step.Options: add addOptionPathDirectory
Now, when adding an option that is a file path, one must explicitly
choose between:
* `addOptionPath` (must be a file)
* `addOptionPathDirectory` (must be a directory)
* `addOptionPathUntracked` (opt out of dependency tracking)

closes #35766
2026-09-17 21:04:22 -07:00