Commit Graph

51 Commits

Author SHA1 Message Date
Andrew Kelley 9eb85c4e5e build system: track TODOs outside source code
related to #363
2026-05-25 18:54:36 -07:00
Andrew Kelley 4ba2bcbbec std.Build.Configuration: fix loading on big endian 2026-05-25 18:54:36 -07:00
Andrew Kelley 3e75a3e36b Configuration: add new target info 2026-05-25 18:54:36 -07:00
Andrew Kelley 9989f72c61 Maker: implement ConfigHeader 2026-05-25 18:54:36 -07:00
Andrew Kelley ed1f005826 Maker: finish implementing Step.Compile.appendIncludeDirFlags 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 54bb8d2dd9 implement the concept of configure cache poisoning 2026-05-25 18:54:36 -07:00
Andrew Kelley a874e729df zig build: remove "cc args" from Run steps
Not sure what I was thinking. This is silly, translate-c package simply
needs to pass this data (link_libc and target) to the CLI application,
which can then do the appropriate behavior.
2026-05-25 18:54:36 -07:00
Andrew Kelley 996b411809 Configuration: more type safety for adding data
erased method still exists for when the result will be converted to an
int anyway.
2026-05-25 18:54:36 -07:00
Andrew Kelley df92898ec3 Maker: fix packagePath function
Currently, neither configurer nor Maker is aware of the standard zig
package path, and the root path is stored as a bare string rather than
relative to a known base directory. Without changing that, we must
construct a cwd relative path here rather than using knowledge of the
standard package path plus package hash.

Also fixes a bug that would have been prevented by implementing the
accepted proposal https://github.com/ziglang/zig/issues/25315
2026-05-25 18:54:36 -07:00
Andrew Kelley 88e066bb7b Configuration: fix dynamic linker null unwrap 2026-05-25 18:54:36 -07:00
Andrew Kelley 940b9bccc2 Configuration: fix Cpu.Arch enum mismatch 2026-05-25 18:54:36 -07:00
Andrew Kelley b991b868ae Configuration: prevent ObjectFormat enum mismatch 2026-05-25 18:54:36 -07:00
Andrew Kelley 88ae1d9aec Configuration: fix the target os enum mismatch 2026-05-25 18:54:36 -07:00
Andrew Kelley 5c133c5765 Configuration: fix deserialization of LengthPrefixedList
don't assume only 1 field
2026-05-25 18:54:35 -07:00
Andrew Kelley bb1b59ee1f Maker: implement Step.InstallDir 2026-05-25 18:54:35 -07:00
Andrew Kelley 5fb120a3c0 maker: implement cleanTmpFiles 2026-05-25 18:54:35 -07:00
Andrew Kelley 9709efce98 std.Build.Step.Run: introduce Arg.cc_args
provides a way for the build system to append -target and -isystem/-I
flags to a Run step.

needed by translate-c package to avoid doing naughty stuff in the
configure phase.
2026-05-25 18:54:35 -07:00
Andrew Kelley bd4c1e34d2 configurer: add search_prefixes back
It is generally best practice to avoid calling this function, instead
relying on the user to provide these paths via the standard build system
interface. However, when integrating with other build systems, the user
may have already provided the information to the other build system, and
thus it is desirable to use that same information without requiring the
user to provide it again.
2026-05-25 18:54:35 -07:00
Andrew Kelley 42be6c0088 configurer: serialize Step.TranslateC 2026-05-25 18:54:35 -07:00
Andrew Kelley 315d6ee59b configurer: serialize Step.ConfigHeader 2026-05-25 18:54:35 -07:00
Andrew Kelley 7e6be7ee6e configurer: serialize Step.ObjCopy 2026-05-25 18:54:35 -07:00
Andrew Kelley d7eab060db configurer: serialize Step.UpdateSourceFiles 2026-05-25 18:54:35 -07:00
Andrew Kelley 1186a10d4e configurer: serialize WriteFile 2026-05-25 18:54:35 -07:00
Andrew Kelley f4ae918684 configurer: implement serializing InstallDir 2026-05-25 18:54:35 -07:00
Andrew Kelley ecba6324bf configurer: update TranslateC step
and get zig's build.zig script fully compiling
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 fa26566867 configurer: get InstallDir and Options steps compiling 2026-05-25 18:54:35 -07:00
Andrew Kelley c57bf99043 Configuration: implement Storage.UnionList.tag 2026-05-25 18:54:35 -07:00
Andrew Kelley ac0b1bfda2 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-25 18:54:35 -07:00
Andrew Kelley 7819e4dea7 rename addCliExtras to addPassthruArgs
finally, a good name
2026-05-25 18:54:35 -07:00
Andrew Kelley 8f224bc3f0 rename addBuildPositionals to addCliExtras
they don't have to be positionals
2026-05-25 18:54:35 -07:00
Andrew Kelley 0d95b44a1c build system: implement cli positionals 2026-05-25 18:54:35 -07:00
Andrew Kelley 0f3471eb66 maker: finish porting over run step 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 378b790ee2 maker: port more of Run step over 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 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 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 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