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

Stack setup failed with error 1 #298

Open
milesfrain opened this issue Jun 17, 2020 · 27 comments
Open

Stack setup failed with error 1 #298

milesfrain opened this issue Jun 17, 2020 · 27 comments

Comments

@milesfrain
Copy link

$ bash /tmp/haskell-vim-now.sh
...
HvnArgs {hvnArgsNoHoogleDb = False, hvnArgsNoHelperBinaries = False}
Setting up GHC if needed...
Stack setup failed with error 1
*** setup_haskell.hs failed with error 1.
*** Aborting...

Adding set -x to the top of the shell script shows that this is the failing command:

stack /home/miles/.config/haskell-vim-now/scripts/setup_haskell.hs

I believe I have all the dependencies:

$ ghcide --version
ghcide version: 0.2.0 (GHC: 8.6.5) (PATH: /home/miles/.local/bin/ghcide) (GIT hash: 0ddc62fb96ada49d660382fbd91835f964c241ef)
$ hlint --version 
HLint v2.1.26, (C) Neil Mitchell 2006-2019
$ hoogle --version
Hoogle 5.0.17.11, https://hoogle.haskell.org/
$ stack ghc -- --version   
The Glorious Glasgow Haskell Compilation System, version 8.8.3

Not sure if it's an issue that ghc can only be launched via stack.

@begriffs
Copy link
Owner

begriffs commented Jun 20, 2020

Maybe the problem is that setup_haskell.hs calls stack internally with a shabang:
https://github.com/begriffs/haskell-vim-now/blob/master/scripts/setup_haskell.hs#L1

So invoking stack /foo/bar/setup_haskell.hs may be redundant? Perhaps the script should be run directly on its own...

I believe @p-alik is familiar with that section of code and may be able to investigate.

@p-alik
Copy link
Contributor

p-alik commented Jun 20, 2020

Installation succeeded on ubuntu 18.04. ghc v8.6.5 is only difference in my environment because installation of 8.8.3 failed despite allow-newer setting with

stack --version
Version 2.3.1, Git revision de2a7b694f07de7e6cf17f8c92338c16286b2878 (8103 commits) x86_64 hpack-0.33

I believe I have all the dependencies

setup_haskell.hs doesn't look for installed helpers. It overrides them heedlessly.

@saniac
Copy link

saniac commented Aug 14, 2020

I also see this error on a more or less clean install of Ubuntu 20.04. Am too much of a noob to diagnose but happy to provide additional info about this system.

@p-alik
Copy link
Contributor

p-alik commented Aug 15, 2020

@saniac, please provide:

@saniac
Copy link

saniac commented Aug 15, 2020

Run in my home directory, I hope that's right.

stack --version
Version 2.3.3, Git revision cb44d51bed48b723a5deb08c3348c0b3ccfc437e x86_64 hpack-0.33.0

stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.8.3

stack setup --verbosity warning

( doesn't produce any output.)

@p-alik
Copy link
Contributor

p-alik commented Aug 16, 2020

Could you try to execute stack setup with --resolver please, which is used by

--resolver lts-14.12

However on a new vagrant box ubuntu/focal64 I can't reproduce the issue:

vagrant@ubuntu-focal:~$ stack setup --resolver lts-14.12 --verbosity warning
vagrant@ubuntu-focal:~$ echo $?
0

@saniac
Copy link

saniac commented Aug 16, 2020

stack setup --resolver lts-14.12 --verbosity warning
(no output)

echo $7
(no output)

My laptop has a fairly new Focal install. I've just checked my bash history to see how I got Haskell and stack set up, in case that's relevant.

I installed the haskell-platform. Then installed haskell-stack. Then executed stack upgrade.

@p-alik
Copy link
Contributor

p-alik commented Aug 17, 2020

echo $7

echo $? prints last command exit status. If it prints 0 there is no issue and you could install by running ~/.config/haskell-vim-now/install.sh,. ~/.config/haskell-vim-now/ created by /tmp/haskell-vim-now.sh.

@saniac
Copy link

saniac commented Aug 17, 2020

Output:

~/.config/haskell-vim-now/install.sh
--> Existing Haskell-Vim-Now installation detected at /home/stephen/.config/haskell-vim-now.
--- Syncing Haskell-Vim-Now with upstream...
Already up to date.
Current branch master is up to date.
--- Installing system packages [libcurl4-openssl-dev] using [APT]...
--- Installing with apt-get...
[sudo] password for stephen:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Skipping libcurl4-openssl-dev, it is already installed and upgrade is not set.
The following packages were automatically installed and are no longer required:
libfprint-2-tod1 python3-cliapp python3-markdown python3-packaging python3-pygments
python3-pyparsing python3-ttystatus
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
--- Checking ctags' exuberance...
--- Setting git to use fully-pathed vim for messages...
--- Backing up current vim config using timestamp 20200817_175158...
/home/stephen/.config/haskell-vim-now/backup/.vim.20200817_175158
/home/stephen/.config/haskell-vim-now/backup/.vimrc.20200817_175158
--- Creating vim config symlinks
~/.vimrc -> /home/stephen/.config/haskell-vim-now/.vimrc
~/.vim -> /home/stephen/.config/haskell-vim-now/.vim
--- Installing plugins using vim-plug...
HvnArgs {hvnArgsNoHoogleDb = False, hvnArgsNoHelperBinaries = False}
Setting up GHC if needed...
Stack setup failed with error 1
*** setup_haskell.hs failed with error 1.
*** Aborting...

@saniac
Copy link

saniac commented Aug 17, 2020

But also:

stack setup --resolver lts-14.12 --verbosity warning

echo $0
/bin/bash

Which is not 0.

I'm just theorising here, but I have bash-it installed. I wonder if something it does is interfering with the shell scripts. I'm just going to uninstall it and see what happens.

@saniac
Copy link

saniac commented Aug 17, 2020

Update: removing bash-it did not make a difference.

@p-alik
Copy link
Contributor

p-alik commented Aug 17, 2020

I couldn't reproduce the issue in any of on default installed shells bash, sh or dash. No issue even with bash-it. Maybe making stack more talkative can help. Please try

echo $SHELL
which stack
set -x
stack setup --resolver lts-14.12 --verbosity debug
echo $?
set +x # to disable set -x

@saniac
Copy link

saniac commented Aug 17, 2020

Output attached.

output.txt

@p-alik
Copy link
Contributor

p-alik commented Aug 17, 2020

That's weird, stack setup --resolver lts-14.12 --verbosity debug exits with 0, but for stack setup --resolver lts-14.12 --verbosity warning with not 0? In this case that's an issue for stack team. Could you check exit code for --verbosity warning one more time please?

@saniac
Copy link

saniac commented Aug 17, 2020

I'm sorry to have wasted your time, I'm an idiot who has not closely read instructions. I've reviewed carefully and realise now that sometimes I was typing "echo $0" not "echo $?".

$? is 0 consistently for both "stack setup --resolver lts-14.12 --verbosity debug" and "stack setup --resolver lts-14.12 --verbosity warning".

@p-alik
Copy link
Contributor

p-alik commented Aug 17, 2020

In this case ~/.config/haskell-vim-now/install.sh should fail (at least in on stack setup). Please retry.

@saniac
Copy link

saniac commented Aug 17, 2020

Yes, the last lines are:

--- Installing plugins using vim-plug...
HvnArgs {hvnArgsNoHoogleDb = False, hvnArgsNoHelperBinaries = False}
Setting up GHC if needed...
Stack setup failed with error 1
*** setup_haskell.hs failed with error 1.
*** Aborting...

@jship
Copy link
Collaborator

jship commented Aug 25, 2020

@saniac With @p-alik's #299 merged, hopefully the stack setup call will provide more info. Would you please try again when you get a chance?

@saniac
Copy link

saniac commented Aug 26, 2020

Tried again, output below.

...
Stack setup failed with exit code: 1
stderr: RedownloadInvalidResponse Request {
  host                 = "raw.githubusercontent.com"
  port                 = 443
  secure               = True
  requestHeaders       = []
  path                 = "/fpco/lts-haskell/master//lts-16.10.yaml"
  queryString          = ""
  method               = "GET"
  proxy                = Nothing
  rawBody              = False
  redirectCount        = 10
  responseTimeout      = ResponseTimeoutDefault
  requestVersion       = HTTP/1.1
}
 "/home/stephen/.stack/build-plan/lts-16.10.yaml" (Response {responseStatus = Status {statusCode = 404, statusMessage = "Not Found"}, responseVersion = HTTP/1.1, responseHeaders = [("Connection","keep-alive"),("Content-Length","14"),("Content-Type","text/plain; charset=utf-8"),("Content-Security-Policy","default-src 'none'; style-src 'unsafe-inline'; sandbox"),("Strict-Transport-Security","max-age=31536000"),("X-Content-Type-Options","nosniff"),("X-Frame-Options","deny"),("X-XSS-Protection","1; mode=block"),("Via","1.1 varnish (Varnish/6.0)"),("X-GitHub-Request-Id","72BE:0BDE:1FBA06:23672E:5F45F959"),("Accept-Ranges","bytes"),("Date","Wed, 26 Aug 2020 05:55:38 GMT"),("Via","1.1 varnish"),("X-Served-By","cache-akl10333-AKL"),("X-Cache","MISS, MISS"),("X-Cache-Hits","0, 0"),("X-Timer","S1598421338.249071,VS0,VE303"),("Vary","Authorization,Accept-Encoding"),("Access-Control-Allow-Origin","*"),("X-Fastly-Request-ID","757882ecee632259d3ac142fcdcbe5c18471ac42"),("Expires","Wed, 26 Aug 2020 06:00:38 GMT"),("Source-Age","0")], responseBody = (), responseCookieJar = CJ {expose = []}, responseClose' = ResponseClose})

stdout: 
*** setup_haskell.hs failed with error 1.
*** Aborting...
stephen@vivo:~$  

@p-alik
Copy link
Contributor

p-alik commented Aug 26, 2020

Thank you, @saniac!
We've to wait for response in commercialhaskell/stackage#5615

@juhp
Copy link

juhp commented Sep 6, 2020

There is no mention of the stack version.

If this is a stack 1.9 report, then it is no longer supported.

@p-alik
Copy link
Contributor

p-alik commented Sep 6, 2020

@juhp, stack 2.3.3 is mentioned above

@juhp
Copy link

juhp commented Sep 6, 2020

Okay, I am not sure what is going on but I think the location should be https://github.com/commercialhaskell/stackage-snapshots/blob/master/lts/16/10.yaml

Though I am not a stack authority.

@p-alik
Copy link
Contributor

p-alik commented Sep 6, 2020

@saniac, I can only guess there is some mixed up in your enviroment because as you mentioned you had installed haskell-stack, which seems to contain stack 1.9.3 and then upgraded stack to 2.3.3. So you've two versions of stack. The former you could find with dpkg -L haskell-stack, the later presumably in .local/bin directory.
If you haven't particular demand for haskell-stack, it could be helpful to purge it completely.

@saniac
Copy link

saniac commented Sep 8, 2020

Can confirm, purged Ubuntu Focal haskell-stack, verified stack running from ~/.local/bin is 2.3.3. Still fails.

@p-alik
Copy link
Contributor

p-alik commented Sep 8, 2020

@saniac, the last option, I would suggest, is to remove content of ~/.stack directory because there could remain some settings of 1.9, which lead your 2.3 stack to use snapshot of deprecated former once and try again to install haskell-vim-now.
If it doesn't help, I'll reopen issue commercialhaskell/stackage#5615

@saniac
Copy link

saniac commented Sep 8, 2020

stephen@vivo:$ rm -rf .stack/
stephen@vivo:
$ stack --version
Version 2.3.3, Git revision cb44d51bed48b723a5deb08c3348c0b3ccfc437e x86_64 hpack-0.33.0
stephen@vivo:~$ ~/.config/haskell-vim-now/install.sh

...

Setting up GHC if needed...
Stack setup failed with exit code: 1
stderr:
stdout:
*** setup_haskell.hs failed with error 1.
*** Aborting...

Still happening I'm afraid. I can't exclude remnants of earlier efforts short of a clean install of this OS, but this is as close as I can get.

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

No branches or pull requests

6 participants