Commit Graph
657 Commits
Author SHA1 Message Date
Alex Rønne Petersen eb8ab541be libc: add darwin header os/os_sync_wait_on_address.h 2026-10-07 00:30:52 +02:00
Alex Rønne Petersen bcc451758e zig cc: update options data to LLVM 23 2026-10-07 00:30:51 +02:00
Alex Rønne Petersen 53173d25ab std.Target: update CPU models and features to LLVM 23 2026-10-07 00:30:51 +02:00
Jacob Young 00b59eb18a Runner: implement error reporting 2026-09-26 19:08:50 -04:00
Jacob Young b6f68ca4ba Runner: implement cbe backend 2026-09-26 19:08:50 -04:00
Jacob Young ec261c5e8d test-incremental: convert tests to new format 2026-09-26 19:08:50 -04:00
Jacob Young 488c15320b runner: spawn compiler process 2026-09-26 19:08:50 -04:00
Jacob Young 207c883bfb runner: implement skip commands 2026-09-26 19:08:50 -04:00
Jacob Young 11958a306f test: implement new runner 2026-09-26 19:08:50 -04:00
Andrew Kelley d09c1aef02 maker: serialize compilation errors of configurer over the build protocol
serves an ErrorBundle as a configuration_failed message instead of
configuration message upon connection. at this point the protocol enters
an invalid state and the process will need to be restarted in order to
reconfigure. in the future, build server should outlive
reconfigurations.

closes #36389
2026-09-25 11:47:25 -07:00
Andrew Kelley 3d2207fc79 build server protocol: send generated file paths
closes #36403
2026-09-24 23:10:27 -07:00
Ali Cheraghi 65b95b0af4 add unskip_spirv_tests.zig tool 2026-09-18 16:36:24 +03:30
Ali Cheraghi c4c3818c39 gen_spirv_spec: shrink output 2026-09-18 16:36:24 +03:30
Andrew Kelley 5549d9bbe3 incr-check: pass local and global cache overrides also to C compilation
and simplify by using `zig build-exe` rather than `zig cc`
2026-09-16 14:52:32 -07:00
Andrew Kelley 117fc710ee incr-check: log the subprocess argv and cwd 2026-09-16 13:12:47 -07:00
lg 39512c3e55 compiler: add support for patchable functions 2026-09-16 19:21:21 +02:00
Linus Groh 66f53abf3c tools: Update fetch_them_macos_headers.zig for macOS 27 2026-09-11 00:08:56 +01:00
Jacob Young 79bb28aa57 Elf2: implement dwarf unwind info
Other debug info is still in progress.

