Commit Graph

13491 Commits

Author SHA1 Message Date
Andrew Kelley 7fa49fc283 maker: add the --listen and --seed args back to run 2026-04-29 15:53:30 -07:00
Andrew Kelley f00d4e966a maker: finish porting over run step 2026-04-29 15:36:33 -07:00
Andrew Kelley 9929f420a9 maker: port Run step logic up to spawnChildAndCollect 2026-04-27 20:58:30 -07:00
Andrew Kelley 0bd424beaa std.process.Environ.Map: add putAll and clearRetainingCapacity 2026-04-27 20:57:58 -07:00
Andrew Kelley 2c59c419c3 maker: port more of Run step over 2026-04-27 13:05:32 -07:00
Andrew Kelley d0379c0def fix compilation errors from rebase conflicts 2026-04-27 13:05:32 -07:00
Andrew Kelley e92959df9c maker: upgrade some of the run step logic 2026-04-27 13:05:32 -07:00
Andrew Kelley 4bbb8ce63b configurer: serialize all data from run steps 2026-04-27 13:05:32 -07:00
Andrew Kelley 28d27e672b compiler: fix compilation errors 2026-04-27 13:05:32 -07:00
Andrew Kelley a33b2b2ca1 configurer: back out the string interning from prev commit
partial revert of 2d3fbb687fba1ed52b42998ac4dcbf2a042644ea - see its
commit message for reasoning
2026-04-27 13:05:32 -07:00
Andrew Kelley 3f2cbd5624 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-04-27 13:05:32 -07:00
Andrew Kelley 6244f48b1e maker: implement InstallArtifact and InstallFile 2026-04-27 13:05:32 -07:00
Andrew Kelley d97ec7d894 maker: finish migrating compile step make logic 2026-04-27 13:05:31 -07:00
Andrew Kelley 6518b6787a Configuration: refactor maxInt(u32) 2026-04-27 13:05:07 -07:00
Andrew Kelley 31b591d614 Configuration: fix bad serialization of PrefixedList and MultiList
Length zero is still serialized because there is no flag bit to hide the
length.
2026-04-27 13:05:07 -07:00
Andrew Kelley c3d8e606ba maker: finish migrating most of CLI lowering code 2026-04-27 13:05:07 -07:00
Andrew Kelley 6ccd6a070d maker: progress towards lowering zig cli args 2026-04-27 13:05:07 -07:00
Andrew Kelley 0cd81e2235 std: rename zig.Configuration to Build.Configuration 2026-04-27 13:05:07 -07:00
Andrew Kelley d1587dcd3f 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-04-27 13:05:07 -07:00
Andrew Kelley 1081519099 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-04-27 13:05:07 -07:00
Andrew Kelley 3bd875024d Configuration: serialize remaining CSourceFiles information 2026-04-27 13:05:07 -07:00
Andrew Kelley 3d41434a5d maker: implement module printing 2026-04-27 13:05:07 -07:00
Andrew Kelley 7ab4e84697 Configuration: serialize remaining Module information
also handle properly Module circular references and introduce a general
deduplication mechanism.
2026-04-27 13:05:07 -07:00
Andrew Kelley 6c6b0b9473 Configuration: serialize remaining Target information 2026-04-27 13:05:07 -07:00
Andrew Kelley fc63c3bd69 Configuration: complete serialization of Compile steps 2026-04-27 13:05:07 -07:00
Andrew Kelley 4711c1a554 maker: progress towards updating zig CLI lowering 2026-04-27 13:05:07 -07:00
Andrew Kelley e71739ad88 Configuration: implement UnionList storage 2026-04-27 13:05:07 -07:00
Andrew Kelley 9b938d45ae configurer: serialize 3 more Module fields 2026-04-27 13:05:07 -07:00
Andrew Kelley 93c7bd61e0 Configuration: implement FlagLengthPrefixedList 2026-04-27 13:05:07 -07:00
Andrew Kelley 207d2ae7b2 Configuration: implement Storage.EnumOptional 2026-04-27 13:05:07 -07:00
Andrew Kelley 02aff33353 ScannedConfig: more general zon printing
it's almost all automated now
2026-04-27 13:05:07 -07:00
Andrew Kelley 1579ead44b std.zon.Serializer: slightly more helpful message
when a type is unserializable
2026-04-27 13:05:07 -07:00
Andrew Kelley bb7a4fe244 Configuration: type safety for extended pattern 2026-04-27 13:05:07 -07:00
Andrew Kelley a64f16e88c std.Build.Configure: implement FlagOptional serialization 2026-04-27 13:05:07 -07:00
Andrew Kelley 4141060b7b zig build: make --error-limit globally configurable
still overridable by individual Compile steps
2026-04-27 13:05:07 -07:00
Andrew Kelley 8646288def std.build.Configuration: sketch a data layout idea 2026-04-27 13:05:07 -07:00
Andrew Kelley 019e80313e Maker.Step.Compile: progress towards lowering zig args 2026-04-27 13:05:07 -07:00
Andrew Kelley 70e89f5f46 massage Step code into compiling 2026-04-27 13:05:05 -07:00
Andrew Kelley 3e192424ae make runner: prepare steps for execution 2026-04-27 13:04:32 -07:00
Andrew Kelley 7ed0118c79 make runner gets compiled and run
and --print-configuration prints some deserialized stuff
2026-04-27 13:04:32 -07:00
Andrew Kelley 0f9a5889a1 configure runner: implement builderToPackage 2026-04-27 13:04:32 -07:00
Andrew Kelley 6ed2b47ce6 configure runner: serialization of Module 2026-04-27 13:04:32 -07:00
Andrew Kelley 5efa5c0e8b configure runner: serialization of compile step 2026-04-27 13:04:32 -07:00
Andrew Kelley 55c5f3e3b9 configure runner: add Step.Run serialization 2026-04-27 13:04:32 -07:00
Andrew Kelley c64916ad71 configure runner: implement serialization of InstallArtifact 2026-04-27 13:04:32 -07:00
Andrew Kelley 949d898d61 std.Io.Writer: placeholder code for new {q} format character
intendend to print something with double quotes, escaped the same as a
zig string literal.
2026-04-27 13:04:32 -07:00
Andrew Kelley 643f26c9a9 zig build: configure runner basics implemented 2026-04-27 13:04:31 -07:00
Andrew Kelley 0ce01d2131 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-27 11:28:33 -07:00
mihael 764760df62 libzigc/math: Implement rintl, lrintl (#31791)
It's a fairly straightforward port of `musl`'s `rintl`, like `rint` and `rintf` were. `libc-test` tests for `rintl` are uncommented since they're now passing.

I've also covered special cases for `rint` with tests, and broke down the current `rint` and `modf` test declarations into multiple -- so each libc function get its own test declaration at the very least.

Contributes to #30978

Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31791
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-04-27 16:48:55 +02:00
GasInfinity 1deb029a66 std: rename bit_set variants and deprecate the managed one.
* aliases and deprecates the previous names.
* also update callsites to use the non-deprecated declarations.
2026-04-27 16:46:26 +02:00