Smoking Perl

Sawyer X's March 5-25 2018 Perl 5 Porters Mailing list summary put out a call for macOS smoke testers. I thought I would see how far I could get putting one together from the Test-Smoke docs.

The following is not a blow-by-blow (painful and uninteresting to read), but rather what I came up with after a few false starts, with emphasis on what I did over and above the Test-Smoke README documentation, and (sometimes) why.

Environment:

  • macOS 10.13 High Sierra
  • Custom-built Perl installed system-wide in custom directory
  • CPAN client (not cpanp or cpanm) configured to sudo

Procedure:

  1. Install Test::Smoke. I chose a directory that was not backed up by Time Machine. I used ~/Nobackup/perl/Test-Smoke-1.72/smoke. The default install is under ~/.cpan/, but I thought I wanted the smoker to be a little more visible. The Test-Smoke-1.72/ is because trial-and-error showed that the configuration script wants to put the Perl Git repository and build directories in siblings to smoke/, and I wanted everything related to the smoker to be in a directory by itself. Note that there is nothing magic about the Nobackup/ directory name; it is not backed up because I configured Time Machine not to back it up.
  2. Because my CPAN client uses sudo to install, the smoke/ directory and its contents were owned by root, so I had to sudo chown -R back to myself.
  3. cd ~/Nobackup/perl/Test-Smoke-1.72/smoke
  4. I wanted to smoke the current Perl. Trial and error showed that the configuration script wanted to modify perlcurrent.cfg. That file turned out to be read-only, and was found in lib/Test/Smoke/. I copied it to ./, and did a chmod u+w on it.
  5. perl configsmoke.pl. I chose to smoke blead (the default), and took the default for all remaining questions. Note that we need to handle scheduling separately since macOS does not use crontab.
  6. Put contact information in smokecurrent.usernote. I do not know if that is the intended use of this file, but I also did not see any other place to specify this, and I wanted people to be able to reach me if something screwed up.
  7. Ran time ./smokecurrent.sh, just to see if anything useful would happen, and if so what, and how long it would take. It took 5 hours, and somewhat to my surprise showed up as a "pass" at perl5.test-smoke.org/.
  8. MacOS has consolidated a number of functions into a process called launchd. The consolidated functionality includes init, cron, and inetd. In order to get something scheduled by launchd I wrote a launchd.plist (5) file, which needs to be put in ~/Library/LaunchAgents/. I am still tweaking this, but the current version is here. Tweaks you may need or want are:
    • Change the <Label> value to something you like. The name of the file should be this value, with ".plist" appended.
    • Change the path to smokecurrent.sh to the appropriate value for your installation.
    • The <WorkingDirectory> entry may be unneeded, because the first thing smokecurrent.sh does is to cd to the correct directory.
    • Maybe the value of <ProcessType> should be Background. I had it there once and got a FAIL(X), which I did not understand. I thought it might be a timing issue, so I decided to play it safe until I knew I had a working smoker.
    You can log out and back in to get this loaded, but it is probably easier just to issue the command launchctl load ~/Library/LaunchAgents/your-plist-file.plist
  9. In addition, you may want to go into the "Power" setting and tell your CPU not to go to sleep, at least during times your smoker is scheduled to run.

3 Comments

Instead of reading the docs, I started by installing Test::Smoke. It turns out that installing it also configures it and also automatically added a line to my crontab after asking for permission.

I went through the same process. It looks complicated but it is very simple. I used cron though sinceI don't care about jobs that I might have missed (which launchd is smart about).

I modified my cron command to set LOGNAME to use the name I want to use to identify myself instead of the actual login name on my machine.

I have a patched version of Test::Smoke that lets me use HOSTNAME to set something more meaningful instead of the actual hostname of the machine. I set this to the Mac model number (like MacPro4,1).

For a long time I put this off because I thought I'd have to configure email. Test::Smoke can also submit with HTTP::Tiny though so I never touched anything with email.

The smoking takes several hours, but it compiles and tests several different configurations (around 16 combinations I think).

The results are at http://perl5.test-smoke.org.

I was eventually going to make the same post. Now I don't have to!

Thanks for writing up that step-by-step guide. Once I saw it was really quite simple to do, it was the nudge that got me to do what I'd always intended to do someday, start smoking...

Leave a comment

About Tom Wyant

user-pic Fine Perl code for over 0.005 centuries.