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
proofofkeags has quit [Ping timeout: 268 seconds]
fendor has joined #haskell.nix
__monty__ has joined #haskell.nix
fendor_ has joined #haskell.nix
_d0t has joined #haskell.nix
<_d0t> ohai! What is the best way to have the current git sha embedded in code when building with haskell.nix?
<_d0t> We do have some TH code in the project that looks into .git/HEAD, but it doesn't seem compatible with haskell.nix somehow.
fendor has quit [Ping timeout: 268 seconds]
<__monty__> The easiest way is probably to include .git in your src, i.e., not filter it out.
<_d0t> I do have that. Still seems broken somehow.
<_d0t> Although that TH code is inside a submodule. Could this be an issue?
<_d0t> Is there any way to set an environment variable for the build process?
<__monty__> Maybe. Though if it works as a submodule in a regular git repo I'm not sure why it wouldn't.
<__monty__> Hmm, not sure. gtg go. Good luck!
<_d0t> __monty__: o7
<_d0t> hmmm... figured that I need git available and in PATH during build. How do I add an external dependency to the project?
proofofkeags has joined #haskell.nix
<__monty__> _d0t: Usual advice is to do what you'd do with stack/cabal.
<__monty__> I'm not sure cabal allows you to specify build tool dependencies though.
<_d0t> __monty__: it does, but only if they are in haskell. Via build-tool-depends.
<_d0t> Which is a huge drawback if you ask me.
<_d0t> With stack I can add git as a dependency via nix->packages, but haskell.nix seems to ignore this field.
<__monty__> _d0t: Hmm, maybe try adding buildInputs to your stackProject call? I'm sure michaelpj or someone else will have an answer. They're usually active during CE(S)T working hours.
<_d0t> __monty__: I tried but that doesn't seem to work. Thanks, I'll try pinging them tomorrow morning.
<_d0t> it's night time here in europe
<__monty__> _d0t: Channel's been a bit quiet lately. I assume they're busy with other work.
<_d0t> would it make sense to create an issue on github instead, maybe?
<__monty__> I'm sure that'd be fine. If nothing else this is something that should probably be documented.
<_d0t> or maybe even a pull request that would make haskell.nix respect nix packages listed in stack.yaml :D
<__monty__> I actually think this might be worth a custom solution because including .git in the src is blegh.
<__monty__> _d0t: I think *that* would definitely be appreciated. The mantra basically is "If it works in cabal/stack it should work with haskell.nix."
<_d0t> ok
<_d0t> there's a cabal package with basically the same code as we have (I'm wondering why we don't use it!) and it also doesn't work properly
<_d0t> if you dig through the code, it calls git from TH code
<__monty__> Yeah it's popular to include git info in development versions and stuff. Including the repo stuff in the src kinda sucks though because any git action you'd do would cause a rebuild ; /
<_d0t> true. But then again, we don't use haskell.nix for development. Only for CI builds. I assume others follow the same approach.
<__monty__> Then it's less painful yeah. I do use it for my development environment.
<_d0t> also you could decrease the build time if your code is mostly libraries and the executable is just main. That way, if gitrev changes, only it and exes would get a rebuild.
__monty__ has quit [Quit: leaving]
_d0t has quit [Ping timeout: 246 seconds]