nwolverson / atom-ide-purescript

Atom package for PureScript build, completion, etc support
https://atom.io/packages/ide-purescript
MIT License
115 stars 17 forks source link

Error running build - Spago + language release problem? #201

Closed JordanMartinez closed 5 years ago

JordanMartinez commented 5 years ago

Problem

I started getting this issue after I switched to using Spago and a newer PS release came out. I later switched to a new computer and still get the same problem.

After opening a project, I run the build command and get the following error message:

Error running build: Nothing : (Just "/home/user/path/project/")
PureScript (purescript-language-server) /home/user/path/project/

I cannot figure out where that error message appears in the code.

Workarounds

Environment info

# Main programs
node: v10.15.3
npm: 6.9.0
purs: 0.12.5
spago: 0.7.5.0
dhall-to-json: 1.2.7

# Atom specifically
Atom    : 1.36.1
Electron: 2.0.18
Chrome  : 61.0.3163.100
Node    : 8.9.3

# Atom packages
atom-ide-ui: 0.13.0
ide-purescript: 0.25.0
language-purescript: 0.9.0

# build command used
spago build -- --json-errors

# OS
Linux Mint 19.1

(Other unrelated content below)


For more context, I sometimes have my learning repo opened at its root directory:

root
- spago project
-- src
-- test
- spago project
- etc...

I open an individual spago project when I need the code completion and whatnot. I'm not sure whether this affects things or not.

JordanMartinez commented 5 years ago

Update: not sure why this seems to work, but if I edit a .purs file, save it, and then build the project, things work fine.

nwolverson commented 5 years ago

If anything needs to change on upgrading compiler version, I'd thought it was rm -rf output/*

I'd expect opening a project at the root directory to not give completion etc, but not particularly screw things up - actually what you can do is add the spago project as a workspace folder (and move it above the root folder) to have everything open at once with IDE support, I use things like this regularly.

If you are seeing inconsistent behaviour, are there multiple versions of purs available perhaps, eg one from npm somewhere? If you are ending up using different versions from the plugin, from command line, from build etc things may get weird

JordanMartinez commented 5 years ago

On this computer, I only have 0.12.4 installed.

I just nuked the output folder to ensure that wasn't causing an issue. However, the issue still arises.

I also opened a project where the project structure is what one would expect in a Spago-based project.

I've found that this workaround is always reliable:

Perhaps there's a caching issue somewhere?

Note: if I make a file change, save it, and then build (i.e. no failing build attempted before this) then the build will fail. I must first attempt to build the project before the 'save modified file and then build' approach works.

bblfish commented 5 years ago

I had a similar problem. I followed (some of) the instructions on https://qiita.com/kimagure/items/570e6f2bbce5b4724564 and that helped. I was missing psc-package. Perhaps that is the same problem?

JordanMartinez commented 5 years ago

Thanks for the tip @bblfish. I just tried that, but it did not change anything.

JordanMartinez commented 5 years ago

I have another update on this.

First, using my workarounds makes the project build. This means this project is working as expected in at least some situations.

Second, I learned that when I start Atom via the command atom, then this issue arises. However, if I pass it some other flags (e.g. atom -f atom -l atom --enable-electron-logging), then the project builds fine.

So, I think the issue at hand here is something related to Atom, not this project. I'll close this issue for now and edit my original post to link to this comment.

AndrewBrownK commented 5 years ago

I just picked up development after about a month hiatus and ran into this issue. For me this is what solved it:

JordanMartinez commented 5 years ago

Another factor that might be relevant here... I believe I installed Node via nvm on the new computer rather than manually downloading and installing it on my previous one. @AndrewBrownK Did you install node through that manner as well?

JordanMartinez commented 5 years ago

I know this issue is closed, but I recently ran sudo apt-get purge atom, reinstalled it, and this problem went away. So, perhaps I installed an older version of atom at one time, and created a desktop entry that worked for that version of atom. Then, perhaps they released a newer version of atom and when I upgraded to that version, the desktop entry did not also get updated...?