You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build will fail if zls source is placed under git repo which doesn't belongs to zls.
That situation occurs when trying to build it inside FreeBSD ports (which are git repo) where zls is extracted from tar.gz archive. git describe in getVersion() will use data from outer (ports') repo.
===> License MIT accepted by the user
===> zls-0.12.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by zls-0.12.0 for building
===> Extracting for zls-0.12.0
=> SHA256 Checksum OK for zigtools-zls-0.12.0_GH0.tar.gz.
=> SHA256 Checksum OK for antlilja-8372900fcc09e38d7b0b6bbaddad3904-6c3321e_GH0.tar.gz.
=> SHA256 Checksum OK for wolfpld-tracy-v0.9.1_GH0.tar.gz.
=> SHA256 Checksum OK for ziglibs-diffz-90353d4_GH0.tar.gz.
=> SHA256 Checksum OK for ziglibs-known-folders-0.7.0-26-gfa75e1b_GH0.tar.gz.
===> Patching for zls-0.12.0
===> zls-0.12.0 depends on package: zig>=0.12.0 - found
===> zls-0.12.0 depends on file: /usr/local/bin/ccache - found
===> Configuring for zls-0.12.0
===> Building for zls-0.12.0
thread 606035 panic: reached unreachable code
Unwind information for `libc.so.7:0x8049779f0` was not available, trace may be incomplete
/usr/local/lib/zig/std/debug.zig:403:14: 0x10766fc in assert (build)
if (!ok) unreachable; // assertion failure
^
/usr/ports/devel/zls/work/zls-0.12.0/build.zig:346:29: 0x10b60de in getVersion (build)
std.debug.assert(!zls_version_is_tagged); // `zls_version_is_tagged` disagrees with git describe
^
/usr/ports/devel/zls/work/zls-0.12.0/build.zig:40:38: 0x10b0f78 in build (build)
const version_result = getVersion(b);
^
/usr/local/lib/zig/std/Build.zig:2080:43: 0x1094944 in runBuild__anon_8212 (build)
.ErrorUnion => try build_zig.build(b),
^
/usr/local/lib/zig/compiler/build_runner.zig:300:29: 0x108f8ef in main (build)
try builder.runBuild(root);
^
/usr/local/lib/zig/std/start.zig:511:37: 0x109727b in main (build)
const result = root.main() catch |err| {
^
???:?:?: 0x8048c6af9 in ??? (libc.so.7)
/usr/src/lib/csu/amd64/crt1_s.S:83:0: 0x107329f in ??? (/usr/src/lib/csu/amd64/crt1_s.S)
callq __libc_start1
???:?:?: 0x7c581803007 in ??? (???)
error: the following build command crashed:
./obj/cache/o/1f303f76142d5dfc3477cc126f76ebf3/build /usr/local/bin/zig /usr/ports/devel/zls/work/zls-0.12.0 ./obj/cache /usr/ports/devel/zls/work/.cache/zig --seed 0xee20bba3 -Z7f8382c8623f0ff2 --prefix /usr/local -Doptimize=ReleaseFast -Dcpu=baseline -Ddata_version=0.12.0 --verbose
*** Error code 1
Stop.
make: stopped in /usr/ports/devel/zls
This issue should be resolved by the changes in #1882. I would suggest to apply these changes as a patch to 0.12.0.
I don't think this issue by itself is enough to justify a 0.12.1 ZLS release given that this only affects the build process. If we happen to release ZLS 0.12.1 at some point, I will make sure to include this fix.
Zig Version
0.12.0
Zig Language Server Version
0.12.0
Client / Code Editor / Extensions
No response
Steps to Reproduce and Observed Behavior
Build will fail if zls source is placed under git repo which doesn't belongs to zls.
That situation occurs when trying to build it inside FreeBSD ports (which are git repo) where zls is extracted from tar.gz archive. git describe in getVersion() will use data from outer (ports') repo.
Crude patch in that situation would be:
Better fix would be to check if git repo belongs to the zls (or if .git dir exists in the same folder as build.zig).
Expected Behavior
Build is successful when .tar.gz archive is extracted in non-zls git repo.
Relevant log output
No response
The text was updated successfully, but these errors were encountered: