Skip Menu |
 
Report information
Id: 73148
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: quester.pm [at] gmail.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)

Attachments
0001-Change-perl6-version-to-include-info-from-git-show-a.patch
0001-perl6-v-including-and-git-and-build-info.patch
0001-perl6-v-to-include-description-git-info-build-time-l.patch
0001-RT-73148-Fix-perl-v-2010-06-11.patch
0001-RT-73148-Fix-perl-v.patch



Subject: PATCH Fix bug #68752, make perl6 --version more informative
Date: Fri, 26 Feb 2010 07:26:30 -1000
To: rakudobug [...] perl.org
From: Ira Byerly <quester.pm [...] gmail.com>

Message body is not shown because sender requested not to inline it.

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 <colomon@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.pm@gmail.com

Subject: [PATCH] Fix bug #68752, make perl6 --version more informative (second version of patch, replaces #73148)
Date: Sun, 7 Mar 2010 17:30:15 -1000
To: rakudobug [...] perl.org
From: Ira Byerly <quester.pm [...] gmail.com>
Download (untitled) / with headers
text/plain 3.1k
Hello,

Thanks to pmichaud++ and masak++ for pointing me in the right direction structuring this patch to match the existing architecture (#perl6, 08:41-09:20 UTC 2010-03-02.)

******

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:

$ perl6 --version
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 was built Sun Mar  7 16:34:40 HST 2010 by quester on f12.virt
It is from the git branch "master"
    commit 1cc1f3c4e4a9f736c3077532dfec79721b581fbc
    Author: quester <quester.pm@gmail.com>
    Date:   Sun Mar 7 15:43:30 2010 -1000
Rakudo Perl 6 is Copyright (C) 2008-2010, The Perl Foundation.
This compiler is built with the Parrot Compiler Toolkit, parrot revision 44705.

All of the new perl6 -v information is built as static PIR say "..." statements that are written into src/gen/version-cheats.pir during the make process by a Perl 5 script, build/gen_version_pir.pl. The say statements are in a copy of the method "version" that I swiped from parrot/compilers/pct/src/PCT/HLLCompiler.pir.

The first three lines of perl6 --version output above are in a string constant in build/gen_version_pir.pl, 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 needs another manual change 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 line is taken from environment variables (host and user name) and either /bin/date, if that works, or from localtime.

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

The copyright line is another string constant built into build/gen_version_pir.pl, except for the ending year, 2010 in the example, which is taken from the year of the commit in git show. This is a quick attempt to get around the problem of a developer who might forget to bump the copyright statement on the compiler itself each year.

The last line of output is supplied by PCT.

Best regards,
Ira Kevin Byerly
quester (on #perl6 and perlmonks)
quester.pm { at } gmail.com
Patch (from git format-patch origin)
Subject: 0001-perl6-v-to-include-description-git-info-build-time-l.patch
From 1cc1f3c4e4a9f736c3077532dfec79721b581fbc Mon Sep 17 00:00:00 2001 From: quester <quester.pm@gmail.com> Date: Sun, 7 Mar 2010 15:43:30 -1000 Subject: [PATCH] perl6 -v to include description, git info, build time/location --- build/Makefile.in | 4 ++ build/gen_version_pir.pl | 114 ++++++++++++++++++++++++++++++++++++++++++++++ docs/release_guide.pod | 44 ++++++++++++++---- 3 files changed, 152 insertions(+), 10 deletions(-) create mode 100644 build/gen_version_pir.pl diff --git a/build/Makefile.in b/build/Makefile.in index 902343e..f4c23bc 100644 --- a/build/Makefile.in +++ b/build/Makefile.in @@ -155,6 +155,7 @@ CHEATS_PIR = \ src/cheats/parrot/Protoobject.pir \ src/cheats/parrot/P6role.pir \ src/gen/uprop-cheats.pir \ + src/gen/version-cheats.pir \ src/cheats/parrot/register.pir \ CORE_SOURCES = \ @@ -362,6 +363,9 @@ src/gen/core.pm: build/gen_core_pm.pl $(CORE_SOURCES) src/gen/uprop-cheats.pir: build/gen_uprop_pir.pl $(PERL) build/gen_uprop_pir.pl > src/gen/uprop-cheats.pir +src/gen/version-cheats.pir: build/gen_version_pir.pl + $(PERL) build/gen_version_pir.pl > src/gen/version-cheats.pir + #src/gen_metaop.pir: build/gen_metaop_pir.pl # $(PERL) build/gen_metaop_pir.pl > src/gen_metaop.pir # diff --git a/build/gen_version_pir.pl b/build/gen_version_pir.pl new file mode 100644 index 0000000..21692bb --- /dev/null +++ b/build/gen_version_pir.pl @@ -0,0 +1,114 @@ +#! perl +use strict; +use warnings; + +# Put the compiler version information, used for perl6 -v, +# into src/gen/version.pm. + +########################################################################### + +my $copyright_year = "2010"; + +my $release = qq{ + + 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. + +}; + +########################################################################### + +# Display the value of $release set above. +# Then display some information from git branch and git show, if available. + +# The ending year in the copyright line (Copyright (C) 2008-20??) +# will be taken from the year of the git commit, if it is available. +# If not, use the value in $copyright_year. + +$release =~ s/\n\s+/\n/smg; +$release =~ s/^\n//sm; +$release =~ s/"/\\"/g; +my @release = split '\n', $release; + +print "# This file was generated by $0\n"; + +print q{ + .macro_const RAKUDO_HLL 'perl6' + + .HLL .RAKUDO_HLL + + .loadlib 'perl6_group' + .loadlib 'perl6_ops' + .loadlib 'math_ops' + + .namespace ['Perl6';'Compiler'] + + # This overrides the version method in PCT::HLLCompiler + + .sub 'version' :method +}; + +print qq{ say "$_"\n} for @release; + +my $host = $ENV{HOSTNAME} || $ENV{COMPUTERNAME} || ""; +$host = " on $host" if $host; + +my $user = $ENV{USER} || $ENV{USERNAME} || ""; +$user = " by $user" if $user; + +no warnings 'exec'; +my $localtime = qx{/bin/date} + || ""; # DON'T use the Windows "date" command! +use warnings; + +$localtime =~ s/[\r\n]//g; +my $tz = $ENV{TZ} || ""; +$tz = " $tz" if $tz; +$localtime = localtime() . $tz unless $localtime; + +print qq{ say "It was built $localtime$user$host"\n}; + +# Try to include git info if possible. +# +# It is important to fail _gracefully_ if the user doesn't +# have a .git directory (tarballs usually don't) or if the +# # user doesn't have the git command at all. + + +if ( -d ".git" ) { + no warnings 'exec'; + my $git_branch = qx{git branch} || ""; + use warnings; + my @git_branch = split "\n", $git_branch; + for (@git_branch) { + if (/^\*\s+([^ ]+)/) { + print qq{ say "It is from the git branch \\"$1\\""\n}; + } + } + no warnings 'exec'; + my $git_show = qx{git show} || ""; + use warnings; + if ( my @git_show = split "\n", $git_show ) { + $git_show[$_] =~ s/"/\\"/g for ( 0, 1, 2 ); + print qq{ say " $git_show[$_]"\n} for ( 0, 1, 2 ); + $git_show[2] =~ / (\d{4}) /; + $copyright_year = $1; + } else { + print qq{ say "Git commit information is not available."\n}; + } +} else { + # This may confuse casual users more that it helps, + # comment out if that seems to be the case. + print qq{ say "It was not built from a git branch."\n}; +} + +print qq{ say "Rakudo Perl 6 is Copyright (C) 2008-$copyright_year,}, + qq{ The Perl Foundation."\n}; + +print q{ + $P0 = getattribute self, '$version' + say $P0 + exit 0 + .end +}; diff --git a/docs/release_guide.pod b/docs/release_guide.pod index 0f8414c..835908a 100644 --- a/docs/release_guide.pod +++ b/docs/release_guide.pod @@ -157,6 +157,15 @@ you find any steps that are missing. =item 7. +Also, update the settings of $release and $copyright_year near +the top of build/gen_version_pir.pl. This sets the beginning +of the output of perl6 -v or perl6 --version. If this is a +monthly or final release, make sure $release says so. + + $ git commit build/gen_version_pir.pl + +=item 8. + Make sure everything compiles and runs from a known clean state: $ make realclean @@ -170,26 +179,26 @@ Often this means fixing a bug, fudging a test, or (temporarily?) commenting out a test file in t/spectest.data . Use your best judgment or ask others if uncertain what to do here. -=item 8. +=item 9. Make sure any locally modified files have been pushed back to github. $ git status $ git push -=item 9. +=item 10. Create an initial tarball by entering C<make release VERSION=YYYY.MM>, where YYYY-MM is the month for which the release is being made. This will create a candidate tarball file named <rakudo-YYYY.MM.tgz>. -=item 10. +=item 11. Unpack the tar file into another area, and test that it builds and runs properly. If there are any problems, fix them and go back to step 7. -=item 11. +=item 12. Tag the release by its release month ("MMMM.YY") and its code name. @@ -197,26 +206,41 @@ Tag the release by its release month ("MMMM.YY") and its code name. $ git tag -a -m"tag release #nn" CODENAME # e.g., "Bratislava" $ git push --tags -=item 12. +=item 13. Upload the release tarball to github's download area at L<http://github.com/rakudo/rakudo/downloads>. -=item 13. +=item 14. + +Update the setting of $release again, near the top of +build/gen_version_pir.pl. Have it state that this a +development version, based on [the name and date of the +release you just pushed], evolving towards [the name and +target date of the next release.] + + $ git commit build/gen_version_pir.pl + +Push this back to github. + + $ git status + $ git push + +=item 15. Publish the release announcement (from #5) above to appropriate locations, including rakudo.org, use.perl, perl6-language, perl6-announce, perl6-users, and others. -=item 14. +=item 16. Update the Wikipedia entry at L<http://en.wikipedia.org/wiki/Rakudo>. -=item 15. +=item 17. Promote the release anywhere else you think appropriate. -=item 16. +=item 18. You're done! Celebrate with the appropriate amount of fun. @@ -224,7 +248,7 @@ You're done! Celebrate with the appropriate amount of fun. =head1 COPYRIGHT -Copyright (C) 2009, The Perl Foundation. +Copyright (C) 2010, The Perl Foundation. =cut -- 1.6.6.1
Subject: [PATCH] Fix bug #68752, make perl6 --version more informative
#73148 replaced this patch.
Subject: [PATCH] Fix bug #68752, make perl6 --version more informative
Correction: #73418 replaced this patch.
Download (untitled) / with headers
text/plain 140b
Thanks, this looks like an interesting patch. Since Patrick is our expert for the build system, I'm assigning this ticket to him for review.
Subject: Re: [perl #73418] [PATCH] Fix bug #68752, make perl6 --version more informative (second version of patch, replaces #73148)
Date: Mon, 8 Mar 2010 22:17:58 -1000
To: perl6-bugs-followup [...] perl.org
From: Ira Byerly <quester.pm [...] gmail.com>
Download (untitled) / with headers
text/plain 311b
Moritz, Thank you very much. - Ira Byerly -------------------------- On Mon, Mar 8, 2010 at 7:03 AM, Moritz Lenz via RT < perl6-bugs-followup@perl.org> wrote: Show quoted text
> Thanks, this looks like an interesting patch. Since Patrick is our > expert for the build system, I'm assigning this ticket to him for review. >
Download (untitled) / with headers
text/plain 113b
Here is a revised version of the patch that deals better with variations in the output format of git show. - Ira
From 73a1afcff7a60062c40b1344deb16f65f4a73e5a Mon Sep 17 00:00:00 2001 From: quester <quester.pm@gmail.com> Date: Tue, 23 Mar 2010 00:58:52 -1000 Subject: [PATCH] perl6 -v including and git and build info --- build/Makefile.in | 4 ++ build/gen_version_pir.pl | 115 ++++++++++++++++++++++++++++++++++++++++++++++ docs/release_guide.pod | 44 ++++++++++++++---- 3 files changed, 153 insertions(+), 10 deletions(-) create mode 100644 build/gen_version_pir.pl diff --git a/build/Makefile.in b/build/Makefile.in index d1f79f4..dfc6d27 100644 --- a/build/Makefile.in +++ b/build/Makefile.in @@ -154,12 +154,13 @@ CHEATS_PIR = \ src/cheats/want-caller-side-callsig.pir \ src/cheats/parrot-role-quirks.pir \ src/cheats/parrot/attriter.pir \ src/cheats/parrot/Protoobject.pir \ src/cheats/parrot/P6role.pir \ src/gen/uprop-cheats.pir \ + src/gen/version-cheats.pir \ src/cheats/parrot/register.pir \ CORE_SOURCES = \ src/core/traits.pm \ src/core/operators.pm \ src/cheats/trait-export.pm \ @@ -379,12 +380,15 @@ src/gen/cheats.pir: build/gen_cheats_pir.pl $(CHEATS_PIR) src/gen/core.pm: build/gen_core_pm.pl $(CORE_SOURCES) $(PERL) build/gen_core_pm.pl $(CORE_SOURCES) > src/gen/core.pm src/gen/uprop-cheats.pir: build/gen_uprop_pir.pl $(PERL) build/gen_uprop_pir.pl > src/gen/uprop-cheats.pir +src/gen/version-cheats.pir: build/gen_version_pir.pl + $(PERL) build/gen_version_pir.pl > src/gen/version-cheats.pir + #src/gen_metaop.pir: build/gen_metaop_pir.pl # $(PERL) build/gen_metaop_pir.pl > src/gen_metaop.pir # #src/gen_junction.pir: build/gen_junction_pir.pl # $(PERL) build/gen_junction_pir.pl > src/gen_junction.pir # diff --git a/build/gen_version_pir.pl b/build/gen_version_pir.pl new file mode 100644 index 0000000..d8303fe --- /dev/null +++ b/build/gen_version_pir.pl @@ -0,0 +1,115 @@ +#! perl +use strict; +use warnings; + +# Put the compiler version information, used for perl6 -v, +# into src/gen/version.pm. + +########################################################################### + +my $copyright_year = "2010"; + +my $release = qq{ + + This is a development version of Rakudo Perl 6. It comes after + development release #27 "Copenhagen" (18-Mar-2010) and before + development release #28 (est. 22-Apr-2010.) + +}; + +########################################################################### + +# Display the value of $release set above. +# Then display some information from git branch and git show, if available. + +# The ending year in the copyright line (Copyright (C) 2008-20??) +# will be taken from the year of the git commit, if it is available. +# If not, use the value in $copyright_year. + +$release =~ s/\n\s+/\n/smg; +$release =~ s/^\n//sm; +$release =~ s/"/\\"/g; +my @release = split '\n', $release; + +print "# This file was generated by $0\n"; + +print q{ + .macro_const RAKUDO_HLL 'perl6' + + .HLL .RAKUDO_HLL + + .loadlib 'perl6_group' + .loadlib 'perl6_ops' + .loadlib 'math_ops' + + .namespace ['Perl6';'Compiler'] + + # This overrides the version method in PCT::HLLCompiler + + .sub 'version' :method +}; + +print qq{ say "$_"\n} for @release; + +my $host = $ENV{HOSTNAME} || $ENV{COMPUTERNAME} || ""; +$host = " on $host" if $host; + +my $user = $ENV{USER} || $ENV{USERNAME} || ""; +$user = " by $user" if $user; + +no warnings 'exec'; +my $localtime = qx{/bin/date} + || ""; # DON'T use the Windows "date" command! +use warnings; + +$localtime =~ s/[\r\n]//g; +my $tz = $ENV{TZ} || ""; +$tz = " $tz" if $tz; +$localtime = localtime() . $tz unless $localtime; + +print qq{ say "It was built $localtime$user$host"\n}; + +# Try to include git info if possible. + +# It is important to fail _gracefully_ if the user doesn't +# have a .git directory (tarballs usually don't) or if the +# user doesn't have the git command at all. + +if ( -d ".git" ) { + no warnings 'exec'; + my $git_branch = qx{git branch} || ""; + use warnings; + my @git_branch = split "\n", $git_branch; + for (@git_branch) { + if (/^\*\s+([^ ]+)/) { + print qq{ say "It is from the git branch \\"$1\\""\n}; + } + } + no warnings 'exec'; + my $git_show = qx{git show} || ""; + use warnings; + $git_show =~ s/"/\\"/g; + $git_show =~ s/\r//g; + $git_show =~ s/\n\n.*//s; + $git_show =~ s/date.*\b(2\d{3})\b.*?\n\K.*//si; + $copyright_year = $1 if $1; + if ( my @git_show = split "\n", $git_show ) { + print qq{ say " $_"\n} for @git_show; + } else { + print qq{ say "Git commit information is not available."\n}; + } +} else { + # This may confuse casual users more that it helps, + # comment out if that seems to be the case. + print qq{ say "It was not built from a git branch."\n}; +} + +print qq{ say "Rakudo Perl 6 is Copyright (C) 2008-$copyright_year,}, + qq{ The Perl Foundation."\n}; + +print q{ + $P0 = getattribute self, '$version' + say $P0 + exit 0 + .end +}; diff --git a/docs/release_guide.pod b/docs/release_guide.pod index bf5f749..82f7aa3 100644 --- a/docs/release_guide.pod +++ b/docs/release_guide.pod @@ -154,12 +154,21 @@ Update the release dates and names at the top of this file you find any steps that are missing. $ git commit docs/release_guide.pod =item 7. +Also, update the settings of $release and $copyright_year near +the top of build/gen_version_pir.pl. This sets the beginning +of the output of perl6 -v or perl6 --version. If this is a +monthly or final release, make sure $release says so. + + $ git commit build/gen_version_pir.pl + +=item 8. + Make sure everything compiles and runs from a known clean state: $ make realclean $ perl Configure.pl --gen-parrot $ make $ make test @@ -167,67 +176,82 @@ Make sure everything compiles and runs from a known clean state: Continue adjusting things until make spectest passes as expected. Often this means fixing a bug, fudging a test, or (temporarily?) commenting out a test file in t/spectest.data . Use your best judgment or ask others if uncertain what to do here. -=item 8. +=item 9. Make sure any locally modified files have been pushed back to github. $ git status $ git push -=item 9. +=item 10. Create an initial tarball by entering C<make release VERSION=YYYY.MM>, where YYYY.MM is the month for which the release is being made. This will create a candidate tarball file named <rakudo-YYYY.MM.tgz>. -=item 10. +=item 11. Unpack the tar file into another area, and test that it builds and runs properly. If there are any problems, fix them and go back to step 7. -=item 11. +=item 12. Tag the release by its release month ("MMMM.YY") and its code name. $ git tag -a -m"tag release #nn" MMMM.YY # e.g., 2010.02 $ git tag -a -m"tag release #nn" CODENAME # e.g., "Bratislava" $ git push --tags -=item 12. +=item 13. Upload the release tarball to github's download area at L<http://github.com/rakudo/rakudo/downloads>. -=item 13. +=item 14. + +Update the setting of $release again, near the top of +build/gen_version_pir.pl. Have it state that this a +development version, based on [the name and date of the +release you just pushed], evolving towards [the name and +target date of the next release.] + + $ git commit build/gen_version_pir.pl + +Push this back to github. + + $ git status + $ git push + +=item 15. Publish the release announcement (from #5) above to appropriate locations, including rakudo.org, use.perl, perl6-language, perl6-announce, perl6-users, and others. -=item 14. +=item 16. Update the Wikipedia entry at L<http://en.wikipedia.org/wiki/Rakudo>. -=item 15. +=item 17. Promote the release anywhere else you think appropriate. -=item 16. +=item 18. You're done! Celebrate with the appropriate amount of fun. =back =head1 COPYRIGHT -Copyright (C) 2009, The Perl Foundation. +Copyright (C) 2010, The Perl Foundation. =cut # Local Variables: # fill-column: 100 # End: -- 1.6.6.1
Download (untitled) / with headers
text/plain 169b
Updated the comments for the Moscow/April release. (Also unbitrotted the line numbers, since other patches have gone into build/Makefile.in and docs/release_guide.pod.)
From b54df4c7328a928267402a19c447dea27c6c4574 Mon Sep 17 00:00:00 2001 From: quester <quester.pm@gmail.com> Date: Tue, 27 Apr 2010 17:47:16 -1000 Subject: [PATCH] RT #73148 Fix perl -v --- build/Makefile.in | 4 ++ build/gen_version_pir.pl | 115 ++++++++++++++++++++++++++++++++++++++++++++++ docs/release_guide.pod | 42 +++++++++++++---- 3 files changed, 152 insertions(+), 9 deletions(-) create mode 100644 build/gen_version_pir.pl diff --git a/build/Makefile.in b/build/Makefile.in index 30c7acf..376a3f5 100644 --- a/build/Makefile.in +++ b/build/Makefile.in @@ -157,6 +157,7 @@ CHEATS_PIR = \ src/cheats/parrot/Protoobject.pir \ src/cheats/parrot/P6role.pir \ src/gen/uprop-cheats.pir \ + src/gen/version-cheats.pir \ src/cheats/parrot/register.pir \ CORE_SOURCES = \ @@ -391,6 +392,9 @@ src/gen/core.pm: build/gen_core_pm.pl $(CORE_SOURCES) src/gen/uprop-cheats.pir: build/gen_uprop_pir.pl $(PERL) build/gen_uprop_pir.pl > src/gen/uprop-cheats.pir +src/gen/version-cheats.pir: build/gen_version_pir.pl + $(PERL) build/gen_version_pir.pl > src/gen/version-cheats.pir + #src/gen_metaop.pir: build/gen_metaop_pir.pl # $(PERL) build/gen_metaop_pir.pl > src/gen_metaop.pir # diff --git a/build/gen_version_pir.pl b/build/gen_version_pir.pl new file mode 100644 index 0000000..45a7316 --- /dev/null +++ b/build/gen_version_pir.pl @@ -0,0 +1,115 @@ +#! perl +use strict; +use warnings; + +# Put the compiler version information, used for perl6 -v, +# into src/gen/version.pm. + +########################################################################### + +my $copyright_year = "2010"; + +my $release = qq{ + + This is a development version of Rakudo Perl 6. It comes after + development release #28 "Moscow" (22-Apr-2010) and before + development release #29 (est. 20-May-2010.) + +}; + +########################################################################### + +# Display the value of $release set above. +# Then display some information from git branch and git show, if available. + +# The ending year in the copyright line (Copyright (C) 2008-20??) +# will be taken from the year of the git commit, if it is available. +# If not, use the value in $copyright_year. + +$release =~ s/\n\s+/\n/smg; +$release =~ s/^\n//sm; +$release =~ s/"/\\"/g; +my @release = split '\n', $release; + +print "# This file was generated by $0\n"; + +print q{ + .macro_const RAKUDO_HLL 'perl6' + + .HLL .RAKUDO_HLL + + .loadlib 'perl6_group' + .loadlib 'perl6_ops' + .loadlib 'math_ops' + + .namespace ['Perl6';'Compiler'] + + # This overrides the version method in PCT::HLLCompiler + + .sub 'version' :method +}; + +print qq{ say "$_"\n} for @release; + +my $host = $ENV{HOSTNAME} || $ENV{COMPUTERNAME} || ""; +$host = " on $host" if $host; + +my $user = $ENV{USER} || $ENV{USERNAME} || ""; +$user = " by $user" if $user; + +no warnings 'exec'; +my $localtime = qx{/bin/date} + || ""; # DON'T use the Windows "date" command! +use warnings; + +$localtime =~ s/[\r\n]//g; +my $tz = $ENV{TZ} || ""; +$tz = " $tz" if $tz; +$localtime = localtime() . $tz unless $localtime; + +print qq{ say "It was built $localtime$user$host"\n}; + +# Try to include git info if possible. + +# It is important to fail _gracefully_ if the user doesn't +# have a .git directory (tarballs usually don't) or if the +# user doesn't have the git command at all. + +if ( -d ".git" ) { + no warnings 'exec'; + my $git_branch = qx{git branch} || ""; + use warnings; + my @git_branch = split "\n", $git_branch; + for (@git_branch) { + if (/^\*\s+([^ ]+)/) { + print qq{ say "It is from the git branch \\"$1\\""\n}; + } + } + no warnings 'exec'; + my $git_show = qx{git show} || ""; + use warnings; + $git_show =~ s/"/\\"/g; + $git_show =~ s/\r//g; + $git_show =~ s/\n\n.*//s; + $git_show =~ s/date.*\b(2\d{3})\b.*?\n\K.*//si; + $copyright_year = $1 if $1; + if ( my @git_show = split "\n", $git_show ) { + print qq{ say " $_"\n} for @git_show; + } else { + print qq{ say "Git commit information is not available."\n}; + } +} else { + # This may confuse casual users more that it helps, + # comment out if that seems to be the case. + print qq{ say "It was not built from a git branch."\n}; +} + +print qq{ say "Rakudo Perl 6 is Copyright (C) 2008-$copyright_year,}, + qq{ The Perl Foundation."\n}; + +print q{ + $P0 = getattribute self, '$version' + say $P0 + exit 0 + .end +}; diff --git a/docs/release_guide.pod b/docs/release_guide.pod index 9dabd39..e9706a7 100644 --- a/docs/release_guide.pod +++ b/docs/release_guide.pod @@ -164,6 +164,15 @@ you find any steps that are missing. =item 7. +Also, update the settings of $release and $copyright_year near +the top of build/gen_version_pir.pl. This sets the beginning +of the output of perl6 -v or perl6 --version. If this is a +monthly or final release, make sure $release says so. + + $ git commit build/gen_version_pir.pl + +=item 8. + Make sure everything compiles and runs from a known clean state: $ make realclean @@ -177,26 +186,26 @@ Often this means fixing a bug, fudging a test, or (temporarily?) commenting out a test file in t/spectest.data . Use your best judgment or ask others if uncertain what to do here. -=item 8. +=item 9. Make sure any locally modified files have been pushed back to github. $ git status $ git push -=item 9. +=item 10. Create an initial tarball by entering C<make release VERSION=YYYY.MM>, where YYYY.MM is the month for which the release is being made. This will create a candidate tarball file named <rakudo-YYYY.MM.tgz>. -=item 10. +=item 11. Unpack the tar file into another area, and test that it builds and runs properly. If there are any problems, fix them and go back to step 7. -=item 11. +=item 12. Tag the release by its release month ("MMMM.YY") and its code name. @@ -204,26 +213,41 @@ Tag the release by its release month ("MMMM.YY") and its code name. $ git tag -a -m"tag release #nn" CODENAME # e.g., "Bratislava" $ git push --tags -=item 12. +=item 13. Upload the release tarball to github's download area at L<http://github.com/rakudo/rakudo/downloads>. -=item 13. +=item 14. + +Update the setting of $release again, near the top of +build/gen_version_pir.pl. Have it state that this a +development version, based on [the name and date of the +release you just pushed], evolving towards [the name and +target date of the next release.] + + $ git commit build/gen_version_pir.pl + +Push this back to github. + + $ git status + $ git push + +=item 15. Publish the release announcement (from #5) above to appropriate locations, including rakudo.org, use.perl, perl6-language, perl6-announce, perl6-users, and others. -=item 14. +=item 16. Update the Wikipedia entry at L<http://en.wikipedia.org/wiki/Rakudo>. -=item 15. +=item 17. Promote the release anywhere else you think appropriate. -=item 16. +=item 18. You're done! Celebrate with the appropriate amount of fun. -- 1.7.0.4
Subject: [PATCH] Fix bug #68752, make perl6 --version more informative
Download (untitled) / with headers
text/plain 159b
Updated the perl6 --version patch again for the Erlangen/May release. (Also redid git format-patch since there have been more changes in build/Makefile.in.)
From 6992c8c439681b80c010409215eef4ca5e2c3daa Mon Sep 17 00:00:00 2001 From: quester <quester.pm@gmail.com> Date: Fri, 11 Jun 2010 01:56:05 -1000 Subject: [PATCH] Make perl6 --version patch mergable for 2010-06-11 --- build/Makefile.in | 4 ++ build/gen_version_pir.pl | 115 ++++++++++++++++++++++++++++++++++++++++++++++ docs/release_guide.pod | 42 +++++++++++++---- 3 files changed, 152 insertions(+), 9 deletions(-) create mode 100644 build/gen_version_pir.pl diff --git a/build/Makefile.in b/build/Makefile.in index 48eea9b..1a92b33 100644 --- a/build/Makefile.in +++ b/build/Makefile.in @@ -163,6 +163,7 @@ CHEATS_PIR = \ src/cheats/parrot/Protoobject.pir \ src/cheats/parrot/P6role.pir \ src/gen/uprop-cheats.pir \ + src/gen/version-cheats.pir \ src/cheats/parrot/register.pir \ CORE_SOURCES = \ @@ -381,6 +382,9 @@ src/gen/core.pm: build/gen_core_pm.pl $(CORE_SOURCES) src/gen/uprop-cheats.pir: build/gen_uprop_pir.pl $(PERL) build/gen_uprop_pir.pl > src/gen/uprop-cheats.pir +src/gen/version-cheats.pir: build/gen_version_pir.pl + $(PERL) build/gen_version_pir.pl > src/gen/version-cheats.pir + $(PMC_DIR)/objectref.pmc : $(PMC_DIR)/objectref_pmc.template build/gen_objectref_pmc.pl $(PERL) -I$(PARROT_PERL_LIB) build/gen_objectref_pmc.pl $(PMC_DIR)/objectref_pmc.template \ $(PMC_DIR)/objectref.pmc diff --git a/build/gen_version_pir.pl b/build/gen_version_pir.pl new file mode 100644 index 0000000..90b0ad2 --- /dev/null +++ b/build/gen_version_pir.pl @@ -0,0 +1,115 @@ +#! perl +use strict; +use warnings; + +# Put the compiler version information, used for perl6 -v, +# into src/gen/version.pm. + +########################################################################### + +my $copyright_year = "2010"; + +my $release = qq{ + + This is a development build of Rakudo Perl 6. It comes after + development release #29 "Erlangen" (2010-05-20) and before + development release #30 "Atlanta" (scheduled for 2010-06-17.) + +}; + +########################################################################### + +# Display the value of $release set above. +# Then display some information from git branch and git show, if available. + +# The ending year in the copyright line (Copyright (C) 2008-20??) +# will be taken from the year of the git commit, if it is available. +# If not, use the value in $copyright_year. + +$release =~ s/\n\s+/\n/smg; +$release =~ s/^\n//sm; +$release =~ s/"/\\"/g; +my @release = split '\n', $release; + +print "# This file was generated by $0\n"; + +print q{ + .macro_const RAKUDO_HLL 'perl6' + + .HLL .RAKUDO_HLL + + .loadlib 'perl6_group' + .loadlib 'perl6_ops' + .loadlib 'math_ops' + + .namespace ['Perl6';'Compiler'] + + # This overrides the version method in PCT::HLLCompiler + + .sub 'version' :method +}; + +print qq{ say "$_"\n} for @release; + +my $host = $ENV{HOSTNAME} || $ENV{COMPUTERNAME} || ""; +$host = " on $host" if $host; + +my $user = $ENV{USER} || $ENV{USERNAME} || ""; +$user = " by $user" if $user; + +no warnings 'exec'; +my $localtime = qx{/bin/date} + || ""; # DON'T use the Windows "date" command! +use warnings; + +$localtime =~ s/[\r\n]//g; +my $tz = $ENV{TZ} || ""; +$tz = " $tz" if $tz; +$localtime = localtime() . $tz unless $localtime; + +print qq{ say "It was built $localtime$user$host"\n}; + +# Try to include git info if possible. + +# It is important to fail _gracefully_ if the user doesn't +# have a .git directory (tarballs usually don't) or if the +# user doesn't have the git command at all. + +if ( -d ".git" ) { + no warnings 'exec'; + my $git_branch = qx{git branch} || ""; + use warnings; + my @git_branch = split "\n", $git_branch; + for (@git_branch) { + if (/^\*\s+([^ ]+)/) { + print qq{ say "It is from the git branch \\"$1\\""\n}; + } + } + no warnings 'exec'; + my $git_show = qx{git show} || ""; + use warnings; + $git_show =~ s/"/\\"/g; + $git_show =~ s/\r//g; + $git_show =~ s/\n\n.*//s; + $git_show =~ s/date.*\b(2\d{3})\b.*?\n\K.*//si; + $copyright_year = $1 if $1; + if ( my @git_show = split "\n", $git_show ) { + print qq{ say " $_"\n} for @git_show; + } else { + print qq{ say "Git commit information is not available."\n}; + } +} else { + # This may confuse casual users more that it helps, + # comment out if that seems to be the case. + print qq{ say "It was not built from a git branch."\n}; +} + +print qq{ say "Rakudo Perl 6 is Copyright (C) 2008-$copyright_year,}, + qq{ The Perl Foundation."\n}; + +print q{ + $P0 = getattribute self, '$version' + say $P0 + exit 0 + .end +}; diff --git a/docs/release_guide.pod b/docs/release_guide.pod index 4de7397..7382800 100644 --- a/docs/release_guide.pod +++ b/docs/release_guide.pod @@ -163,6 +163,15 @@ you find any steps that are missing. =item 7. +Also, update the settings of $release and $copyright_year near +the top of build/gen_version_pir.pl. This sets the beginning +of the output of perl6 -v or perl6 --version. If this is a +monthly or final release, make sure $release says so. + + $ git commit build/gen_version_pir.pl + +=item 8. + Make sure everything compiles and runs from a known clean state: $ make realclean @@ -176,14 +185,14 @@ Often this means fixing a bug, fudging a test, or (temporarily?) commenting out a test file in t/spectest.data . Use your best judgment or ask others if uncertain what to do here. -=item 8. +=item 9. Make sure any locally modified files have been pushed back to github. $ git status $ git push -=item 9. +=item 10. Create an initial tarball by entering C<make release VERSION=YYYY.MM>, where YYYY.MM is the month for which the release is being made. @@ -193,13 +202,13 @@ B<Caution>: this steps removes your C<t/spec> directory and all files contained therein, and replaces it by a fresh svn export. So please make a backup if you have any important data in there. -=item 10. +=item 11. Unpack the tar file into another area, and test that it builds and runs properly. If there are any problems, fix them and go back to step 7. -=item 11. +=item 12. Tag the release by its release month ("MMMM.YY") and its code name. @@ -207,26 +216,41 @@ Tag the release by its release month ("MMMM.YY") and its code name. $ git tag -a -m"tag release #nn" CODENAME # e.g., "Bratislava" $ git push --tags -=item 12. +=item 13. Upload the release tarball to github's download area at L<http://github.com/rakudo/rakudo/downloads>. -=item 13. +=item 14. + +Update the setting of $release again, near the top of +build/gen_version_pir.pl. Have it state that this a +development version, based on [the name and date of the +release you just pushed], evolving towards [the name and +target date of the next release.] + + $ git commit build/gen_version_pir.pl + +Push this back to github. + + $ git status + $ git push + +=item 15. Publish the release announcement (from #5) above to appropriate locations, including rakudo.org, use.perl, perl6-language, perl6-announce, perl6-users, and others. -=item 14. +=item 16. Update the Wikipedia entry at L<http://en.wikipedia.org/wiki/Rakudo>. -=item 15. +=item 17. Promote the release anywhere else you think appropriate. -=item 16. +=item 18. You're done! Celebrate with the appropriate amount of fun. -- 1.7.0.4
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 650b
On Fri Jun 11 05:09:26 2010, quester wrote: Show quoted text
> Updated the perl6 --version patch again for the Erlangen/May release. > (Also redid git format-patch since there have been more changes in > build/Makefile.in.) > >
Looks like this style of output was not included, but we currently get: $ perl6 --version This is Rakudo Perl 6, version 2011.01-13-gfcc46ea built on parrot 3.0.0 RELEASE_3_0_0- 350-g814a916 Copyright 2008-2011, The Perl Foundation .. which looks pretty good to me. (has the date of the last release, the git-describe string, the parrot build info... Can we (gently) reject the patch and close the ticket? -- Will "Coke" Coleda
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 778b
On Sun Jan 30 22:57:36 2011, coke wrote: Show quoted text
> On Fri Jun 11 05:09:26 2010, quester wrote:
> > Updated the perl6 --version patch again for the Erlangen/May
> release.
> > (Also redid git format-patch since there have been more changes in > > build/Makefile.in.) > > > >
> > Looks like this style of output was not included, but we currently > get: > > $ perl6 --version > > This is Rakudo Perl 6, version 2011.01-13-gfcc46ea built on parrot > 3.0.0 RELEASE_3_0_0- > 350-g814a916 > > Copyright 2008-2011, The Perl Foundation > > .. which looks pretty good to me. (has the date of the last release, > the git-describe string, the > parrot build info... > > Can we (gently) reject the patch and close the ticket? >
No complaints from pmichaud or sorear. -- Will "Coke" Coleda


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org