Raku / whateverable

🤖 Different IRC bots that operate on a bunch of prebuilt Rakudo versions
https://gist.github.com/Whateverable
GNU Affero General Public License v3.0
18 stars 14 forks source link

Running bots without zstd leaves lock dirs behind #316

Open AlexDaniel opened 6 years ago

AlexDaniel commented 6 years ago

@sylints++ for the finding.

Here's some explanation: https://github.com/perl6/whateverable/blob/031cf5de521ba1002ab7379bedc6b432213de194/lib/Whateverable.pm6#L393-L416

\<AlexDaniel> so first it runs this: run(:err(Nil), ‘mkdir’, ‘--’, $build-path).exitcode ≠ 0 { \ which pre-creates the lock dir \ and then it calls die if zstd is not there \ and as a result, rmtree $build-path; is never called!

JJ commented 6 years ago

I changed the detection of ZSTD to the beginning of the file, and I'm getting this error now:

# Failed to get expected result in 11.09198240 seconds (11 nominal)
not ok 56 - Search using the code block
# Failed test 'Search using the code block'
# at /home/jmerelo/Code/forks/perl6/whateverable/t/lib/Testable.pm6 (Testable) line 85
# expected: ["testable430956, U+1F98B BUTTERFLY [So] (🦋)"]
#  matcher: 'infix:<~~>'
#      got: []
# Test failed. Stopping test suite, because PERL6_TEST_DIE_ON_FAIL environmental variable is set to a true value.
# Bot process finished (exit code=0, signal=1)

I got that error before, when zstd was not installed... So I don't really know if that's the thing. Maybe an independent test somewhere else?

AlexDaniel commented 6 years ago

FWIW I'm against early detection. Some bots (e.g. Notable) don't need zstd at all, and unicodable does not need it in most cases. Maybe one way to do it is to write a helper sub somewhere here, and call it from all bots that need zstd. Note that another dependency is lrzip, and some bots also don't need it (e.g. Evalable needs zstd but not lrzip, same for Unicodable, but Committable and Bisectable also need lrzip).

JJ commented 6 years ago

You can insert detection code in those bots. The problem if you don't do that is that you will get weird errors down the line. I'll see if I can do what you suggest.

JJ commented 6 years ago

Testable is probably not a good place, since it's, well, only in the test directory.

AlexDaniel commented 6 years ago

Testable is probably not a good place, since it's, well, only in the test directory.

So? Meaning that if you run tests, you'll get an error relatively early. If you run something like sake debug:evalable, then the bot will respond with a stack trace and everything when it attempts to use zstd, which is good enough.