issue when updating neuron - Neuron

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

felko

I'm having trouble when updating neuron with the latest master. I'm not sure but I would say it's the same problem as https://github.com/srid/neuron/issues/174
Pulling master and running nix-env -if . takes forever, I think it's compiling the entire haskell platform (GHCi, GHC, Cabal, etc...)
I'm building from the default.nix (not shell.nix as in the issue) and the srid cachix was updated so I don't know why it's rebuilding everything

Using your cachix instance, I can build the neuron package without having to rebuild ghc and many other things, and that's great! However, if I want to hack on neuron using shell.nix, then I en...
Sridhar Ratnakumar

Did it download anything from cachix? Did you try running cachix use srid once more?

felko

yeah i tried, didn't seem to change anything
I don't know if something was actually downloaded from cachix though, and i have no way to check because the build is like 6 hours in so the information is
gone by now

Sridhar Ratnakumar

wow, 6 hours? Did it complete in the end? What's your cpu/memory?

Sridhar Ratnakumar

I'll test this from a fresh Ubuntu VM later. Oh, and let me know your nix version as well. nix-env --version. as well as cat /etc/*release

Sridhar Ratnakumar

Wait, are you on mac? @felko Maybe that was it. The new CI I have runs only on Linux.

Sridhar Ratnakumar

I use https://hercules-ci.com/ now; and I can provision my dusty old 2014 macbook to act as mac CI agent.

felko

its still building lol

felko

it finished building GHC and the entire haskell platform from source

felko

its building the libraries now

felko

i think its close to compiling neuron finally

Sridhar Ratnakumar

fwiw, reflex-platform's cache could shave the bulk of that time (including GHC). i didn't document it, because the neuron cache should include all of that.

Sridhar Ratnakumar

If you are just getting started on building the libraries, it might be another 2 hours :-P

Sridhar Ratnakumar

/me started building on his macOS, so that when it completes he can do a manual push to cachix

felko

i'm going to let the build finish anyway, it's quite impressive to see nix compile all of this from almost nothing

felko

its satisfying to watch

felko

but yeah documenting the installation with reflex cache might be a good idea

Sridhar Ratnakumar

if neuron cache is fixed, we won't need reflex cache.

Sridhar Ratnakumar

and ... now i'm worried about Windows users. i think they are fucked haha. Don't know how you can setup cache for WSL

Sridhar Ratnakumar

Oh wait, WSL uses ubuntu. So it should work

felko

neuron is finally building!

felko

it just started downloading from srid.cachix.org

felko

no idea

installing 'neuron-0.5.0.0'
copying path '/nix/store/s2087q37b1fg7ff66gkzifq0sy9xpryk-6d2174b2bdc5aff9064795555e23ff318cb00ff6.tar.gz' from 'https://srid.cachix.org'...
felko

can I do nix-collect-garbage afterwards?

felko

to remove the old neuron builds

Sridhar Ratnakumar

if you want some free space, then yea - nix-collect-garbage --delete-older-than.

Sridhar Ratnakumar

i was looking into caching the executable itself, so your nix install completes in like 10 seconds. but couldn't get it to work. see https://github.com/srid/neuron/blob/master/project.nix#L78-L90

Haskell meets Zettelkasten, for your plain-text delight. - srid/neuron
Sridhar Ratnakumar

(and you don't need the haskell dependencies, even to keep in the nix store)

Sridhar Ratnakumar

Fucking hell, macOS stinks

felko

you know, its still building, when i said "neuron is finally building" actually it had to install all (transitive) dependencies first

felko

i see that some libraries are built multiple times

felko

i've seen pandoc and reflex multiple times during the build

felko

ok, about 12h of build for this:

building '/nix/store/5qlmnbqhmjmp4ws5za018plvzfvm98zq-user-environment.drv'...
error: packages '/nix/store/zdp0wqp6v6jc0i0rswar043hzn41avz5-neuron-0.5.0.0/lib/links/libHSansi-terminal-0.9.1-KAtSkkD7GHFKoP9eT8kWXE-ghc8.6.5.dylib' and '/nix/store/wbyqvj2f2ab1zv50z2ckrc52hm9l5rb6-ormolu-0.0.3.1/lib/links/libHSansi-terminal-0.9.1-KAtSkkD7GHFKoP9eT8kWXE-ghc8.6.5.dylib' have the same priority 5; use 'nix-env --set-flag priority NUMBER INSTALLED_PKGNAME' to change the priority of one of the conflicting packages (0 being the highest priority)
builder for '/nix/store/5qlmnbqhmjmp4ws5za018plvzfvm98zq-user-environment.drv' failed with exit code 1
error: build of '/nix/store/5qlmnbqhmjmp4ws5za018plvzfvm98zq-user-environment.drv' failed
felko

i don't know if that's what i should do but nix-env --set-flag priority 0 neuron worked

TheMatten

Wow, sorry for being out of loop, but why it takes so long to build?

felko

no idea, i think the cachix didn't include the new dependencies and for some reason I had to build GHC and the entire haskell platform from source (i think that's what happened)

felko

also my machine is a 2017 macbook air on which i was running other resource consuming things parallel to the build

Nadrieril

I think it used to use things that were in the default nixos cache, but moving to reflex made it depend on a more recent GHC

Sridhar Ratnakumar

Because I migrated from Github Actions to Hercules. Actions has a 6h limit I think. And it is slow. With hercules I run CI on my own machine, which is Linux. So we have only Linux cache. I'm currently setting up a mac builder for hercules.

Sridhar Ratnakumar

For now, if anyone is looking to build neuron on mac - setup reflex-platform cache using these instructions https://github.com/obsidiansystems/obelisk#installing-obelisk ... it'll cut down build time from 12 hrs to 4hs (or around that ratio).

Obelisk provides an easy way to develop and deploy your Reflex project for web and mobile - obsidiansystems/obelisk
Sridhar Ratnakumar

felko said:

i don't know if that's what i should do but nix-env --set-flag priority 0 neuron worked

I remember doing that once. I have no idea what's causing it. But somehow it seems to me that making an executable-only derivation may fix it.