Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

rurban (7989)

  reversethis-{ta.yar-x} {ta} {nabrur}

cygwin maintainer for perl, parrot, clisp, postgresql, ... and some perl modules (perl-libwin32, perl-Win32-GUI). Has also some hairy CPAN packages: B::C, B::Generate, C::DynaLib, B::Debugger ...

Journal of rurban (7989)

Friday July 11, 2008
09:43 AM

pugs installation on cygwin

This is how I managed to install latest pugs on cygwin. This is the same as for any platform without existing packages.

Download and install ghc from
    Note that from ghc 6.8 on Pugs will not compile OOTB, you'd need Cabal then.
This is a win32 native and goes into "c:/ghc/ghc-6.8.3"

Create symlinks in our path:
$ for f in ln -s /cygdrive/c/ghc/ghc-6.8.3/bin/*; do ln -s $f /usr/local/bin/; done

Download and install Cabal required for cabal-install. Cabal-, which comes with ghc-6.8.3, is not new enough. Sigh.
Cabal tar.gz packages at

tar xfz Cabal-
cd Cabal-
runhaskell ./Setup.hs configure --ghc
runhaskell ./Setup.hs build
runhaskell ./Setup.hs install
cd ..

# Get zlib and HTTP, two required deps for cabal-install:

tar xfz HTTP-3001.0.4.tar.gz
cd HTTP-3001.0.4.tar.gz
runhaskell ./Setup.lhs configure --ghc
runhaskell ./Setup.lhs build
runhaskell ./Setup.lhs install
cd ..

tar xfz zlib-
cd zlib-
runhaskell ./Setup.hs configure --ghc
runhaskell ./Setup.hs build
runhaskell ./Setup.hs install
cd ..

# now get cabal-install, which is the haskell version of CPAN.

wget 5.1.tar.gz
tar xfz cabal-install-0.5.1.tar.gz
cd cabal-install-0.5.1
runhaskell ./Setup.hs configure --ghc
runhaskell ./Setup.hs build
runhaskell ./Setup.hs install
cd ..

# copy the installed bin\cabal.exe to /usr/local/bin/
cp /cygdrive/c/Program\ Files/Cabal/.../bin/cabal.exe /usr/local/bin/
# and now it's getting easier:

cabal update
cabal install Pugs

# here I get a stupid regex-base-0.93.1 failure
# ghc version >=6.4 is required but it could not be found.
# The package locations are registered in C:\ghc\ghc-6.8.3\package.conf

cabal install -v regex-base
# verbose. aha, the cached tar.gz is deep there
cp 'C:/Doc..../regex-base-0.93.1.tar.gz' .
tar xfz regex-base-0.93.1.tar.gz
cd regex-base-0.93.1
runhaskell ./Setup.hs configure --ghc
# => stupid error
joe regex-base.cabal
# add Build-Type: Simple
# after Tested-With:
# Ctrl-k x
runhaskell ./Setup.hs configure --ghc
runhaskell ./Setup.hs build
runhaskell ./Setup.hs install
cd ..

# and continue...
cabal install Pugs

# dada!
cp 'C:\Program Files\Haskell\bin\pugs.exe' /usr/local/bin/


      ______ /\ __ \
  \ \ \/\ \ __ __ ______ ______ (P)erl 6
    \ \ __//\ \/\ \/\ __ \/\ ___\ (U)ser's
      \ \ \/ \ \ \_\ \ \ \/\ \ \___ \ (G)olfing
        \ \__\ \ \____/\ \____ \/\_____\ (S)ystem
          \/__/ \/___/ \/___/\ \/____/ /\____/ Version:
                                              \/___/ Copyright 2005-2008, The Pugs Contributors
  Web: Email:

Welcome to Pugs -- Perl6 User's Golfing System
Type :h for help.

Loading Prelude... done.

Sunday July 06, 2008
06:24 AM

cygwin parrot-0.6.3 and perl6 ready for inspection

I've finally packaged parrot and its languages (perl6!) for cygwin.
icu was the main blocker, but we (Yaakov and me) finally we got that out, so now the fun starts.

ITP and info at

It just needs a GTG ("Good to go"), then it will be uploaded.

The make install step is still in its infancy, the .include search patch a bit insane.

with extensions: "" .exe .lnk .exe.lnk .past .past.exe .past.lnk .past.exe.lnk .pir .pir.exe .pir.lnk .pir.exe.lnk

The .exe and .lnk stuff is cygwin magic.

parrot, libparrot0 and libparrot-devel is in debian, freebsd ports, fedora and gentoo.
parrot-perl6 in debian at least. parrot-languages is my compressed version of the fedora split,
they have for every single language a seperate package.
Otherwise the package layout is similar to fedora, debian, gentoo and freebsd.
It's still a mess and a make install is not fully supported yet, but we have to start somewhere to get it finished.
I just left the docs/examples, the others stripped it.
pdb is called parrot_pdb, disassemble is called pbc_disassemble.

Thursday July 03, 2008
03:02 AM

cygwin upgraded to 5.10

After a busy year cygwin moved from 5.8.8 to 5.10.
It was quite an effort to coordinate a lot of dependant packages. Thanks to Yaakov Selkovitz, who had a to wait a few months.
And we have now a completely new and sane build system as simple shell scripts.

But even after testing for about half year, the first official try 5.10.0-4 has a serious error, which never showed up in any testcase. Jan Dubois found it.

perl -E "say for sort keys %Win32::" is empty.

cygperl links Win32CORE statically to libperl. Because some libtool packages which link to perl like mod_perl, cannot deal with mixed static + dynamic libs. The single static Win32CORE.a breaks it.

The problem is that I accidently removed the Config{static_ext} entry somehow in the intermediate step when compiling perl.c. init_Win32CORE() is not called.
The final static_ext is good again, because then the ExtUtils::Embed tests or my perl compiler tests would have found it.
Oh dear! The Win32 testsuite didn't find it.

The update to perl5.10.0-5 will have this fixed, but will be based on a current MAINT patchlevel.
My patch queue was getting huge, and I almost had to switch to quilt.
So I rather test it a bit longer.
cpan tests with about 500 packages were good so far.

Saturday April 12, 2008
06:21 AM


After busy weeks moving house and attending the local film-festival, work started again.

I've added machinery to support Bytecode portability and maybe across versions also. This will need some opcode version table for older versions.

Thanks to cpantest I've found and fixed some non-threaded bugs.

The main feature with this version is the commented disassembler output.

The main problem was that in the ByteLoader xpv_len is not the length of xpv_pv string. xpv_len also counts the ending \0 byte, but xpv_cur is the correct strlen.
So "\\d\000" has length 3, but a strlen of 2.
This caused problems on an early 5.10 pregcomp() minlen check, so all regexp tests failed.

I've also added a maxstring argument to asciiz strconst strings, which are no pascal-like strings, to avoid buffer-overflow attacks with handcrafted .pmc files.

Next I'll attack the pad panics and
SIGSEGV in Perl_fbm_instr() = Perl_re_intuit_start() = Perl_pp_subst()
Getting the correct re in the PMOP to be accepted by pp_match() is a nightmare.

Saturday March 22, 2008
01:56 PM

compiler updates

I've put my current work onto CPAN as developer releases. The perl compiler B-C has the same features and bugs as the official perl-5.8 release versions, just a little bit enhanced, so I could pull out the underscores, but I have to wait for authorization anyway.

1) the perl compiler
2) the optree debugger
3) And the start for a perloptreeguts.pod at

People complained that the perl internals are so hairy and complicated, and I have to completely disagree. It's just hard to debug at the early parsing/compiler stages. At least we have perl level hooks and don't have to write hooks in C or XS. And the optree debugger helps also. Or it could be that my background is LISP, and parsing, compilation and code transformation within lisp is a non-brainer.

I was a little bit worried about the lack of GSOC students, so I released incomplete work.

Missing authorization seems to be my fate anyway. When John Tobey handed me over C::DynaLib, he couldn't give me co-maintainership for the base module C::DynaLib neither, so this is marked as unauthorized also.

Monday February 18, 2008
10:33 AM

perl compiler B-C-1.04_05

I finally found the disturbing ByteLoader bug.
It had nothing to do with my bytecode changes, just the DATA handle reader started too early, because I added the byteorder header.
I'm still working on the machinery to debug the compiler, but it is getting better now.
The Bytecode backend is almost ready, just some general options (-Ox, -Dx) have to be supported.
The C backend produces some simple to fix syntax errors.
For the Jit backend I wrote some docs, and for my preferred native Asm backends I have to look for some abstraction.
The problem will be how to produce optimized ops from existing ops, and keeping them in sync. Something like stripping common arg headers and footers from the code. Or generating some optimized ops from pp.c automatically.

1.04_05 2008-02-18 rurban
        * added t/ and t/test*.sh to MANIFEST.
        * fixed ByteLoader reading from the filter.
        * fixed -H .plc header parsing
        * updated Bytecode options in NOTES and pod
        * added -O=Bytecode,-v option

Saturday February 02, 2008
04:51 AM

perl compiler 5.9.5

I was worried about the perl compiler state after parts have been removed from CORE with 5.9.5.
Having patched parts of B::Generate and more packages for 5.10, I felt to give B::C and friends a try.

I also wanted to experiment with the GNU lightning library, which I also evaluate for a clisp bytecode compiler extension (done recently by Yann Nicolas Dauphin in parallel), and for another project of mine. The JIT compiler for clisp is now usable, but slow.

So I fixed the obvious compiler warnings with the changed structs, and packaged B::C, B::CC, ByteLoader and its helper packages for a forthcoming B-C-1.05 package.

I also had some thoughts on future optimizations
when a native code perl compiler backend is available. This is what JIT lightning does.
E.g. type checking and detecting IVonly or PVonly ints or strings, which could be optimized to smaller and faster ops in JIT assembler.
Thinking about new B::Asm and B::JIT backends, "PLJC" ByteLoader 4-byte magic header.
byterun.c => jitrun.c

Current state:
1.04_02 2008-01-22 rurban
        * removed from CORE, now on CPAN.
        * added byteorder to bytecode header.
        * added support for 5.10 (NOT YET WORKING!), 5.9.5 not tested.
            up to 5.8.x already in CORE, so disabled.
            add back support later, when C/CC is improved or more features
            are added.
        * added type hekindex
        * added c.t and cc.t tests
        * extended format: added version logic
            to have strictly consecutive indices

All compile-time failures fixed, but still some run-time failures for bytecode XCV_STASH and PV handling.

Saturday January 05, 2008
07:52 PM

cygwin perl updated to 5.10.0-2, libwin32 and Win32::GUI

The cygwin packages for perl-5.10.0-2 and the cygwin modules perl-libwin32-0.28-1 and perl-Win32-GUI-1.05-2 have been updated. Still experimental until all other cygwin perl modules are also updated to 5.10.

What changed from 5.10.0-1 to -2?
@INC has now no duplicate site_perl and vendor_perl entries which came with the new _stem vars and a proper inc_version_list. Stupid.

To add /usr/lib/perl5/site_perl/5.8, without the archlib to @INC I patched perl.c to omit the archlib from otherlibdirs. If someone wants the archlib he should add it explictly to otherlibdirs.

Changed @INC, the include path,
    @INC: /usr/lib/perl5/5.10/cygwin /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/cygwin /usr/lib/perl5/site_perl/5.10 /usr/lib/perl5/site_perl/5.10/cygwin /usr/lib/perl5/site_perl/5.10 /usr/lib/perl5/vendor_perl/5.10/cygwin /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/vendor_perl/5.10/cygwin /usr/lib/perl5/vendor_perl/5.10
    @INC: /usr/lib/perl5/5.10/cygwin /usr/lib/perl5/5.10 /usr/lib/perl5/site_perl/5.10/cygwin /usr/lib/perl5/site_perl/5.10 /usr/lib/perl5/vendor_perl/5.10/cygwin /usr/lib/perl5/vendor_perl/5.10 /usr/lib/perl5/site_perl/5.8

See the cygwin announce: (not yet there)
and the vendor patches at

Tuesday December 25, 2007
12:48 PM

cygwin perl-5.10.0-1 uploaded

The cygwin perl packages perl and perl_manpages have
been updated in the experimental branch to 5.10.0-1.
    Click on [Exp]

Several libraries will follow soon. When all libraries have been updated we can switch from Experimental to Current.

perl-5.10.0 cygwin notes:

This release is binary incompatible with the previous 5.8 releases, but
compatible to all future 5.10.x releases. That's why we named the main
perl DLL /bin/cygperl5_10.dll and not cygperl5_10_0.dll.

The requirements for the special perl link driver ld2 and perlld had
been removed.

Cygwin mount point information is now accessible, esp. text/binary

Some modules have been added to vendor_perl, but most of the old vendor
modules moved to CORE.
Included are Bundle::CPAN, CPAN::Reporter, XML::LibXML and several
Test modules.
Note: Installed modules (e.g. via CPAN) in site_perl have higher
precedence than vendor_perl modules. So you can easily update these.

Cygwin README:

Vendor patches:
* CYG04 - major.version cygperl5_10.dll and not cygperl5_10_x.dll
* CYG11 - no-bs Empty .bs files are not generated anymore

Update recommendations:

Since 5.10 is not installed in parallel to 5.8 (it is possible, but not
with this package), all your old 5.8 modules will need to be reinstalled
for 5.10.
Your old 5.8 modules are not deleted, just not accessible to 5.10.
Non-binary packages can be used by adding /usr/lib/perl5/site_lib/5.8 to
your @INC, but the below procedure is recommended to get the latest
version for each installed package.
This will not harm most of your previous 5.8 modules in case you want to
switch back to 5.8, just the /bin scripts might get overwritten.

# get the list of installed 5.8 modules
$ perl -MExtUtils::Installed \
    -e'print join("\n", new ExtUtils::Installed->modules)' > module.list

# install all previous modules for 5.10
$ cpan `cat module.list`

Detailed NEWS from README

- Configure -de -Dmksymlinks -Duse64bitint -Dusethreads -Uusemymalloc \
        -Doptimize='-O3' -Dman3ext='3pm' -Dusesitecustomize
    (unchanged from 5.8)

- cygwin /bin g+w incompatible with TAINT (-T)
    The default directory permissions for /bin drwxrwxr-x is incompatible
    with perl tainting. chmod g-w /bin to allow perl -T scripts to run
    without warnings.

- included vendor_perl packages

    Rationale: Same local vendor_perl packages included as in 5.8.7,
    plus some of the new CPAN packages which went to core with 5.9.5,
    Bundle::CPAN, CPAN::Reporter, Module::Build for a full CPAN bootstrap,
    and the new patched libXML packages, and some almost-core

    Pod-Escapes-1.04 Pod-Simple-3.05 Test-Pod-1.26
    Devel-Symdump-2.08 Pod-Coverage-0.19 Test-Pod-Coverage-1.08
    Compress-Raw-Bzip2-2.008 IO-Compress-Bzip2-2.008 Compress-Bzip2-2.09
    Term-ReadLine-Perl-1.0302 Term-ReadLine-Gnu-1.16 TermReadKey-2.30
    XML-NamespaceSupport-1.09 XML-SAX-0.16 XML-LibXML-Common-0.13
    XML-LibXML-1.65 XML-Parser-2.36
    YAML-0.66 Config-Tiny-2.12 File-Copy-Recursive-0.35 IPC-Run3-0.039
    Probe-Perl-0.01 Tee-0.13 IO-CaptureOutput-1.06 File-pushd-1.00
    File-HomeDir-0.67 Digest-SHA-5.45 Module-Signature-0.55
    URI-1.35 HTML-Tagset-3.10 HTML-Parser-3.56 libwww-perl-5.808
    CPAN-1.9205 Test-Reporter-1.38 CPAN-Reporter-1.0601
    Net-Telnet-3.03 Module-ScanDeps-0.81 PAR-Dist-0.25
    B-Generate-1.11 PadWalker-1.5 Alias-2.32

Thanks to Jerry D. Hedden and Jan Dubois.

Monday July 02, 2007
03:57 PM

Future Cygwin:: enhancements

I just added cygpath style conversions to blead and now I'm wondering what other useful internal API's would be useful to be exported to perl starting with 5.10.

And if it should require the "use Cygwin;" importer. Probably so. The current list of 6 cygwin functions in core require no "use Cygwin;".

I came up with this list for a future Cygwin package:

  cygserver_running() => bool
  CW_GET_CYGDRIVE_PREFIXES($user, $system) => flags as str
  CW_STRACE_ACTIVE() => bool
  CW_EXTRACT_DOMAIN_AND_USER(\%pw) => (domain, user)
  CW_CMDLINE($pid) => str
  CW_CHECK_NTSEC($filename) => bool
  CW_GET_ERRNO_FROM_WINERROR($error, $deferrno) => int
  CW_GET_POSIX_SECURITY_ATTRIBUTE($attribute, \@psa) => \%sd
  CW_GET_SHMLBA() => GetSystemInfo.dwAllocationGranularity
  CW_GET_UID_FROM_SID($psid) => $uid
  CW_GET_GID_FROM_SID($psid) => $gid

Of course CW_ will be removed and properly lower cased. Look up sys/cygwin.h and/or winsup/ for example.