Skip to content

Zig master (0.16.0) Update#856

Draft
mattnite wants to merge 15 commits intomainfrom
zig-master
Draft

Zig master (0.16.0) Update#856
mattnite wants to merge 15 commits intomainfrom
zig-master

Conversation

@mattnite
Copy link
Copy Markdown
Contributor

No description provided.

@mattnite mattnite marked this pull request as draft January 15, 2026 18:30
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🔍 Lint Results

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🔍 Lint Results

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🔍 Lint Results

Found 105 issues on changed lines in 1 file:

  • core/src/failing.zig: 105 issues

⚠️ Could not attach inline comments due to an error.

@github-actions github-actions bot dismissed their stale review January 21, 2026 13:59

Updating with new lint results

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🔍 Lint Results

Found 106 issues on changed lines in 2 files:

  • core/src/failing.zig: 105 issues
  • examples/raspberrypi/rp2xxx/src/net/lwip/net.zig: 1 issue

⚠️ Could not attach inline comments due to an error.

Comment on lines +13 to +128
const Args = struct {
help: bool = false,
input_elf: ?[]const u8 = null,
output: ?[]const u8 = null,
chip_id: ?esp_image.ChipId = null,
min_rev_full: u16 = 0x0000,
max_rev_full: u16 = 0xffff,
dont_append_digest: bool = false,
flash_freq: esp_image.FlashFreq = .@"40m",
flash_mode: esp_image.FlashMode = .dio,
flash_size: esp_image.FlashSize = .@"4mb",
flash_mmu_page_size: esp_image.FlashMMU_PageSize = .default,
use_segments: bool = false,

pub fn parse(args: []const [:0]const u8) !Args {
var ret: Args = .{};

var index: usize = 1;
while (index < args.len) : (index += 1) {
if (std.mem.eql(u8, args[index], "--help")) {
ret.help = true;
} else if (std.mem.eql(u8, args[index], "--output")) {
index += 1;
if (index >= args.len) {
return error.FormatRequiresArgument;
}
ret.output = args[index];
} else if (std.mem.eql(u8, args[index], "--chip-id")) {
index += 1;
if (index >= args.len) {
return error.FormatRequiresArgument;
}
ret.chip_id = std.meta.stringToEnum(esp_image.ChipId, args[index]) orelse {
return error.InvalidChipId;
};
} else if (std.mem.eql(u8, args[index], "--min-rev-full")) {
index += 1;
if (index >= args.len) {
return error.FormatRequiresArgument;
}
ret.min_rev_full = std.fmt.parseInt(u16, args[index], 10) catch {
return error.InvalidNumber;
};
} else if (std.mem.eql(u8, args[index], "--max-rev-full")) {
index += 1;
if (index >= args.len) {
return error.FormatRequiresArgument;
}
ret.max_rev_full = std.fmt.parseInt(u16, args[index], 10) catch {
return error.InvalidNumber;
};
} else if (std.mem.eql(u8, args[index], "--dont-append-digest")) {
ret.dont_append_digest = true;
} else if (std.mem.eql(u8, args[index], "--flash-freq")) {
index += 1;
if (index >= args.len) {
return error.FormatRequiresArgument;
}
ret.flash_freq = std.meta.stringToEnum(esp_image.FlashFreq, args[index]) orelse {
return error.InvalidFlashFreq;
};
} else if (std.mem.eql(u8, args[index], "--flash-mode")) {
index += 1;
if (index >= args.len) {
return error.FormatRequiresArgument;
}
ret.flash_mode = std.meta.stringToEnum(esp_image.FlashMode, args[index]) orelse {
return error.InvalidFlashMode;
};
} else if (std.mem.eql(u8, args[index], "--flash-size")) {
index += 1;
if (index >= args.len) {
return error.FormatRequiresArgument;
}
ret.flash_size = std.meta.stringToEnum(esp_image.FlashSize, args[index]) orelse {
return error.InvalidFlashSize;
};
} else if (std.mem.eql(u8, args[index], "--flash-mmu-page-size")) {
index += 1;
if (index >= args.len) {
return error.FormatRequiresArgument;
}
ret.flash_mmu_page_size = std.meta.stringToEnum(esp_image.FlashMMU_PageSize, args[index]) orelse {
return error.InvalidFlashMMU_PageSize;
};
} else if (std.mem.eql(u8, args[index], "--use-segments")) {
ret.use_segments = true;
} else {
if (ret.input_elf != null) {
std.log.err("extra arg: {s}", .{args[index]});
return error.ExtraArguments;
}
ret.input_elf = args[index];
}
}

return ret;
}
};


