⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@mattnite
Copy link
Contributor

No description provided.

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

@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

@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

@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

@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
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

const AnyFuture = std.Io.AnyFuture;
const net = Io.net;

// Taken from https://codeberg.org/ziglang/zig/pulls/30691/ until it lands.
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should switch to Io.failing when it lands

@github-actions github-actions bot dismissed their stale review January 21, 2026 20:08

Updating with new lint results

Copy link

@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.

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