Commit graph

37290 commits

Author SHA1 Message Date
Andrew Kelley
66ee28813a maker: implement module printing 2026-03-02 20:56:48 -08:00
Andrew Kelley
934bedf8b3 Configuration: serialize remaining Module information
also handle properly Module circular references and introduce a general
deduplication mechanism.
2026-03-02 19:46:22 -08:00
Andrew Kelley
fce7d8cf6d Configuration: serialize remaining Target information 2026-03-02 12:27:12 -08:00
Andrew Kelley
414de8893f compiler: no longer need ThreadSafeArena wrapper 2026-03-02 12:10:48 -08:00
Andrew Kelley
ec009cd68e Configuration: complete serialization of Compile steps 2026-03-02 12:07:29 -08:00
Andrew Kelley
8f74cf3222 maker: progress towards updating zig CLI lowering 2026-03-02 12:07:29 -08:00
Andrew Kelley
e911add06f Configuration: implement UnionList storage 2026-03-02 12:07:29 -08:00
Andrew Kelley
f45c4925a5 rename configure_runner to configurer 2026-03-02 12:07:29 -08:00
Andrew Kelley
177d4e615e configurer: serialize 3 more Module fields 2026-03-02 12:07:29 -08:00
Andrew Kelley
2748743122 Configuration: implement FlagLengthPrefixedList 2026-03-02 12:07:29 -08:00
Andrew Kelley
45fcf22ad9 Configuration: implement Storage.EnumOptional 2026-03-02 12:07:29 -08:00
Andrew Kelley
4b950ac055 ScannedConfig: more general zon printing
it's almost all automated now
2026-03-02 12:07:29 -08:00
Andrew Kelley
b3d4c1e3a3 std.zon.Serializer: slightly more helpful message
when a type is unserializable
2026-03-02 12:07:29 -08:00
Andrew Kelley
a080de3284 Configuration: type safety for extended pattern 2026-03-02 12:07:29 -08:00
Andrew Kelley
0da081b358 Maker: don't include non-root top level steps 2026-03-02 12:07:29 -08:00
Andrew Kelley
fd9835f066 ScannedConfig: print Step.TopLevel 2026-03-02 12:07:29 -08:00
Andrew Kelley
71e26fa6ae ScannedConfig: print Step header data 2026-03-02 12:07:29 -08:00
Andrew Kelley
2d410093af Maker: move ScannedConfig to separate file 2026-03-02 12:07:29 -08:00
Andrew Kelley
c41ccfd664 std.Build.Configure: implement FlagOptional serialization 2026-03-02 12:07:29 -08:00
Andrew Kelley
3f86783f74 zig build: make --error-limit globally configurable
still overridable by individual Compile steps
2026-03-02 12:07:29 -08:00
Andrew Kelley
e49e012a7d std.build.Configuration: sketch a data layout idea 2026-03-02 12:07:29 -08:00
Andrew Kelley
8fbfcf34d1 Maker.Step.Compile: progress towards lowering zig args 2026-03-02 12:07:29 -08:00
Andrew Kelley
224d0598e3 massage Step code into compiling 2026-03-02 12:07:29 -08:00
Andrew Kelley
4750ee5137 build maker: rename files to match type 2026-03-02 12:07:29 -08:00
Andrew Kelley
b1b733bf9f build maker: rename Run to Maker 2026-03-02 12:07:29 -08:00
Andrew Kelley
ef874f446d make runner: execute step graph 2026-03-02 12:07:29 -08:00
Andrew Kelley
4fa061cc6a make runner: prepare steps for execution 2026-03-02 12:07:29 -08:00
Andrew Kelley
d0c431674a make runner gets compiled and run
and --print-configuration prints some deserialized stuff
2026-03-02 12:07:29 -08:00
Andrew Kelley
c4d4988db7 configure runner: implement builderToPackage 2026-03-02 12:07:28 -08:00
Andrew Kelley
5ff98159db configure runner: serialization of Module 2026-03-02 12:07:28 -08:00
Andrew Kelley
18ecac20b6 configure runner: serialization of compile step 2026-03-02 12:07:28 -08:00
Andrew Kelley
e8a24a2098 configure runner: add Step.Run serialization 2026-03-02 12:07:28 -08:00
Andrew Kelley
6a4603368c configure runner: implement serialization of InstallArtifact 2026-03-02 12:07:28 -08:00
Andrew Kelley
2b0a8ad103 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-03-02 12:07:28 -08:00
Andrew Kelley
08b5f7e78c std.Io.Threaded: support passing a file handle to child proc 2026-03-02 12:07:28 -08:00
Andrew Kelley
297a923a2f zig build: configure runner basics implemented 2026-03-02 12:07:27 -08:00
Andrew Kelley
2b0c34eff9 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-03-02 12:05:14 -08:00
Alex Rønne Petersen
421c3c3cc5 ci: update qemu to 10.2.1.1
https://patchwork.kernel.org/project/qemu-devel/list/?series=1059138
2026-03-02 19:25:09 +01:00
invlpg
0a2f6a048b fix msghdr and cmsghdr on non-Linux targets, document musl behaviour
The following assertions fail on non-Linux platforms after c0c2010535
which inserted padding based on musl definitions. This padding only
exists on musl to workaround a discrepancy betweeen the POSIX API and
Linux ABI, and is incorrect on other POSIX operating systems.

