Closed ejoubaud closed 7 years ago
I agree this is not ideal, but I'm not sure about your suggestions. Some observations:
pulp init
continues to generate sensible project skeletons, and more importantly, that we can get situations where older versions of pulp cannot be comfortably used with newer compilers even if the compiler CLI hasn't changed.I think the real fix is to get libraries to declare which compiler versions they support, and to take that into account in pulp/psc-package.
Is there a workaround for getting this stuff to work without downgrading? If so, could this be mentioned in the Getting Started Guide docs? This was my first time trying PureScript and I immediately had to start shaving yaks.
I wouldn't really call it a workaround; the situation right now is basically that certain versions of libraries only work with certain compiler versions, and for now you have to manually ensure that you're using versions which match up. I expect most libraries will need to be updated for 0.11, in fact, so for now you're best off sticking to 0.10.7, especially if you're new to purescript.
Well even if it isn't a workaround, something needs to change on that doc page so that following the instructions there doesn't result in:
Conflicting definitions are in scope for kind Effect from the following modules:
Control.Monad.Eff
Prim
A user who is following the getting started docs is not equipped to understand or resolve this error message.
I expect most libraries will need to be updated for 0.11, in fact, so for now you're best off sticking to 0.10.7
Problem is atm pulp init
doesn't give you a working project out of the box if you're on 0.10.7, and the error message on pulp run
or pulp psci
is not helpful.
Valid points though, I can't think of a good solution, out of the libraries controlling for the versions of purescript they're incompatible with, either through some dependency manager mechanism or a more helpful compile-time error message :(
I think the real fix is to get libraries to declare which compiler versions they support, and to take that into account in pulp/psc-package.
This would be nice indeed, but I guess it will be quite some work?
Maybe it's an idea to split off bower.json
(and possibly other templates) into a separate repository and maintain templates per compiler version in that repos? Then on pulp init
it can check which psc
version is active & generate according to this version by default (possibly with an option to set it explicitly to change the default).
This is definitely a big problem right now. I believe psc-package
will help out a lot with solving this problem, but it's not quite ready for mainstream use yet.
Would it be possible to use a snapshsot based approach like stackage to provide a consistent set of compiler+packages?
Yes, that's exactly what we're trying to work towards with psc-package. I want to integrate pulp with psc-package eventually but it's a fairly big job and I won't be able to find the time during the semester.
Great to hear!
It's late, so my comment might not be too helpful but I am one of those beginners. Just wanted to check out PSC real quick and the first wall I hit was about the aforementioned
Conflicting definitions are in scope for kind Effect from the following modules:
Instead of downgrading things I just did
yarn add global purescript@next
Now purs compile Main.purs
from the tutorial gave me something about Control.Monad.Eff.Console
not found. Somehow I arrived at the conclusion that a yarn add purescript-console
was necessary but in PSC land that should be bower ...
and now it's still
Module Control.Monad.Eff.Console was not found.
~Back to Elm because why bother.~ I'm sorry, I'm grumpy. I'm going to go to bed now and I am sure there is a solution that I just don't see right now due to me being a total beginner and it being past midnight.
o/
@cideM I'm very sorry you had a rough time.
PureScript is normally quite stable, but you started at a really bad time, because right now we are in the middle of releasing PureScript 0.11, which breaks a lot of things.
Within a couple of days things should settle down and everything will be stable again for a while. And after psc-package
becomes the de-facto way to use libraries, this problem won't happen again.
I am sure things will stabilize soon and you already helped me greatly in Gitter :) so I'll definitely not give up because of a minor hiccup. Thanks for the reassurance
Closing because it doesn't really make sense to track this here, it's a much wider issue than just pulp, and also because the specific issue described no longer happens because all of the tooling now works with psc 0.11 by default.
Hello, purs 0.12.0, exactly this problem, but I don't know what versions should I use. My bower.json is like this:
"dependencies": {
"purescript-prelude": "^4.0.0",
"purescript-console": "^4.1.0"
},
"devDependencies": {
"purescript-psci-support": "^4.0.0"
}
When I try to run pulp build I get the following errors:
Error 1 of 2:
in module Main
at src/Main.purs line 4, column 1 - line 4, column 31
Module Control.Monad.Eff was not found.
Make sure the source file exists, and that it has been provided as an input to the compiler.
Meta:
$ pulp -v ‹ruby-2.3.0›
Pulp version 12.2.0
purs version 0.12.0 using /usr/local/bin/purs
There is no pulp
release for 0.12 yet, so you're stuck with either making sure you download purs
0.11.x, or not relying on the auto-generated files. When #340 gets merged, pulp init
should auto-detect compiler version and generate the correct project files.
What do you recommend ? Now I have a project bootstraped with 0.12.0 ready to start learning. Will be hard to migrate once it is released ? Which will be better in terms of learning the language ? Maybe using the latest version does not pay off in terms of frustration.
@danielo515 delete your dependencies, kill bower_components
, and re-add them at the appropriate version for compiler 0.12. I believe the point here is that the auto-generated files aren't suitable, so it's a matter of replacing them. You could even copy them from https://github.com/purescript-contrib/pulp/pull/340
If you already have your project up and running, I don't believe you will have any issue upgrading pulp once the new version is released - by that time you won't need the auto-generated files.
Hello @LiamGoodacre
The thing is that I'm following the PureScript by Example book, and all examples are targeted at version 0.11.x so I ended installing and using that purescript version.
Thanks for your comment anyway
well I'm stuck with the same problem. just wanted to start with purescript but its not working. how do I know which versions of purescript, pulp and the dependencies in bower are working together?
Another +1, following the Getting Started docs for me on Node 8 + OSX results in Module Control.Monad.Eff.Console was not found.
Steps to reproduce:
npm install -g purescript
npm install -g pulp bower
pulp init
bower install purescript-lists --save
pulp build
If anyone wants to follow my steps this should work, at least today:
npm i -g pulp bower purescript@0.11.x
pulp init
However, choosing the libraries from bower is veery tricky. Some of them are on the 4.x which corresponds to PS 0.12, while for some others the version for 0.12 is the library on 5.x The only solution is to install, try, see if it fails, delete bower_components (I hate bower) and install one version less, then REPEAT
I just had quite the struggle getting Pulp to run on my OSX machine with npm. Following the installation instructions from the readme, I would run:
and consistently get this error:
Turns out the problem was with the dependencies versions in the
bower.json
generated bypulp init
:Those dependencies were all just upgraded 2 days ago to
3.0.0
for Purescript 0.11 and pulp init bower-installs them with unpinned versions. Butnpm install -g purescript
still only installs purescript0.10.7
, which I guess is incompatible with the latest version of those deps versions and causes the crash.I was able to fix this by downgrading the dependencies, removing
bower_components
and running a newbower install
:I guess this will somewhat sort itself when purescript 0.11 gets released to npm, but it still reveals a dependency management crack that will cause issues (e.g. with people installing pulp on an old purescript version) and can be quite the turn-off for newcomers. Here are a few options I can think to help resolve this in the future:
bower install
calls inpulp init
to only install the same versions ofpurescript-prelude
andpurescript-console
as in pulp's own bowerfile.bower install -g purescript
line.I guess option 1 is the one that makes most sense to me as the root issue here isn't that pulp isn't compatible with 0.11 but rather that
gulp init
generates a bower.json with unpinned versions that end up incompatible with 0.10.x.