cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cons on Cygwin


From: Oren Ben-Kiki
Subject: Cons on Cygwin
Date: Tue, 15 Oct 2002 15:27:26 +0200

We've just tried running cons 2.2 on a Cygwin system. We had to make the
following four changes to make it pass all the tests:

1. Converting '//' to '/' in path names. This is explicitly disabled in
Cygwin, probably due to the old Cygwin behavior of using '//c' as a way to
access disk 'c:'. This is no longer the case, so we changed 'cons' acc

2. Stripping CRs from lines for text comparisons in Test::Cmd. That isn't
really Cons's problem... BTW, this is only a problem if you set up Cygwin to
use CR LF as the line terminator, instead of LF. We do that because we
invoke many MS tools that use that convention.

3. Remove the space after '-I' when invoking Perl from cons-test. For some
reason the Cygwin Perl (5.6.1) takes this to mean there's no argument to the
'-I' flag.

4. Change test 64; the expected output for Cygwin is the same as for Win32
systems instead of the expected output for UNIX systems. This again seems to
depend on the Perl version.

The 'diff -u' patch for all 4 changes are provided below (note Outlook will
wrap long lines). After applying them, cons-test successfully run all the
130 tests.

Our next step would be to write Conscript and Construct files that invoke
the Visual Studio compiler (cl) instead of the Gnu compiler (gcc). If it
turns out to be different from the Win32 rule set, it may be worth while to
provide it directly in cons as a third option.

Have fun,

        Oren Ben-Kiki

diff --strip-trailing-cr -urN orig/cons patched/cons
--- orig/cons   2000-11-22 02:17:37.000000000 +0200
+++ patched/cons        2002-10-15 14:28:56.000000000 +0200
@@ -2135,7 +2135,7 @@
        $path =~ s|\\$||
                 unless $path =~ m#^([A-Z]:)?\\$#s;   # xx/       -> xx
     } else {
-       $path =~ s|/+|/|g unless($^O eq 'cygwin');     # xx////xx  -> xx/xx
+       $path =~ s|/+|/|g;                             # xx////xx  -> xx/xx
        $path =~ s|(/\.)+/|/|g;                        # xx/././xx -> xx/xx
        $path =~ s|^(\./)+||s unless $path eq "./";    # ./xx      -> xx
        $path =~ s|^/(\.\./)+|/|s;                     # /../../xx -> xx
diff --strip-trailing-cr -urN orig/test/Test/Cmd.pm patched/test/Test/Cmd.pm
--- orig/test/Test/Cmd.pm       2000-05-26 18:03:41.000000000 +0300
+++ patched/test/Test/Cmd.pm    2002-10-15 12:41:54.000000000 +0200
@@ -549,6 +549,10 @@
     if (! close(IN)) {
        return undef;
     }
+    my $i = 0;
+    for (my $i = 0; $i < @lines; $i++) {
+       $lines[$i] =~ s/\r//g;
+    }
     if (ref $destref eq 'SCALAR') {
        $$destref = join('', @lines);
     } else {
diff --strip-trailing-cr -urN orig/test/cons-test patched/test/cons-test
--- orig/test/cons-test 2000-11-22 02:18:17.000000000 +0200
+++ patched/test/cons-test      2002-10-15 13:01:12.000000000 +0200
@@ -157,7 +157,7 @@
 
 $ENV{CONS} = $Cons;
 $ENV{PERLFLAGS} = $w_flag;
-$ENV{PERL5OPT} .= " -I " . join(" -I ", @IDirs) if @IDirs;
+$ENV{PERL5OPT} .= " -I" . join(" -I", @IDirs) if @IDirs;
 
 my $pass = 0;
 my @fail = ();
diff --strip-trailing-cr -urN orig/test/t/t0064.t patched/test/t/t0064.t
--- orig/test/t/t0064.t 2000-06-20 01:07:36.000000000 +0300
+++ patched/test/t/t0064.t      2002-10-15 14:56:06.000000000 +0200
@@ -78,7 +78,7 @@
 my $ret = open(INSTALLED, $install_subdir1_foo1_pl);
 $test->no_result(! $ret);
 
-if ($_is_win32) {
+if ($^O =~ /cygwin/ || $_is_win32) {
     $fail = '$? != 0';
     $stderr = <<_EOF_;
 \Q${\$test->basename}: can't install "$src_foo1_pl" to
"$install_subdir1_foo1_pl" (Permission denied)\E




reply via email to

[Prev in Thread] Current Thread [Next in Thread]