This change makes the padding musl-only, and documents the reason it
exists. With this change, the assertions pass on Linux and FreeBSD
targets. The corresponding definitions on other targets line up with the
POSIX and FreeBSD ones, so they should work there too.

```zig
const std = @import("std");
const assert = std.debug.assert;
const msghdr = std.c.msghdr;
const cmsghdr = std.c.cmsghdr;

const c = @cImport({
    @cInclude("sys/socket.h");
});

comptime {
    assert(@offsetOf(msghdr, "iovlen") == @offsetOf(c.msghdr, "msg_iovlen"));
    assert(@offsetOf(msghdr, "controllen") == @offsetOf(c.msghdr, "msg_controllen"));
    assert(@offsetOf(msghdr, "control") == @offsetOf(c.msghdr, "msg_control"));
    assert(@offsetOf(msghdr, "flags") == @offsetOf(c.msghdr, "msg_flags"));

    assert(@sizeOf(msghdr) == @sizeOf(c.msghdr));

    assert(@offsetOf(cmsghdr, "len") == @offsetOf(c.cmsghdr, "cmsg_len"));
    assert(@offsetOf(cmsghdr, "level") == @offsetOf(c.cmsghdr, "cmsg_level"));

    assert(@sizeOf(cmsghdr) == @sizeOf(c.cmsghdr));
}
```
2026-03-02 17:46:26 +01:00
rpkak
442b292a37
zig fetch: wait until all jobs are finished 2026-03-02 10:17:55 +01:00
Ryan Liptak
e58fea8227 tar: Fix symlink test when symlinks can't be created on Windows 2026-03-01 15:01:51 -08:00
hemisputnik
74f361a5ce std.math.big.int: address log2/log10 reviews
There were good reviews made after #31365 was merged, so this commit
addresses them separately.

1. Assert that the number is greater than zero
2. Use `constants` instead of calculating constants manually
3. Use `Const.bitCountAbs` for log2
2026-03-01 20:34:17 +01:00
Alex Rønne Petersen
da6d4e28ef
Revert "ci: disable aarch64-freebsd"
This reverts commit 104e73ecb2.

The OOM issues should be resolved now.
2026-03-01 17:54:47 +01:00
Alex Rønne Petersen
104e73ecb2
ci: disable aarch64-freebsd
Working through some OOM issues.
2026-03-01 12:04:55 +01:00
Alex Rønne Petersen
bf13b6b41d
test: partially disable cmakedefine standalone test
https://codeberg.org/ziglang/zig/issues/31368
2026-03-01 11:53:05 +01:00
Andrew Kelley
9ef1050bb3 Merge pull request 'std.math.big.int: add log2 and log10 operations' (#31365) from hemisputnik/zig:work/13642-bigint-log2-log10 into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31365
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-03-01 03:35:16 +01:00
hemisputnik
bd6f512f0c
std.math.big.int: add log10 2026-02-28 20:16:32 +02:00
Alex Rønne Petersen
41594c1903 Merge pull request 'enable aarch64-freebsd CI' (#31354) from alexrp/zig:aarch64-freebsd-ci into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/31354
2026-02-28 08:19:51 +01:00
Alex Rønne Petersen
b3c8c0df0d ci: switch to VS 2026 in x86_64-windows scripts 2026-02-28 07:08:06 +01:00
Andrew Kelley
02142a54d2 std.Io: remove cancelation propagation assertions
While the general guidance remains useful, it is not the case that
error.Canceled will always pass across the Group task function boundary.

Remove the too-aggressive assertions and add unit test coverage.

Closes #30096
Closes #31340
Closes #31358
2026-02-28 05:07:54 +01:00