[darcs-users] darcs patch: Recognize a special DARCS_TESTING_PREFS_... (and 2 more)

Eric Kow kowey at darcs.net
Wed Jul 15 15:22:38 UTC 2009


On Wed, Jul 15, 2009 at 09:56:55 +0200, Petr Rockai wrote:
> the attached patches, together with hashed-storage 0.3.6 (mostly just waiting
> for mmap 0.4 to hit hackage) should make darcs pass the testsuite on win32. My
> instance of win32 was also seeing the same DeleteFiles failures we had on the
> buildbot, so there should be no more excuses to have the windows buildslave
> green.
> 
> I have applied the patches on the release branch.

I tried pushing these to the main branch along with your branch-2.3 patches for
beta 4, but I get failures for old-fashioned tests.  The harness isn't telling me
which ones though:

   Running tests for format: darcs-2
   ...
   All tests OK
   Running tests for format: hashed
   ...
   All tests OK
   Running tests for format: old-fashioned-inventory
   ...
   Running unrecord-add.sh ...                      passed.
   Running unrecord-dont-prompt.sh ...              passed.
   Running unrecord-remove.sh ...                   passed.
   Setup: user error (Tests failed)
   The repository is consistent!
   Running test...
   
   Test failed!

The candidates appear to be
  unrecord-setpref.sh
  unrecord.sh
  unrevert-add.sh
  unrevert-replace-moved.sh
  unrevert.sh
  unrevert_cancel.sh
  what_sl.sh
  whatsnew-file.sh
  whatsnew.sh
  workingdir.sh

Also, one doubt at the end, but I'll just ask if Ganesh could check it,
since the two of you know what you're doing.
 
Recognize a special DARCS_TESTING_PREFS_DIR envvar to override the
global preference directory.
-----------------------------------------------------------------------------------------------
> -global_prefs_dir = (getAppUserDataDirectory "darcs" >>= return.Just)
> -                   `catchall` (return Nothing) +global_prefs_dir = do
> +  env <- getEnvironment +  case lookup "DARCS_TESTING_PREFS_DIR" env
> of +    Just d -> return (Just d) +    Nothing ->
> (getAppUserDataDirectory "darcs" >>= return.Just) +
> `catchall` (return Nothing)

Well, this has ping-ponged a bit, but now we'll know to be a bit more
careful about changing it again.

Use DARCS_TESTING_PREFS_DIR in ShellHarness, since APPDATA override does not work.
----------------------------------------------------------------------------------

Use mmapFilePS in gzReadFilePS to avoid lazy bytestring readFile.
-----------------------------------------------------------------
>  It turns out that the lazy readFile does not close the filedescriptor soon
>  enough in some cases and causes DeleteFile failures on win32. mmapFilePS uses
>  mmap when available and falls back to strict bytestring readFile, neither of
>  which causes these issues.

> -               in fmap B.concat . (doDecompress =<<) $
> -#ifdef HAVE_OLD_BYTESTRING
> -                        -- bytestring < 0.9.1 had a bug where it did not know to close handles upon EOF
> -                        -- performance would be better with a newer bytestring and lazy
> -                        -- readFile below -- ratify readFile: comment
> -                        fmap (BL.fromChunks . (:[])) $
> -                        B.readFile f  -- ratify readFile: immediately consumed
> -#else
> -                        BL.readFile f -- ratify readFile: immediately consumed by the conversion to a strict bytestring
> -#endif
> +               compressed <- (BL.fromChunks . return) `fmap` mmapFilePS f
> +               B.concat `fmap` doDecompress compressed

I don't yet understand the significance of the
(BL.fromChunks .  return) here.

Ganesh, any chance you'd be able to comment?

-- 
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20090715/92808435/attachment.pgp>


More information about the darcs-users mailing list