From 3aa3c2143f8e84733f1e80edaf18fdcd4aaafb53 Mon Sep 17 00:00:00 2001 From: Moritz Lenz Date: Thu, 11 Nov 2010 15:33:16 +0100 Subject: [PATCH 1/9] use git instead of svn in gen_parrot.pl (incomplete) --- build/gen_parrot.pl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/build/gen_parrot.pl b/build/gen_parrot.pl index 63173a3c094..e07c841b22f 100644 --- a/build/gen_parrot.pl +++ b/build/gen_parrot.pl @@ -44,7 +44,19 @@ =head2 DESCRIPTION } print "Checking out Parrot r$reqsvn via svn...\n"; -system_or_die(qw(svn checkout -r), $reqsvn , qw(https://svn.parrot.org/parrot/trunk parrot)); +if (-d 'parrot') { + if (-d 'parrot/.svn') { + die "===SORRY===\n" + ."Your 'parrot' directory is still an SVN repository.\n" + ."Parrot switched to git recently; in order to replace your\n" + ."repository by a git repository, please manually delete\n" + ."the 'parrot' directory, and then re-run the command that caused\n" + ."this error message\n"; + } +} elsif (-d 'parrot') { + system_or_die(qw(git clone git://github.com/parrot/parrot.git parrot)); +} +system_or_die(qw(git checkout), $reqsvn); chdir('parrot') || die "Can't chdir to 'parrot': $!"; From f0f2d33cb4726b1ecd30cc2f8d2296eb8a7a2f22 Mon Sep 17 00:00:00 2001 From: Moritz Lenz Date: Fri, 12 Nov 2010 16:26:51 +0100 Subject: [PATCH 2/9] bump PARROT_REVISION to something that can report a git-describe-ish revision note that that's currently from a parrot branch (git_describe), so that parrot branch must be merged before we merge this rakudo branch --- build/PARROT_REVISION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/PARROT_REVISION b/build/PARROT_REVISION index d071a36fc0a..4d0230179b1 100644 --- a/build/PARROT_REVISION +++ b/build/PARROT_REVISION @@ -1 +1 @@ -49711 +RELEASE_2_9_1-233-gb18101c From a8285d73a6316fa76f20753971543b7d95221629 Mon Sep 17 00:00:00 2001 From: Moritz Lenz Date: Fri, 12 Nov 2010 18:55:37 +0100 Subject: [PATCH 3/9] small p5 module for comparing revisions --- build/lib/Rakudo/CompareRevisions.pm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 build/lib/Rakudo/CompareRevisions.pm diff --git a/build/lib/Rakudo/CompareRevisions.pm b/build/lib/Rakudo/CompareRevisions.pm new file mode 100644 index 00000000000..c3573c7c9ac --- /dev/null +++ b/build/lib/Rakudo/CompareRevisions.pm @@ -0,0 +1,28 @@ +package Rakudo::CompareRevision; +use strict; +use warnings; + +sub parse_parrot_git_describe { + my $g = shift; + my $sep = qr/[_\W]/; + $g =~ /^REL(?:EASE)?$sep(\d+)$sep(\d+)$sep(\d+)(?:-(\d+)-g[a-f0-9]*)?$/ + or die "Invalid revision specifier: '$g' " + ."(expected something of format RELEASE_1_2_3-123-gdeadbee)\n"; + my @c = ($1, $2, $3, $4 || 0); + return @c; +} + +sub compare_parrot_revs { + my ($aa, $bb) = @_; + return 1 if $bb =~ /^r?\d+$/; + return -1 if $aa =~ /^r?\d+$/; + my @a = parse_git_describe($aa); + my @b = parse_git_describe($bb); + for (0..3) { + my $cmp = $a[$_] <=> $b[$_]; + return $cmp if $cmp; + } + return 0; +} + +1; From f2fa5e1b70c430ed9503436ddb0fcfc591765d1c Mon Sep 17 00:00:00 2001 From: Moritz Lenz Date: Fri, 12 Nov 2010 19:11:13 +0100 Subject: [PATCH 4/9] use new revision comparison in Configure.pl --- Configure.pl | 9 +++++---- build/lib/Rakudo/CompareRevisions.pm | 9 ++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/Configure.pl b/Configure.pl index 9562c7e1a79..24ede0c1d89 100644 --- a/Configure.pl +++ b/Configure.pl @@ -6,6 +6,8 @@ use warnings; use Getopt::Long; use Cwd; +use lib "build/lib"; +use Rakudo::CompareRevisions qw(compare_parrot_revs); MAIN: { my %options; @@ -22,7 +24,6 @@ open my $REQ, '<', "build/PARROT_REVISION" or die "cannot open build/PARROT_REVISION: $!\n"; my ($reqsvn, $reqpar) = split(' ', <$REQ>); - $reqsvn += 0; close $REQ; # Update/generate parrot build if needed @@ -60,16 +61,16 @@ if (!%config) { $parrot_errors .= "Unable to locate parrot_config\n"; } - elsif ($reqsvn > $config{'revision'} && + elsif (compare_parrot_revs($reqsvn, $config{'git_describe'}) < 0 && ($reqpar eq '' || version_int($reqpar) > version_int($config{'VERSION'}))) { - $parrot_errors .= "Parrot revision r$reqsvn required (currently r$config{'revision'})\n"; + $parrot_errors .= "Parrot revision $reqsvn required (currently $config{'git_describe'})\n"; } if ($parrot_errors) { die <<"END"; ===SORRY!=== $parrot_errors -To automatically checkout (svn) and build a copy of parrot r$reqsvn, +To automatically clone (git) and build a copy of parrot $reqsvn, try re-running Configure.pl with the '--gen-parrot' option. Or, use the '--parrot-config' option to explicitly specify the location of parrot_config to be used to build Rakudo Perl. diff --git a/build/lib/Rakudo/CompareRevisions.pm b/build/lib/Rakudo/CompareRevisions.pm index c3573c7c9ac..d461801f378 100644 --- a/build/lib/Rakudo/CompareRevisions.pm +++ b/build/lib/Rakudo/CompareRevisions.pm @@ -1,7 +1,10 @@ -package Rakudo::CompareRevision; +package Rakudo::CompareRevisions; use strict; use warnings; +use base qw(Exporter); +our @EXPORT_OK = qw(compare_parrot_revs parse_parrot_git_describe); + sub parse_parrot_git_describe { my $g = shift; my $sep = qr/[_\W]/; @@ -16,8 +19,8 @@ sub compare_parrot_revs { my ($aa, $bb) = @_; return 1 if $bb =~ /^r?\d+$/; return -1 if $aa =~ /^r?\d+$/; - my @a = parse_git_describe($aa); - my @b = parse_git_describe($bb); + my @a = parse_parrot_git_describe($aa); + my @b = parse_parrot_git_describe($bb); for (0..3) { my $cmp = $a[$_] <=> $b[$_]; return $cmp if $cmp; From 914a4c021409aae6de46b36013f092c1c0b6b9bb Mon Sep 17 00:00:00 2001 From: Moritz Lenz Date: Fri, 12 Nov 2010 19:28:59 +0100 Subject: [PATCH 5/9] update release guide --- docs/release_guide.pod | 4 ++-- src/Perl6/Compiler.pir | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/release_guide.pod b/docs/release_guide.pod index 11110faf80e..c4181e15198 100644 --- a/docs/release_guide.pod +++ b/docs/release_guide.pod @@ -98,8 +98,8 @@ the release announcement). =item 2. Once Parrot issues its monthly release, edit Rakudo's -build/PARROT_REVISION file to contain the subversion revision -number and release number corresponding to Parrot's monthly +build/PARROT_REVISION file to contain the C output +and release number corresponding to Parrot's monthly release. For example, for June 2009 PARROT_REVISION file contained "39599 1.3.0". As always, test to make sure Rakudo still builds and passes its tests. Once build/PARROT_REVISION diff --git a/src/Perl6/Compiler.pir b/src/Perl6/Compiler.pir index 8b1e6c2269c..60d3c5ddc76 100644 --- a/src/Perl6/Compiler.pir +++ b/src/Perl6/Compiler.pir @@ -260,7 +260,7 @@ Perl6::Compiler - Perl6 compiler interp = getinterp config = interp[.IGLOBALS_CONFIG_HASH] version = config['VERSION'] - rev = config['revision'] + rev = config['git_describe'] say '' print 'This is Rakudo Perl 6, version ' From d8ec04910aa19fa214eecc7c740180fc1c2f3025 Mon Sep 17 00:00:00 2001 From: Moritz Lenz Date: Fri, 12 Nov 2010 19:37:05 +0100 Subject: [PATCH 6/9] some git updates to gen_parrot.pl --- build/gen_parrot.pl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/build/gen_parrot.pl b/build/gen_parrot.pl index e07c841b22f..c67226852f4 100644 --- a/build/gen_parrot.pl +++ b/build/gen_parrot.pl @@ -21,6 +21,9 @@ =head2 DESCRIPTION use warnings; use 5.008; +use lib "build/lib"; +use Rakudo::CompareRevisions qw(compare_parrot_revs); + # Work out slash character to use. my $slash = $^O eq 'MSWin32' ? '\\' : '/'; @@ -28,22 +31,22 @@ =head2 DESCRIPTION open my $REQ, "build/PARROT_REVISION" || die "cannot open build/PARROT_REVISION\n"; my ($reqsvn, $reqpar) = split(' ', <$REQ>); -$reqsvn += 0; close $REQ; { no warnings; if (open my $REV, '-|', "parrot_install${slash}bin${slash}parrot_config revision") { - my $revision = 0+<$REV>; + my $revision = <$REV>; close $REV; - if ($revision >= $reqsvn) { - print "Parrot r$revision already available (r$reqsvn required)\n"; + $revision =~ s/\s.*//s; + if (compare_parrot_revs($revision, $reqsvn) >= 0) { + print "Parrot $revision already available ($reqsvn required)\n"; exit(0); } } } -print "Checking out Parrot r$reqsvn via svn...\n"; +print "Checking out Parrot $reqsvn via git...\n"; if (-d 'parrot') { if (-d 'parrot/.svn') { die "===SORRY===\n" @@ -53,7 +56,7 @@ =head2 DESCRIPTION ."the 'parrot' directory, and then re-run the command that caused\n" ."this error message\n"; } -} elsif (-d 'parrot') { +} else { system_or_die(qw(git clone git://github.com/parrot/parrot.git parrot)); } system_or_die(qw(git checkout), $reqsvn); From 2d53082a93fbcc4ff32c39b093b0512fffbebb19 Mon Sep 17 00:00:00 2001 From: Moritz Lenz Date: Fri, 12 Nov 2010 21:03:55 +0100 Subject: [PATCH 7/9] more fixes to gen_parrot.pl --- build/PARROT_REVISION | 2 +- build/gen_parrot.pl | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/build/PARROT_REVISION b/build/PARROT_REVISION index 4d0230179b1..574cb71e919 100644 --- a/build/PARROT_REVISION +++ b/build/PARROT_REVISION @@ -1 +1 @@ -RELEASE_2_9_1-233-gb18101c +RELEASE_2_9_1-235-g0d855e0 diff --git a/build/gen_parrot.pl b/build/gen_parrot.pl index c67226852f4..b2456e3376e 100644 --- a/build/gen_parrot.pl +++ b/build/gen_parrot.pl @@ -30,7 +30,7 @@ =head2 DESCRIPTION ## determine what revision of Parrot we require open my $REQ, "build/PARROT_REVISION" || die "cannot open build/PARROT_REVISION\n"; -my ($reqsvn, $reqpar) = split(' ', <$REQ>); +my ($req, $reqpar) = split(' ', <$REQ>); close $REQ; { @@ -39,14 +39,14 @@ =head2 DESCRIPTION my $revision = <$REV>; close $REV; $revision =~ s/\s.*//s; - if (compare_parrot_revs($revision, $reqsvn) >= 0) { - print "Parrot $revision already available ($reqsvn required)\n"; + if (compare_parrot_revs($revision, $req) >= 0) { + print "Parrot $revision already available ($req required)\n"; exit(0); } } } -print "Checking out Parrot $reqsvn via git...\n"; +print "Checking out Parrot $req via git...\n"; if (-d 'parrot') { if (-d 'parrot/.svn') { die "===SORRY===\n" @@ -56,13 +56,14 @@ =head2 DESCRIPTION ."the 'parrot' directory, and then re-run the command that caused\n" ."this error message\n"; } + system_or_die(qw(git fetch)); } else { system_or_die(qw(git clone git://github.com/parrot/parrot.git parrot)); } -system_or_die(qw(git checkout), $reqsvn); chdir('parrot') || die "Can't chdir to 'parrot': $!"; +system_or_die(qw(git checkout), $req); ## If we have a Makefile from a previous build, do a 'make realclean' if (-f 'Makefile') { From 08fb200c5d7aaf3e652bd0da7235f37b91ac406f Mon Sep 17 00:00:00 2001 From: Moritz Lenz Date: Fri, 12 Nov 2010 21:39:37 +0100 Subject: [PATCH 8/9] [Configure.pl] abrt of gen_parrot.pl failed; tadzik++ --- Configure.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Configure.pl b/Configure.pl index 24ede0c1d89..4b8932b6e99 100644 --- a/Configure.pl +++ b/Configure.pl @@ -36,7 +36,8 @@ print "Generating Parrot ...\n"; print "@command\n\n"; - system @command; + system(@command) == 0 + or die "Error while executing @command; aborting\n"; } # Get a list of parrot-configs to invoke. From cfd1b926c418b8fd427893f75343b9c3cdd07f0c Mon Sep 17 00:00:00 2001 From: Moritz Lenz Date: Fri, 12 Nov 2010 21:53:20 +0100 Subject: [PATCH 9/9] remove spurious r in --version output --- src/Perl6/Compiler.pir | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Perl6/Compiler.pir b/src/Perl6/Compiler.pir index 60d3c5ddc76..23174622a0c 100644 --- a/src/Perl6/Compiler.pir +++ b/src/Perl6/Compiler.pir @@ -268,7 +268,7 @@ Perl6::Compiler - Perl6 compiler print ' built on parrot ' print version unless rev goto done_rev - print ' r' + print ' ' print rev done_rev: say ''