Raku / ecosystem

Raku ecosystem – modules and more
https://modules.raku.org/
138 stars 154 forks source link

Build modules before testing with Travis #423

Open taboege opened 5 years ago

taboege commented 5 years ago

The Travis CI script does not zef build new modules before zef testing them. This can cause tests to fail. (For instance, see https://travis-ci.org/perl6/ecosystem/builds/472346894#L1435 where the file being used does not exist because it is normally generated in the build phase, which is skipped. Note that this issue is independent of any "hack" I mentioned in #422 corresponding to that build failure -- the missing file is a program needed by all tests of the module, because the module is an interface to that program.)

The Problem

I use Build.pm, which is executed by zef build, to generate resources files. These files are needed for the module to function and to pass its tests. The Travis script skips the build phase between installing dependencies and testing the module:

my $zef = run "zef", "install", "--depsonly", "--/build", ".";
ok $zef.exitcode eq 0, "Able to install deps";
$zef = run "zef", "test", ".";
ok $zef.exitcode eq 0, "Package tests pass";

My understanding is that this is a legitimate use of Build.pm. zef includes the build phase when you install a module.

More Problem

It is not as easy as adding a zef build invocation because that fails when no build file exists. I'm not sure how standardized the build procedure is. According to zef source the build file can be called Build.pm or Build.pm6 and the whole thing is a giant ball of shit.

Steps to reproduce

The build failure linked in the first paragraph is from SAT::Solver::MiniSAT:

$ git clone https://github.com/taboege/p6-SAT-Solver-MiniSAT
$ cd p6-SAT-Solver-MiniSAT

What the Travis script does:

$ zef install --depsonly --/build .
All candidates are currently installed
$ zef test .
===> Testing: SAT::Solver::MiniSAT:ver<0.0.1>
# Failed test 'SAT::Solver::MiniSAT module can be use-d ok'
# at t/00-use.t line 8
# ===SORRY!=== Error while compiling /tmp/p6-SAT-Solver-MiniSAT/lib/SAT/Solver/MiniSAT.pm6 (SAT::Solver::MiniSAT)
# An exception occurred while evaluating a BEGIN
# at /tmp/p6-SAT-Solver-MiniSAT/lib/SAT/Solver/MiniSAT.pm6 (SAT::Solver::MiniSAT):35
# Exception details:
#   Failed to find '/tmp/p6-SAT-Solver-MiniSAT/resources/minisat' while trying to do '.mode'
#     in code  at /tmp/p6-SAT-Solver-MiniSAT/lib/SAT/Solver/MiniSAT.pm6 (SAT::Solver::MiniSAT) line 35
#     in code  at /tmp/p6-SAT-Solver-MiniSAT/lib/SAT/Solver/MiniSAT.pm6 (SAT::Solver::MiniSAT) line 35
# 
# 
# Looks like you failed 1 test of 2

With zef build:

$ zef install --depsonly --/build .
All candidates are currently installed
$ zef build .
# compilation noise from minisat...
$ zef test .
===> Testing: SAT::Solver::MiniSAT:ver<0.0.1>
===> Testing [OK] for SAT::Solver::MiniSAT:ver<0.0.1>
JJ commented 4 years ago

Let's try and see the status of this.