David Roundy | 1 May 2008 01:05
Favicon
Gravatar

Re: [darcs-devel] darcs patch: Use GHC instead of GCC to check for zlib availability ...

On Thu, May 01, 2008 at 12:02:08AM +0200, Reinier Lamers wrote:
> Thu May  1 00:01:05 CEST 2008  tux_rocker <at> reinier.de
>   * Use GHC instead of GCC to check for zlib availability (issue 813)

This looks like a nice attempt, but I'd like to see an even nicer
version that defines an autoconf macro to do this sort of test...

Content-Description: A darcs patch for your repository!
> 
> New patches:
> 
> [Use GHC instead of GCC to check for zlib availability (issue 813)
> tux_rocker <at> reinier.de**20080430220105] hunk ./configure.ac 410
> +dnl look for zlib library and header.
> +dnl Use TRY_COMPILE_GHC and not AC_CHECK_HEADER / AC_CHECK_LIB because GHC may
> +dnl use a different library and header than the system GCC (on Windows, issue 813)
> +
> +OLDGHCFLAGS="$GHCFLAGS"
> +dnl Force compilation via C to detect missing headers
> +GHCFLAGS="$GHCFLAGS -lz -fvia-C"
> +AC_MSG_CHECKING([for zlib])
> +TRY_COMPILE_GHC([{-# INCLUDE <zlib.h> #-}
> +{-# OPTIONS_GHC -fglasgow-exts #-}
> +module Main where 
> +import Foreign
> +import Foreign.C
> +import Foreign.Ptr
> +
> +foreign import ccall unsafe "zlib.h deflate" zlib_deflate :: Ptr () -> CInt -> CInt

(Continue reading)

David Roundy | 1 May 2008 01:31
Favicon
Gravatar

Re: [darcs-devel] darcs patch: Use GHC instead of GCC to check for zlib availability ...

On Wed, Apr 30, 2008 at 4:05 PM, David Roundy <droundy <at> darcs.net> wrote:
> On Thu, May 01, 2008 at 12:02:08AM +0200, Reinier Lamers wrote:
>
> > Thu May  1 00:01:05 CEST 2008  tux_rocker <at> reinier.de
>  >   * Use GHC instead of GCC to check for zlib availability (issue 813)
>
> This looks like a nice attempt, but I'd like to see an even nicer
>  version that defines an autoconf macro to do this sort of test...

Okay, this looked interesting, so I coded up a more general macro, and
am pushing your code as well as mine.  Thanks for looking into this!

David
Jason Dagit | 1 May 2008 02:52

darcs patch: remove gitlib.{c, h.in} as it appears to be unused

Prehaps we've been keeping gitlib around in case someone resurrects
git support but I noticed that it doesn't appear to be referenced
anywhere:

$ grep -r gitlib .
./src/gitlib.c:#include "gitlib.h"

This patch simply removes both files.

Wed Apr 30 17:23:06 PDT 2008  Jason Dagit <dagit <at> codersbase.com>
  * remove gitlib.{c,h.in} as it appears to be unused

_______________________________________________
darcs-users mailing list
darcs-users <at> darcs.net
http://lists.osuosl.org/mailman/listinfo/darcs-users
Gwern Branwen | 1 May 2008 06:07
Picon
Gravatar

Re: darcs patch: darcs prefs: remove type witness stuff, breaks compiles

On 2008.04.30 07:03:45 -0700, David Roundy <droundy <at> darcs.net> scribbled 1.2K characters:
> On Tue, Apr 29, 2008 at 11:34:35PM -0400, gwern0 <at> gmail.com wrote:
> > Tue Apr 29 23:19:21 EDT 2008  gwern0 <at> gmail.com
> >   * darcs prefs: remove type witness stuff, breaks compiles
> >   It's worth noting that the test as it stood ran on every patch record, and allows patches to be recorded
only if one can compile with type witnesses.
> >   It's also worth noting that 6.8.x can't compile everything with type witnesses, and lispy says 6.6.1
can't either. So, in general, turning on type witnesses in this particular place strikes me as a very very
bad thing to do.
> >   If Dr. Roundy wants to automatically test compilation with type witnesses, the thing to do is to have the
configure script turn it on if an example compiles, say. Forcing it on just leads to breakage and
considerable annoyance for people who have to rm _darcs/prefs/prefs just to record some patches.
>
> No, the default should be to run all tests.  If you don't have ghc 6.6 on
> your machine, you can trivially configure your repository to run a subset
> of the full test suite.  This is a per-repository configurable option,
> after all.
> --
> David Roundy

I still don't follow.

I don't see how forcing compilation with known broken stuff is a 'test'.

I don't see how the current record hook can be said to 'run all tests' when it doesn't even do something like
'make test_network' (or whatever other tests are omitted as well).

And I don't see why being a 'per-repository configurable option' is any sort of justification or defense;
by that logic, everything in the configure script is per-repository configurable, and we might as well
default to type witnesses, remove the capability tests, hardwire in package names, etc...
(Continue reading)

Jason Dagit | 1 May 2008 07:02

darcs patch: refactor "_darcs" to darcsdir variable

I'm not a fan of hardcoded values and I realized we have "_darcs"
appearing all over in the source base.  So in the spirit of relaxing
mindless programming tasks I've refactored it all to Darcs.Global (not
sure that's the right place, but the other ones I tried created module
import cycles).

Enjoy,
Jason

Wed Apr 30 21:26:50 PDT 2008  Jason Dagit <dagit <at> codersbase.com>
  * refactor "_darcs" to darcsdir variable

_______________________________________________
darcs-users mailing list
darcs-users <at> darcs.net
http://lists.osuosl.org/mailman/listinfo/darcs-users
Jason Dagit | 1 May 2008 07:09

Test -- Please Ignore

Testing, please ignore.

_______________________________________________
darcs-users mailing list
darcs-users <at> darcs.net
http://lists.osuosl.org/mailman/listinfo/darcs-users
Jason Dagit | 1 May 2008 07:11

Last Test -- Sorry

Please ignore this also.

_______________________________________________
darcs-users mailing list
darcs-users <at> darcs.net
http://lists.osuosl.org/mailman/listinfo/darcs-users
Gwern Branwen | 1 May 2008 07:23
Picon
Gravatar

make test_unit compile failures

Hiya everyone: so I was interested in seeing the full range of tests for Darcs, and I wanted to try out make
test_network (something buggy there AFAIK) and make test_unit.

make test_unit initially failed with a CPP error. No problem:

hunk ./src/unit.lhs 44
-{-# OPTIONS_GHC -fno-warn-deprecations -fglasgow-exts #-}
+{-# OPTIONS_GHC -fno-warn-deprecations -fglasgow-exts -cpp #-}

Then it failed with link errors. Oops. make clean && make test_unit. Oops. Right, it needs QuickCheck 2.0
no? So I download from <http://code.haskell.org/QuickCheck> and install. Now I don't get link errors,
but I do get type errors
<http://hpaste.org/7292>:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> gwern <at> localhost:3024~/darcs/darcs.net>make test_unit > > [ 1:12AM] >
> rm -f Main.hi Main.o >
> [ghc] unit >
> >
> src/unit.lhs:116:6: >
>     No instance for (Arbitrary Prim) >
>       arising from a use of `check_subcommutes' at src/unit.lhs:116:6-76 >
>     Possible fix: add an instance declaration for (Arbitrary Prim) >
>     In the expression: >
>         check_subcommutes >
>           subcommutes_inverse "patch and inverse both commutex" >
>     In a 'do' expression: >
>         check_subcommutes >
>           subcommutes_inverse "patch and inverse both commutex" >
>     In the expression: >
>         do putStr >
>              ("There are a total of " >
>             ++  (show (length primitive_test_patches)) >
>               ++ >
>                 " primitive patches.\n") >
>            putStr >
>              ("There are a total of " >
>             ++  (show (length test_patches)) ++ " patches.\n") >
>            putStr "Checking that concatPS works... " >
>            quickCheck prop_concatPS >
>            .... >
> >
> src/unit.lhs:151:6: >
>     No instances for (Testable >
>                         (QuickCheck-2.0:Test.QuickCheck.Gen.Gen >
>                            QuickCheck-2.0:Test.QuickCheck.Property.Prop), >
>                       Arbitrary Patch) >
>       arising from a use of `quickCheck' at src/unit.lhs:151:6-41 >
>     Possible fix: >
>       add an instance declaration for >
>       (Testable >
>          (QuickCheck-2.0:Test.QuickCheck.Gen.Gen >
>             QuickCheck-2.0:Test.QuickCheck.Property.Prop), >
>        Arbitrary Patch) >
>     In the expression: quickCheck prop_commute_either_order >
>     In a 'do' expression: quickCheck prop_commute_either_order >
>     In the expression: >
>         do putStr >
>              ("There are a total of " >
>             ++  (show (length primitive_test_patches)) >
>               ++ >
>                 " primitive patches.\n") >
>            putStr >
>              ("There are a total of " >
>             ++  (show (length test_patches)) ++ " patches.\n") >
>            putStr "Checking that concatPS works... " >
>            quickCheck prop_concatPS >
>            .... >
> make: *** [unit] Error 1 > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

I'm not familiar with QuickCheck very much beyond the basics, but I tried greping for a Testable instance
and didn't see anything. Any ideas?

--
gwern
package Yakima Tzvrif Knife Tony Weekly Bob HRT TOS DJC
_______________________________________________
darcs-users mailing list
darcs-users <at> darcs.net
http://lists.osuosl.org/mailman/listinfo/darcs-users
Jon Hart | 1 May 2008 08:14

Re: Windows version of darcs wont 'get'

>
> This really should work for you and not require any special effort  
> (as others have mentioned), but I have noticed that sometimes the  
> pull error messages are not so good.  I bet the same thing happens  
> with get.  I'll try it real quick:
>
> $ darcs get http://blah
>
> darcs failed:  Not a repository: http://blah (failed to fetch: http://blah/_darcs/inventory 
>  ExitFailure 1)
>
> Yes,  it would seem that a bug I reported just yesterday about the  
> error message of pull is happening with get.  You can find the  
> wishlist item here:
> http://bugs.darcs.net/issue822
>
> Does it sound like your problem?

It doesnt seem to be, I can browse the site perfectly well from a  
browser on the remote machine, and Ive double checked the url.

The command Im typing in is

darcs pull http://darcs.mmmpie.com/cfc

Ive tried various permutations of it, but nothing helps.
The problem with the issue you noted is that the error message darcs  
is giving me is exactly correct. There is no inventory file in my  
repo, Im using a darcs-2 format repo on both ends, and have the same  
identical versions of darcs, 2.0.0 + 19 patches. Note that when I pull  
from a local file system repo it works perfectly, it is like the  
remote pull is default to a darcs-1 format ( I assume that darcs-1 has  
an inventory file ).

It is possible that darcs cant see the server for some reason, but in  
that case I cant really think of anything to do. Ping and firefox both  
have no issues resolving it and browsing to it.

I would appreciate it if someone else could try pulling from my repo.  
I will leave my laptop on overnight so that it can be accessed.

Jon Hart.
Jon Hart | 1 May 2008 08:31

Re: Windows version of darcs wont 'get'

>
>
> I would appreciate it if someone else could try pulling from my repo.
> I will leave my laptop on overnight so that it can be accessed.
>

I found the problem, Im using IIS 7 for the first time, and it has no  
default handler for files without extensions.
I had to add a mime type for .* and now I can access the files. I had  
no trouble browsing the directories, so I thought the site was fine.

I would attribute this to the bug that Jason reported. At least two  
changes need to be made to that error reporting:
a) darcs needs to report the error code returned from the server
b) darcs needs to report the actual file being requested

Thanks for you help,
Jon Hart.

Gmane