zls
zls copied to clipboard
wsl ubuntu build zls fail
Zig Version
0.13.0-x86_64-linux.4.19...6.5.7-gnu.2.35
Zig Language Server Version
c5ceadf362df07aa40b657db166bf6229a5ea1c5
Client / Code Editor / Extensions
No response
Steps to Reproduce and Observed Behavior
zig build --release=fast
err info
install
└─ install zls
└─ zig build-exe zls ReleaseFast native
└─ run zls_gen (version_data_master_19889.zig) failure
panic: reached unreachable code
/root/code/zls/src/config_gen/config_gen.zig:642:21: 0x1156517 in collectBuiltinData (zls_gen)
else => unreachable,
^
/root/code/zls/src/config_gen/config_gen.zig:849:44: 0x114fbaf in generateVersionDataFile (zls_gen)
const builtins = try collectBuiltinData(allocator, version, langref_source);
^
/root/code/zls/src/config_gen/config_gen.zig:1089:40: 0x115a616 in main (zls_gen)
try generateVersionDataFile(gpa, version, output_path, langref_path);
^
/snap/zig/11625/lib/std/start.zig:524:37: 0x1137c21 in posixCallMainAndExit (zls_gen)
const result = root.main() catch |err| {
^
/snap/zig/11625/lib/std/start.zig:266:5: 0x1137761 in _start (zls_gen)
asm volatile (switch (native_arch) {
^
???:?:?: 0x4 in ??? (???)
Unwind information for `???:0x4` was not available, trace may be incomplete
error: the following command terminated unexpectedly:
/root/code/zls/.zig-cache/o/155eb794d0de85212c13f549e2921e43/zls_gen --generate-version-data master --generate-version-data-path /root/code/zls/.zig-cache/o/b0e753307cdc2f488956021576251ba5/version_data_master_19889.zig
Expected Behavior
build success
Relevant log output
No response
Could you try to compile ZLS with the following patch and then post the content of /root/code/zls/langref.html.in? A diff to https://github.com/ziglang/zig/blob/master/doc/langref.html.in would also suffice
diff --git a/src/config_gen/config_gen.zig b/src/config_gen/config_gen.zig
index 3e07db1c..1f6114e1 100644
--- a/src/config_gen/config_gen.zig
+++ b/src/config_gen/config_gen.zig
@@ -845,6 +845,10 @@ fn generateVersionDataFile(allocator: std.mem.Allocator, version: []const u8, ou
}
};
defer allocator.free(langref_source);
+ try std.fs.cwd().writeFile(.{
+ .sub_path = "/root/code/zls/langref.html.in", // adjust the path if necessary
+ .data = langref_source,
+ });
const builtins = try collectBuiltinData(allocator, version, langref_source);
defer {
no response...