CPAN Testers is only made possible with the support of our sponsors.
For more information on sponsoring, please visit the I CPAN Testers website.

Upgrade Notice

The CPAN Testers Wiki site has been upgraded since you last accessed the site. Please press the F5 key or CTRL-R to refresh your browser cache to use the latest javascript and CSS files.

Smoker on OpenBSD

These are more like notes only than a proper documentation about setting up a smoker on OpenBSD. It assumes you already read the SmokeTesting page.

OpenBSD has a history of not caring too much about virtualization: it doesn't runs as a dom0 and has a past of problems as running as a guest.

In those notes, the author was able to run the Smoker on Virtualbox 4.5 and 5.0.23 without problems. You may want to choose a different VM, so be ready to make adaptations.

Steps for configuration

VM Configuration with Virtualbox

  • 1 or 2 CPUs: more than that will probably leave CPUs unused.
  • Configure Network as bridge.
  • Partitions:
    • Allocate at least 5GB for the /home (or any other where installed Perl modules will be located).
    • Also create another partition to hold the CPAN mirror (CPAN::Mini) with at least 5GB.
  • install required software:
    • During setup, mark the set comp<version>.tgz (development).
    • Set pkg_add:
export PKG_PATH=
pkg_add bzip2 unzip wget curl bash ntp tidyp
    • Optional (but recommended) software:
pkg_add libxml gmp libxslt
  • Using bash (necessary if you want to run perlbrew):
chsh -s /usr/local/bin/bash <login>
    • Create the .bash_profile:
-bash-4.3$ cat .bash_profile
if [ -e "${HOME}/.bashrc" ]
    source "${HOME}/.bashrc"

You will also need to properly define in the .bashrc to use local::lib or perlbrew. I'll defer the configuration of it when appropriated.


The .bashrc configuration proposed automatically by CPAN configuration on OpenBSD offers a different set of parameters than the one documented on local::lib Pod. Compare the values above with the single proposed line on .bashrc from local::lib Pod:

eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"
  • Configure ntp
As root:
ntpd -s
  • Configure MFS

If there is available RAM to the VM, configure 512 MB (minimum) for mfs file system. This file system should be used as build_dir option of CPAN module. In the /etc/fstab:

swap /location mfs rw,async,nodev,nosuid,-s=512m 0 0

Also include the option clean_cache_after => 50 for 512 MB of mfs mount point to start() sub of CPAN::Reporter::Smoker.

alias smoker = "perl -MCPAN::Reporter::Smoker -e `start( clean_cache_after => 50, install => 1)'"

Also, set the CPAN parameter keep_source_where to the same value configured for the build_dir parameter. This will guarantee that the FIFO mechanism used by build_cache is also applied to the source code files.

  • Fix libpth

OpenBSD keeps "no standard" C libraries in /usr/local/lib, not /usr/lib. Even if you're installing software available on OpenBSD packages repository (but it is not standard), the standard perl shipped with OpenBSD will not be able to find those libraries.

The default perl configuration:

-bash-4.3$ perl -V:libpth
libpth='/usr/lib /usr/lib';

To solved the problem, edit the two files below (with root):

/usr/libdata/perl5/<PLATFORM>-openbsd/<PERL VERSION>/
/usr/libdata/perl5/<PLATFORM>-openbsd/<PERL VERSION>/

Where <PERL VERSION> is the current version of perl, replacing lines from: libpth => '/usr/lib' to: libpth => '/usr/lib /usr/local/lib' for both files.

After the changes:

-bash-4.3$ perl -V:libpth
libpth='/usr/lib /usr/local/lib';

See the standard core module Config perldoc for more information.

Configure CPAN

There are two options to do that:

Using the default perl

Since OpenBSD 5.9, the default perl available will offer to configure CPAN automatically, including configuring it to use local::lib.

Create the .bashrc file:

-bash-4.3$ cat .bashrc
PATH="/home/john/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/home/john/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_MB_OPT="--install_base \"/home/john/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/home/john/perl5"; export PERL_MM_OPT;

O you can do a manual configuration:

Use the CPAN shell to configure (or copy configuration?) Install local::lib (offered automatically as default option in OpenBSD 5.9):

get local::lib
look local::lib
perl Makefile.PL --bootstrap
make test && make install
exit (from CPAN shell)


eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)" 

to .bashrc and activate it.

Enter CPAN shell again and install Task::CPAN::Reporter and exit.

Using perlbrew

You can also use perlbrew if you want a different perl version (or with different configuration). perlbrew will work fine with OpenBSD after you installed and configured bash as the default shell, but at the time the author is writing this wiki, the standard perl is failing some tests, [but you can safely ignore them], just going to the directory where perl was compiled and finishing the process after the tests failed:

make install