I continue to play with RakuDist API searching for useful cases for Raku modules authors.
With RakuDist/Sparrow6 one can easily customize an installation and testing process.
Why would people need it? For various reasons:
- A module requires external libraries not satisfied by zef install
- A module requires external services – e.g. databases servers running and so on
- A module requires extra configuration files which are hard to deliver by standard distribution means
To address all the needs RakuDist provides a handy functionality called custom scenarios.
Just drop a
.rakudist folder into your Raku module source code, with some custom scenario inside:
Say, you need an installation of an sqlite library as your module relies on it:
That is it. Now commit and push changes to git:
git add .rakudist && git commit -m "my custom scenario" && git push
Now you may test your distribution hosted on GitHub through API:
POST os=$os project=$author/$project /rakudist/api/run/:github
For example to test Teddy::Bear module:
curl \ -d os=alpine \ -d project=melezhik/rakudist-teddy-bear \ http://repo.westus.cloudapp.azure.com/rakudist/api/run/:github
Once you’ve packed
.rakudist/ folder in a CPAN distribution, you can test it as well:
POST os=$os /rakudist/api/run/$module
curl \ -d os=alpine \ http://repo.westus.cloudapp.azure.com/rakudist/api/run/Teddy::Bear
1. Custom tasks/scripts
# your Bash code here
And then inside Sparrow scenario just:
2. Raku dependencies not declared in META6.json file
Sometimes developers might be not ready to include dependencies in meta6 file for various reasons. For example, when a dependent module itself is not released yet, or if the dependency fails and needs to be installed as
--/test exclusively, here is
depends.raku for the rescue:
.rakudist/depends.raku file declaring Raku dependencies in simple format:
OpenSSL notest git://github.com/frithnanth/raku-Math-Libgsl-Constants.git
Here we want to install
OpenSSLwithout unit tests and
Math::Libgsl::Constants from GitHub sources.
3. Existing modules examples
I’ve recently made a PR to
Math::Libgsl::Permutation and to PR to
Archive::Libarchive::Raw to support RakuDist test against various OS systems. These modules rely on external libraries
libarchive and so need to be tested against platforms. RakuDist comes very handy in such case.
RakuDist keeps growing, but is still in quite experimental phase, to see the project potential, I would like to have a feedback from Raku modules authors. Thanks.