ugexe / zef

Raku Module Management
Artistic License 2.0
206 stars 44 forks source link

Can't `zef install` YAMLish on Windows 10 #533

Closed zb226 closed 9 months ago

zb226 commented 9 months ago

The installation errors out when the archive should be unzipped:

[YAMLish] Extracting with plugin Zef::Service::Shell::tar aborted.
something went wrong extracting C:\Users\zb\AppData\Local\Temp/.zef/1698391208.16200\1698391222.16200.367.3485459071357\YAMLish%3Aver%3C0.0.6%3E%3Aauth%3Cgithub%3ALeont%3E.tar.gz
to C:\Users\zb\AppData\Local\Temp/.zef/1698391208.16200\YAMLish%3Aver%3C0.0.6%3E%3Aauth%3Cgithub%3ALeont%3E.tar.gz
with Zef::Service::Shell::git<3508240998224>,Zef::Service::FetchPath<3508225362272>,Zef::Service::Shell::tar<3508225362240>,Zef::Service::Shell::unzip<3508225361216>

Context

Elizabeth Mattijsen sent me over here after I've asked a question about this on SO.

Expected Behavior

Should install the module.

Actual Behavior

Does not install the module.

Steps to Reproduce

zef install cro --debug

or

zef install YAMLish --debug

Your Environment

C:\>raku -v
Welcome to Rakudo™ v2023.10.
Implementing the Raku® Programming Language v6.d.
Built on MoarVM version 2023.10.

C:\>zef list --installed
===> Found via inst#D:\dev\rakudo\share\perl6\site
PathTools:ver<0.2.0>:auth<github:ugexe>
zef:ver<0.20.0>:auth<github:ugexe>:api<0>
===> Found via inst#D:\dev\rakudo\share\perl6\core
rakudo:ver<2023.10>:auth<Yet Another Society>

C:\>ver

Microsoft Windows [Version 10.0.19045.3570]
ugexe commented 9 months ago

I would suggest updating windows (you seem to be on something from 2019?) or installing bsdtar separately. https://github.com/ugexe/zef/pull/508

zb226 commented 9 months ago

@ugexe It's the most recent version of Windows 10 I believe, corresponding to:

[Edit: better link directly to M$]

Windows 10 version 22H2-10.0.19045.3570 / KB5031356 / 10th October 2023

The bsdtar is available on the PATH:

C:\>where tar
C:\Windows\System32\tar.exe

C:\>tar --version
bsdtar 3.5.2 - libarchive 3.5.2 zlib/1.2.5.f-ipp
ugexe commented 9 months ago

Ah, I misunderstood your original post which said unzip when in actuality it is working with a .tar.gz file. That being said I think you may have been correct in your hunch about symlinks on Windows. You could try downloading the distribution (the url should be shown when using --debug) and then manually extracting it using the tar command. If this is the case then a YAMLish issue would probably be appropriate.

ugexe commented 9 months ago

You might also try zef install https://github.com/Leont/yamlish.git and/or zef install https://github.com/Leont/yamlish/archive/refs/heads/master.tar.gz to see if it is an issue with how REA is archiving the distribution.

zb226 commented 9 months ago

Manual extraction shows the problem is with those symlinks:

C:\temp>tar xvfz YAMLish%3Aver%3C0.0.6%3E%3Aauth%3Cgithub%3ALeont%3E.tar.gz
x yamlish-master/
(...)
x yamlish-master/test-suite/meta/229Q.label: Can't create '\\\\?\\C:\\temp\\yamlish-master\\test-suite\\meta\\229Q.label'
x yamlish-master/test-suite/meta/236B.label: Can't create '\\\\?\\C:\\temp\\yamlish-master\\test-suite\\meta\\236B.label'
(...)
x yamlish-master/xt/spec.t
tar: Error exit delayed from previous errors.

...but direct install from the repo root works fine!

C:\temp>zef install https://github.com/Leont/yamlish.git
===> Staging YAMLish:ver<0.0.6>
===> Staging [OK] for YAMLish:ver<0.0.6>
===> Testing: YAMLish:ver<0.0.6>
===> Testing [OK] for YAMLish:ver<0.0.6>
===> Installing: YAMLish:ver<0.0.6>

Direct install from the master.tar.gz has the same problems as before.

Should I open an issue somewhere else?

Thanks for helping out!

ugexe commented 9 months ago

My guess is git on windows does something differently for representing symlinks than e.g. the tar command. I'd probably open an issue with YAMLish suggesting to not use symlinks. It may also be worth mentioning in some Raku document somewhere that distributions should not contain symlinks if they are expected to be platform agnostic.