Compare commits

...

6 commits

Author SHA1 Message Date
Pavel Verigo
49ef28a5f1 sema: fix error_return_trace_index handling in zirCondBr 2025-12-05 18:42:47 +01:00
Matthew Lugg
ea94ac52c5
std.debug: skip manage resources correctly with cbe
Some checks are pending
ci / aarch64-linux-debug (push) Waiting to run
ci / aarch64-linux-release (push) Waiting to run
ci / aarch64-macos-debug (push) Waiting to run
ci / aarch64-macos-release (push) Waiting to run
ci / loongarch64-linux-debug (push) Waiting to run
ci / loongarch64-linux-release (push) Waiting to run
ci / riscv64-linux-debug (push) Waiting to run
ci / riscv64-linux-release (push) Waiting to run
ci / s390x-linux-debug (push) Waiting to run
ci / s390x-linux-release (push) Waiting to run
ci / x86_64-freebsd-debug (push) Waiting to run
ci / x86_64-freebsd-release (push) Waiting to run
ci / x86_64-linux-debug (push) Waiting to run
ci / x86_64-linux-debug-llvm (push) Waiting to run
ci / x86_64-linux-release (push) Waiting to run
ci / x86_64-windows-debug (push) Waiting to run
ci / x86_64-windows-release (push) Waiting to run
2025-12-05 15:10:58 +01:00
Aidan Welch
032e3c9254 std.Io.Timestamp: when creating a Clock.Timestamp actually set .raw instead of the non-existant .nanoseconds
Some checks are pending
ci / aarch64-linux-debug (push) Waiting to run
ci / aarch64-linux-release (push) Waiting to run
ci / aarch64-macos-debug (push) Waiting to run
ci / aarch64-macos-release (push) Waiting to run
ci / loongarch64-linux-debug (push) Waiting to run
ci / loongarch64-linux-release (push) Waiting to run
ci / riscv64-linux-debug (push) Waiting to run
ci / riscv64-linux-release (push) Waiting to run
ci / s390x-linux-debug (push) Waiting to run
ci / s390x-linux-release (push) Waiting to run
ci / x86_64-freebsd-debug (push) Waiting to run
ci / x86_64-freebsd-release (push) Waiting to run
ci / x86_64-linux-debug (push) Waiting to run
ci / x86_64-linux-debug-llvm (push) Waiting to run
ci / x86_64-linux-release (push) Waiting to run
ci / x86_64-windows-debug (push) Waiting to run
ci / x86_64-windows-release (push) Waiting to run
2025-12-05 14:14:01 +01:00
Luna Schwalbe
adc5a39de2 Change github links to codeberg 2025-12-05 14:12:39 +01:00
Loris Cro
58e3c2cefd make Io.net.sendMany compile 2025-12-05 11:50:04 +01:00
Alex Rønne Petersen
c166bb36f6
ci: reduce x86_64-linux timeouts
These excessive timeouts should no longer be necessary with the recent tuning of
job capacity and maxrss on these machines.
2025-12-04 20:52:34 +01:00
10 changed files with 47 additions and 18 deletions

View file

@ -152,7 +152,7 @@ jobs:
fetch-depth: 0
- name: Build and Test
run: sh ci/x86_64-linux-debug.sh
timeout-minutes: 240
timeout-minutes: 180
x86_64-linux-debug-llvm:
runs-on: [self-hosted, x86_64-linux]
steps:
@ -162,7 +162,7 @@ jobs:
fetch-depth: 0
- name: Build and Test
run: sh ci/x86_64-linux-debug-llvm.sh
timeout-minutes: 480
timeout-minutes: 360
x86_64-linux-release:
runs-on: [self-hosted, x86_64-linux]
steps:
@ -172,7 +172,7 @@ jobs:
fetch-depth: 0
- name: Build and Test
run: sh ci/x86_64-linux-release.sh
timeout-minutes: 480
timeout-minutes: 360
x86_64-windows-debug:
runs-on: [self-hosted, x86_64-windows]

View file

@ -485,16 +485,14 @@ interpret your words.
### Find a Contributor Friendly Issue
The issue label
[Contributor Friendly](https://github.com/ziglang/zig/issues?q=is%3Aissue+is%3Aopen+label%3A%22contributor+friendly%22)
[Contributor Friendly](https://codeberg.org/ziglang/zig/issues?labels=741726&state=open)
exists to help you find issues that are **limited in scope and/or
knowledge of Zig internals.**
Please note that issues labeled
[Proposal](https://github.com/ziglang/zig/issues?q=is%3Aissue+is%3Aopen+label%3Aproposal)
but do not also have the
[Accepted](https://github.com/ziglang/zig/issues?q=is%3Aissue+is%3Aopen+label%3Aaccepted)
label are still under consideration, and efforts to implement such a proposal
have a high risk of being wasted. If you are interested in a proposal which is
[Proposal: Proposed](https://codeberg.org/ziglang/zig/issues?labels=746937&state=open)
are still under consideration, and efforts to implement such a proposal have
a high risk of being wasted. If you are interested in a proposal which is
still under consideration, please express your interest in the issue tracker,
providing extra insights and considerations that others have not yet expressed.
The most highly regarded argument in such a discussion is a real world use case.
@ -777,7 +775,7 @@ If you will be debugging the Zig compiler itself, or if you will be debugging
any project compiled with Zig's LLVM backend (not recommended with the LLDB
fork, prefer vanilla LLDB with a version that matches the version of LLVM that
Zig is using), you can get a better debugging experience by using
[`lldb_pretty_printers.py`](https://github.com/ziglang/zig/blob/master/tools/lldb_pretty_printers.py).
[`lldb_pretty_printers.py`](https://codeberg.org/ziglang/zig/src/branch/master/tools/lldb_pretty_printers.py).
Put this line in `~/.lldbinit`:

View file

@ -39,7 +39,7 @@ v2.2.5.
The file `lib/libc/glibc/abilist` is a Zig-specific binary blob that
defines the supported glibc versions and the set of symbols each version
must define. See https://github.com/ziglang/glibc-abi-tool for the
must define. See https://codeberg.org/ziglang/libc-abi-tools for the
tooling to generate this blob. The code in `glibc.zig` parses the abilist
to build version-specific stub libraries on demand.

View file

@ -79,7 +79,7 @@ enable_rosetta: bool = false,
enable_wasmtime: bool = false,
/// Use system Wine installation to run cross compiled Windows build artifacts.
enable_wine: bool = false,
/// After following the steps in https://github.com/ziglang/zig/wiki/Updating-libc#glibc,
/// After following the steps in https://codeberg.org/ziglang/infra/src/branch/master/libc-update/glibc.md,
/// this will be the directory $glibc-build-dir/install/glibcs
/// Given the example of the aarch64 target, this is the directory
/// that contains the path `aarch64-linux-gnu/lib/ld-linux-aarch64.so.1`.

View file

@ -890,7 +890,7 @@ pub const Timestamp = struct {
}
pub fn withClock(t: Timestamp, clock: Clock) Clock.Timestamp {
return .{ .nanoseconds = t.nanoseconds, .clock = clock };
return .{ .raw = t, .clock = clock };
}
pub fn fromNanoseconds(x: i96) Timestamp {

View file

@ -1090,7 +1090,8 @@ pub const Socket = struct {
}
pub fn sendMany(s: *const Socket, io: Io, messages: []OutgoingMessage, flags: SendFlags) SendError!void {
return io.vtable.netSend(io.userdata, s.handle, messages, flags);
const err, const n = io.vtable.netSend(io.userdata, s.handle, messages, flags);
if (n != messages.len) return err.?;
}
pub const ReceiveError = error{

View file

@ -1604,6 +1604,13 @@ pub fn dumpStackPointerAddr(prefix: []const u8) void {
test "manage resources correctly" {
if (SelfInfo == void) return error.SkipZigTest;
if (builtin.zig_backend == .stage2_c) {
// The C backend emits an extremely large C source file, meaning it has a huge
// amount of debug information. Parsing this debug information makes this test
// take too long to be worth running.
return error.SkipZigTest;
}
const S = struct {
noinline fn showMyTrace() usize {
return @returnAddress();

View file

@ -18470,6 +18470,9 @@ fn zirCondbr(
break :blk try sub_block.addTyOp(.unwrap_errunion_err, result_ty, err_operand);
};
// Reset, this may have been updated by the then block analysis
sub_block.error_return_trace_index = parent_block.error_return_trace_index;
const false_hint: std.builtin.BranchHint = if (err_cond != null and
try sema.maybeErrorUnwrap(&sub_block, else_body, err_cond.?, cond_src, false))
h: {
@ -18945,9 +18948,10 @@ fn restoreErrRetIndex(sema: *Sema, start_block: *Block, src: LazySrcLoc, target_
while (true) {
if (block.label) |label| {
if (label.zir_block == zir_block) {
const target_trace_index = if (block.parent) |parent_block| tgt: {
break :tgt parent_block.error_return_trace_index;
} else sema.error_return_trace_index_on_fn_entry;
const target_trace_index = if (block.parent) |parent_block|
parent_block.error_return_trace_index
else
sema.error_return_trace_index_on_fn_entry;
if (start_block.error_return_trace_index != target_trace_index)
break :b target_trace_index;

View file

@ -1090,3 +1090,22 @@ test "compare error union to error set" {
try S.doTheTest(0);
try comptime S.doTheTest(0);
}
test "'if' ignores error via local while 'else' ignores error directly" {
const S = struct {
/// This function is intentionally fallible despite never returning an
/// error so that it participates in error return tracing.
fn testOne(cond: bool) !void {
if (cond) {
const result = notError();
result catch {};
} else {
notError() catch {};
}
}
fn notError() error{E}!void {}
};
try S.testOne(false);
try S.testOne(true);
}

View file

@ -1,6 +1,6 @@
//! This script updates the .c, .h, .s, and .S files that make up the start
//! files such as crt1.o. Not to be confused with
//! https://github.com/ziglang/glibc-abi-tool/ which updates the `abilists`
//! https://codeberg.org/ziglang/libc-abi-tools which updates the `abilists`
//! file.
//!
//! Example usage: