Coder Social home page Coder Social logo

missingh's Introduction

-------------------------
What is MissingH?
-------------------------

It's a collection of Haskell-related utilities.  It is an extension of my
earlier work developing MissingLib for OCaml.

-------------------------
Major Features
-------------------------

 * Powerful Logging Framework for Haskell
   This framework provides a system of hierarchical loggers and
   modular handlers permitting fine-grained logging with a great deal
   of control and yet a simple and fast interface.  It's based on
   log4j for Java and logging for Python.

   Also included is a native-Haskell Syslog client.

 * Versatile modules to simplify everyday tasks:
   + FTP client library
   + E-mail client library
   + MIME types library to determine MIME types from files or URLs
   + Configuration file parser/generator

 * IO utilities make it easier to work with line-based text files
   and binary files

 * IO object virtualization so you can use one set of code to work
   on files of many different types

 * Filesystem virtualization so you can access various items with the
   same ease as your system's filesystem

 * Network utilities to streamline connections

 * List utilities including association list tools,
   list splitting, truncation, and delimiter joining

 * String utilities including removal of leading or trailing
   whitespace, joining, splitting, and truncation

 * Other utilities for threads, parsers, filenames, etc.

 * Printf utilities for formatting strings

 * GZip decompression

 * Hundreds of unit tests to verify proper functionality

 * DBM module abstraction

The following modules are are provided at this time, and more are
likely to follow:

MissingH.AnyDBM           * Generic DBM-like database infrastructure

MissingH.AnyDBM.          * Use a Map in the AnyDBM interface
 MapDBM

MissingH.AnyDBM.          * Simple persistent mapping storage
 StringDBM

MissingH.Bits             * Obtain individual bytes from a bitfield

MissingH.Cmd              * Trap errors during calls to external programs

MissingH.Checksum.*       * Utilities for calculating checksums over strings

MissingH.Compression.*    * Compression/decompression algorithms

MissingH.Compression.     * The Inflate algorithm from unzip and
  Inflate                   gunzip

MissingH.ConfigParser     * Configuration file parser
                          * Interpolation supported
                          * Compatible with Python and OCaml ConfigParsers

MissingH.Daemon           * Support for detaching from a terminal

MissingH.Debian           * Compare two Debian version numbers
                            [ does not require Debian to compile ]

MissingH.Debian.          * Parse debian/control files or output from
 ControlParser              various Debian commands that use the same format
                            [ does not require Debian to compile run ]

MissingH.Either           * Utilities for the Either type/Error monad

MissingH.Email.Parser     * Parse a flat string into component parts
                          * Walk through the components of a message

MissingH.Email.Sendmail   * Send a message via a locally-installed Sendmail
                            program

MisssingH.FileArchive.    * Support for analyzing and extracting
  GZip                      GZip archives

MissingH.Hsemail          * E-mail parsers

MissingH.HUnit            * Utilities for writing HUnit unit tests

MissingH.IO               * Copying data between files or handles
                          * Lazy operations on line input

MissingH.IO.Binary        * Binary I/O with Haskell Strings or [Word8]
                          * Lazy operations on binary blocks
                          * Binary file copy

MissingH.IO.HVFS          * Haskell Virtual File System
                          * Lets you emulate real filesystems and work
                            with multiple filesystems

MissingH.IO.StatCompat    * Utilities for simulating stat(2) structures
                            on home-grown filesystems or Windows

MissingH.IO.WindowsCompat * Provides POSIX-like functions on Windows

MissingH.List             * Association list manipulation
                          * List splitting and delimiter joining
                          * Truncation

MissingH.Logging          * Base logging types

MissingH.Logging.Handler  * Base handler types

MissingH.Logging.         * Logging to a stream
 Handler.Simple           * Logging to a file

MissingH.Logging.         * Logging to local or remote syslog
 Handler.Syslog           * No C library implementation required

MissingH.Logging.Logger   * Primary user interface to logging
                          * Documentation for the logging system

MissingH.Map              * Flip a Map and other utilities

MissingH.Maybe            * forceMaybe utility function

MissingH.MIMETypes        * Determine the MIME type of a file
                          * Guess an extension based on MIME type

MissingH.Network          * Establish TCP connections easily
                          * Trap SIGPIPE to prevent odd crashes

MissingH.Network.         * Versatile FTP client module
 FTP.Client               * Full support for uploads and downloads
                          * Passive or standard mode
                          * Lazy uploads and downloads
                          * Also provides low-level interface to issue
                            advanced server commands

MissingH.Network.         * Parse FTP protocol replies
 FTP.Parser

MissingH.Parsec           * Invert the sense of a parser

MissingH.Path             * Split apart filename components
                          * Recursive directory scanning
                          * Recursive file/directory removal (rm -r)

MissingH.Path.Glob        * Expand wildcards to obtain a list of files

MissingH.Path.WildPath    * Evaluate filenames or strings against wildcards
                          * Convert wildcards to regular expressions

MissingH.Regex.Pesco      * Perl-like regular expression operations and
                            operators

MissingH.Str              * Leading/trailing whitespace removal
                          * Beginning/ending tests
                          * Joining, splitting, and truncation

MissingH.Str.CSV          * Parsing of comma-separated value (CSV) files

MissingH.Threads          * Threaded callbacks

MissingH.Time             * Utilities for working with times and dates

MissingH.Time.            * Parsing of dates, similar to strptime() in C
 ParseDate

Wash.Mail.*               * Generate or parse e-mail messages
                          * Full support for headers and MIME

Wash.Utility.*            * Base64 codec
                          * Various Internet-related parsers

The entire library has no prerequisites save the Haskell standard
library and is designed to install without complexity on a variety of
systems.  It could also easily be embedded within your own source
trees so that users need not have it installed beforehand.

-------------------------
Author
-------------------------

MissingH was written by John Goerzen <[email protected]>.

arch-tag: general information

missingh's People

Contributors

andreasabel avatar bergmark avatar bgamari avatar bjornbm avatar dcoutts avatar defanor avatar erikd avatar gwern avatar hamishmack avatar hvr avatar jgoerzen avatar jleeuwes avatar joee avatar kostmo avatar markwright avatar mvoidex avatar nh2 avatar ppelleti avatar sol avatar stepcut avatar trofi avatar tvh avatar wizzup avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

missingh's Issues

MissingH 1.4.0.1 and parsec 3.1.12.0 are not compatible

MissingH 1.4.0.1 and parsec 3.1.12.0 are not compatible because the Text.ParserCombinators.Parsec module is no longer Safe. It used to be Safe in version 3.1.11.

This incompatibility breaks upstream packages such as Gitit (see comment by cidig on 2018-02-04).

Issue in parsec repo: haskell/parsec#88

src/Text/ParserCombinators/Parsec/Utils.hs:33:1: error:
    Text.ParserCombinators.Parsec: Can't be safely imported!
    The module itself isn't safe.
   |
33 | import Text.ParserCombinators.Parsec
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Incompatible with LTS nightly (GHC 8.6.1)?

MissingH is no longer part in LTS Haskell after GHC 8.6.1, and attempting to include it in builds manually results in an error due to the requirement base <4.12.

  • Can the requirement be relaxed so that it can be included manually?
  • Would that change alone allow reinstatement into LTS, or are there other, substantive, incompatibilities?

Drop splitWS in favor of words from Prelude

According to Hoogle, the Prelude function words link splits on all chars that are the isSpace class of whitespaces link

Comparing source code for spitWS from MissingH says that it splits on exactly the same chars. To keep one single idiomatic way to write this, I think you should drop this from the library or at least give some motivation in the docs for why to keep it.

mktmpdir broken: insecure temporary file race condition

System.Path.mktmpdir does not make temporary directories securely. It calls either mkstemp or openTempFile to create a temporary file, removes that file, and creates a directory with the same name. That introduces a race condition: between the removal of the file and the creation of the directory, another program could create a symlink with the same name.

Jamey Sharp and I ended up writing a similar function that works securely, in pure portable Haskell with no FFI:

-- Note that this uses the current umask
mkdtemp :: FilePath -> IO FilePath
mkdtemp prefix = do
    suffix <- sequence $ replicate 8 $ randomRIO ('a', 'z')
    let path = prefix ++ '.' : suffix
    result <- tryJust (guard . isAlreadyExistsError) $ createDirectory path
    case result of
        Left _ -> mkdtemp prefix
        Right _ -> return path

If you don't mind using the createDirectory from System.Posix.Directory instead, you can trivially create the directory with mode 0o700 instead. Other potentialy useful enhancements: allowing the user to specify a template (with the .XXXXXXXX included) rather than just a prefix, and using [A-Za-z0-9] rather than just [a-z](hence why I use 8 characters rather than 6: 8 [a-z] has more entropy than 6 [A-Za-z0-9]). Not sure I see any value in the template, though, except for compatibility with the mkdtemp C function which only wants the template so it can overwrite the X characters and avoid allocating memory itself. That doesn't apply to the Haskell version, though, so the template seems like a waste.

System.Cmd.Utils.pipeBoth subject to pipeline stalls with ghc 7

Hi John,

this is to track the bug reported by Joey at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=624389 here, to ensure it is not forgotten. For your convenience, here is the original report:

For quite a while I have been using missingh's pipeBoth with success; but as
soon as my program was rebuilt with ghc 7, it started stalling when large
quantities of data needed to be passed through the pipe.

Here is a simple test case. It needs to run in a git repository.

import System.Cmd.Utils

main = do
        as <- checkAttr "blah" $ map show [1..100000]
        sequence $ map (putStrLn . show) as

