34 Commits

Author SHA1 Message Date
David Senoner c91727108e Replace usages of ArrayHashMapUnmanaged with array_hash_map.Custom 2026-06-10 16:14:58 +02: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 f3dd10d40f Maker: add --debug-maker-leaks flag and fix some leaks 2026-05-25 20:14:34 -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 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 1aa65d094e Maker.Step.Run: leak into global arena less
There are still some uses:
- fuzzing
- generated paths (will require adjusting all step logic)
- Step.result_stderr
2026-05-25 18:54:36 -07:00
Andrew Kelley 9eb85c4e5e build system: track TODOs outside source code
related to #363
2026-05-25 18:54:36 -07:00
Andrew Kelley e435299cfa Maker: progress towards ConfigHeader
however... why is this done in the make phase anyway? making a header
like this is typically done by the configure phase...
2026-05-25 18:54:36 -07:00
Andrew Kelley 31c159c228 Maker: implement CheckFile 2026-05-25 18:54:36 -07:00
Andrew Kelley 1edc5d7d67 Maker: implement FindProgram (lazy) 2026-05-25 18:54:36 -07:00
Andrew Kelley 619f23b3c7 CLI: support both --fork=[path] and --fork [path] 2026-05-25 18:54:36 -07:00
Andrew Kelley 91a7ea4ff4 Maker: implement TranslateC 2026-05-25 18:54:36 -07:00
Andrew Kelley bb1b59ee1f Maker: implement Step.InstallDir 2026-05-25 18:54:35 -07:00
Andrew Kelley db7ceada15 Maker: implement Step.WriteFile 2026-05-25 18:54:35 -07:00
Andrew Kelley 398ea7e492 Maker: handle fallible child proc capture gracefully 2026-05-25 18:54:35 -07:00
Andrew Kelley 4aa8fa898d Maker.PkgConfig: fix regression when pkg-config not found
unless pkg_config == .force, this is supposed to be allowed
2026-05-25 18:54:35 -07:00
Andrew Kelley 43209551b7 maker: implement Step.Options
also revert #35224
2026-05-25 18:54:35 -07:00
Andrew Kelley a249201aec maker: fix Step.Fmt 2026-05-25 18:54:35 -07:00
Andrew Kelley 8a8bf5ad02 maker: update ObjCopy to new system 2026-05-25 18:54:35 -07:00
Andrew Kelley affe5ed867 std.Build: port UpdateSourceFiles step to new system 2026-05-25 18:54:35 -07:00
Andrew Kelley d3ec255a1f more progress towards zig's build.zig compiling 2026-05-25 18:54:35 -07:00
Andrew Kelley 3d78589765 std.Build: port Fmt step to new system
and integrate properly with LazyPath
2026-05-25 18:54:35 -07:00
Andrew Kelley ddabd57743 progress towards compiling zig's build script 2026-05-25 18:54:35 -07:00
Andrew Kelley 4e3d14f590 maker: update more Run step logic 2026-05-25 18:54:34 -07:00
Andrew Kelley c8b583885d maker: port Run step logic up to spawnChildAndCollect 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 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 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