Commit Graph

38136 Commits

Author SHA1 Message Date
Andrew Kelley fe4709209e more progress towards zig's build.zig compiling 2026-05-04 20:11:13 -07:00
Andrew Kelley 417d092d5b remove ios standalone test
relied on setting sysroot in configure phase

let's examine this use case more carefully next time before reinstating
this test.
2026-05-04 20:11:13 -07:00
Andrew Kelley 03a12bdf34 remove run_output_caching standalone test
it relied on custom build steps
2026-05-04 20:11:13 -07:00
Andrew Kelley 964564d739 zig build: add zig_exe back to argv
trying to eliminate this can be a followup
2026-05-04 20:11:13 -07:00
Andrew Kelley 13eb50a6e6 std.Build: port Fmt step to new system
and integrate properly with LazyPath
2026-05-04 20:11:13 -07:00
Andrew Kelley 8b8f04e2f0 progress towards compiling zig's build script 2026-05-04 20:11:13 -07:00
Andrew Kelley b31b2ae9ea configurer: get InstallDir and Options steps compiling 2026-05-04 20:11:13 -07:00
Andrew Kelley 8162e405f3 Configuration: implement Storage.UnionList.tag 2026-05-04 20:11:13 -07:00
Andrew Kelley 560e2bcf6f configurer: fix compilation in the presence of dependencies 2026-05-04 20:11:13 -07:00
Andrew Kelley 223b54ef69 zig build: actually the configure passthru args are ordered 2026-05-04 20:11:13 -07:00
Andrew Kelley 9db6b01a50 build system: implement options
options which are passed to configurer and therefore observable by the
build script are added to the cache hash. A sorted list is hashed since
they are unordered.
2026-05-04 20:11:13 -07:00
Andrew Kelley de455ee0ae build system: remove unneeded args from configurer
not needed:
* zig exe path
* zig lib dir
* build root
* local cache root
* global cache root
2026-05-04 20:11:13 -07:00
Andrew Kelley 6bb3a11959 configurer: remove Cache 2026-05-04 20:11:13 -07:00
Andrew Kelley 74862f6cdd rename addCliExtras to addPassthruArgs
finally, a good name
2026-05-04 20:11:13 -07:00
Andrew Kelley 6689b2b1a8 rename addBuildPositionals to addCliExtras
they don't have to be positionals
2026-05-04 20:11:13 -07:00
Andrew Kelley c78de5b3ed build system: implement cli positionals 2026-05-04 20:11:13 -07:00
Andrew Kelley 93ecd3a352 compiler: update callsites of std.zig.binNameAlloc 2026-05-04 20:10:28 -07:00
Andrew Kelley 436dd3e47f maker: fix the has side effects logic in run step 2026-05-04 20:10:28 -07:00
Andrew Kelley 562cd35652 maker: report when result_oom flag is set 2026-05-04 20:10:27 -07:00
Andrew Kelley 05558483ad maker: add the --listen and --seed args back to run 2026-05-04 20:10:27 -07:00
Andrew Kelley f229bf9a8d maker: finish porting over run step 2026-05-04 20:10:27 -07:00
Andrew Kelley d21fbc36bb maker: update more Run step logic 2026-05-04 20:10:27 -07:00
Andrew Kelley 8fac5151bc maker: port Run step logic up to spawnChildAndCollect 2026-05-04 20:10:27 -07:00
Andrew Kelley 2514947cca std.process.Environ.Map: add putAll and clearRetainingCapacity 2026-05-04 20:10:27 -07:00
Andrew Kelley a9c7bccf5a maker: port more of Run step over 2026-05-04 20:10:27 -07:00
Andrew Kelley 5e15fd2690 maker: restore Step.Run logic for adding artifact arg
When an artifact arg is added to a Run step, if the artifact is
installed, then the installation path is added rather than the cache
artifact path. This is probably something that should change in the
future, but the goal of this branch is to generally avoid breakage other
than that caused by phase separation.
2026-05-04 20:10:27 -07:00
Andrew Kelley bbfeaff467 update todo text file 2026-05-04 20:10:27 -07:00
Andrew Kelley f5a72b30dc configurer: fix bad serialization of strings in run args 2026-05-04 20:10:27 -07:00
Andrew Kelley b0a4bb5657 fix compilation errors from rebase conflicts 2026-05-04 20:10:27 -07:00
Andrew Kelley 78fba5055a there are some unresolved branch conflicts 2026-05-04 20:10:27 -07:00
Andrew Kelley 8f6e256df2 maker: upgrade some of the run step logic 2026-05-04 20:10:27 -07:00
Andrew Kelley a4b194583d configurer: serialize all data from run steps 2026-05-04 20:10:27 -07:00
Andrew Kelley b5802b5772 compiler: fix compilation errors 2026-05-04 20:10:27 -07:00
Andrew Kelley e43c2cf859 configurer: back out the string interning from prev commit
partial revert of 2d3fbb687fba1ed52b42998ac4dcbf2a042644ea - see its
commit message for reasoning
2026-05-04 20:10:27 -07:00
Andrew Kelley 7534e832d0 configurer: make string duplication also intern
I had this idea to make b.dupe() also intern the strings since they will
be ultimately serialized to Configuration. Unfortunately the idea does
not work, because although a process-lived arena is used for the
string_bytes ArrayList of the Configuration.Wip, when the ArrayList is
resized, Allocator.free() memsets the freed memory to undefined, even
though it still technically lives due to being in a process-scoped
arena. So this commit will need to be partially reverted. However, I
kept it for posterity, and there are some more changes which I will now
note below.

- dupePaths: don't rewrite backslashes to forward slashes. backslashes
  are valid in filenames on non-windows systems.
- always compile configurer in single-threaded mode
- use arena allocator for everything, no gpa for anything
- construct the Configuration.Wip instance earlier, so some stuff can be
  prepopulated as desired.
- don't forget to flush
2026-05-04 20:10:27 -07:00
Andrew Kelley d4e832bfb2 maker: implement TopLevel step 2026-05-04 20:10:27 -07:00
Andrew Kelley 45d1ad1db8 maker: implement InstallArtifact and InstallFile 2026-05-04 20:10:27 -07:00
Andrew Kelley 1d280c7a14 maker: finish migrating compile step make logic 2026-05-04 20:10:27 -07:00
Andrew Kelley 3d1844243e maker: finish lowering compile step CLI args 2026-05-04 20:10:27 -07:00
Andrew Kelley c78f182136 Configuration: refactor maxInt(u32) 2026-05-04 20:10:27 -07:00
Andrew Kelley b0e3d6d028 Configuration: fix bad serialization of PrefixedList and MultiList
Length zero is still serialized because there is no flag bit to hide the
length.
2026-05-04 20:10:27 -07:00
Andrew Kelley df324df3ad maker: finish migrating most of CLI lowering code 2026-05-04 20:10:27 -07:00
Andrew Kelley 7de77b8721 maker: progress towards lowering zig cli args 2026-05-04 20:10:27 -07:00
Andrew Kelley c864f975c5 zig build: add --debug-maker CLI flag
for changing the optimization mode of the maker executable
2026-05-04 20:10:27 -07:00
Andrew Kelley 1369f51bb1 std: rename zig.Configuration to Build.Configuration 2026-05-04 20:10:27 -07:00
Andrew Kelley d1904e00ae build system: implement LazyPath
Number of generated files is recorded in serialized Configuration. Maker
preallocates array of generated files so that loads and stores can be
synchronization-free (protected by the dependency tree ordering).

More progress on Compile Step Zig CLI lowering.
2026-05-04 20:10:27 -07:00
Andrew Kelley ede8a181e2 maker: progress towards lowering Compile Step CLI args
next thing to do is figure out how LazyPath is supposed to work now.
something like this:
* each Step that provides LazyPath objects has a setLazyPath and
  getLazyPath function which takes a tagged union identifying which one
  to access
* steps that fulfill LazyPath objects can freely call setLazyPath
  without obtaining a lock because the dependency graph prevents
  simultaneous access.
* similarly, steps that access LazyPath results can freely call
  getLazyPath without obtaining a lock, because after modification,
  there may be simultaneous reads from dependencies but they will all be
  read-only
* a fulfilled LazyPath object is a read-only std.Build.Cache.Path.
2026-05-04 20:10:27 -07:00
Andrew Kelley 833fd405f0 Configuration: serialize remaining CSourceFiles information 2026-05-04 20:10:27 -07:00
Andrew Kelley 636e81ad2a maker: implement module printing 2026-05-04 20:10:27 -07:00
Andrew Kelley 218b6337a2 Configuration: serialize remaining Module information
also handle properly Module circular references and introduce a general
deduplication mechanism.
2026-05-04 20:10:27 -07:00