Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow more windows environments with git to work correctly with build process #2208

Closed
p6rt opened this issue Oct 5, 2010 · 12 comments
Closed
Labels

Comments

@p6rt
Copy link

p6rt commented Oct 5, 2010

Migrated from rt.perl.org#78214 (status was 'resolved')

Searchable as RT78214$

@p6rt
Copy link
Author

p6rt commented Oct 5, 2010

From @ronaldxs

  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

@p6rt
Copy link
Author

p6rt commented Oct 5, 2010

From @ronaldxs

Configure.pl.patch
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;

@p6rt
Copy link
Author

p6rt commented Oct 5, 2010

From @ronaldxs

gen_parrot.pl.patch
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
+}

@p6rt
Copy link
Author

p6rt commented Oct 5, 2010

From @ronaldxs

Makefile.in.patch
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

@p6rt
Copy link
Author

p6rt commented Oct 5, 2010

From @ronaldxs

root.in.patch
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         = @VERSION@$(DEVEL)
 SOVERSION       = @VERSION@

@p6rt
Copy link
Author

p6rt commented Nov 29, 2010

From @ronaldxs

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.

The Parrot ticket was created and the related patch has been applied to
Parrot closing the ticket. The (closed) Parrot ticket is #​1865
(http://trac.parrot.org/parrot/ticket/1865). Parrot has also now moved
to git simplifying the patch for Rakudo needed to get the intended
result. I have attached the new set of patches as a single file for
convenience - win32_cmd_line_git.patch.

@p6rt
Copy link
Author

p6rt commented Nov 29, 2010

From @ronaldxs

win32_cmd_line_git.patch
diff --git a/Configure.pl b/Configure.pl
index 15cfcef..bcb75c1 100644
--- a/Configure.pl
+++ b/Configure.pl
@@ -174,13 +174,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/Makefile.in b/build/Makefile.in
index d1e2ac7..21d0cde 100644
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -11,6 +11,7 @@ PARROT_LIB_DIR     = @libdir@$(PARROT_VERSION)
 PARROT_SRC_DIR     = @srcdir@$(PARROT_VERSION)
 HAS_ICU            = @has_icu@
 
+@win32_force_shell@
 CC            = @cc@
 CFLAGS        = @ccflags@ @cc_shared@ @cc_debug@ @ccwarn@ @cc_hasjit@ @gc_flag@
 EXE           = @exe@

@p6rt
Copy link
Author

p6rt commented Nov 29, 2010

@ronaldxs - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 9, 2011

From @zhuomingliang

I sent a pull request rakudo/rakudo#19 .

@p6rt
Copy link
Author

p6rt commented Mar 15, 2011

From @zhuomingliang

在 2011-03-09 02​:14​:25 星期三 时,jimmy 写到:

I sent a pull request rakudo/rakudo#19 .

it's applied as
rakudo/rakudo@e3bd9aa
49804d12

this ticket can be closed.

@p6rt
Copy link
Author

p6rt commented May 1, 2011

From @ronaldxs

On Tue Mar 15 03​:55​:57 2011, jimmy wrote​:

this ticket can be closed.

wfm and we seem to be closing tickets today.

@p6rt p6rt closed this as completed May 1, 2011
@p6rt
Copy link
Author

p6rt commented May 1, 2011

@ronaldxs - Status changed from 'open' to 'resolved'

@p6rt p6rt added the patch label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant