Commit Graph

22 Commits

Author SHA1 Message Date
Andrew Kelley 10e1fe282a Configuration: serialize remaining Module information
also handle properly Module circular references and introduce a general
deduplication mechanism.
2026-04-19 10:56:47 -07:00
Andrew Kelley a305547752 Configuration: serialize remaining Target information 2026-04-19 10:56:47 -07:00
Andrew Kelley 5a1e6d434b Configuration: complete serialization of Compile steps 2026-04-19 10:56:46 -07:00
Andrew Kelley 3962d87bb2 maker: progress towards updating zig CLI lowering 2026-04-19 10:56:46 -07:00
Andrew Kelley 56ec3614d9 Configuration: implement UnionList storage 2026-04-19 10:56:46 -07:00
Andrew Kelley e525962631 configurer: serialize 3 more Module fields 2026-04-19 10:56:46 -07:00
Andrew Kelley 4a2c193179 Configuration: implement FlagLengthPrefixedList 2026-04-19 10:56:46 -07:00
Andrew Kelley 2bcacd2c88 Configuration: implement Storage.EnumOptional 2026-04-19 10:56:46 -07:00
Andrew Kelley e848b540a4 ScannedConfig: more general zon printing
it's almost all automated now
2026-04-19 10:56:46 -07:00
Andrew Kelley 518588e9fc Configuration: type safety for extended pattern 2026-04-19 10:56:46 -07:00
Andrew Kelley 46545d1f8d std.Build.Configure: implement FlagOptional serialization 2026-04-19 10:56:46 -07:00
Andrew Kelley ce0cfd9ad8 std.build.Configuration: sketch a data layout idea 2026-04-19 10:56:46 -07:00
Andrew Kelley 82e3f0d619 massage Step code into compiling 2026-04-19 10:56:46 -07:00
Andrew Kelley 21d76c5bb5 make runner: prepare steps for execution 2026-04-19 10:56:46 -07:00
Andrew Kelley e88fdc72ee make runner gets compiled and run
and --print-configuration prints some deserialized stuff
2026-04-19 10:56:46 -07:00
Andrew Kelley 6b3d0cee1f configure runner: implement builderToPackage 2026-04-19 10:56:46 -07:00
Andrew Kelley cfa0b7cd95 configure runner: serialization of Module 2026-04-19 10:56:46 -07:00
Andrew Kelley 33428c6f1f configure runner: serialization of compile step 2026-04-19 10:56:46 -07:00
Andrew Kelley acf57b8244 configure runner: add Step.Run serialization 2026-04-19 10:56:46 -07:00
Andrew Kelley c3168cf25a configure runner: implement serialization of InstallArtifact 2026-04-19 10:56:46 -07:00
Andrew Kelley af30dbf9af zig build: configure runner basics implemented 2026-04-19 10:56:46 -07:00
Andrew Kelley a41ad3a702 configure/make phase process separation sketch
`zig build` CLI kicks off async task to compile optimized make runner
executable, does fetch, compiles configure process in debug mode, then
checks cache for the CLI options that affect configuration only. On hit,
skips building/running the configure script. On miss, runs it, saves
result in cache.

The cached artifact is a "configuration" file - a serialized build step
graph, which also includes unlazy package dependencies and additional
file system dependencies.

Next, awaits task for compiling optimized make runner executable, passes
configuration file to it. Make runner is responsible for the CLI after
that point.

For the use case of detecting when `git describe` needs to be rerun, we
can allow the configure process to manually add a file system mtime
dependencies, in this case it would be on `.git/index` and `.git/HEAD`.

This will enable two optimizations:

1. The bulk of the build system will not be rebuilt when user changes
   their configure script.

2. The user logic can be completely bypassed when the CLI options
   provided do not affect the configure phase - even if they affect the
   make phase.

Remaining tasks in the branch:

* some stuff in `zig build` CLI is `@panic("TODO")`.
* configure runner needs to implement serialization of build graph using
  std.zig.Configuration
* build runner needs to be transformed into make runner, consuming
  configuration file as input and deserializing the step graph.
* introduce depending only on a file's metadata and *not* its contents
  into the cache system, and add a std.Build API for using it.
2026-04-19 10:56:46 -07:00