vscode-zig icon indicating copy to clipboard operation
vscode-zig copied to clipboard

update ZLS install tool

Open Techatrix opened this issue 1 year ago • 1 comments

ZLS builds are now offered by https://github.com/zigtools/release-worker

Techatrix avatar Aug 21 '24 20:08 Techatrix

Have you tested both Windows and Linux?

Only linux. I will test on Windows and report back soon.

And do you want me to make a new release of the extension once this is merged?

Yes that would be nice. The only install method doesn't provide new nightly builds and is forever stuck at ZLS 0.13.0

Techatrix avatar Aug 22 '24 15:08 Techatrix

I believe that I have discovered an issue with the windows tar utility. Extracting a zip files that is supplied over stdin with tar -xf - will be incorrectly unzipped.

This causes the ZLS installation to only contain the zls.pdb file. All other files are missing. The Zig installation is also missing the following files:

  • doc/langref.html
  • LICENSE
  • README.md

This can checked by running the Zig install command in VS-Code and comparing it with 7-Zip or WinRAR. I did not observe this issue when using bsdtar on linux.

System Information:

OS Name	Microsoft Windows 10 Pro
Version	10.0.19045 Build 19045
tar --version
# bsdtar 3.5.2 - libarchive 3.5.2 zlib/1.2.5.f-ipp

Edit: I just test a Windows 11 VM and the bug is still present:

OS Name	Microsoft Windows 11 Pro
Version	10.0.22631 Build 22631
tar --version
bsdtar 3.6.2 - libarchive 3.6.2 zlib/1.2.5.f-ipp liblzma/5.2.5 bz2lib/1.0.8 libzstd 1.5.4

Techatrix avatar Aug 23 '24 18:08 Techatrix

I remember running into something similar. Does saving the archive to a file first work?

Vexu avatar Aug 24 '24 08:08 Vexu

Does saving the archive to a file first work?

This works as expected.

Techatrix avatar Aug 24 '24 12:08 Techatrix

I changed to code to temporarily save the tarball/zip on disk until it has been extracted. I tested it on windows and linux.

I also made downloadAndExtractArtifact use the async functions instead of blocking and replaced the dependency on mkdirp with vscode.workspace.fs.createDirectory.

Techatrix avatar Aug 31 '24 18:08 Techatrix