# New Ticket Created by Ron Schmidt
# Please include the string: [perl #78214]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=78214 >
Rakudo now depends on git for both its own source and its tests. For
the time being it also depends on a program called curl for pushing
spectest_smolder results to the smolder server. These programs are
available for Windows, but several installation configurations that make
them available easily also put a "sh.exe" program on the path which
crashes the build process on Windows. The attached patches allow the
build process to work correctly on Windows with a "sh" program on the
path and also work around one known problem with Cygwin and subversion
on Windows Vista. At a higher level they allow a windows user to get
access to git, subversion, and curl by installing Cygwin with those
programs and putting "\Cygwin\bin" on their dos path or, alternatively,
they can install msys git and Slik subversion and put "\Program
Files\Git\bin" and the Slik subversion bin directory on their dos path.
In my previous ticket, RT 78152
<http://rt.perl.org/rt3//Public/Bug/Display.html?id=78152>, I described
a working Windows build environment with msys git, Slik subversion and a
curl from http://curl.haxx.se. These patches extend that work and add
several more, easier to install, build environments for Windows. We
still lack, I believe, a document describing good build environments for
Windows, but that may be easier to write after these patches are applied
and we can describe a better set of environments.
One of the patches here, the one for root.in, is actually a one line
patch to a Parrot file. After this ticket is open, unless there are
objections, I will open a Parrot trac ticket and cross reference the
two patch tickets.
Hoping this helps,
Ron Schmidt
diff --git a/Configure.pl b/Configure.pl
index 9562c7e..6036c10 100644
--- a/Configure.pl
+++ b/Configure.pl
@@ -162,13 +162,17 @@ END
# Generate a Makefile from a configuration
sub create_makefile {
my ($makefile_timing, %config) = @_;
+ my $is_win32 = $^O eq 'MSWin32';
my $maketext = slurp( 'build/Makefile.in' );
$config{'stagestats'} = $makefile_timing ? '--stagestats' : '';
- $config{'win32_libparrot_copy'} = $^O eq 'MSWin32' ? 'copy $(PARROT_BIN_DIR)\libparrot.dll .' : '';
+ $config{'win32_libparrot_copy'} = $is_win32 ? 'copy $(PARROT_BIN_DIR)\libparrot.dll .' : '';
+ $config{'win32_force_shell'} = $is_win32 ? 'SHELL = cmd' : '';
+
$maketext =~ s/@(\w+)@/$config{$1}/g;
- if ($^O eq 'MSWin32') {
+
+ if ($is_win32) {
$maketext =~ s{/}{\\}g;
$maketext =~ s{\\\*}{\\\\*}g;
$maketext =~ s{(?:git|http):\S+}{ do {my $t = $&; $t =~ s'\\'/'g; $t} }eg;
diff --git a/build/gen_parrot.pl b/build/gen_parrot.pl
index 63173a3..21ad17a 100644
--- a/build/gen_parrot.pl
+++ b/build/gen_parrot.pl
@@ -44,7 +44,8 @@ close $REQ;
}
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));
+svn_checkout( qw(svn checkout -r), $reqsvn ,
+ qw(https://svn.parrot.org/parrot/trunk parrot) );
chdir('parrot') || die "Can't chdir to 'parrot': $!";
@@ -86,3 +87,20 @@ sub system_or_die {
system( @cmd ) == 0
or die "Command failed (status $?): @cmd\n";
}
+
+sub svn_checkout {
+ my @svn_cmd = @_;
+
+ # detect and cope with cygwin/vista/svn problem
+ # see http://www.cygwin.com/ml/cygwin/2010-01/msg01102.html
+ if ( ($^O eq 'MSWin32') &&
+ (my ($rep_url) = map { m!(https://\S+)! } @svn_cmd)
+ ) {
+ if (not length(`svn info $rep_url`) and length(`svn --version`)) {
+ print "Working around cygwin vista svn issue\n";
+ return system_or_die('sh', '-c', qq/"@svn_cmd"/); # -------->
+ }
+ }
+
+ system_or_die(@svn_cmd); # "old" path through code
+}
diff --git a/build/Makefile.in b/build/Makefile.in
index 437ab2f..4e18c67 100644
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -1,6 +1,7 @@
# Copyright (C) 2006-2010, The Perl Foundation.
# $Id$
+...@win32_force_shell@
PARROT_ARGS =
# values from parrot_config
Index: parrot/config/gen/makefiles/root.in
===================================================================
--- parrot/config/gen/makefiles/root.in (revision 49387)
+++ parrot/config/gen/makefiles/root.in (working copy)
@@ -16,6 +16,7 @@
#
###############################################################################
+#IF(win32):SHELL = cmd
DEVEL = @DEVEL@
VERSION = @vers...@$(DEVEL)
SOVERSION = @VERSION@