# New Ticket Created by  Ira Byerly 
# Please include the string:  [perl #73148]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=73148 >


Hello,

I noticed that perl6 -v (--version) doesn't currently say very much, and the
differences in output between different version of Rakudo appear to be
mostly accidental.  For example, here is perl6 -v from Alpha (just before
the -ng merge) and Amsterdam (just after.)

$ alpha  -v
This is Rakudo Perl 6.

Copyright 2006-2010, The Perl Foundation.

$ amsterdam -v
This compiler is built with the Parrot Compiler Toolkit, parrot revision
44147.

There is an existing Perl6 bug report from August 2009 on the same topic,
"#68752: perl6 --version doesn't actually give version info".

The attached patch changes the output from Amsterdam's format  to this:

$ rakudo -v
This is a DEVELOPMENT version of Rakudo Perl 6.  It is based on the
"rakudo-ng" development branch and is expected to evolve into
development release #27 "Copenhagen" about March 18, 2010.
It is from the git master branch:
    commit 4f74e3b1bb56ecdf31ff2356ff6ae73ae581f5f8
    Author: Solomon Foster <colo...@gmail.com>
    Date:   Tue Feb 23 22:28:22 2010 -0500
Rakudo Perl 6 is Copyright (C) 2008-2010, The Perl Foundation.
This compiler is built with the Parrot Compiler Toolkit, parrot revision
44371.


All of the new perl6 -v information is built as say "..." statements
inserted into src/Perl6/Compiler.pir during the make process by a Perl 5
script, Compiler_Version_Setup.pl.  The edited file is
src/gen/compiler.pir.  The say statements are added into a copy of the
method "version" that I swiped from
parrot/compilers/pct/src/PCT/HLLCompiler.pir.

The first three lines of perl6 -v output are simply copied from a new file,
RELEASE, which would be filled in by hand during the process of making the
tarball for a new release.  It would remain as is until the tarball for
2010-03 is built, at which point it would be changed to read something like:

    This is Rakudo Perl 6, development release #27 "Copenhagen"
    released on March 18, 2010.

The next git commit sent after the tarball is created should switch back to
labelling the release as a development version, rather than development
release.  Users who want to know which development version is which could
use the git information.

The next four lines are taken from git branch and git show, which are run
during the make.  If the git commands fail, those lines will be omitted from
the output of perl6 -v.

The copyright line is a constant built into Compiler_Version_Setup.pl,
except for the ending year, 2010 in the example, which is taken from the
year in git show.  This gets around the problem of people forgetting to bump
the copyright statement on the compiler itself each year.

The last line of output is supplied by PCT.


This is my first patch to Perl6 and I must admit that I am guessing at some
of the naming and packaging conventions.  If you have any concerns or
suggestions I would be more than happy to modify the patch to improve its
aesthetics or to better fit into the existing structure.  Please let me know
what you think.

Best regards,
Ira Kevin Byerly
quester  (on #perl6 and perlmonks)
quester...@gmail.com

Attachment: 0001-Change-perl6-version-to-include-info-from-git-show-a.patch
Description: Binary data

Reply via email to