-
Notifications
You must be signed in to change notification settings - Fork 47
feat: adopt with Zig 0.15 #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
fix up to 04-03
22faf35 to
ec67ecd
Compare
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the Zig Cookbook to be compatible with Zig version 0.15. The changes include updating API calls, method names, and build configurations to match the new version's requirements.
- Update Zig version from 0.14.x to 0.15.x across the codebase
- Replace deprecated API methods with their Zig 0.15 equivalents
- Update build system configurations for the new version
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates version tracking information to Zig 0.15.x |
| .github/workflows/ci.yml | Bumps CI Zig version from 0.14.1 to 0.15.1 |
| build.zig.zon | Updates zigcli dependency from v0.2.3 to v0.3.0 |
| build.zig | Updates build system API calls for Zig 0.15 compatibility |
| src/*/01-01-read-file-line-by-line.smd | Updates documentation to reflect API method name change |
| assets/src/*.zig | Updates various source files with new API methods and patterns |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| defer server.deinit(); | ||
|
|
||
| log.info("Start HTTP server at {any}", .{addr}); | ||
| log.info("Start HTTP server at {f}", .{addr}); |
Copilot
AI
Sep 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format specifier {f} is for floating point numbers, but addr is a network address. This should be {any} to properly format the address.
| log.info("Start HTTP server at {f}", .{addr}); | |
| log.info("Start HTTP server at {any}", .{addr}); |
| defer conn.stream.close(); | ||
|
|
||
| log.info("Got new client({any})!", .{conn.address}); | ||
| log.info("Got new client({f})!", .{conn.address}); |
Copilot
AI
Sep 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format specifier {f} is for floating point numbers, but conn.address is a network address. This should be {any} to properly format the address.
| log.info("Got new client({f})!", .{conn.address}); | |
| log.info("Got new client({any})!", .{conn.address}); |
| var buf: [1024]u8 = undefined; | ||
|
|
||
| print("Listen on {any}...\n", .{addr}); | ||
| print("Listen on {f}\n", .{addr}); |
Copilot
AI
Sep 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format specifier {f} is for floating point numbers, but addr is a network address. This should be {any} to properly format the address.
| print("Listen on {f}\n", .{addr}); | |
| print("Listen on {any}\n", .{addr}); |
| const stream = try net.tcpConnectToAddress(peer); | ||
| defer stream.close(); | ||
| print("Connecting to {}\n", .{peer}); | ||
| print("Connecting to {f}\n", .{peer}); |
Copilot
AI
Sep 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format specifier {f} is for floating point numbers, but peer is a network address. This should be {any} to properly format the address.
| print("Connecting to {f}\n", .{peer}); | |
| print("Connecting to {any}\n", .{peer}); |
|
|
||
| print("{} says {s}\n", .{ client.address, message }); | ||
| fn handleClient(client: net.Server.Connection) !void { | ||
| print("Accepted connection from {f}\n", .{client.address}); |
Copilot
AI
Sep 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format specifier {f} is for floating point numbers, but client.address is a network address. This should be {any} to properly format the address.
| var writer = client.stream.writer(&.{}); | ||
|
|
||
| while (true) { | ||
| print("Waiting for data from {f}...\n", .{client.address}); |
Copilot
AI
Sep 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format specifier {f} is for floating point numbers, but client.address is a network address. This should be {any} to properly format the address.
| print("Waiting for data from {f}...\n", .{client.address}); | ||
| const msg = reader.interface().takeDelimiterInclusive('\n') catch |err| { | ||
| if (err == error.EndOfStream) { | ||
| print("{f} closed the connection\n", .{client.address}); |
Copilot
AI
Sep 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format specifier {f} is for floating point numbers, but client.address is a network address. This should be {any} to properly format the address.
| print("{f} closed the connection\n", .{client.address}); | |
| print("{any} closed the connection\n", .{client.address}); |
| return err; | ||
| } | ||
| }; | ||
| print("{f} says {s}", .{ client.address, msg }); |
Copilot
AI
Sep 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format specifier {f} is for floating point numbers, but client.address is a network address. This should be {any} to properly format the address.
Close #112