checkAttr attr files = do
        (_, s) <- pipeBoth "git" params $ unlines files
        return $ lines s
        where
                params = ["check-attr", attr, "--stdin"]

It queries git for attribute values for 100000 files. With ghc 6, it
should run to completion. With ghc 7, it stalls, deadlocked, after
a varying number of files, under 1000:

select(2, [], [1], NULL, {0, 0})        = 1 (out [1], left {0, 0})
write(1, "\"701: blah: unspecified\"\n", 25"701: blah: unspecified") = 25
select(2, [], [1], NULL, {0, 0})        = 1 (out [1], left {0, 0})
write(1, "\"702: blah: unspecified\"\n", 25"702: blah: unspecified") = 25
select(2, [], [1], NULL, {0, 0})        = 1 (out [1], left {0, 0})
write(1, "\"703: blah: unspecified\"\n", 25"703: blah: unspecified") = 25
select(2, [], [1], NULL, {0, 0})        = 1 (out [1], left {0, 0})
write(1, "\"704: blah: unspecified\"\n", 25"704: blah: unspecified") = 25
--- SIGVTALRM (Virtual timer expired) @ 0 (0) ---
sigreturn()                             = ? (mask now [])
gettimeofday({1303958431, 174266}, NULL) = 0
select(7, [], [6], NULL, {0, 0})        = 1 (out [6], left {0, 0})
write(6, "345\n15346\n15347\n15348\n15349\n1535"..., 8096

The program is blocked trying to write to git-check-attr, and
git-check-attr is in turn blocked waiting for its output to be read.

I've skipping over missingh and filing this bug directly on ghc because
I think it's unlikely missingh is at fault. IIRC, pipeBoth works by
sparking off a helper thread, which is used to write input to a command.
Unless it made a bad assumption about that being a safe thing to do,
this must be a bug in GHC?

FWIW, I have worked around this in my code by forking a process, not a
thread, to do the writing. Which works fine, just a little more
heavyweight than needed. I'm concerned about all the other potential
callers of pipeBoth out there, however.

Broken links

I love your libraries! I just wanted to point out that the links in the documentation for System.Daemon are broken. I'd submit a pull request but I don't really know what they were supposed to point to or if the resource still exists.

ambiguous import

Ambiguous occurrence ‘isSymbolicLink’
    It could refer to either ‘System.IO.PlafCompat.isSymbolicLink’,
                             imported from ‘System.IO.PlafCompat’ at src/System/IO/HVFS.hs:60:1-27
                             (and originally defined in ‘unix-2.7.2.0:System.Posix.Files.Common’)
                          or ‘System.Directory.isSymbolicLink’,
                             imported from ‘System.Directory’ at src/System/IO/HVFS.hs:63:1-23
Failed to install MissingH-1.3.0.1

File src/System/IO/HVFS.hs to fix. It doesn't work for package directory (strictly) newer than ver. 1.2.2.0.

startswith should have its arguments flipped

I like MissingH's Data.String.Utils module, but never use startswith, even though I would like to,
and I think it's a good function name.

That's because I like my functions to make sense when read out loud:

>>> "ba" `isPrefixOf` "banana"
True

makes sense to me, because "ba" is a prefix of "banana". However

>>> "ba" `startswith` "banana"
True

I find odd, because "ba" does not start with "banana", it's the other way araound:
"banana" starts with "ba". thus what I`m doing is this:

>>> mystartswith = flip startswith
>>> "banana" `mystartswith` "ba"
True

I think this should be fixed in MissingH in the long run (and I m sure this would break existing code).

Re-license under the LGPL or BSD3?

I was thinking of using your Haskell ConfigFile package for a commercial project. This seemed like it would be fine at first because ConfigFile is licensed under the LGPL. Unfortunately it references MissingH which is licensed under the GPL and although I would love to, I'm not able to comply with a GPL license at this stage.

Would you consider re-licensing MissingH under the LGPL (or BSD3) so that it can be used more freely?

problem with default cabal install

Sorry I don't know how to track this down yet; will post some follow-up if I get it solved.

Currently, building with cabal using either ghc 7.0.3 or ghc 7.0.4 fails. I wiped ~/.cabal and ~/.ghc, but no luck. The error given is,

Building MissingH-1.1.0.3...
<command line>: cannot satisfy -package-id random-1.0.0.3-9024b40453c28359a37c49ce4e776f6e: 
    random-1.0.0.3-9024b40453c28359a37c49ce4e776f6e is shadowed by package random-1.0.0.3-15ae8b1458485ee9647f74174e442c33
    (use -v for more information)

When I replace the ghc commands "-package-id random-1.0.0.3-9024b40453c28359a37c49ce4e776f6e" with the other one, it builds fine, but then I don't know how to install.

(I'm also having trouble running "make", it says "setup: At least the following dependencies are missing:
hslogger -any").

Thanks in advance.

Drop regex dependency?

The library describes itself as "a library of all sorts of utility functions for Haskell programmers. It is written in pure Haskell and thus should be extremely portable and easy to use." but its dependency on regex means that on Windows, it doesn't work so easily. It runs afoul of haskell-hvr/regex-posix#4 in particular. That bug has been open for more than a year!

So this would be more portable if the stuff that depends on regex was split out.

n-way merge?

FYI, I found Data.List.Utils merge, but I also need:

mergeN :: Ord a => [[a]] -> [a]
mergeNBy :: (a -> a -> Ordering a) -> [[a]] -> [a]

build on windows fails

When installing the latest version of MissingH using cabal on windows, I get

c:\TorXakisSandbox\1897_ImproveDesign\torxakis2>cabal install MissingH
Resolving dependencies...
Configuring MissingH-1.4.0.1...
Building MissingH-1.4.0.1...
Preprocessing library MissingH-1.4.0.1...
[ 1 of 45] Compiling System.Console.GetOpt.Utils ( src\System\Console\GetOpt\Utils.hs, dist\
build\System\Console\GetOpt\Utils.o )
[ 2 of 45] Compiling System.Debian    ( src\System\Debian.hs, dist\build\System\Debian.o )
[ 3 of 45] Compiling System.Posix.Consts ( src\System\Posix\Consts.hs, dist\build\System\Pos
ix\Consts.o )
[ 4 of 45] Compiling System.IO.StatCompat ( src\System\IO\StatCompat.hs, dist\build\System\I
O\StatCompat.o )
[ 5 of 45] Compiling Data.Compression.Inflate ( src\Data\Compression\Inflate.hs, dist\build\
Data\Compression\Inflate.o )
[ 6 of 45] Compiling Data.Hash.MD5.Zord64_HARD ( src\Data\Hash\MD5\Zord64_HARD.lhs, dist\bui
ld\Data\Hash\MD5\Zord64_HARD.o )

src\Data\Hash\MD5\Zord64_HARD.lhs:17:12: Warning:
    No explicit method or default declaration for `*'
    In the instance declaration for `Num Zord64'

src\Data\Hash\MD5\Zord64_HARD.lhs:17:12: Warning:
    No explicit method or default declaration for `abs'
    In the instance declaration for `Num Zord64'

src\Data\Hash\MD5\Zord64_HARD.lhs:17:12: Warning:
    No explicit method or default declaration for `signum'
    In the instance declaration for `Num Zord64'

src\Data\Hash\MD5\Zord64_HARD.lhs:26:12: Warning:
    No explicit method or default declaration for `xor'
    In the instance declaration for `Bits Zord64'

src\Data\Hash\MD5\Zord64_HARD.lhs:26:12: Warning:
    No explicit method or default declaration for `bit'
    In the instance declaration for `Bits Zord64'

src\Data\Hash\MD5\Zord64_HARD.lhs:26:12: Warning:
    No explicit method or default declaration for `testBit'
    In the instance declaration for `Bits Zord64'

src\Data\Hash\MD5\Zord64_HARD.lhs:26:12: Warning:
    No explicit method or default declaration for `bitSize'
    In the instance declaration for `Bits Zord64'

src\Data\Hash\MD5\Zord64_HARD.lhs:26:12: Warning:
    No explicit method or default declaration for `isSigned'
    In the instance declaration for `Bits Zord64'

src\Data\Hash\MD5\Zord64_HARD.lhs:26:12: Warning:
    No explicit method or default declaration for `popCount'
    In the instance declaration for `Bits Zord64'

src\Data\Hash\MD5\Zord64_HARD.lhs:43:12: Warning:
    No explicit method or default declaration for `quotRem'
    In the instance declaration for `Integral Zord64'

src\Data\Hash\MD5\Zord64_HARD.lhs:46:12: Warning:
    No explicit method or default declaration for `toRational'
    In the instance declaration for `Real Zord64'

src\Data\Hash\MD5\Zord64_HARD.lhs:47:12: Warning:
    No explicit method or default declaration for `toEnum'
    In the instance declaration for `Enum Zord64'

src\Data\Hash\MD5\Zord64_HARD.lhs:47:12: Warning:
    No explicit method or default declaration for `fromEnum'
    In the instance declaration for `Enum Zord64'
[ 7 of 45] Compiling Data.Hash.MD5    ( src\Data\Hash\MD5.lhs, dist\build\Data\Hash\MD5.o )

src\Data\Hash\MD5.lhs:114:12: Warning:
    No explicit method or default declaration for `*'
    In the instance declaration for `Num ABCD'

src\Data\Hash\MD5.lhs:114:12: Warning:
    No explicit method or default declaration for `abs'
    In the instance declaration for `Num ABCD'

src\Data\Hash\MD5.lhs:114:12: Warning:
    No explicit method or default declaration for `signum'
    In the instance declaration for `Num ABCD'

src\Data\Hash\MD5.lhs:114:12: Warning:
    No explicit method or default declaration for `fromInteger'
    In the instance declaration for `Num ABCD'
[ 8 of 45] Compiling Data.Hash.CRC32.GZip ( src\Data\Hash\CRC32\GZip.hs, dist\build\Data\Has
h\CRC32\GZip.o )
[ 9 of 45] Compiling Data.Bits.Utils  ( src\Data\Bits\Utils.hs, dist\build\Data\Bits\Utils.o
 )
[10 of 45] Compiling System.FileArchive.GZip ( src\System\FileArchive\GZip.hs, dist\build\Sy
stem\FileArchive\GZip.o )
[11 of 45] Compiling Data.Tuple.Utils ( src\Data\Tuple\Utils.hs, dist\build\Data\Tuple\Utils
.o )
[12 of 45] Compiling Data.Maybe.Utils ( src\Data\Maybe\Utils.hs, dist\build\Data\Maybe\Utils
.o )
[13 of 45] Compiling Data.Either.Utils ( src\Data\Either\Utils.hs, dist\build\Data\Either\Ut
ils.o )
[14 of 45] Compiling Network.Utils    ( src\Network\Utils.hs, dist\build\Network\Utils.o )
[15 of 45] Compiling Network.SocketServer ( src\Network\SocketServer.hs, dist\build\Network\
SocketServer.o )
[16 of 45] Compiling System.Path.NameManip ( src\System\Path\NameManip.hs, dist\build\System
\Path\NameManip.o )
[17 of 45] Compiling Data.Quantity    ( src\Data\Quantity.hs, dist\build\Data\Quantity.o )
[18 of 45] Compiling System.Time.Utils ( src\System\Time\Utils.hs, dist\build\System\Time\Ut
ils.o )
[19 of 45] Compiling System.IO.WindowsCompat ( src\System\IO\WindowsCompat.hs, dist\build\Sy
stem\IO\WindowsCompat.o )

src\System\IO\WindowsCompat.hs:60:1:
    Data.Time: Can't be safely imported! The module itself isn't safe.

src\System\IO\WindowsCompat.hs:61:1:
    Data.Time.Clock.POSIX: Can't be safely imported!
    The module itself isn't safe.
Failed to install MissingH-1.4.0.1
cabal: Error: some packages failed to install:
MissingH-1.4.0.1 failed during the building phase. The exception was:
ExitFailure 1

I have no problems with older versions of MissingH

c:\TorXakisSandbox\1897_ImproveDesign\torxakis2>cabal info MissingH
* MissingH         (library)
    Synopsis:      Large utility library
    Versions available: 0.18.2, 0.18.6, 1.1.1.0, 1.2.0.2, 1.2.1.0, 1.3.0.1,
                        1.3.0.2, 1.4.0.0, 1.4.0.1 (and 13 others)
    Versions installed: 1.3.0.2
    Homepage:      http://software.complete.org/missingh
    Bug reports:   [ Not specified ]
    Description:   MissingH is a library of all sorts of utility functions for
                   Haskell programmers. It is written in pure Haskell and thus
                   should be extremely portable and easy to use.
    Category:      Unclassified
    License:       BSD3
    Author:        John Goerzen
    Maintainer:    John Goerzen <[email protected]>
    Source repo:   [ Not specified ]
    Dependencies:  network -any, parsec -any, base -any, mtl -any, HUnit -any,
                   regex-compat -any, filepath -any, hslogger -any, base >=4.5,
                   base <5, directory -any, random -any, process -any,
                   old-time -any, containers -any, old-locale -any, array -any,
                   time -any, unix -any, unix -any, HUnit -any, QuickCheck -any,
                   testpack -any, time -any, array -any, old-locale -any,
                   containers -any, old-time -any, process -any, random -any,
                   directory -any, base <5, base >=4.5, hslogger -any,
                   filepath -any, errorcall-eq-instance -any, regex-compat -any,
                   HUnit -any, mtl -any, base -any, parsec -any, network -any
    Documentation: [ Not installed ]
    Cached:        Yes
    Modules:
        Control.Concurrent.Thread.Utils
        Data.BinPacking
        Data.Bits.Utils
        Data.CSV
        Data.Compression.Inflate
        Data.Either.Utils
        Data.Hash.CRC32.GZip
        Data.Hash.CRC32.Posix
        Data.Hash.MD5
        Data.Hash.MD5.Zord64_HARD
        Data.List.Utils
        Data.MIME.Types
        Data.Map.Utils
        Data.Maybe.Utils
        Data.Progress.Meter
        Data.Progress.Tracker
        Data.Quantity
        Data.String.Utils
        Data.Tuple.Utils
        Network.Email.Mailbox
        Network.Email.Sendmail
        Network.SocketServer
        Network.Utils
        System.Cmd.Utils
        System.Console.GetOpt.Utils
        System.Daemon
        System.Debian
        System.Debian.ControlParser
        System.FileArchive.GZip
        System.IO.Binary
        System.IO.HVFS
        System.IO.HVFS.Combinators
        System.IO.HVFS.InstanceHelpers
        System.IO.HVFS.Utils
        System.IO.HVIO
        System.IO.PlafCompat
        System.IO.StatCompat
        System.IO.Utils
        System.IO.WindowsCompat
        System.Path
        System.Path.Glob
        System.Path.NameManip
        System.Path.WildMatch
        System.Posix.Consts
        System.Time.ParseDate
        System.Time.Utils
        Text.ParserCombinators.Parsec.Utils

GHC 8.0.1-rc4 build failure

hese derivations will be built:
  /nix/store/ip1zcx71sjy8w8sxf3sg68mxkrqaa4al-MissingH-1.3.0.1.drv
building path(s) ‘/nix/store/2qx6zf37hnpka6z5495nz5wwyvwcw3dx-MissingH-1.3.0.1’
setupCompilerEnvironmentPhase
Build with /nix/store/02hq0p02lf5aj342yb57sw1h2fg9sii0-ghc-8.0.0.20160421.
unpacking sources
unpacking source archive /nix/store/9fi5kfg76zzmxfm9j4qxn74sicig5sp7-MissingH-1.3.0.1.tar.gz
source root is MissingH-1.3.0.1
setting SOURCE_DATE_EPOCH to timestamp 1414500384 of file MissingH-1.3.0.1/wintest.bat
patching sources
Replace Cabal file with edited version from http://hackage.haskell.org/package/MissingH-1.3.0.1/revision/1.cabal.
Run jailbreak-cabal to lift version restrictions on build inputs.
compileBuildDriverPhase
setupCompileFlags: -package-db=/tmp/nix-build-MissingH-1.3.0.1.drv-0/package.conf.d -j8 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /tmp/nix-build-MissingH-1.3.0.1.drv-0/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/2qx6zf37hnpka6z5495nz5wwyvwcw3dx-MissingH-1.3.0.1 --libdir=$prefix/lib/$compiler --libsubdir=$pkgid --with-gcc=gcc --package-db=/tmp/nix-build-MissingH-1.3.0.1.drv-0/package.conf.d --ghc-option=-optl=-Wl,-rpath=/nix/store/2qx6zf37hnpka6z5495nz5wwyvwcw3dx-MissingH-1.3.0.1/lib/ghc-8.0.0.20160421/MissingH-1.3.0.1 --enable-split-objs --disable-library-profiling --disable-profiling --enable-shared --enable-library-vanilla --enable-executable-dynamic --disable-tests
Configuring MissingH-1.3.0.1...
Setup: Encountered missing dependencies:
base <3 || >=4 && <4.9
note: keeping build directory ‘/tmp/nix-build-MissingH-1.3.0.1.drv-2’
builder for ‘/nix/store/ip1zcx71sjy8w8sxf3sg68mxkrqaa4al-MissingH-1.3.0.1.drv’ failed with exit code 1
error: build of ‘/nix/store/ip1zcx71sjy8w8sxf3sg68mxkrqaa4al-MissingH-1.3.0.1.drv’ failed

doesn't work on ghc 7.6.1 on windows

i may have a misconfigured setup, but i think it's OK.

I get this error when attempting to build (using cabal install missingh) 1.2.0.0 on windows 7:

[21 of 47] Compiling System.IO.WindowsCompat ( src\System\IO\WindowsCompat.hs, d
ist\build\System\IO\WindowsCompat.o )

src\System\IO\WindowsCompat.hs:123:41:
Couldn't match expected type System.Time.ClockTime' with actual typetime-1.4.0.1:Data.Time.Clock.UTC.UTCTime'
In the first argument of clockTimeToEpoch', namelymodct'
In the expression: clockTimeToEpoch modct
In an equation for `epochtime': epochtime = clockTimeToEpoch modct
cabal: Error: some packages failed to install:
MissingH-1.2.0.0 failed during the building phase. The exception was:
ExitFailure 1

ghc-9.4.3 haddock crashes in Stackage Nightly

Running Haddock on library for MissingH-1.5.0.1..
                                                                                                                                    
<no location info>: error:                                                                                                              panic! (the 'impossible' happened)                                                                                              
  GHC version 9.4.3:                                              
        funResultTy                                                                                                                 
  BinPackerError size_a5dp obj_a5dq   
  Call stack:                                                     
      CallStack (from HasCallStack):                              
        callStackDoc, called at compiler/GHC/Utils/Panic.hs:182:37 in ghc:GHC.Utils.Panic
        pprPanic, called at compiler/GHC/Core/Type.hs:1334:49 in ghc:GHC.Core.Type

Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

Build failure with unix-2.8

Currently relaxing to unix-2.8 is not possible:

[22 of 45] Compiling System.Daemon    ( src/System/Daemon.hs, /Users/abel/project/open-source/hvr/missingh/dist-newstyle/build/x86_64-osx/ghc-9.4.3/MissingH-1.5.0.1/build/System/Daemon.o, /Users/abel/project/open-source/hvr/missingh/dist-newstyle/build/x86_64-osx/ghc-9.4.3/MissingH-1.5.0.1/build/System/Daemon.dyn_o ) [System.Directory package changed]

src/System/Daemon.hs:89:18: error:
    • Couldn't match expected type: unix-2.8.0.0:System.Posix.IO.Common.OpenFileFlags
                                    -> IO System.Posix.Types.Fd
                  with actual type: IO System.Posix.Types.Fd
    • The function ‘openFd’ is applied to four value arguments,
        but its type ‘FilePath
                      -> OpenMode
                      -> unix-2.8.0.0:System.Posix.IO.Common.OpenFileFlags
                      -> IO System.Posix.Types.Fd’
        has only three
      In a stmt of a 'do' block:
        nullFd <- openFd "/dev/null" ReadWrite Nothing defaultFileFlags
      In the second argument of ‘($)’, namely
        ‘do setCurrentDirectory "/"
            mapM_ closeFd [stdInput, stdOutput, ....]
            nullFd <- openFd "/dev/null" ReadWrite Nothing defaultFileFlags
            mapM_ (dupTo nullFd) [stdInput, stdOutput, ....]
            ....’
   |
89 |        nullFd <- openFd "/dev/null" ReadWrite Nothing defaultFileFlags
   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Version 1.5.0.0 cannot be built on windows

System: Windows 11
Stack version: 2.7.5
LTS version: 18.28
Raw log:

MissingH                         > [19 of 45] Compiling Network.SocketServer
MissingH                         > [20 of 45] Compiling System.Cmd.Utils
MissingH                         >
MissingH                         > src\System\Cmd\Utils.hs:351:14: error:
MissingH                         >     Variable not in scope:
MissingH                         >       rawSystem :: FilePath -> [String] -> IO ExitCode
MissingH                         >     |
MissingH                         > 351 |        ec <- rawSystem command args
MissingH                         >     |              ^^^^^^^^^
MissingH                         >

It seems that in this new version, the code forgot to import the method rawSystem anywhere. It was there in the previous version.

MissingH won't upgrade

Specs:

  • cabal-install 0.8.2
  • Cabal 1.8.0.6
  • GHC 6.12.3
  • Mac OS X 10.6.6
  • MacBook? Pro 5,1

Trace:

$ cabal upgrade missingh
Resolving dependencies...
Configuring regex-base-0.93.2...
Preprocessing library regex-base-0.93.2...
Building regex-base-0.93.2...
[1 of 4] Compiling Text.Regex.Base.RegexLike ( Text/Regex/Base/RegexLike.hs, dist/build/Text/Regex/Base/RegexLike.o )
[2 of 4] Compiling Text.Regex.Base.Context ( Text/Regex/Base/Context.hs, dist/build/Text/Regex/Base/Context.o )
[3 of 4] Compiling Text.Regex.Base  ( Text/Regex/Base.hs, dist/build/Text/Regex/Base.o )
[4 of 4] Compiling Text.Regex.Base.Impl ( Text/Regex/Base/Impl.hs, dist/build/Text/Regex/Base/Impl.o )
Registering regex-base-0.93.2...
Installing library in /Users/andrew/.cabal/lib/regex-base-0.93.2/ghc-6.12.3
Registering regex-base-0.93.2...
Configuring regex-posix-0.94.4...
Preprocessing library regex-posix-0.94.4...
Building regex-posix-0.94.4...
[1 of 6] Compiling Text.Regex.Posix.Wrap ( dist/build/Text/Regex/Posix/Wrap.hs, dist/build/Text/Regex/Posix/Wrap.o )
[2 of 6] Compiling Text.Regex.Posix.String ( Text/Regex/Posix/String.hs, dist/build/Text/Regex/Posix/String.o )
[3 of 6] Compiling Text.Regex.Posix.Sequence ( Text/Regex/Posix/Sequence.hs, dist/build/Text/Regex/Posix/Sequence.o )
[4 of 6] Compiling Text.Regex.Posix.ByteString ( Text/Regex/Posix/ByteString.hs, dist/build/Text/Regex/Posix/ByteString.o )
[5 of 6] Compiling Text.Regex.Posix.ByteString.Lazy ( Text/Regex/Posix/ByteString/Lazy.hs, dist/build/Text/Regex/Posix/ByteString/Lazy.o )
[6 of 6] Compiling Text.Regex.Posix ( Text/Regex/Posix.hs, dist/build/Text/Regex/Posix.o )
Registering regex-posix-0.94.4...
Installing library in /Users/andrew/.cabal/lib/regex-posix-0.94.4/ghc-6.12.3
Registering regex-posix-0.94.4...
Configuring regex-compat-0.93.1...
Preprocessing library regex-compat-0.93.1...
Building regex-compat-0.93.1...
[1 of 1] Compiling Text.Regex       ( Text/Regex.hs, dist/build/Text/Regex.o )
Registering regex-compat-0.93.1...
Installing library in /Users/andrew/.cabal/lib/regex-compat-0.93.1/ghc-6.12.3
Registering regex-compat-0.93.1...
Configuring MissingH-1.1.0.3...
Preprocessing library MissingH-1.1.0.3...
Preprocessing executables for MissingH-1.1.0.3...
Building MissingH-1.1.0.3...
[ 1 of 47] Compiling System.Console.GetOpt.Utils ( src/System/Console/GetOpt/Utils.hs, dist/build/System/Console/GetOpt/Utils.o )
[ 2 of 47] Compiling System.Debian    ( src/System/Debian.hs, dist/build/System/Debian.o )
[ 3 of 47] Compiling System.IO.WindowsCompat ( src/System/IO/WindowsCompat.hs, dist/build/System/IO/WindowsCompat.o )
[ 4 of 47] Compiling System.Posix.Consts ( src/System/Posix/Consts.hs, dist/build/System/Posix/Consts.o )
[ 5 of 47] Compiling System.IO.StatCompat ( src/System/IO/StatCompat.hs, dist/build/System/IO/StatCompat.o )
[ 6 of 47] Compiling System.IO.PlafCompat ( src/System/IO/PlafCompat.hs, dist/build/System/IO/PlafCompat.o )
[ 7 of 47] Compiling Data.Compression.Inflate ( src/Data/Compression/Inflate.hs, dist/build/Data/Compression/Inflate.o )
[ 8 of 47] Compiling Data.Hash.MD5.Zord64_HARD ( src/Data/Hash/MD5/Zord64_HARD.lhs, dist/build/Data/Hash/MD5/Zord64_HARD.o )

src/Data/Hash/MD5/Zord64_HARD.lhs:4:2:
    Bad interface file: /Users/andrew/.cabal/lib/haskell98-1.1.0.0/ghc-6.12.3/Word.hi
        Something is amiss; requested module  haskell98:Word differs from name found in the interface file haskell98-1.1.0.0:Word
cabal: Error: some packages failed to install:
MissingH-1.1.0.3 failed during the building phase. The exception was:
ExitFailure 1

split is inefficient; can be sped up over 2x for single character delimiter

Data.List.Utils.split if you profile it, does a lot of allocation.

With a 600 mb "data" file containing short words, I profiled this program:

import Data.List.Utils
main = do
        s <- readFile "data"
        let l = split " " s
        print (length l)

Tue Jan 31 19:49 2017 Time and Allocation Profiling Report  (Final)

       foo +RTS -p -RTS

    total time  =      117.11 secs   (117106 ticks @ 1000 us, 1 processor)
    total alloc = 139,419,374,656 bytes  (excludes profiling overheads)

COST CENTRE MODULE           %time %alloc

spanList    Data.List.Utils   46.2   59.3
startswith  Data.List.Utils   28.4   14.1
MAIN        MAIN              14.7   17.8
split       Data.List.Utils    8.3    6.4
breakList   Data.List.Utils    2.5    2.4

Compare with this program using a splitc specialized to a single character delimiter:

main = do
    s <- readFile "data"
    let l = splitc ' ' s
    print (length l)

splitc :: Char -> String -> [String]
splitc _ [] = []
splitc c s = case break (== c) s of
    (i, d:rest) -> i : splitc c rest
    (i, []) -> i : []

    Tue Jan 31 19:54 2017 Time and Allocation Profiling Report  (Final)

       foo +RTS -p -RTS

    total time  =       54.44 secs   (54435 ticks @ 1000 us, 1 processor)
    total alloc = 99,505,766,960 bytes  (excludes profiling overheads)

So over twice as fast!

A simple improvement then would be to make split use splitc when the delimiter is a single character. But, it might be better to investigate why the helper functions are doing so much allocation.

secureAbsNormPath isn't secure

Joey reports at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=599676 against version 1.1.0.3:

Prelude System.Path> secureAbsNormPath "/home/joey" "/home/bob/foo"
Nothing

So far so good, and based on that and secureAbsNormPath's description,
you might expect it to be usaable to limit access to files in my home
directory. That is not the case:

Prelude System.Path> secureAbsNormPath "/home/joey" "/home/joeyish/foo"
Just "/home/joeyish/foo"

So to be "secure", the first parameter should end with a slash.
But, the documentation doesn't say that. Actually, it says "in many
cases, it would correspond to the current working directory". Note
that getCurrentDirectory does not return a directory with a trailing
slash.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.