Created
January 12, 2011 04:15
-
-
Save snarkyboojum/775688 to your computer and use it in GitHub Desktop.
perl6 --version breaks for Rakudo Star builds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 90565a159daa75f0fb8db51a1de7c68394b2836d Mon Sep 17 00:00:00 2001 | |
From: snarkyboojum <snarkyboojum@gmail.com> | |
Date: Wed, 12 Jan 2011 15:04:15 +1100 | |
Subject: [PATCH] [Perl6/Compiler] Parrot revision for --version fix | |
Check to see that the Parrot rev is available before trying to use it. | |
--- | |
src/Perl6/Compiler.pir | 2 +- | |
1 files changed, 1 insertions(+), 1 deletions(-) | |
diff --git a/src/Perl6/Compiler.pir b/src/Perl6/Compiler.pir | |
index 7e49a4e..9340e88 100644 | |
--- a/src/Perl6/Compiler.pir | |
+++ b/src/Perl6/Compiler.pir | |
@@ -267,7 +267,7 @@ Perl6::Compiler - Perl6 compiler | |
print .RAKUDO_VERSION | |
print ' built on parrot ' | |
print version | |
- unless rev goto done_rev | |
+ if null rev goto done_rev | |
print ' ' | |
print rev | |
done_rev: | |
-- | |
1.7.0.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
One of the Parrot Configure.pl tasks runs: | |
rakudo/parrot/config/auto/git_describe.pm | |
auto::git_describe uses Parrot::Git::Describe::current; which runs `git describe --tags` and puts the result of that command in a file .parrot_current_git_describe | |
Similar thing happens for .parrot_current_sha1 | |
However, auto::git_describe will skip this unless a .git directory exists in the parrot directory. For Rakudo Star this .git directory doesn't exist as part of a Parrot release, so the git_describe step is skipped. This means that .parrot_current_git_describe doesn't get generated as part of parrot Configure.pl, which in turn means that the current git revision isn't built into the parrot config hash. | |
e.g. for a Rakudo Star build, | |
$ ./parrot_config git_describe | |
no such key: 'git_describe' | |
Rakudo tries to use this information when it reports the version number via `perl6 --version`. | |
Either this information needs to be made available to auto::git_describe for Rakudo Star distributions using a bundled Parrot release (which is not a git repo), or the code to handle to --version in src/Perl6/Compiler.pir needs to be improved (see an example patch below, 0001-Perl6-Compiler-Parrot-revision-for-version-fix.patch) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment