Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Chapter 2 - Testing Code Using the Interactive Mode #81

Closed
p2327 opened this issue Apr 14, 2020 · 12 comments
Closed

Update Chapter 2 - Testing Code Using the Interactive Mode #81

p2327 opened this issue Apr 14, 2020 · 12 comments

Comments

@p2327
Copy link

p2327 commented Apr 14, 2020

After following the step up to the secion Testing Code Using the Interactive Mode, executing
$ spago repl will throw:

purs repl: PSCi requires the psci-support package.
For help getting started, visit https://github.com/purescript/documentation/blob/master/guides/PSCi.md
spago: callCommand: purs repl ".spago/console/v4.4.0/src/**/*.purs" ".spago/effect/v2.0.1/src/**/*.purs" ".spago/prelude/v4.1.1/src/**/*.purs" ".spago/psci-support/v4.0.0/src/**/*.purs" "src/**/*.purs" "test/**/*.purs"  (exit 1): failed

Please add current instructions to load the psci-support package, like so:

spago install psci-support

This code was written on MacOSX Mojave 10.14.6 using:

  • spago==v0.14.0.0
  • purs==v0.13.6
  • npm==6.14.4
@hdgarrood
Copy link

This is strange - an explicit spago install psci-support shouldn't be necessary, especially since psci-support already appears to be listed in the dependencies section in exercises/chapter2/spago.dhall.

@JordanMartinez
Copy link

So, funnily enough, if one just runs spago repl in a directory that doesn't have a spago.dhall file in it, this will work fine.

However, if one runs spago init and then spago repl, it will produce this error because a spago install was never ran. Thus, while it may be listed as a dependency, psci-support is never installed into that local folder, so that spago repl can function correctly.

@hdgarrood
Copy link

Interesting, good find! Perhaps spago repl should ensure that all dependencies are installed before attempting to start the repl, then?

@JordanMartinez
Copy link

It should only if a spago.dhall file exists in the directory in which it runs. Otherwise, it should work as it currently does when there isn't such a file.

@JordanMartinez
Copy link

There's already an issue for this, but it doesn't quite address this particular problem: purescript/spago#550

@hdgarrood
Copy link

I opened purescript/spago#611

@hdgarrood
Copy link

This is apparently a bug in spago which should be fixed as of the next release.

@JordanMartinez
Copy link

This bug no longer appears if one uses Spago v0.15.2.

To close this, we should update the repo to use that version of Spago in its instructions. However, the Spago release is a breaking change, so I don't know whether that would be problematic in other areas.

@hdgarrood
Copy link

The only breaking change is the removal of an obscure CLI flag which I doubt this repo was using, so I think updating will be fine.

@milesfrain
Copy link
Member

To close this, we should update the repo to use that version of Spago in its instructions.

Do we need to specify specific tool versions?
Any reader who runs the suggested:

npm install -g spago

will get the latest version (0.15.2 currently).

https://book.purescript.org/chapter2.html#installing-tools

@hdgarrood
Copy link

Yeah, I'd be tempted to just leave this. I think asking people to try updating their tools if things go wrong is the correct approach in general.

@JordanMartinez
Copy link

Do we need to specify specific tool versions?

At one point, I didn't specify the version of tools in my learning repo. Then, breaking releases were made that messed up a number of the commands I listed. So, I think it's better to list a specific tool version. That way, one can ensure that entire repo is updated before upgrading.

However, some tools (e.g. Spago) are more mature now than when I made that decision. So, I don't know whether that's really desirable at this point either.

Regardless, I don't think we should specify tool versions until it becomes an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants