Angering the sun gods

I must have commited hubris the last time I tried Rakudo on Solaris and had no trouble.

I booted up a fresh OpenSolaris partition today, the first time in about two weeks, installed all the tools and downloaded rakudo, however Parrot’s Configure.pl script gave out errors and it died during the build process as a result. Utterly confused (as it was working without any hassle two weeks ago) I decided to try Sun Studio’s C Compiler, and it built fine. So I ran the spectest and had a few failures that I do not remember getting last time.

The first failure was in S03-operators/arith.t #163 fails. This test checks that 1**Inf returns 1, however on OpenSolaris:

> say 1**Inf
NaN

On Ubuntu:

> say 1**Inf
1

Utterly perplexed I asked on IRC but received no answer as to why this was happening, so I made a note to report it later.

I moved on then to sedate my curiosity into $*OS. I thought its value depended on the result of uname -s but OpenSolaris reports that as ‘SunOS’ while its $*OS variable is ’solaris’, so while digging into the code (I never did figure out how it works) I found that $*OSVER is defined in Rakudo. On my Ubuntu box it returns:
#49-Ubuntu SMP Tue Aug 18 19:25:34 UTC 2009
and on Solaris it returns nada. It’s defined, but an empty string. Something to do with how Parrot works it out, I tried to dig into the source but didn’t understand it.

So having found a few issues I decided to look into my initial problems; GCC not working. I tried to compile it a few more times, each time it failing until the answer just came to me; Rakudo’s configure script was recently changed to pass –optimize to Parrot by default. It made sense, it Just Worked(tm) two weeks ago, in that time the –optimize flag was made a default and now it doesn’t work, so I tried building Parrot with GCC without the flag and it worked! Here the Parrot bug that was filed.

My original intent was to see what spectests faster, Rakudo with GCC-Parrot or Rakudo with SSCC-Parrot. So I started spectesting the GCC-compiled-Parrot Rakudo and some strange failures came up that didn’t fail on the first run; t/spec/S32-num/log # 12 and 16. (Just an aside, S32-num/power #11 also fails but that’s because of 1**Inf). Confused I looked at the tests but couldn’t work it out, I thought I might have missed those failures in my first run so I rebuilt both Rakudo’s, one with GCC and one with SunStudio CC and set the spectests going. While they were spectesting I had a thought and decided to test the test:

On Ubuntu:
> say log(-Inf)
NaN

On OpenSolaris:
> say log(-Inf)
-Inf

Then I had a weird thought … on the Rakudo using a Parrot compiled with SunStudio CC:
> say log(-Inf)
NaN

Oops?

I have no idea what is going on here, but I do know that Parrot and Rakudo need more people using other platforms ;-)

If I was using OpenSolaris as my $ONE_TRUE_OS I would have noticed this two weeks ago … I would love to be doing that but I life has been so easy with Ubuntu I don’t think I could handle the switch.

Just a postscript, when the –optimize change was made I booted my Haiku box, cloned a fresh Rakudo and rebuilt from scratch to test if it affected anything … curses!


This entry was posted on Wednesday, September 30th, 2009 at 12:45 am and is filed under Perl6.

You can follow any responses to this entry through the RSS 2.0 feed.

You can leave a response, or trackback from your own site.

Leave a Reply