const help_message =
\\--help Show this message
\\--output <str> Path to save the generated file
\\--chip-id <ChipId> Chip id
\\--min-rev-full <u16> Minimal chip revision (in format: major * 100 + minor)
\\--max-rev-full <u16> Maximal chip revision (in format: major * 100 + minor)
\\--dont-append-digest Don't append a SHA256 digest of the entire image after the checksum
\\--flash-freq <FlashFreq> SPI Flash frequency
\\--flash-mode <FlashMode> SPI Flash mode
\\--flash-size <FlashSize> SPI Flash size in megabytes
\\--flash-mmu-page-size <FlashMMU_PageSize> Flash MMU page size
\\--use-segments Use program headers instead of section headers
\\<str>
\\
;
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.

Rewrote arg parsing to not depend on clap that isn't up to date with master. We should use the std cli parser when it lands

Comment thread core/src/failing.zig Outdated
@github-actions github-actions bot dismissed their stale review January 21, 2026 20:08

Updating with new lint results

Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

🔍 Lint Results

Found 105 issues on changed lines in 1 file:

  • core/src/failing.zig: 105 issues

⚠️ Could not attach inline comments due to an error.

@der-teufel-programming
Copy link
Copy Markdown

Io.failing is available in 0.16.0 so this PR could use that

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 15, 2026

⚠️ Unused Imports Found

build.zig:39:0: exe_targets is unused
build.zig:17:0: regz is unused
core/src/cpus/cortex_m.zig:6:0: shared is unused
core/src/cpus/cortex_m.zig:5:0: app is unused
core/src/cpus/cortex_m.zig:1019:0: dwt_base is unused
core/src/microzig.zig:7:0: root is unused
core/src/microzig.zig:8:0: builtin is unused
core/src/start.zig:2:0: builtin is unused
examples/raspberrypi/rp2xxx/src/allocator.zig:4:0: PPB is unused
examples/raspberrypi/rp2xxx/src/cyw43.zig:9:0: pio is unused
examples/raspberrypi/rp2xxx/src/cyw43/wifi_connect.zig:11:0: Runner is unused
examples/raspberrypi/rp2xxx/src/cyw43/wifi_connect.zig:9:0: Wifi is unused
examples/raspberrypi/rp2xxx/src/i2c_accel.zig:8:0: ClockDevice is unused
examples/raspberrypi/rp2xxx/src/i2c_bus_scan.zig:3:0: time is unused
examples/raspberrypi/rp2xxx/src/i2c_hall_effect.zig:3:0: time is unused
examples/raspberrypi/rp2xxx/src/net/irq.zig:15:0: pio is unused
examples/raspberrypi/rp2xxx/src/net/irq.zig:13:0: time is unused
examples/raspberrypi/rp2xxx/src/net/pong.zig:6:0: pio is unused
examples/raspberrypi/rp2xxx/src/net/scan.zig:6:0: pio is unused
examples/raspberrypi/rp2xxx/src/net/tcp_client.zig:6:0: pio is unused
examples/raspberrypi/rp2xxx/src/net/tcp_server.zig:6:0: pio is unused
examples/raspberrypi/rp2xxx/src/net/udp.zig:6:0: pio is unused
examples/raspberrypi/rp2xxx/src/rp2040_only/flash_program.zig:6:0: time is unused
examples/raspberrypi/rp2xxx/src/rp2040_only/flash_program.zig:8:0: clocks is unused
examples/raspberrypi/rp2xxx/src/rp2040_only/random.zig:9:0: clocks is unused
examples/raspberrypi/rp2xxx/src/spi_slave.zig:7:0: chip is unused
examples/raspberrypi/rp2xxx/src/system_timer.zig:4:0: time is unused
examples/raspberrypi/rp2xxx/src/uart_reader_writer.zig:4:0: time is unused
port/raspberrypi/rp2xxx/src/hal/pins.zig:13:0: resets is unused
port/raspberrypi/rp2xxx/src/hal/pins.zig:2:0: assert is unused
port/raspberrypi/rp2xxx/src/hal/pins.zig:4:0: StructField is unused
port/raspberrypi/rp2xxx/src/hal/uart.zig:8:0: gpio is unused
port/raspberrypi/rp2xxx/src/hal/uart.zig:11:0: resets is unused
port/stmicro/stm32/src/hals/common/i2c_v2.zig:7:0: peripherals is unused
tools/regz/build.zig:5:0: GeneratedFile is unused
tools/regz/build.zig:3:0: Compile is unused
tools/regz/build.zig:4:0: Step is unused
tools/regz/src/atdf.zig:2:0: ArenaAllocator is unused
tools/regz/src/atdf.zig:1097:0: expect is unused
tools/regz/src/main.zig:2:0: clap is unused
tools/regz/src/main.zig:9:0: assert is unused
tools/regz/src/main.zig:7:0: ArenaAllocator is unused
tools/regz/src/svd.zig:13:0: PeripheralID is unused
tools/regz/src/svd.zig:4:0: assert is unused
tools/regz/src/svd.zig:683:0: DimType is unused
tools/uf2/src/uf2.zig:2:0: testing is unused
tools/uf2/src/uf2.zig:9:0: uf2_alignment is unused

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

- Update uart Writer and Reader to writergate
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.

3 participants