Skip to content

Zig 0.17.0 master#954

Open
mattnite wants to merge 86 commits into
mainfrom
zig-0.17.0-master
Open

Zig 0.17.0 master#954
mattnite wants to merge 86 commits into
mainfrom
zig-0.17.0-master

Conversation

@mattnite

Copy link
Copy Markdown
Contributor

No description provided.

@mattnite mattnite marked this pull request as draft May 29, 2026 05:35
@github-actions

github-actions Bot commented May 29, 2026

Copy link
Copy Markdown

⚠️ Unused Imports Found

drivers/src/base/BlockMemory.zig:3:0: logger is unused
drivers/src/display/hd44780.zig:15:0: FunctionSet is unused
drivers/src/display/sh1106.zig:11:0: std is unused
drivers/src/io_expander/pca9685.zig:3:0: Digital_IO is unused
drivers/src/sensor/HTS221.zig:12:0: assert is unused
drivers/src/sensor/MPU_6050.zig:24:0: std is unused
drivers/src/wireless/cyw43/cyw43.zig:4:0: std is unused
drivers/src/wireless/cyw43/wifi.zig:22:0: IOCTL_SET_VAR is unused
drivers/src/wireless/cyw43439.zig:2:0: mem is unused
drivers/src/wireless/cyw43439/wifi.zig:5:0: assert is unused
examples/raspberrypi/rp2xxx/src/spi_master.zig:7:0: BUF_LEN is unused
port/nordic/nrf5x/src/hal/drivers.zig:5:0: std is unused
port/nordic/nrf5x/src/hal/drivers.zig:14:0: Stream_Device is unused
port/nxp/mcx/src/mcxn947/scripts/generate.zig:2:0: core is unused
port/raspberrypi/rp2xxx/src/hal/cyw43.zig:1:0: std is unused
port/raspberrypi/rp2xxx/src/hal/cyw43_pio_spi.zig:3:0: std is unused
port/raspberrypi/rp2xxx/src/hal/cyw43_pio_spi.zig:9:0: chip is unused
port/raspberrypi/rp2xxx/src/hal/drivers.zig:14:0: Stream_Device is unused
port/raspberrypi/rp2xxx/src/hal/pio/assembler.zig:2:0: assert is unused
port/raspberrypi/rp2xxx/src/hal/pio/assembler.zig:4:0: microzig is unused
port/raspberrypi/rp2xxx/src/hal/pio/assembler/comparison_tests.zig:3:0: tokenizer is unused
port/stmicro/stm32/src/hals/STM32F103/drivers.zig:8:0: Stream_Device is unused
port/stmicro/stm32/src/hals/STM32F103/drivers.zig:1:0: std is unused
port/stmicro/stm32/src/hals/STM32F103/drivers.zig:9:0: Digital_IO is unused
port/stmicro/stm32/src/hals/STM32F103/uart.zig:12:0: drivers is unused
port/stmicro/stm32/src/hals/STM32F103/uart.zig:16:0: peripherals is unused
port/stmicro/stm32/src/hals/STM32F103/usb_internals/usb_ll.zig:13:0: ep_test is unused
port/stmicro/stm32/src/hals/common/i2c_v2.zig:7:0: peripherals is unused
port/wch/ch32v/src/hals/drivers.zig:17:0: Stream_Device is unused
port/wch/ch32v/src/hals/drivers.zig:5:0: std is unused
port/wch/ch32v/src/hals/spi.zig:37:0: gpio is unused
port/wch/ch32v/src/hals/spi.zig:32:0: std is unused
tools/printer/src/main.zig:2:0: builtin is unused
tools/printer/tests/generate_test_data.zig:7:0: test_data_writer_buf is unused
tools/regz/src/xml.zig:4:0: Allocator is unused

Run zigimports --fix <file> locally to automatically remove unused imports.

@mattnite

Copy link
Copy Markdown
Contributor Author

@Grazfather This is ready to be looked at. Once this PR lands and the master binary is available, this PR should pass CI

Comment thread .github/workflows/ci.yml Outdated
@mattnite mattnite marked this pull request as ready for review May 31, 2026 03:02
Comment on lines +83 to +87
// TODO: do we use debug_io?
_ = format;
_ = args;
_ = prefix;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify what the TODO means? Also, I have an Io.Writer implemented for this. If you want I can commit it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO is stale. There's a separate std.Io instance for the debug system, passed in through options:

https://codeberg.org/ziglang/zig/src/commit/0c41edf4978cc45b59909fce69885e310360cbfa/lib/std/debug.zig#L664

There are two boundaries we could choose for implementing the logger. The first is setting a logging function, which we've always done, and the second is to implement a std.Io for the standard library debug system.

I'm leaning towards implementing a logging function, similar to how you mentioned we should have our own stack iterator. I have a feeling that implementing a std.Io will have some unintended side effects like binary size. I've cut a ticket for research so we can have an informed answer, to be done sometime after 0.17.0 lands:

#956

Comment thread port/raspberrypi/rp2xxx/src/hal/uart.zig Outdated
Comment thread core/src/microzig.zig Outdated
var frame_index: usize = 0;
if (@errorReturnTrace()) |trace| frame_index = utilities.dump_stack_trace(trace);
// TODO: sit down and determine if we want to provide our own SelfInfo.
// Is that what plugs into the standard panic?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a quick skim of std.debug, at least on freestanding, the standard panic just traps. Imho, we should keep a custom panic with also a custom StackIterator that doesn't depend on io. SelfInfo might not make sense for embedded as there isn't any debug info available on the device.

@mattnite mattnite force-pushed the zig-0.17.0-master branch from b85d6a9 to 5aee49b Compare June 13, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants