Commit Graph

38249 Commits

Author SHA1 Message Date
Andrew Kelley c8b583885d maker: port Run step logic up to spawnChildAndCollect 2026-05-25 18:54:34 -07:00
Andrew Kelley 0d48cbb822 std.process.Environ.Map: add putAll and clearRetainingCapacity 2026-05-25 18:54:34 -07:00
Andrew Kelley 378b790ee2 maker: port more of Run step over 2026-05-25 18:54:34 -07:00
Andrew Kelley 5a4b5b549b 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-25 18:54:34 -07:00
Andrew Kelley d707e37ec2 update todo text file 2026-05-25 18:54:34 -07:00
Andrew Kelley 24d260363f configurer: fix bad serialization of strings in run args 2026-05-25 18:54:34 -07:00
Andrew Kelley 7c718fc72e fix compilation errors from rebase conflicts 2026-05-25 18:54:34 -07:00
Andrew Kelley 088f815031 there are some unresolved branch conflicts 2026-05-25 18:54:34 -07:00
Andrew Kelley a399d37886 maker: upgrade some of the run step logic 2026-05-25 18:54:34 -07:00
Andrew Kelley 81ee4ab32c configurer: serialize all data from run steps 2026-05-25 18:54:34 -07:00
Andrew Kelley 8bc0913212 compiler: fix compilation errors 2026-05-25 18:54:34 -07:00
Andrew Kelley e436d9c4ad configurer: back out the string interning from prev commit
partial revert of 2d3fbb687fba1ed52b42998ac4dcbf2a042644ea - see its
commit message for reasoning
2026-05-25 18:54:34 -07:00
Andrew Kelley c6d37f3895 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-25 18:54:34 -07:00
Andrew Kelley 1a63d26836 maker: implement TopLevel step 2026-05-25 18:54:34 -07:00
Andrew Kelley aa0652ff8d maker: implement InstallArtifact and InstallFile 2026-05-25 18:54:34 -07:00
Andrew Kelley dd51fc30f8 maker: finish migrating compile step make logic 2026-05-25 18:54:34 -07:00
Andrew Kelley b998d71e93 maker: finish lowering compile step CLI args 2026-05-25 18:54:34 -07:00
Andrew Kelley c60d33f167 Configuration: refactor maxInt(u32) 2026-05-25 18:54:34 -07:00
Andrew Kelley 6ad6a58e5d 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-25 18:54:34 -07:00
Andrew Kelley a60ffaf5b3 maker: finish migrating most of CLI lowering code 2026-05-25 18:54:34 -07:00
Andrew Kelley cc4f205fc3 maker: progress towards lowering zig cli args 2026-05-25 18:54:34 -07:00
Andrew Kelley c8f7e27060 zig build: add --debug-maker CLI flag
for changing the optimization mode of the maker executable
2026-05-25 18:54:34 -07:00
Andrew Kelley ec2b156720 std: rename zig.Configuration to Build.Configuration 2026-05-25 18:54:34 -07:00
Andrew Kelley 71ac3f15b3 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-25 18:54:34 -07:00
Andrew Kelley eaffd55513 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-25 18:54:34 -07:00
Andrew Kelley 8f36a83b45 Configuration: serialize remaining CSourceFiles information 2026-05-25 18:54:34 -07:00
Andrew Kelley 6c61803d8b maker: implement module printing 2026-05-25 18:54:34 -07:00
Andrew Kelley 8aec13b6ab Configuration: serialize remaining Module information
also handle properly Module circular references and introduce a general
deduplication mechanism.
2026-05-25 18:54:34 -07:00
Andrew Kelley 8331c59ee2 Configuration: serialize remaining Target information 2026-05-25 18:54:34 -07:00
Andrew Kelley 5fbfeabd5f compiler: no longer need ThreadSafeArena wrapper 2026-05-25 18:54:34 -07:00
Andrew Kelley 4381a387bf Configuration: complete serialization of Compile steps 2026-05-25 18:54:34 -07:00
Andrew Kelley d3d3fb8473 maker: progress towards updating zig CLI lowering 2026-05-25 18:54:34 -07:00
Andrew Kelley 6925a57d2f Configuration: implement UnionList storage 2026-05-25 18:54:34 -07:00
Andrew Kelley b04818644c rename configure_runner to configurer 2026-05-25 18:54:34 -07:00
Andrew Kelley a180012dd2 configurer: serialize 3 more Module fields 2026-05-25 18:54:34 -07:00
Andrew Kelley 92803903f3 Configuration: implement FlagLengthPrefixedList 2026-05-25 18:54:34 -07:00
Andrew Kelley e8e7fbf843 Configuration: implement Storage.EnumOptional 2026-05-25 18:54:34 -07:00
Andrew Kelley b53e4e84bd ScannedConfig: more general zon printing
it's almost all automated now
2026-05-25 18:54:34 -07:00
Andrew Kelley 052aeee415 std.zon.Serializer: slightly more helpful message
when a type is unserializable
2026-05-25 18:54:34 -07:00
Andrew Kelley b9aeedd23c Configuration: type safety for extended pattern 2026-05-25 18:54:34 -07:00
Andrew Kelley 603e92cdde Maker: don't include non-root top level steps 2026-05-25 18:54:34 -07:00
Andrew Kelley 20bb5bde88 ScannedConfig: print Step.TopLevel 2026-05-25 18:54:34 -07:00
Andrew Kelley 4777ad964c ScannedConfig: print Step header data 2026-05-25 18:54:34 -07:00
Andrew Kelley 9baf02de5f Maker: move ScannedConfig to separate file 2026-05-25 18:54:34 -07:00
Andrew Kelley 612560d019 std.Build.Configure: implement FlagOptional serialization 2026-05-25 18:54:34 -07:00
Andrew Kelley 74b018ceb3 zig build: make --error-limit globally configurable
still overridable by individual Compile steps
2026-05-25 18:54:34 -07:00
Andrew Kelley 174532c78e std.build.Configuration: sketch a data layout idea 2026-05-25 18:54:34 -07:00
Andrew Kelley 959103c3fd Maker.Step.Compile: progress towards lowering zig args 2026-05-25 18:54:34 -07:00
Andrew Kelley 6b7ce1fa22 massage Step code into compiling 2026-05-25 18:54:34 -07:00
Andrew Kelley b3d162d6bf build maker: rename files to match type 2026-05-25 18:54:34 -07:00