Closed sjmackenzie closed 7 years ago
I have also noticed some obscure performance with this system, though nothing nearly that bad. I haven't really tried to debug it, so I honestly have no idea what the problem is. I don't think it's psc
, since that seems to perform fine elsewhere usually.
Oh interesting, firstly, let me understand how you invoke the system, so that I can incrementally understand this problem.
Do you just nix-build
the system? Or nix-build -A xxx
?
I have a relatively beefy machine so I'm quite surprised to see it completely lockup.
Also it doesn't die immediately, I get to the point of calling like 4~6 (forgot) psc
instances then after about a minute everything locks up.
I just do nix-build
. It should call psc
once for each package. More than that is unexpected.
okay I've managed to cut back everything ensuring there's enough memory so it doesn't fall over.
I'll do a time nix-build
and post the results in a bit.
Ah I \<ctrl-c>'ed it
$ time nix-build
these derivations will be built:
/nix/store/93gg6lrd0a4gyq1bxh1yq1r7bzyj93qn-purescript-prelude-2.1.0.drv
/nix/store/dfp2a7v28mkmsaw4rzfwyk8pqvkv0m54-purescript-eff-2.0.0.drv
/nix/store/qii8g746kprz13d5yj96aiqkp8v3hn12-purescript-console-2.0.0.drv
/nix/store/a3icr8ss8wzfxsb5x20plbr0f80c7jj1-purescript-mine-0.1.0.drv
building path(s) ‘/nix/store/qb1h7s7wbs3sp1y38gfx9bm0idnsk2y9-purescript-prelude-2.1.0’
building
^Cerror: interrupted by the user
real 39m44.252s
user 0m0.656s
sys 0m0.071s
Something is very wrong here, I'm very surprised you didn't get a similar actual behaviour.
I'm going to try fiddle with different versions of psc
to see what happens.
Well it definitely seems to be psc
falling over. echo
s before and after reveal it to be the case.
But other than this, I really appreciate the beautiful nix code. Nice job!
Would you mind doing a time nix-build
on your system please?
So I let the thing go over night, here's the details:
$ time nix-build
these derivations will be built:
/nix/store/vvn7plxp6bsz4n5zqq5w1zb86q85z81g-purescript-prelude-v2.1.0.drv
/nix/store/xwqdqcirwd9fmgrs7l1x7w1ssx39p6af-purescript-eff-v2.0.0.drv
/nix/store/zlqj6caqyz6ididvhc24xkzx1i18f59c-purescript-console-v2.0.0.drv
/nix/store/s6ww8c1zwxmyxsn9k1bzxj0r0va0ris7-purescript-mine-0.1.0.drv
building path(s) ‘/nix/store/l8f35irz9lcqb7psni1an5dp82s64nnl-purescript-prelude-v2.1.0’
building
Compiling Data.NaturalTransformation
Compiling Control.Semigroupoid
Compiling Data.Boolean
Compiling Data.Show
Compiling Control.Category
Compiling Data.Void
Compiling Data.Unit
Compiling Data.Function
Compiling Data.Semiring
Compiling Data.HeytingAlgebra
Compiling Data.Eq
Compiling Data.Semigroup
Compiling Data.Functor
Compiling Data.Ring
Compiling Data.Ordering
Compiling Data.BooleanAlgebra
Compiling Data.Ord.Unsafe
Compiling Data.CommutativeRing
Compiling Control.Apply
Compiling Data.Ord
Compiling Data.EuclideanRing
Compiling Data.Field
Compiling Control.Applicative
Compiling Control.Bind
Compiling Data.Bounded
Compiling Control.Monad
Compiling Prelude
installing
building path(s) ‘/nix/store/raxhy0vwsxvgcs6pd5xs2grfh8g7mprs-purescript-eff-v2.0.0’
building
^[^[Compiling Control.Monad.Eff
Compiling Control.Monad.Eff.Class
Compiling Control.Monad.Eff.Unsafe
installing
building path(s) ‘/nix/store/kmbi21zkswjzirqciasiaqrsac1zx4ns-purescript-console-v2.0.0’
building
^[Compiling Control.Monad.Eff.Console
installing
building path(s) ‘/nix/store/4mp9m1vhrw190dfn3fj5pc5khlr3gg9w-purescript-mine-0.1.0’
building
Compiling Main
installing
/nix/store/4mp9m1vhrw190dfn3fj5pc5khlr3gg9w-purescript-mine-0.1.0
real 265m53.532s
user 0m0.747s
sys 0m0.100s
Note I ran your purescript2nix haskell application before hand.
I've pinged upstream about this: https://github.com/purescript/purescript/issues/2598
As determined in that other thread, this appears to be specific to your environment. Anyone should feel free to reopen this issue should this prove to be a problem with purescript-modules
in some way.
Also, FYI, I'm likely to move this repository to that name: purescript-modules
, or something like that.
Yes good!
Might I suggest creating an organization to host purescript-modules
? I suspect this could easily become the defacto language level package manager for purescript, should it be well maintained, that is!
Again, thank you kindly for your assistance.
I actually think this should land in nixpkgs
eventually. Basically, as soon as the precompiling issue with psc
is resolved, I'll start thinking about making that happen.
I would like to see this become the defacto dependency manager for PureScript, but I don't think that will happen because Nix doesn't work on Windows, and it would require a fairly featureful and friendly front end interface so that people don't have to learn the bohemeth that is Nix.
nixpkgs
; Please consider that the purescript community might be moving the index forward fast. Nix maintainers can take a very long time to merge code. This will be a drag for the purescript community, so what might be possible is keep the index in a separate repo, but get nixpkgs to reference the index. That way you can keep the dynamism of a fast moving index, with a more general stabilization points for nixpkgs, allowing fast movers to reference your index directly. -L
flags, that would be very nice to have indeed! Yea, nixpkgs
may be too slow. It certainly wouldn't be hard to have an independent release series, like lts
in Stack.
npm
is not an example of a nice front end =P All I meant was that requiring users to install Nix and write Nix expressions to use PureScript sounds like a problem. If we could have a decent command line tool to hide these things for those who don't want them, that'd be good, as long as it allows people to drop into Nix directly whenever they want. Without that, I'm afraid this stuff will only be useful to the Nix enthusiasts.
Probably but you can get away with a lot, say for example, you strip down the requirements for a project to a single configuration file that looks something like this:
{ psmod, psmods, npms }:
psmod {
src = ./.;
psmods = with psmods; [ purescript_halogen ];
npms = with npms; [ leftpad ];
}
The above default.nix
will replace every configuration file.
That's no more intimidating than any other config file. Quite possibly there is plenty of millage there!
(Inspiration is derived from a project I contribute to )
It has been renamed
Interestingly enough when bumping this: https://github.com/ElvishJerricco/nix-purescriptPackages/blob/master/nixpkgs/github.json#L4 to this: https://github.com/NixOS/nixpkgs-channels/commit/20eac78ccbc1f8896da75c3596ce23fe649dd46d
I get this:
real 0m16.894s
user 0m26.151s
sys 0m25.387s
installing
building path(s) ‘/nix/store/hrka4b8bflwk90gxclvbbxvibrrgi1mz-purescript-eff-v2.0.0’
building
Compiling Control.Monad.Eff
Compiling Control.Monad.Eff.Class
Compiling Control.Monad.Eff.Unsafe
real 0m21.484s
user 0m41.461s
sys 0m41.964s
installing
building path(s) ‘/nix/store/k3927p99gxw9dscyylmq8sdiqb7fnr3x-purescript-console-v2.0.0’
building
Compiling Control.Monad.Eff.Console
real 0m32.422s
user 1m2.498s
sys 1m5.681s
installing
building path(s) ‘/nix/store/aax2jn23k1x8i0gdsxlplaqip94sfbk9-purescript-mine-0.1.0’
building
Compiling Main
real 1m21.095s
user 2m11.800s
sys 1m38.463s
installing
/nix/store/aax2jn23k1x8i0gdsxlplaqip94sfbk9-purescript-mine-0.1.0
Very hopeful project, keep this ball rolling!
After git cloning on nixos and running
nix-build
My system locks up, completely non-responsive, all 8 cores nearly hit 100% and all of my 8 gigs of memory is used.