grondilu / libdigest-raku

Raku implementation of various digests
Artistic License 2.0
27 stars 42 forks source link

Fails to install on Windows and Fedora #28

Open landyacht opened 2 years ago

landyacht commented 2 years ago

I am running Raku 2022.07 and Windows 10. [Coke] was also able to reproduce this error with Raku 2022.04.

Output of zef install Digest::SHA:

===> Searching for: Digest::SHA
===> Testing: Digest:ver<0.17.1>
[Digest] Cannot unbox negative bigint into native unsigned integer
[Digest]   in sub infix:«<<<» at C:\Users\[redacted]\.zef\tmp\Digest%3Aver%3C0.17.1%3E%3Aauth%3Cgithub%3Agrondilu%3E.tar.gz\libdigest-raku-master\lib\Digest.rakumod (Digest) line 47
[Digest]   in block  at C:\Users\[redacted]\.zef\tmp\Digest%3Aver%3C0.17.1%3E%3Aauth%3Cgithub%3Agrondilu%3E.tar.gz\libdigest-raku-master\lib\Digest.rakumod (Digest) line 69
[Digest]   in sub md5 at C:\Users\[redacted]\.zef\tmp\Digest%3Aver%3C0.17.1%3E%3Aauth%3Cgithub%3Agrondilu%3E.tar.gz\libdigest-raku-master\lib\Digest.rakumod (Digest) line 65
[Digest]   in block <unit> at t\digest.t line 15
===> Testing [FAIL]: Digest:ver<0.17.1>
Aborting due to test failure: Digest:ver<0.17.1> (use --force-test to override)
grondilu commented 2 years ago

I don't have access to a Windows machine at the moment. I suspect it can be fixed by enforcing native type conversion either with an anonymous var affectation my uint32 $ = or explicit modular arithmetic operation mod 2**32

patrickbkr commented 2 years ago

I just observed a similar error on Fedora Linux:

===> Install [FAIL] for Digest:ver<0.18.4>: ===SORRY!=== Error while compiling /app/site#sources/AEFF11B600B271AEDDA936C81735A2C8E19966C0 (Digest::SHA2) An exception occurred while evaluating a constant at /app/site#sources/AEFF11B600B271AEDDA936C81735A2C8E19966C0 (Digest::SHA2):69 Exception details: ===SORRY!=== Error while compiling Cannot unbox 64 bit wide bigint into native integer at :

grondilu commented 2 years ago

I just observed a similar error on Fedora Linux:

Indeed install fails on my machine too. I've only ever checked that the tests passed, not the actual installation process. Not sure how to debug that, or if I should even. Seems to me that if the tests pass, so should the installation. If not, I think it's a raku or zef bug, not a package bug.

patrickbkr commented 2 years ago

Given it's a rather low-level error, I fear it's a Rakudo bug. Yikes. I'll see if downgrading fixes it for me.

I guess the next steps in solving this should be somehow reproducing the issue outside of the installation process and filing a Rakudo bug.

patrickbkr commented 2 years ago

Ugh. This module is only released on P6C only. So I can't downgrade. I guess I'll have to manually copy the module into my project and install from there.

patrickbkr commented 2 years ago

I think it's possible the bug is already fixed in Rakudo 2022.07. I did observe it in 2021.03 but don't see it on 2022.07. Edit: Nope, my observations contradict the original bugreport.

2colours commented 2 years ago

Interestingly enough, when I first tried to install it, I got a very vague "test failed" error - when I retried using --verbose, the installation succeeded. Now, either --verbose has side effects or maybe the installation of the module is not idempotent? :D

patrickbkr commented 2 years ago

Interestingly enough, when I first tried to install it, I got a very vague "test failed" error - when I retried using --verbose, the installation succeeded. Now, either --verbose has side effects or maybe the installation of the module is not idempotent? :D

I observed the same effect. Installing this module in a container allows to reproduce the issue.

2colours commented 2 years ago

I noticed the same thing with Cro::HTTP: test fails without any hints on the why's, retried with --verbose and it succeeded. I don't think a test failure should be because of a dependency, at least not this way... so I start to suspect this is a broader zef problem.

ab5tract commented 1 year ago

From the Windows side, the issue appears to persist, regardless of whether --verbose is used.

C:\Users\xxx\.zef\store\libdigest-raku\FED024BB91D68875840B75234E7BFC43605AD9D5>zef test . --verbose
[Digest] ===SORRY!=== Error while compiling C:\Users\xxx\.zef\store\libdigest-raku\FED024BB91D68875840B75234E7BFC43605AD9D5/t\rfc4231.t
[Digest] ===SORRY!=== Error while compiling C:\Users\xxx\.zef\store\libdigest-raku\FED024BB91D68875840B75234E7BFC43605AD9D5\lib\Digest\SHA2.rakumod (Digest::SHA2)
[Digest] An exception occurred while evaluating a BEGIN
[Digest] at C:\Users\xxx\.zef\store\libdigest-raku\FED024BB91D68875840B75234E7BFC43605AD9D5\lib\Digest\SHA2.rakumod (Digest::SHA2):95
[Digest] Exception details:
[Digest]   ===SORRY!=== Error while compiling
[Digest]   Cannot unbox 64 bit wide bigint into native integer
[Digest]   at :
[Digest] at C:\Users\xxx\.zef\store\libdigest-raku\FED024BB91D68875840B75234E7BFC43605AD9D5/t\rfc4231.t:6

When installed via --force-test, the exception continues.

PS C:\Users\xxx> raku -MDigest::SHA2 -e1
===SORRY!=== Error while compiling -e
===SORRY!=== Error while compiling C:\Users\Longwalker/home#sources\31E9EE6247850F0104ABF2E25C29FAF603CC1231 (Digest::SHA2)
An exception occurred while evaluating a BEGIN
at C:\Users\xxx/home#sources\31E9EE6247850F0104ABF2E25C29FAF603CC1231 (Digest::SHA2):95
Exception details:
  ===SORRY!=== Error while compiling
  Cannot unbox 64 bit wide bigint into native integer
  at :

at -e:1

Edit: I noticed that I had an old version of Raku installed that may have been causing some conflicts. I've uninstalled that and using 2023.06, it installs and runs fine on Windows 11.