Skip to content

Installation

Aleks-Daniel Jakimenko-Aleksejev edited this page Jun 30, 2019 · 35 revisions

Data

Most data files are available here: https://github.com/perl6/whateverable-data

Just clone that repository into the data/ folder if you want to run the bots with the existing data.

Clone the repo

Get the source code:

git clone --recurse-submodules [email protected]:perl6/whateverable.git
# or using https ↓
# git clone --recurse-submodules https://github.com/perl6/whateverable.git
cd whateverable

If you already cloned the repo without submodules and want to clone them later, run this in whateverable root:

git submodule update --init --recursive

Dependencies

Use zef to install dependencies:

zef install --deps-only .

If you get any failures in the installed modules, either investigate what makes them fail, or temporarily install them with --force:

zef install --force --deps-only .

If you are using rakudobrew, you will need to run rehash command to make sake available.

rakudobrew rehash

For Nativecallable you will need castxml debian package or its equivalent (gccxml should also work fine).

You will also need zstd and lrzip. On Debian you can install these using this command:

sudo apt install zstd lrzip

zstd might not be available for your distribution (notably, Ubuntu 14.04). Download and compile from source in that case.

Debugging

To run a bot, use sake debug:botname command. For example:

sake debug:unicodable

The bot should start and join #whateverable channel on freenode. It will have its normal nickname with “test” appended to it (e.g. “bisectable6test”). When running commands, make sure that you're talking to your debug instance of a bot (and not the main one).

Using github gists

Anytime the answer of a bot does not fit into a single IRC message, a gist will be uploaded. Recently anonymous gists were disabled on GitHub, meaning that now you have to create an access token for uploads to work.

To do that, copy config-default.json file to config.json. Now you can fill in config.json with things that you need. In this case we'll need to fill login and access_token in github section. Your login is just your github login, and for the access token go to Personal access tokens and click Generate new token. The only checkbox you have to tick is gist (Create gists). Copy the generated access token to config.json and after that bots should be able to upload gists.

Running tests and using rakudo builds

If you want to run tests, just run the appropriate test file from the root whateverable directory. Like this:

perl6 t/unicodable.t

Keep in mind that most bots need a bunch of rakudo builds in order to work properly. Here are some possible approaches:

  1. If you're using linux on amd64 architecture, then by default bots will attempt to pull builds from the main whateverable server. This way you won't need to build over 15000 rakudo builds, but at the same time any bot will work up to its full potential. Also, most tests are guaranteed to work. This is the best option. 👍
  2. If you are not using linux on amd64, then you may consider trying a virtual machine. The convenience will probably outweigh the effort for setting it up.
  3. If you don't want or can't run linux on amd64, it's OK, a lot of features that don't require rakudo builds will work just fine (e.g. Unicodable works almost fully, but a few of its tests will not pass). That is, most likely you'll be able to work on many tickets anyway.
  4. We provide ssh access to the server for those who want to work on the bots, so feel free to contact us on #whateverable.
  5. You can also try creating just enough rakudo builds in order to test your changes. See build.p6.
  6. If everything fails, just come to #whateverable and talk to a human, we will figure something out.

Unless really needed, try not to run all of the tests in bulk. First of all, it will take a lot of time. Secondly, some test files are known not to work locally.