Spago 0.20.7 not producing output directory for PureScript 0.14.7

I have recently upgraded a project from 0.13.8 to 0.14.7. I also upgraded spago to 0.20.7. (Not all of the libraries I used are available for 0.15 yet.) I’m on Windows 10.

After the upgrade, spago build no longer creates the output directory, nor any of the files that should be contained there. I’m not sure what I can do to debug this, even -V doesn’t include much information. I’m a PureScript and Haskell beginner, debugging this myself would be pretty tough. The only thing out of the ordinary I’m using is a local forked copy of one purescript library, purescript-crypto.

I can make my source available if anybody wants to investigate. It’s currently in a private github repository although it doesn’t contain any proprietary information yet.

Here’s the output from spago build -V:

2022-05-26 02:38:15.524882: [debug] Running `getGlobalCacheDir`
@(src\Spago\RunEnv.hs:56:11)
2022-05-26 02:38:15.687883: [debug] Transformed config is the same as the read one, not overwriting it
@(src\Spago\Prelude.hs:294:20)
2022-05-26 02:38:15.735882: [debug] Ensuring that the package set is frozen
@(src\Spago\Prelude.hs:294:20)
2022-05-26 02:38:15.763883: [debug] Getting transitive deps
@(src\Spago\Prelude.hs:294:20)
2022-05-26 02:38:15.769883: [debug] Running `fetchPackages`
@(src\Spago\Prelude.hs:294:20)
2022-05-26 02:38:15.769883: [debug] Checking if `purs` is up to date
@(src\Spago\Prelude.hs:294:20)
2022-05-26 02:38:15.917885: [debug] Running `getMaybeGraph`
@(src\Spago\Prelude.hs:294:20)
2022-05-26 02:38:15.917885: [debug] Getting module graph with "purs"
@(src\Spago\Prelude.hs:294:20)
2022-05-26 02:38:16.707887: [debug] Running in `BuildEnv`
@(src\Spago\Prelude.hs:294:20)
2022-05-26 02:38:16.707887: [debug] Running `spago build`
@(src\Spago\Prelude.hs:294:20)
2022-05-26 02:38:16.708889: [debug] Getting transitive deps
@(src\Spago\Prelude.hs:294:20)
2022-05-26 02:38:16.709889: [debug] Compiling with "C:\\Users\\jsparkes\\AppData\\Roaming\\npm\\psa.cmd"
@(src\Spago\Prelude.hs:294:20)
2022-05-26 02:38:16.709889: [debug] Running command: `C:\Users\jsparkes\AppData\Roaming\npm\psa.cmd  ".spago/aff/v6.0.0/src/**/*.purs" ".spago/affjax/v12.0.0/src/**/*.purs" ".spago/ansi/v6.1.0/src/**/*.purs" ".spago/argonaut/v8.0.0/src/**/*.purs" ".spago/argonaut-codecs/v8.1.0/src/**/*.purs" ".spago/argonaut-core/v6.0.0/src/**/*.purs" ".spago/argonaut-generic/v7.0.1/src/**/*.purs" ".spago/argonaut-traversals/v9.0.0/src/**/*.purs" ".spago/arraybuffer-types/v3.0.1/src/**/*.purs" ".spago/arrays/v6.0.1/src/**/*.purs" ".spago/assert/v5.0.0/src/**/*.purs" ".spago/avar/v4.0.0/src/**/*.purs" ".spago/bifunctors/v5.0.0/src/**/*.purs" ".spago/catenable-lists/v6.0.1/src/**/*.purs" ".spago/console/v5.0.0/src/**/*.purs" ".spago/const/v5.0.0/src/**/*.purs" ".spago/contravariant/v5.0.0/src/**/*.purs" ".spago/control/v5.0.0/src/**/*.purs" ".spago/crypto/cryptiv/src/**/*.purs" ".spago/datetime/v5.0.2/src/**/*.purs" ".spago/distributive/v5.0.0/src/**/*.purs" ".spago/effect/v3.0.0/src/**/*.purs" ".spago/either/v5.0.0/src/**/*.purs" ".spago/enums/v5.0.0/src/**/*.purs" ".spago/exceptions/v5.0.0/src/**/*.purs" ".spago/exists/v5.1.0/src/**/*.purs" ".spago/fixed-points/v6.0.0/src/**/*.purs" ".spago/foldable-traversable/v5.0.1/src/**/*.purs" ".spago/foreign/v6.0.1/src/**/*.purs" ".spago/foreign-generic/v11.0.0/src/**/*.purs" ".spago/foreign-object/v3.0.0/src/**/*.purs" ".spago/fork/v5.0.0/src/**/*.purs" ".spago/form-urlencoded/v6.0.2/src/**/*.purs" ".spago/formatters/v6.0.0/src/**/*.purs" ".spago/free/v6.2.0/src/**/*.purs" ".spago/functions/v5.0.0/src/**/*.purs" ".spago/functors/v4.1.1/src/**/*.purs" ".spago/gen/v3.0.0/src/**/*.purs" ".spago/http-methods/v5.0.0/src/**/*.purs" ".spago/httpure/v0.14.0/src/**/*.purs" ".spago/identity/v5.0.0/src/**/*.purs" ".spago/integers/v5.0.0/src/**/*.purs" ".spago/invariant/v5.0.0/src/**/*.purs" ".spago/js-date/v7.0.0/src/**/*.purs" ".spago/js-timers/v5.0.1/src/**/*.purs" ".spago/js-uri/v2.0.0/src/**/*.purs" ".spago/lazy/v5.0.0/src/**/*.purs" ".spago/lcg/v3.0.0/src/**/*.purs" ".spago/lists/v6.0.1/src/**/*.purs" ".spago/math/v3.0.0/src/**/*.purs" ".spago/maybe/v5.0.0/src/**/*.purs" ".spago/media-types/v5.0.0/src/**/*.purs" ".spago/mmorph/v6.0.0/src/**/*.purs" ".spago/newtype/v4.0.0/src/**/*.purs" ".spago/node-buffer/v7.0.1/src/**/*.purs" ".spago/node-fs/v6.2.0/src/**/*.purs" ".spago/node-fs-aff/v7.0.0/src/**/*.purs" ".spago/node-http/v6.0.0/src/**/*.purs" ".spago/node-net/v2.0.1/src/**/*.purs" ".spago/node-path/v4.0.0/src/**/*.purs" ".spago/node-streams/v5.0.0/src/**/*.purs" ".spago/node-url/v5.0.0/src/**/*.purs" ".spago/nonempty/v6.1.0/src/**/*.purs" ".spago/now/v5.0.0/src/**/*.purs" ".spago/nullable/v5.0.0/src/**/*.purs" ".spago/numbers/v8.0.0/src/**/*.purs" ".spago/options/v6.0.0/src/**/*.purs" ".spago/ordered-collections/v2.0.2/src/**/*.purs" ".spago/orders/v5.0.0/src/**/*.purs" ".spago/parallel/v5.0.0/src/**/*.purs" ".spago/parsing/v8.4.0/src/**/*.purs" ".spago/partial/v3.0.0/src/**/*.purs" ".spago/payload/v0.4.0/src/**/*.purs" ".spago/pipes/v7.0.1/src/**/*.purs" ".spago/prelude/v5.0.1/src/**/*.purs" ".spago/profunctor/v5.0.0/src/**/*.purs" ".spago/profunctor-lenses/v7.0.1/src/**/*.purs" ".spago/psci-support/v5.0.0/src/**/*.purs" ".spago/quickcheck/v7.1.0/src/**/*.purs" ".spago/random/v5.0.0/src/**/*.purs" ".spago/record/v3.0.0/src/**/*.purs" ".spago/refs/v5.0.0/src/**/*.purs" ".spago/safe-coerce/v1.0.0/src/**/*.purs" ".spago/simple-json/v8.0.0/src/**/*.purs" ".spago/spec/v5.0.1/src/**/*.purs" ".spago/st/v5.0.1/src/**/*.purs" ".spago/strings/v5.0.0/src/**/*.purs" ".spago/stringutils/v0.0.11/src/**/*.purs" ".spago/tailrec/v5.0.1/src/**/*.purs" ".spago/test-unit/v16.0.0/src/**/*.purs" ".spago/transformers/v5.2.0/src/**/*.purs" ".spago/tuples/v6.0.1/src/**/*.purs" ".spago/type-equality/v4.0.0/src/**/*.purs" ".spago/typelevel-prelude/v6.0.0/src/**/*.purs" ".spago/unfoldable/v5.0.0/src/**/*.purs" ".spago/unicode/v5.0.1/src/**/*.purs" ".spago/unordered-collections/v2.1.4/src/**/*.purs" ".spago/unsafe-coerce/v5.0.0/src/**/*.purs" ".spago/uuid/v8.0.0/src/**/*.purs" ".spago/variant/v7.1.0/src/**/*.purs" ".spago/web-dom/v5.0.0/src/**/*.purs" ".spago/web-events/v3.0.0/src/**/*.purs" ".spago/web-file/v3.0.0/src/**/*.purs" ".spago/web-html/v3.2.0/src/**/*.purs" ".spago/web-storage/v4.0.0/src/**/*.purs" ".spago/web-xhr/v4.1.0/src/**/*.purs" "src/**/*.purs" "test/**/*.purs"`
@(src\Spago\Prelude.hs:294:20)
2022-05-26 02:38:17.152891: [info] Build succeeded.
@(src\Spago\Prelude.hs:295:19)

this looks good - maybe it’s the compiler itself - could your try something like

purs compile .spago/prelude/v5.0.1/src/**/*.purs -v

and see what this produces (if you have a output folder remove it first just to make sure).
You might have to replace purs with purs.cmd on Windows - not sure to be honest


PS: could you include the versions of spago, psa and purs you are using (should be queryable with spago --version, psa --version, purs --version)

Running that command produces files in output as expected. Compiling my own sources produces some errors, which spago doesn’t complain about.

It seems that either psa doesn’t support --version, or something is wrong with it. I don’t know what it does, so I don’t know how to test it separately.

F:\src\purescript\mindserver-ps>purs --version
0.14.7

F:\src\purescript\mindserver-ps>psa --version

F:\src\purescript\mindserver-ps>spago --version
0.20.7

I guess psa is corrupted or something

You don’t actually need it and should be able to compile with spago build -P


PS: it’s probably simplifying too much but basically PSA gives you nicer output around the output the compiler produces - see here

Aha! Apparently I had installed a npm package named psa when what I really wanted was purescript-psa. I wonder if spago could be enhanced to detect that. It currently doesn’t even detect when there is no psa command installed.

Thanks for the help!

1 Like

I honestly don’t know but I think it does check (I used to not install psa and it was never an issue for me - spago used purs) - I’ll try to find out

it should do - I guess something did go wrong because of the installed npm-package - see for example this issue here - maybe you can report it to spago?

ok seems the psa npm-package includes a binary - so I think there is really nothing spago could do here aside from trying to call psa --version or something and parse the result - IMHO not worth as this package seems not really widely used.

Maybe there should be some warning/message pointing to purescript-psa though ?

I agree that the overhead of running psa --version for each build it not worth it. Hopefully anyone else who runs into this problem will find this message thread.

We do have a migration guide for 0.13.x to 0.14.x: documentation/0.14-Migration-Guide.md at master · purescript/documentation · GitHub

Is there anything in there that might help? For example, did you update purescript-psa to 0.8.2? In the 0.13 to 0.14 migration, content that was previously written to stdout was changed to stderr. Not sure if this affects you, but might be something to consider.

The problem was that I had done “npm install -g psa” instead of “npm install -g purescript-psa”. It had created a command names psa which didn’t do what spago expected. Perhaps the command could also be created with the name purescript-psa.cmd and spago could prefer that one to avoid any confusion. The psa command should be kept as well since users are accustomed to it.