angerman changed the topic of #haskell.nix to: https://input-output-hk.github.io/haskell.nix - alternative haskell infrastructure for nix; logs at https://logs.nix.samueldr.com/haskell.nix
acarrico has quit [Ping timeout: 240 seconds]
codygman has quit [Read error: Connection reset by peer]
codygman has joined #haskell.nix
codygman has quit [Read error: Connection reset by peer]
codygman has joined #haskell.nix
<typetetris> Is there a way to override the url for https://github.com/input-output-hk/nix-tools or isn't that repo used any more?
<typetetris> How can I get a complete list of available "tools"?
<michaelpj> typetetris: nix-tools is where stack-to-nix and cabal-to-nix come from. You can override the sources `haskell.nix` uses by passing sourceOverrides when you import it: https://github.com/input-output-hk/haskell.nix/blob/master/default.nix#L3
<michaelpj> there's no list of things you can put in 'tools' at the moment, it's fairly ad-hoc: https://github.com/input-output-hk/haskell.nix/blob/master/overlays/tools.nix
<typetetris> What is the attribute name for the override?
<typetetris> Thanks for you always answering my questions!
<michaelpj> typetetris: `sourceOverrides` is an attribute set that gets `//`d with the thing that comes out of niv, and if you look at `sources.json` you'll see that repo is `nix-tools`
hekkaidekapus} has quit [Quit: hekkaidekapus}]
hekkaidekapus has joined #haskell.nix
fendor has joined #haskell.nix
fendor has quit [Remote host closed the connection]
<typetetris> I can't connect the documentation of materialization with what I am seeing, trying to use it. Adding "index-state" to "cabalProject" call didn't change the output for example as described.
<typetetris> no `nix-hash` command is mentioned in the output I am seeing.
<typetetris> But `


/nix/store/y7yirycf0vmxara45d5yqzqmhnq52kc2-calculateSha` doesn't exist on my system.
hekkaidekapus has quit [Remote host closed the connection]
hekkaidekapus has joined #haskell.nix
__monty__ has joined #haskell.nix
fendor has joined #haskell.nix
<typetetris> michaelpj: Next question would be, how to materialize the stuff for haskell-language-server and the stuff in tools, but the ticket probably isn't the correct place for that.
<michaelpj> you can't really materialize the stuff in tools. It's designed to be easy-to-use, not easy to customize. If you want to do that I advise just having the `cabalProject` expression for HLS in your own config
<michaelpj> (I'm not a huge fan of the 'tools' thing partially for this reason)
<typetetris> michaelpj: Ok, thanks.
<typetetris> is there also `hackage-package'` ?
<typetetris> okay, I have to use `hackage-project` then I guess?
<michaelpj> typetetris: yes.... except HLS isn't on hackage yet :) so just use cabalProject with fetchFromGitHub. You can look at the expression in haskell.nix: https://github.com/input-output-hk/haskell.nix/blob/master/overlays/tools.nix#L129
<typetetris> michealpj: Ahh I am working on getting `cabal-install` into my `shell.nix` with materialization for it :)
<michaelpj> typetetris: you might find this file useful as an example: https://github.com/input-output-hk/plutus/blob/master/nix/haskell-extra.nix
<typetetris> How are the paths for the `materialized` attribute set there? I can only see `checkMaterialization` being passed around?
<michaelpj> typetetris: those ones aren't totally materialized, I've just pinned the `plan-sha256`. Which makes it fixed-output, but not totally read-from-disk
codygman has quit [Read error: Connection reset by peer]
codygman has joined #haskell.nix
<typetetris> michaelpj: Ok. One last thing and I think I am set for now: What about hoogle? Using shellFor tells me hoogle isn't materialized. Can I get that materialized too?
<michaelpj> typetetris: uh, not sure. I'd have to dig around in the `haskell.nix` source to figure out where that comes from...
<typetetris> tried to do that ... I couldn't spot it in the 15 min I spent on it.
acarrico has joined #haskell.nix
fendor has quit [Quit: Leaving]
<typetetris> What is really strange: My test suites, compiled with `-threaded -with-rtsopts=-N` seem to use only one cpu since I started using haskell.nix?
<typetetris> Is that to be expected?
<michaelpj> as in, it runs single-threaded in the derivation that runs the test, or it runs single-threaded when you do `cabal test`?
fendor has joined #haskell.nix
<typetetris> `cabal test` does run them in parallel, but building the executable `(cabalProject { ... }).projectName.components.tests.test-suite-exe` and calling `test-suite-exe` does run on one core.
<michaelpj> is there some argument that cabal passes to make it run in parallel which isn't being passed elsewhere? Do you get it in parallel if you build the test executable with cabal and run that directly?
<typetetris> This is rather strange ... executable from haskell.nix reports the same `+RTS --info` stuff as `cabal test test-suite-name --test-option=+RTS --test-option=--info` ... `,("RTS way", "rts_thr")` and `,("Flag -with-rtsopts", "-N")`
<typetetris> `test-suite-exe +RTS -N32` doesn't help also ...
<michaelpj> you know, I think I might have also observed this and been mystified
<michaelpj> in that I had my test suite be a lot slower when I built it in a nix-shell but not outside. And that was just using `cabal build`
<michaelpj> I'd be interested to see if you get the same non-parallel behaviour if you `cabal build` the test-suite inside a `nix-shell`
<typetetris> michealpj: Definitely the nix-shell. Calling the executable produced by `haskell.nix` outside the nix-shell it is parallel as expected.
<typetetris> michaelpj: I was using direnv and didn't have this behaviour, so it is not triggered by env variables. Some kind of cgroup stuff. I will ask on #nixos.
fendor has quit [Remote host closed the connection]
<typetetris> okay normal nix-shell doesn't show that behaviour
<michaelpj> okay now I'm confused about which combination shows which behaviour! Could you open an issue if you manage to figure out which combination triggers it?
<typetetris> michaelpj: Yes, will do. I'll try to make a trivial example reproducing it.
<typetetris> Seems like some derivation `...components.exes.stuff` in `buildInputs` is sufficient.
<michaelpj> there's definitely something weird here
<typetetris> Maybe there is a setupHook attached to those.
<typetetris> Is it ok if I link to a repo with the test case or should I c&p all files in the ticket?
codygman has quit [Read error: Connection reset by peer]
codygman has joined #haskell.nix
pjb has quit [Remote host closed the connection]
<michaelpj> typetetris: link to a repo is fine
fendor has joined #haskell.nix
pjb has joined #haskell.nix
<typetetris> I am baffled. I can't reproduce it with a minimal example so far ...
codygman has quit [Ping timeout: 272 seconds]
codygman has joined #haskell.nix
codygman has quit [Read error: Connection reset by peer]
codygman has joined #haskell.nix
<michaelpj> one of those kinds of bugs...
jD91mZM2 has joined #haskell.nix
<typetetris> michaelpj: It has `Cpus_allowed_list: 28` in its `/proc/<pid>/status` so somehow cpusets or cgroups have been used to restrict it.
<typetetris> clever from #nixos claims it is a bug in `nix-shell` it restricts itself to one cpu and sometimes it doesn't lift that restriction ...
* clever waves
<clever> [clever@amd-nixos:~/iohk/daedalus-turtle]$ /nix/store/04qxh0msnm7dzm68h706dij5xh2y6l27-nix-2.1pre6424_c5ab07e/bin/nix-shell -p hello -I nixpkgs=https://github.com/nixos/nixpkgs/archive/nixos-19.09.tar.gz
<clever> [nix-shell:~/iohk/daedalus-turtle]$ grep Cpus_allowed_list /proc/self/status
<clever> Cpus_allowed_list: 0-7
<clever> hmmmm, i remember it being a bug, but even nix 2.1 doesnt do it...
<clever> this says it was a bug with `nix run`, not `nix-shell`
<clever> > nix-shell inherits single CPU affinity when derivation has import from derivation #3345
<clever> typetetris: aha, that would explain why it randomly behaves differently!
<typetetris> clever: thanks!
<typetetris> I think about opening an issue in haskell.nix, just to close it directly and point to #3345 in nixos/nix.
hekkaidekapus_ has joined #haskell.nix
hekkaidekapus has quit [Ping timeout: 240 seconds]
<michaelpj> clever always knows the answer :)
__monty__ has quit [Quit: leaving]
fendor has quit [Remote host closed the connection]
codygman has quit [Ping timeout: 258 seconds]
acarrico has quit [Ping timeout: 256 seconds]
codygman has joined #haskell.nix