Skip to content

Conversation

@ataias
Copy link
Contributor

@ataias ataias commented Oct 13, 2025

I bumped Zig to 0.16.0-dev.728+87c18945c but zls failed to build.

@llogick
Copy link
Contributor

llogick commented Oct 14, 2025

Failures are due to ArrayList pop() now setting the previously last element to undefined (ziglang/zig@87c1894), which affects the value of 'curr_ctx' in Analysis.getPositionContext()

quickest way around it

diff --git a/src/analysis.zig b/src/analysis.zig
index e4a1ea22..07558c1a 100644
--- a/src/analysis.zig
+++ b/src/analysis.zig
@@ -5035,13 +5035,15 @@ pub fn getPositionContext(
             },
             .l_bracket => try stack.append(allocator, .{ .ctx = .empty, .stack_id = .bracket }),
             .r_paren => {
-                _ = stack.pop();
+                // Do this manually, as .pop() sets `stack.items[stack.items.len - 1]` to `undefined` which currently curr_ctx points to
+                if (stack.items.len != 0) stack.items.len -= 1;
                 if (curr_ctx.stack_id != .paren) {
                     (try peek(allocator, &stack)).ctx = .empty;
                 }
             },
             .r_bracket => {
-                _ = stack.pop();
+                // Do this manually, as .pop() sets `stack.items[stack.items.len - 1]` to `undefined` which currently curr_ctx points to
+                if (stack.items.len != 0) stack.items.len -= 1;
                 if (curr_ctx.stack_id != .bracket) {
                     (try peek(allocator, &stack)).ctx = .empty;
                 }

@ataias ataias force-pushed the fix-master-build-2025-10-13 branch from b7222c4 to 1a24a39 Compare October 14, 2025 09:31
@ataias ataias force-pushed the fix-master-build-2025-10-13 branch from 1a24a39 to 972ae36 Compare October 14, 2025 09:33
@ataias
Copy link
Contributor Author

ataias commented Oct 14, 2025

@llogick Thanks! I've applied your suggestion and this time I double checked that the zig build check test step passes locally.

Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/b2a3852bd078e68dd2b3dfa8c00c67af1f0a7d20?narHash=sha256-afXE7AJ7MY6wY1pg/Y6UPHNYPy5GtUKeBkrZZ/gC71E%3D' (2025-09-20)
  → 'github:NixOS/nixpkgs/7e297ddff44a3cc93673bb38d0374df8d0ad73e4?narHash=sha256-4xggC56Rub3WInz5eD7EZWXuLXpNvJiUPahGtMkwtuc%3D' (2025-10-10)
• Updated input 'zig-overlay':
    'github:mitchellh/zig-overlay/f5b915caa89385d00ddba3e09e6f75951b2cd2c3?narHash=sha256-4dSjuHMYwTKXQMxw3nDiC6MgdUh0rCROJ6lHXcc3Vio%3D' (2025-09-23)
  → 'github:mitchellh/zig-overlay/365085b6652259753b598d43b723858184980bbe?narHash=sha256-/zj5GYO5PKhBWGzbHbqT%2BehY8EghuABdQ2WGfCwZpCQ%3D' (2025-10-14)
@Techatrix
Copy link
Member

The minimum zig version needs to be updated in the build.zig and build.zig.zon as well as the zig version in the nix flake. I will take care of that.

@Techatrix Techatrix merged commit 89e13c7 into zigtools:master Oct 14, 2025
7 checks passed
@ataias ataias deleted the fix-master-build-2025-10-13 branch October 14, 2025 15:35
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