Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

stack install.hs cabal fails #1160

Closed
arrowd opened this issue Apr 5, 2019 · 13 comments
Closed

stack install.hs cabal fails #1160

arrowd opened this issue Apr 5, 2019 · 13 comments
Labels
build Continuous integration and building
Milestone

Comments

@arrowd
Copy link
Collaborator

arrowd commented Apr 5, 2019

I'm running stack install.hs cabal on FreeBSD and get the following output:

┌─[arr]─[/home/arr/projects/haskell-ide-engine]──╼
└──╼ % stack ./install.hs cabal 
# stack (for cabal)
# stack (for cabal)
Copying from /usr/home/arr/.stack/snapshots/x86_64-freebsd-ino64/nightly-2018-12-15/8.6.2/bin/cabal to /usr/home/arr/.local/bin/cabal

Copied executables to /usr/home/arr/.local/bin:
- cabal

Warning: The cabal executable found on the PATH environment variable is /usr/home/arr/.stack/snapshots/x86_64-freebsd-ino64/nightly-2018-12-15/8.6.2/bin/cabal and not the version that was just
         installed. This means that cabal calls on the command line will not use this version.
# cabal (for cabal)
Warning: The update command is a part of the legacy v1 style of cabal usage.

Please switch to using either the new project style and the new-update command
or the legacy v1-update alias as new-style projects will become the default in
the next version of cabal-install. Please file a bug if you cannot replicate a
working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
# cabal (for cabal)
Warning: The install command is a part of the legacy v1 style of cabal usage.

Please switch to using either the new project style and the new-install
command or the legacy v1-install alias as new-style projects will become the
default in the next version of cabal-install. Please file a bug if you cannot
replicate a working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
cabal: There is no package named 'Cabal'.
You may need to run 'cabal update' to get the latest list of available
packages.

Error when running Shake build system:
  at src/Development/Shake/Internal/Args.hs:81:69-79:
* Depends on: cabal
* Raised the exception:
user error (Development.Shake.command_, system command failed
Command: cabal install Cabal-2.4.1.0 --with-compiler=/usr/home/arr/.stack/programs/x86_64-freebsd/ghc-ino64-8.6.3/bin/ghc
Exit code: 1
Stderr:
Warning: The install command is a part of the legacy v1 style of cabal usage.

Please switch to using either the new project style and the new-install
command or the legacy v1-install alias as new-style projects will become the
default in the next version of cabal-install. Please file a bug if you cannot
replicate a working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
cabal: There is no package named 'Cabal'.
You may need to run 'cabal update' to get the latest list of available
packages.

)

The warning message about PATH seems unrelated and harmless, but

No remote package servers have been specified

seems suspicious.

Any ideas how fix/debug this?

@mpickering
Copy link
Collaborator

I think the problem is actually cabal: There is no package named 'Cabal'.

I have no idea what the install script does but the fact it called cabal install seems dubious to me. What is that supposed to do?

@fendor
Copy link
Collaborator

fendor commented Apr 5, 2019

Line is copied from the original Makefile, I dont know what it actually does or why it is needed.
Maybe @alanz knows more?

@alanz
Copy link
Collaborator

alanz commented Apr 5, 2019

There is a package called Cabal on hackage, which is the base library used by cabal-install, and also by GHC (I think).

I recall at some stage we had to pull it in specifically, because the older GHC versions shipped with a version that is too early for ghc-mod. I am not sure if it is still needed, perhaps do an experiment to see what happens, but make sure to test the actual installed version of hie for that GHC version, with Cabal uninstalled.

@samuelpilz
Copy link
Contributor

I am currently investigating the need of this step and it currently seems that this step is not required.

@arrowd
Copy link
Collaborator Author

arrowd commented Apr 5, 2019

I removed "cabal" rule from install.hs and stack install.hs hie-8.6.3 finished fine for me.

@fendor
Copy link
Collaborator

fendor commented Apr 5, 2019

@arrowd, was it a complete clean install? E.g. only stack and git were freshly installed?

@arrowd
Copy link
Collaborator Author

arrowd commented Apr 5, 2019

Hmm, not sure. I also have ghc installed system-wide, but not cabal.

@samuelpilz
Copy link
Contributor

does running cabal update fix the issue?

@arrowd
Copy link
Collaborator Author

arrowd commented Apr 5, 2019

Which cabal? Installed by "cabal" rule? I didn't try.

@samuelpilz
Copy link
Contributor

stack install.hs cabal currently calls stack instal cabal-install. Then, you should have cabal in the path, normaly ~/.local/bin.

@lukel97 lukel97 added the build Continuous integration and building label Apr 7, 2019
@samuelpilz
Copy link
Contributor

Is this still an issue? I am not able to reproduce this error

@arrowd
Copy link
Collaborator Author

arrowd commented Apr 19, 2019

Ah, I found the source of the error. I had empty ~/.cabal/config file and this was causing cabal update to fail.

I'm still don't like that it installs cabal-install into my PATH, though.

@arrowd arrowd closed this as completed Apr 19, 2019
@samuelpilz
Copy link
Contributor

@arrowd have a look out for #1168. This fixes the problem

@alanz alanz added this to the 2019-04 milestone May 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build Continuous integration and building
Projects
None yet
Development

No branches or pull requests

6 participants