xcmw_ 2017-02-05 16:45:13
kadoban: Apparantly I built the wrong version. How can I build 8.0.3. I says I built 8.1.20170206.
xcmw_ 2017-02-05 16:45:28
I used git
kadoban 2017-02-05 16:45:48
No idea honestly. Maybe you checked out the wrong tag, at a guess?
geekosaur 2017-02-05 16:46:02
check out ghc-8.0 branch
geekosaur 2017-02-05 16:46:08
you built HEAD
xcmw_ 2017-02-05 16:46:32
I need this commit. https://git.haskell.org/ghc.git/commitdiff/3540d1e1a23926ce0a8a6ae83a36f5f6b2497ccf
xcmw_ 2017-02-05 16:47:05
Will ghc-8.0 have that?
kadoban 2017-02-05 16:48:36
xcmw_: You can try 'git branch --contains 3540d1e' or something
kadoban 2017-02-05 16:48:54
Probably want -a on that
xcmw_ 2017-02-05 16:49:54
I get master
geekosaur 2017-02-05 16:50:08
right, I think you want head, there is no 8.0.3 planned
geekosaur 2017-02-05 16:50:13
8.2.1 is the next release
xcmw_ 2017-02-05 16:51:07
geekosaur: So what do I run? Does head (which I think I built) have that commit?
geekosaur 2017-02-05 16:51:38
if you have master checked out then yes (that would be the default)
geekosaur 2017-02-05 16:52:23
HEAD is shorthand for the tip of the master branch (this is a slight lie as every branch has a HEAD, but conventional git usage tends to assume HEAD only applies to master...)
xcmw_ 2017-02-05 16:52:31
geekosaur: So then stack is not using that ghc then because the glitch still occurs
geekosaur 2017-02-05 16:52:46
you'll need to figure out what stack is using, then
Koterpillar 2017-02-05 16:52:56
it won't be using 8.2
geekosaur 2017-02-05 16:53:00
unless git status says you are not on master
xcmw_ 2017-02-05 16:53:05
geekosaur: I am running stack --system-ghc build
Koterpillar 2017-02-05 16:53:16
did you specify compiler: ?
geekosaur 2017-02-05 16:53:57
xcmw_, I can say sensible things about ghc, not so much about stack, don't bother directing those at me
kadoban 2017-02-05 16:54:01
Pretty sure --system-ghc just means "you can use the system GHC, if you feel like it", it doesn't stop it from trying to use a "correct" version of GHC, including its own. Fairly sure
geekosaur 2017-02-05 16:54:18
and ^ that would not surprise me much
kadoban 2017-02-05 16:54:33
So you need to both tell it that it's okay to use a system GHC, and also tell it to use the version you want. Which is the stuff Koterpillar linked earlier I believe.
geekosaur 2017-02-05 16:54:33
so you probably need to convince stack that a "ghc 8.1" is valid
Koterpillar 2017-02-05 16:54:53
or 8.2?
geekosaur 2017-02-05 16:55:08
(note that it will not call itself ghc 8.2 until that is branched, which is iirc a month or so down the road)
xcmw_ 2017-02-05 16:55:15
ghc version is 8.1.20170206
kadoban 2017-02-05 16:55:22
Usually just a matter of setting the flags in the stack.yaml file, or there's probably a way on the command line if a stack.yaml isn't relevant.
xcmw_ 2017-02-05 16:55:33
compiler: 8.1
kadoban 2017-02-05 16:56:25
xcmw_: The usual matching algo it uses is something like "only the exact version" so you either need to make that match exactly, or change that with compiler-match or whatever it is.
Koterpillar 2017-02-05 16:56:43
https://docs.haskellstack.org/en/stable/yaml_configuration/?highlight=compiler#compiler
Koterpillar 2017-02-05 16:56:56
xcmw_: compiler: ghc-8.1.20170206
xcmw_ 2017-02-05 16:58:02
Now I get Failure when adding dependencies for a bunch of packages
kadoban 2017-02-05 16:59:03
What resolver are you using? I'd hope whichever one is nearest to new at least? Other than that, I dunno. A bunch of them just might not even be ready to support that version even.
xcmw_ 2017-02-05 16:59:18
resolver: nightly-2017-02-03
Koterpillar 2017-02-05 16:59:43
xcmw_: do you want to build this yourself, or does it have to go to other people?
xcmw_ 2017-02-05 16:59:56
Koterpillar: Just me
geekosaur 2017-02-05 17:00:02
I suspect you will lose until a resolver exists or you manually pick and possibly patch packages to match that compiler
Koterpillar 2017-02-05 17:00:19
xcmw_: can you cherry-pick that commit on top of 8.0 and rebuild as 8.0.3?
geekosaur 2017-02-05 17:00:20
that's the problem with bleeding edge, especially when building with a reproducible builds tool
kadoban 2017-02-05 17:01:09
Ya, stack isn't exactly working with you for this kind of usage. There are resolvers for "just the crap that comes with GHC", you could start there and add extra-deps maybe, depending on what this is and how much it uses in terms of packages, perhaps that's more likely to succeed.
xcmw_ 2017-02-05 17:01:45
Is there an I don't care about versions just built it flag?
Koterpillar 2017-02-05 17:02:24
no
Koterpillar 2017-02-05 17:02:26
by design
xcmw_ 2017-02-05 17:02:44
Can I fake the ghc version to 8.0.2?
Koterpillar 2017-02-05 17:03:17
xcmw_: can you cherry-pick that commit on top of 8.0 and rebuild as 8.0.3?
Koterpillar 2017-02-05 17:03:20
or 8.02
kadoban 2017-02-05 17:03:21
Probably? I would imagine the GHC version is just somewhere in a text file you change before you build GHC, but that's a pretty big guess.
kadoban 2017-02-05 17:03:30
Or yeah that makes more sense.
xcmw_ 2017-02-05 17:04:10
Koterpillar: I will try that tomorrow
xcmw_ 2017-02-05 17:04:13
Thanks
sshine 2017-02-05 17:10:33
https://hackage.haskell.org/package/bytestring-trie-0.2.4.1/docs/src/Data-Trie-Internal.html#line-163 -- trying to understand where this 'Mask' type comes from. can anyone here see that?
kadoban 2017-02-05 17:14:47
sshine: Very likely either Data.Trie.ByteStringInternal or Data.Trie.BitTwiddle I don't see it in Data.Binary. If you still can't find it, you can load that in ghci, if it's convenient, and see. (:i Mask or whatever)
sshine 2017-02-05 17:17:23
kadoban, I see that it is probably modelled on http://hackage.haskell.org/package/containers-0.5.9.1/docs/src/Data.IntMap.Internal.html#line-347
sshine 2017-02-05 17:17:36
kadoban, this code makes it more clear that they're just aliases to Int. :)
kadoban 2017-02-05 17:18:34
Suspected it was just an alias (or a newtype), but still couldn't find exactly where it's defined, heh.
sshine 2017-02-05 17:19:17
kadoban, yeah.
halogenandtoast 2017-02-05 17:26:56
Is there any cleaner way to write `mStory <- getBy $ UniqueNewsId nid case mStory of Just _ -> return () Nothing -> insert_ story`
halogenandtoast 2017-02-05 17:27:21
I keep wanting to use `maybe` but can't get the types to check out
Koterpillar 2017-02-05 17:27:47
:t maybe
lambdabot 2017-02-05 17:27:48
b -> (a -> b) -> Maybe a -> b
Koterpillar 2017-02-05 17:27:58
maybe (return ()) (void . insert)
Axman6 2017-02-05 17:28:31
needs const (insert_ story) I think
halogenandtoast 2017-02-05 17:28:58
Axman6: I think I tried something like that, but I'll try again
Axman6 2017-02-05 17:29:08
maybe (pure ()) (const (insert_ story)) =<< getBy (UniqueNewsId nid)
halogenandtoast 2017-02-05 17:30:31
Axman6: yeah that worked, last time I was trying to one line both operations and was using `<$>` instead of `=<<`
halogenandtoast 2017-02-05 17:31:37
thanks Axman6 and Koterpillar
kotangent 2017-02-05 17:40:03
exit
halogenandtoast 2017-02-05 17:44:07
Another cleanup challenge if anyone has ideas... `runDB $ do dbcount <- countPublishedToday return $ void $ when (dbcount == 0) (runDB refreshStories)`
jle` 2017-02-05 17:44:39
what's the return . void supposed to be doing
jle` 2017-02-05 17:44:48
oh
halogenandtoast 2017-02-05 17:45:03
The void isn't needed
jle` 2017-02-05 17:45:03
are you doing runDB inside a runDB ...?