0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
Commit graph

15,718 commits

Author SHA1 Message Date
Andrew Kelley
9add673f58 Maker: fix path to configurer.zig 2026-06-29 23:50:19 -07:00
Andrew Kelley
74168de68b Maker: fix lowering of build module on CLI 2026-06-29 23:50:19 -07:00
Andrew Kelley
20e7cc8d88 std.Build.Cache: bump max number of prefixes 2026-06-29 23:50:19 -07:00
Andrew Kelley
ad4887d1b8 Maker: fix arg parsing
init subcommand works now
2026-06-29 23:50:19 -07:00
Andrew Kelley
98854a673e Maker: it's compiling again 2026-06-29 23:50:19 -07:00
Andrew Kelley
27ae3b30ad WIP: also move init subcommand to Maker process 2026-06-29 23:50:18 -07:00
Andrew Kelley
0c978ba957 WIP: migrate build and fetch commands to Maker process 2026-06-29 23:50:18 -07:00
Andrew Kelley
a04f90c35b introduce std.Build API for making configure script depend on fs 2026-06-29 23:50:18 -07:00
Andrew Kelley
c616c00db6 Maker: restore "new" as the default build summary in watch mode 2026-06-29 23:50:18 -07:00
Andrew Kelley
6a052277c3 std.Build: document a handful of functions 2026-06-29 23:50:18 -07:00
Nguyen Gia Huy
1d1193aa7b
std.math: Mark signExtend as pub
Introduced in b636906fb6
2026-06-30 02:24:16 +00:00
Pavel Verigo
ba5420896d Enable std tests for wasm backend again + enable field reordering
Additionally remove some skips, closes #30575
2026-06-29 13:22:20 +02:00
Ali Cheraghi
85b0259307 Target: chain spirv versions 2026-06-28 18:25:43 +02:00
Lukas Lalinsky
e0e145048d Make it possible to implement Io.vtable.netWriteFile
- Fix error set to include the necessary errors
- Wire it into `Io.net.Stream.Writer`
2026-06-28 11:12:34 +02:00
fardragon
1467054bae In newline detection handle files that contain newlines, but don't end in one 2026-06-27 11:28:21 +02:00
fardragon
f05ceb6aa1 Merge remote-tracking branch 'origin/master' into fardragon/configheader-tests 2026-06-27 10:41:24 +02:00
Andrew Kelley
1581601ffa Merge pull request 'std.hash.crc: full namespace audit' (#35952) from crc-namespace into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35952
2026-06-27 09:32:09 +02:00
Arthur Teixeira
8f7febfa6f Step Runner: set color environment variables before executing test step 2026-06-27 03:19:14 +02:00
Andrew Kelley
072534bb2a std.hash.crc: restore auto-generated status 2026-06-26 16:13:19 -07:00
Andrew Kelley
c646f0e182 std.hash.crc: embrace standard names 2026-06-26 16:07:53 -07:00
Andrew Kelley
030e7d3567 std.hash.crc: restore auto-generated status 2026-06-26 16:07:53 -07:00
Andrew Kelley
3a11c86837 std.hash.crc: fix namespace issues
in accordance with the style guide in the langref
2026-06-26 16:07:53 -07:00
Robbie Lyman
32b44497e2 fix(Io.Uring): free size must match alloc size 2026-06-26 23:49:16 +02:00
Andrew Kelley
07782d7a46 Merge pull request 'hash: implement fast crc32c' (#30021) from sinon/zig:fast-crc32c into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/30021
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-06-26 23:46:46 +02:00
whatisaphone
b636906fb6 std.math: Add signExtend 2026-06-26 23:30:13 +02:00
Alex Rønne Petersen
1999d80d6e Merge pull request 'Elf2: add initial LoongArch support' (#35875) from AstraFall/zig:loongarch/elf2/init into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35875
Reviewed-by: mlugg <mlugg@noreply.codeberg.org>
2026-06-26 02:08:14 +02:00
Andrew Kelley
56e313b288 Merge pull request 'Asserts InternPool keys have unique representations' (#35914) from masonremaley/intern-pool-unique-key-reprs into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35914
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-06-25 20:38:05 +02:00
Andrew Kelley
cd3288a3f6 Merge pull request 'Coff linker enhancements, new linker testing framework, and COFF objdump implementation' (#35674) from kcbanner/zig:coff_linker_wip into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35674
Reviewed-by: Jacob Young <jacobly@ziglang.org>
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-06-25 19:20:51 +02:00
xtex
360deedcf1
std.elf: add LoongArch e_flags definition
Link: 44ef5f63e1/laelf.adoc (L74-L93)
2026-06-25 22:12:55 +08:00
xtex
e048c90545
std.elf: add R_LARCH relocations 2026-06-25 22:06:24 +08:00
Ali Cheraghi
e8ccd4fbcd spirv: allow specifying texel type for storage images 2026-06-25 15:47:10 +02:00
Ryan Liptak
64c5cc8047 resinator: Sync with upstream
Fixes a bug where certain non-ASCII filenames would lead to errors
2026-06-25 15:13:00 +02:00
Mason Remaley
87860e80b4 Adds unions support to hasUniqueRepresentation 2026-06-24 22:11:49 -07:00
Robbie Lyman
f3544a7079 fix: Allocator contract should allow free on single-pointer-to-array
Currently, when calling `free` a slice created by slicing a pointer with
comptime-known start and end, a compile-time assertion is hit, because
the slicing results in `*[len]T` rather than the expected `[]T`.

This commit allows `Allocator.free` to be called on such pointers as
well.

closes #35712
2026-06-25 02:09:34 +02:00
Andrew Kelley
92505a7de7 std: move fmt.bufPrint to mem.print 2026-06-24 17:01:19 -07:00
Andrew Kelley
9dda196eea Merge pull request 'std: move fmt.allocPrint to Allocator and document it' (#35926) from Allocator.print into master
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35926
2026-06-25 01:59:23 +02:00
Alex Rønne Petersen
7ff1556502
libcxx: update to LLVM 22.1.8 2026-06-25 01:46:47 +02:00
Andrew Kelley
243192c60e std.mem.Allocator: add unit tests for print and printSentinel 2026-06-24 14:16:50 -07:00
Andrew Kelley
745a029b9e std: move fmt.allocPrint to Allocator.print 2026-06-24 14:09:30 -07:00
Techatrix
5f78220dbe std.Build.Step.Run: add support specifying preopens 2026-06-24 21:10:43 +02:00
Techatrix
d95dcb2a62 std.Build.Step.Compile: remove setExecCmd
This function can be used to prepend a list of arguments when running a
test step. Instead, the additional arguments should be manually added to
the run step which can handle a broader set of use cases.
2026-06-24 20:57:36 +02:00
pentuppup
a078d55a25 fix compile error in web interface 2026-06-24 14:45:43 -04:00
Ryan Liptak
d3f7cf7345 Io.Threaded: Fix dirReadLinkWindows not handling its async handle correctly
NtCreateFile is called with `.IO = .ASYNCHRONOUS` but then `NtFsControlFile` is called without any handling of `PENDING`. By switching to the `deviceIoControl` helper function, `PENDING` is handled since we are passing `.nonblocking = true`.

Fixes https://codeberg.org/ziglang/zig/issues/35871
2026-06-24 20:15:50 +02:00
mlugg
39a9a4b2ca Merge pull request 'llvm: only load/store ABI-sized integers to/from memory' (#35711) from mlugg/llvm-weird-int-in-memory into master
Resolves: https://github.com/ziglang/zig/issues/17768
Resolves: https://github.com/ziglang/zig/issues/18936
Resolves: https://github.com/ziglang/zig/issues/19755
Resolves: https://github.com/ziglang/zig/issues/24282
Resolves: https://github.com/ziglang/zig/issues/24883
Resolves: https://github.com/ziglang/zig/issues/25042
Resolves: https://github.com/ziglang/zig/issues/25555
Resolves: https://codeberg.org/ziglang/zig/issues/32036
Resolves: https://codeberg.org/ziglang/zig/issues/35560
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/35711
Reviewed-by: Andrew Kelley <andrew@ziglang.org>
2026-06-24 17:28:01 +02:00
Matthew Lugg
664c1d0198
cbe: disable some failing tests 2026-06-24 10:20:56 +01:00
Matthew Lugg
2e05249544
compiler_rt: update for new @bitCast semantics 2026-06-24 10:20:56 +01:00
Matthew Lugg
10c97c26d9
std: update for new @bitCast semantics 2026-06-24 10:20:56 +01:00
Matthew Lugg
fa3a9fcdfa
llvm: only load/store ABI-sized integers to/from memory
In theory, for any integer type containing padding bits (e.g. `i3`),
LLVM *does* support storing and loading that type to and from memory,
and the documented semantics for this in the LLVM langref are a valid
implementation of Zig's integer semantics. However, in practice, this
support is frequently buggy, because Clang never emits such operations
and so they are poorly tested in LLVM. The most recent example of such a
bug is https://codeberg.org/ziglang/zig/issues/35560.

In addition, LLVM's semantics here lead to suboptimal codegen, because
loads/stores are only rounded up to the next byte (rather than the next
ABI integer type) and padding bits are unspecified (or, on LLVM master,
padding bits are all zero, even for a negative signed integer).

We can both mitigate LLVM bugs and get better codegen by employing the
strategy used by the self-hosted backends, wherein we zero- or
sign-extend to an integer of bit size `@sizeOf(WeirdInt) * 8`. This type
has the same size in memory but has no padding bits. When loading, we
load the extended type and then use `trunc nuw` or `trunc nsw`
(depending on the signedness) to convert to the correct value type.

The name of the game here is to minimize occurrences of `wip.load` and
`wip.store` in the LLVM backend, with most accesses instead going
through higher-level functions which handle this extension/truncation
for us. Those higher-level functions are `codegen.llvm.FuncGen.load` and
`codegen.llvm.FuncGen.store`. I changed their signatures slightly to
make them consistent and more generally useful, and changed the majority
of calls to `wip.load`/`wip.store` to use them. They are the only
functions which include the integer extension/truncation logic.

The remaining occurrences of `wip.load` and `wip.store` outside of those
two functions are all in ABI handling. These code paths cannot occur for
non-ABI types due to how we lower `CallingConvention.auto`, therefore
they cannot be reached for non-ABI-sized integer types.

This diff was not purely mechanical---I had to make a handful of
non-trivial logic changes and refactors. The biggest logic change is in
lowering a "select" operation to a manual loop: we now use phi nodes to
track the loop iterator and accumulator instead of an `alloca`. (To be
honest, this wasn't really necessary, but I felt dirty migrating the old
logic when this approach is clearly better.) The most significant
refactor is that the logic for extracting function call arguments has
been moved into `FuncGen`: the `codegen.llvm.Object.updateFunc`
implementation will not initialize the three fields which depend on
function arguments, and a new function `FuncGen.genMainBody` will
populate those fields before calling `genBody` on the main AIR body.
This change was made so that I could use member functions on `FuncGen`
in this logic without jumping through hoops.

The reproduction given in https://codeberg.org/ziglang/zig/issues/35560
is apparently quite delicate, so I haven't added a test case because it
realistically would not be very useful. However, I have manually tested
the reproduction, and can confirm that the bug *does* trigger before
this commit (targeting both baseline and native CPU), and does *not*
trigger after this commit (again, for both baseline and native CPU).

Resolves: https://codeberg.org/ziglang/zig/issues/35560
2026-06-24 10:20:52 +01:00
David Rubin
2e1b172850 codegen: fix x86-64 backend crc32 inline asm 2026-06-24 02:12:43 -05:00
David Rubin
874b6e39db hash: implement fast crc32c 2026-06-24 02:12:43 -05:00