[Haskell-community] [Haskell-cafe] technical thoughts on stack

Christopher Allen cma at bitemyapp.com
Wed Sep 14 20:10:22 UTC 2016


I see what is meant now, but it's not really applicable. If I am
co-developing a package and its dependencies, I add them as packages
(not deps) to my stack.yaml and still get the warnings.

Example:

>From the stack.yaml for the package that uses my previous example's library:


packages:
- '.'
- ../simple-library


Then stack build'ing the project (uses-sl) that depends on
simple-library which as a module with a warning:


$ stack build
simple-library-0.1.0.0: build
Progress: 1/2
--  While building package simple-library-0.1.0.0 using:
      /home/callen/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.24.0.0-ghc-8.0.1
--builddir=.stack-work/dist/x86_64-linux/Cabal-1.24.0.0 build
lib:simple-library exe:simple-library-exe --ghc-options " -ddump-hi
-ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to:
/home/callen/work/uses-sl/.stack-work/logs/simple-library-0.1.0.0.log

    Preprocessing library simple-library-0.1.0.0...
    [1 of 1] Compiling SimpleLib        ( src/SimpleLib.hs,
.stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/SimpleLib.o )

    /home/callen/work/simple-library/src/SimpleLib.hs:7:3: warning:
[-Wunused-do-bind]
        A do-notation statement discarded a result of type ‘[Char]’
        Suppress this warning by saying ‘_ <- return "hello"’



One of the first things I did when figuring out Stack was to look at
how Yesod used it:
https://github.com/yesodweb/yesod/blob/master/stack.yaml

On Wed, Sep 14, 2016 at 2:56 PM, David McBride <toad3k at gmail.com> wrote:
> The rule of thumb seems to be, if you do a stack build and it decides to
> build multiple packages, it hides this log info.
>
> I understand why it does that, I should be able to build lens without
> worrying about tons of spurious output, but at the same time it is common
> for me to have an entire tree of packages I'm developing and it often
> obscures errors that are happening in my own packages.  At the very least,
> if it is only building local packages, I'd very much like to see that
> output.
>
> On Wed, Sep 14, 2016 at 3:42 PM, Patrick Pelletier
> <code at funwithsoftware.org> wrote:
>>
>> On 9/14/16 12:21 PM, Christopher Allen wrote:
>>>
>>> What are you talking about?
>>>
>>> $ stack build
>>> simple-library-0.1.0.0: unregistering (local file changes: src/Lib.hs)
>>> simple-library-0.1.0.0: build
>>> Preprocessing library simple-library-0.1.0.0...
>>> [1 of 1] Compiling Lib              ( src/Lib.hs,
>>> .stack-work/dist/x86_64-linux/Cabal-1.24.0.0/build/Lib.o )
>>>
>>> /home/callen/work/simple-library/src/Lib.hs:7:3: warning:
>>> [-Wunused-do-bind]
>>>      A do-notation statement discarded a result of type ‘[Char]’
>>>      Suppress this warning by saying ‘_ <- return "woot"’
>>> Preprocessing executable 'simple-library-exe' for
>>> simple-library-0.1.0.0...
>>
>>
>> Weird.  That's not how it works for me:
>>
>> whiteandnerdy:normalize ppelleti$ stack build
>> normalization-insensitive-2.0: unregistering (local file changes:
>> Data/Unicode/NormalizationInsensitive.hs
>> Data/Unicode/NormalizationInsensitive/Internal.hs)
>> normalization-insensitive-2.0: configure
>> normalization-insensitive-2.0: build
>> normalization-insensitive-2.0: copy/register
>> photos-0.1.0.0: configure
>> photos-0.1.0.0: build
>> photos-0.1.0.0: copy/register
>> Completed 2 action(s).
>> whiteandnerdy:normalize ppelleti$ cat
>> .stack-work/logs/normalization-insensitive-2.0.log
>> Configuring normalization-insensitive-2.0...
>> Preprocessing library normalization-insensitive-2.0...
>> [1 of 3] Compiling Data.Unicode.NormalizationInsensitive.Internal (
>> Data/Unicode/NormalizationInsensitive/Internal.hs,
>> .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Data/Unicode/NormalizationInsensitive/Internal.o
>> )
>>
>> Data/Unicode/NormalizationInsensitive/Internal.hs:30:1: Warning:
>>     The import of ‘Data.Bool’ is redundant
>>       except perhaps to import instances from ‘Data.Bool’
>>     To import instances alone, use: import Data.Bool()
>>
>> Data/Unicode/NormalizationInsensitive/Internal.hs:38:1: Warning:
>>     The import of ‘otherwise, &&, <=, +’
>>     from module ‘Prelude’ is redundant
>>
>> Data/Unicode/NormalizationInsensitive/Internal.hs:57:1: Warning:
>>     Module ‘Data.ByteString.UTF8.Normalize’ is deprecated:
>>       Convert ByteString to Text and then normalize
>>
>> Data/Unicode/NormalizationInsensitive/Internal.hs:135:1: Warning:
>>     Top-level binding with no type signature: mode :: NormalizationMode
>>
>> Data/Unicode/NormalizationInsensitive/Internal.hs:143:17: Warning:
>>     In the use of ‘B.normalize’
>>     (imported from Data.ByteString.UTF8.Normalize):
>>     Deprecated: "Convert ByteString to Text and then normalize"
>>
>> Data/Unicode/NormalizationInsensitive/Internal.hs:147:33: Warning:
>>     In the use of ‘B.normalize’
>>     (imported from Data.ByteString.UTF8.Normalize):
>>     Deprecated: "Convert ByteString to Text and then normalize"
>> [2 of 3] Compiling Data.Unicode.NormalizationInsensitive.Unsafe (
>> Data/Unicode/NormalizationInsensitive/Unsafe.hs,
>> .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Data/Unicode/NormalizationInsensitive/Unsafe.o
>> )
>> [3 of 3] Compiling Data.Unicode.NormalizationInsensitive (
>> Data/Unicode/NormalizationInsensitive.hs,
>> .stack-work/dist/x86_64-osx/Cabal-1.22.5.0/build/Data/Unicode/NormalizationInsensitive.o
>> )
>>
>> Data/Unicode/NormalizationInsensitive.hs:25:31: Warning:
>>     ‘normalize’ is exported by ‘Normalizable(normalize)’ and ‘normalize’
>> In-place registering normalization-insensitive-2.0...
>> Installing library in
>>
>> /Users/ppelleti/programming/haskell/normalize/.stack-work/install/x86_64-osx/lts-6.1/7.10.3/lib/x86_64-osx-ghc-7.10.3/normalization-insensitive-2.0-KLVtcrPtbow6nG8kRB6WPM
>> Registering normalization-insensitive-2.0...
>> whiteandnerdy:normalize ppelleti$
>>
>> I hadn't even been aware of these warnings in the package I was
>> developing, until Harendra Kumar pointed them out to me, after I had
>> uploaded a candidate to Hackage.
>>
>> --Patrick
>>
>>
>> _______________________________________________
>> Haskell-Cafe mailing list
>> To (un)subscribe, modify options or view archives go to:
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>> Only members subscribed via the mailman list are allowed to post.
>
>



-- 
Chris Allen
Currently working on http://haskellbook.com


More information about the Haskell-community mailing list