Closes #25421
2026-09-03 11:00:53 -04:00
Pavel Verigo 79837d5112 incr-check: update timestamp on each update 2026-09-01 21:22:06 +02:00
K4 2c93c6e91b std.lang.OptimizeMode -> std.lang.Optimize migration progress 2026-08-23 14:30:48 +02:00
Andrew Kelley 6ddb6f5759 regenerate parser oracle 2026-08-20 17:35:12 -07:00
Andrew Kelley 515a494220 Merge pull request 'loongarch: self-hosted backend' (#36418) from AstraFall/zig:loongarch/isel-pr into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36418
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-08-20 22:01:52 +02:00
Andrew Kelley 7b0f777ffd update tools/check_mingw.zig to new API 2026-08-19 12:39:37 -07:00
Matthew Lugg cecc3e1b91 incr-check: restore stderr printing logic
Jacob just hit this confusing panic while working on DWARF stuff. I'm
not sure how this was regressed---the code prior to build system rework
already handled this case correctly by `break`ing to code after the
loop, which was written specifically to handle this case. All we need to
do is restore that `break`, and everything works again.
2026-08-11 09:33:35 +01:00
xtex 0fe1894158 tools: add LoongArch opcode encoding generator
This tool reads data from loongarch-opcodes.git
and generates three data files.

encoding.zig contains an enum of mnemonics, a packed
union of packed structs to represent bit-fields
in instructions and encoder functions for each
instruction.

inst_formats.zon contains required target feature
set for each instruction, which can be used by
the backend to, under debug mode, verify if it
emits any instruction that is not supported by
the compilation target.
It also contains information about slots in each
instruction format, their type, location and
postprocessing, which can be used by disassemblers.

decode_tree.zon is the auto-generated decode tree,
which will be used by disassemblers.

Signed-off-by: xtex <xtex@astrafall.org>
2026-08-08 10:53:46 +08:00
Saurabh MishraandRyan Liptak 21f2381438 std.ArrayListUnmanaged: last and lastPtr methods (#36318)
ArrayList:

- `getLastOrNull` has been deprecated and renamed to `last`
- `getLast` has been removed in favor of `last` combined with `.?`
- `lastPtr` has been added which returns `?*T`

Upgrade guide:

```zig
if (list.getLastOrNull()) |foo| {
    // ...
}
const foo = list.getLast();
```
⬇️
```zig
if (list.last()) |foo| {
    // ...
}
const foo = list.last().?;
```

Co-authored-by: Ryan Liptak <squeek502@hotmail.com>
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36318
Reviewed-by: Ryan Liptak <squeek502@noreply.codeberg.org>
2026-08-07 07:30:10 +02:00
Krzysztof Wolicki ab4028d579 Update usages of most deprecated APIs
In particular renames of `std.mem.indexOf` family to `std.mem.find`
and generic unmanaged containers
2026-08-05 03:40:30 +02:00
Andrew Kelley 5bf19f61ff Merge pull request 'Implement foundation of the build system protocol' (#36147) from Techatrix/zig:build-system-protocol into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/36147
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-08-05 01:42:28 +02:00
Alex Rønne Petersen 086f8d7b22 update_glibc: exclude some 2.32 crt0 files 2026-08-02 09:48:22 +02:00
Alex Rønne Petersen 23aa045ef4 libc: update glibc headers to 2.44 2026-07-31 23:04:47 +02:00
Jacob Young 865f329e4f cbe: update for compiler_rt abi changes
* `tools/generate_c_size_and_align_checks.zig`: superceded by any cbe
   output artifact
 * `cTypePreferredAlignment`: no uses, if brought back, cbe should be
   updated to verify `__alignof`

Closes #19991
Closes #20881
Closes #35523
2026-07-27 14:35:12 -04:00
Techatrix 38efc69dc9 Maker: serve build status over protocol 2026-07-21 16:31:30 +02:00
Techatrix 54162b1b9d Maker: implement build steps request 2026-07-21 16:31:29 +02:00
Techatrix f58c93b566 Maker: implement build system protocol foundation 2026-07-21 16:31:04 +02:00
Techatrix 0b681ec6c3 std.zig.Client: introduction 2026-07-21 14:34:40 +02:00
Andrew Kelley ae4e835a66 std.lang: rename OptimizeMode to Optimize
and remove "release" from the enum tag names.

no functional change, however, despite the addition of
backwards-compatibile declarations in this patch, it is breaking because
expressions that use `==` or `!=` operators will not able to use the
deprecated names.

I predict these names to survive until the 1.0 tag without any more
breakage.
2026-07-20 17:26:50 -07:00
Justus Klausecker 69a26976ed zig fmt
Converts usages of `@intFromEnum` and `@enumFromInt` to instead use the
new `@backingInt` and `@fromBackingInt` builtins.
2026-07-17 23:30:26 +02:00
Ryan Liptak e07edda6e7 gen_parser_oracle: Handle CRLF line endings, fail on invalid grammar 2026-07-10 12:18:39 +02:00
Andrew Kelley 65073f3dc5 std.zig.Ast: move mode into ParseOptions 2026-07-08 18:26:18 -07:00
Isaac Freund b2c3c33eef build: check if parser oracle must be regenerated 2026-07-08 15:49:43 +02:00
Isaac Freund 06b1896a61 build: add gen-parser-oracle step 2026-07-08 15:49:43 +02:00
Isaac Freund 3e45baa60a std.zig.Ast.parse: introduce options struct
This is a much cleaner way to expose the new option to disable recovery
added in 62720ad9f9. It also makes it possible to add further
options in the future without further breaking changes.
2026-07-08 15:49:18 +02:00
Isaac Freund 5bafdbf9d8 tools/gen_parser_oracle: gen recursion guards for all defs
More rules are being made recursive for efficiency reasons, see the
previous commit.
2026-07-08 11:49:02 +02:00
Isaac Freund e6749167fe tools: enforce Block max depth in parser oracle 2026-07-08 11:49:01 +02:00
Isaac Freund 775dac9149 tools: add max depth to parser oracle
This is useful to avoid unbounded recursion/iteration while fuzzing.
It's not interesting to learn that the parser hits a stack overflow when
fed a million open parens for example.
2026-07-08 11:49:00 +02:00
Isaac Freund 068d483780 grammar: fix doc comment at start of file
My attempt to handle this case in 6f151109b5fdf88eb8b has proven
insufficient, the test case added by this commit was failing.

Solve this with a "start of file" non-terminal in the PEG grammar,
which unfortunately isn't portable but much better reflects the actual
implementation and is much simpler.
2026-07-08 11:48:59 +02:00
Isaac Freund ac6930544f grammar: fix operator whitespace after multiline string literal
Currently the grammar fails to enforce matching whitespace or lack of
whitespace around operators that are immediately preceded by a multiline
string literal and terminating newline.
2026-07-08 11:48:58 +02:00
Isaac Freund 20a2485061 tools: add oracle generator for parser fuzzing
This script parses a PEG grammar definition and generates a simple
recursive descent parser that recognizes that grammar.

The intent is to use this tool to generate an oracle against which
std.zig.Ast.parse() can be fuzz tested.

Unfortunately, generating a "smith" that can produce all possible valid
source code according to the PEG grammar definition does not seem
feasible due to PEG semantics. In particular, modeling the ordered
choice operator ('/') with a smith is problematic and seems to have
worst-case exponential runtime. Consider that `A / B` is equivalent to
`A / !A B`, it is not sufficient for a smith to choose an option from
the ordered choice at random and generate an input matched by that
sub-expression.

The current handwritten AstSmith.zig implementation does not match the
exact semantics of the PEG grammar. It has some hacks (see the `not_*`
variables) to work around specific instances of the general problem
with ordered choice described above but that is not an acceptable
long term solution in my opinion.

Generating the oracle for the fuzz test automatically from the PEG
makes the oracle correct by construction and gives us a single source of
truth: the PEG definition in the language spec.
2026-07-08 11:48:57 +02:00
Isaac Freund 8229720726 langref: move grammar.peg to separate file
This improves the developer experience, especially with the new
gen_parser_oracle tool. My intent is for doc/langref/grammar.peg
to be the single source of truth, at least until we have an actual
language spec.

The separate copy in the separate zig-spec repo should not be considered
canonical as it is not tested against by CI.
2026-07-08 11:48:57 +02:00
Alex Rønne Petersen 3e6b2c6b03 std.Target: fix definition of generic_la64 CPU model
LLVM's generic_la64 model is clearly biased towards Loongson's current offerings
rather than actually reflecting a generic model in the architectural sense. So
fix it up on our side.
2026-07-06 23:27:58 +02:00