koalaman / shellcheck

ShellCheck, a static analysis tool for shell scripts
https://www.shellcheck.net
GNU General Public License v3.0
36.36k stars 1.77k forks source link

ShellCheck from git clone fails to install on Fedora 24 #936

Closed pgporada closed 7 years ago

pgporada commented 7 years ago

I'm not sure what to do about this as I'm a first time cabal user. I chose to install from the git repository rather than dnf because the package in the Fedora repos is 0.38.0 and the latest version is 0.46.0.

$ cabal update
Config file path source is default config file.
Config file /home/user/.cabal/config not found.
Writing default configuration to /home/user/.cabal/config
Downloading the latest package list from hackage.haskell.org

$ cabal --version
cabal-install version 1.18.1.0
using version 1.18.1.5 of the Cabal library 

$ cabal install shellcheck
Resolving dependencies...
Downloading array-0.5.1.1...
Downloading filepath-1.4.1.2...
Downloading ghc-boot-th-8.0.2...
Configuring array-0.5.1.1...
Failed to install array-0.5.1.1
Last 10 lines of the build log ( /home/user/.cabal/logs/array-0.5.1.1.log ):
Configuring ghc-boot-th-8.0.2...
Downloading syb-0.7...
Failed to install ghc-boot-th-8.0.2
Last 10 lines of the build log ( /home/user/.cabal/logs/ghc-boot-th-8.0.2.log ):
Downloading transformers-0.5.4.0...
Configuring filepath-1.4.1.2...
Failed to install filepath-1.4.1.2
Last 10 lines of the build log ( /home/user/.cabal/logs/filepath-1.4.1.2.log ):
Configuring syb-0.7...
Failed to install syb-0.7
Last 10 lines of the build log ( /home/user/.cabal/logs/syb-0.7.log ):
Configuring transformers-0.5.4.0...
Failed to install transformers-0.5.4.0
Last 10 lines of the build log ( /home/user/.cabal/logs/transformers-0.5.4.0.log ):
cabal: Error: some packages failed to install:
QuickCheck-2.9.2 depends on transformers-0.5.4.0 which failed to install.
ShellCheck-0.4.6 depends on transformers-0.5.4.0 which failed to install.
array-0.5.1.1 failed during the configure step. The exception was:
user error (The package 'array' requires Cabal library version -any && >=1.10
but no suitable version is installed.)
binary-0.8.5.1 depends on array-0.5.1.1 which failed to install.
bytestring-0.10.8.1 depends on array-0.5.1.1 which failed to install.
containers-0.5.10.2 depends on array-0.5.1.1 which failed to install.
deepseq-1.4.2.0 depends on array-0.5.1.1 which failed to install.
directory-1.3.1.1 depends on filepath-1.4.1.2 which failed to install.
filepath-1.4.1.2 failed during the configure step. The exception was:
user error (The package 'filepath' requires Cabal library version -any &&
>=1.18 but no suitable version is installed.)
ghc-boot-th-8.0.2 failed during the configure step. The exception was:
user error (The package 'ghc-boot-th' requires Cabal library version -any &&
>=1.10 but no suitable version is installed.)
hashable-1.2.6.0 depends on array-0.5.1.1 which failed to install.
json-0.9.1 depends on transformers-0.5.4.0 which failed to install.
mtl-2.2.1 depends on transformers-0.5.4.0 which failed to install.
nats-1.1.1 depends on ghc-boot-th-8.0.2 which failed to install.
parsec-3.1.11 depends on transformers-0.5.4.0 which failed to install.
pretty-1.1.3.5 depends on array-0.5.1.1 which failed to install.
primitive-0.6.2.0 depends on transformers-0.5.4.0 which failed to install.
process-1.6.0.0 depends on filepath-1.4.1.2 which failed to install.
random-1.1 depends on array-0.5.1.1 which failed to install.
regex-base-0.93.2 depends on transformers-0.5.4.0 which failed to install.
regex-tdfa-1.2.2 depends on transformers-0.5.4.0 which failed to install.
semigroups-0.18.3 depends on transformers-0.5.4.0 which failed to install.
syb-0.7 failed during the configure step. The exception was:
user error (The package 'syb' requires Cabal library version -any && >=1.8 but
no suitable version is installed.)
tagged-0.8.5 depends on transformers-0.5.4.0 which failed to install.
template-haskell-2.11.1.0 depends on ghc-boot-th-8.0.2 which failed to
install.
text-1.2.2.2 depends on array-0.5.1.1 which failed to install.
tf-random-0.5 depends on transformers-0.5.4.0 which failed to install.
time-1.7.0.1 depends on array-0.5.1.1 which failed to install.
transformers-0.5.4.0 failed during the configure step. The exception was:
user error (The package 'transformers' requires Cabal library version -any &&
>=1.6 but no suitable version is installed.)
transformers-compat-0.5.1.4 depends on transformers-0.5.4.0 which failed to
install.
unix-2.7.2.1 depends on array-0.5.1.1 which failed to install.
unordered-containers-0.2.8.0 depends on array-0.5.1.1 which failed to install.
koalaman commented 7 years ago

Looks like cabal itself is pretty old, so several dependencies fail because they require a later version to build. Try updating it first:

cabal update
cabal install cabal-install 

Then try again (make sure to use the version installed to ~/.cabal/bin/cabal and not the system cabal binary)

pgporada commented 7 years ago

That's probably the root problem then. I can't even cabal install cabal-install

$ cabal install cabal-install
Resolving dependencies...
Configuring array-0.5.1.1...
Configuring filepath-1.4.1.2...
Configuring ghc-boot-th-8.0.2...
Configuring old-locale-1.0.0.7...
Configuring transformers-0.5.4.0...
Failed to install array-0.5.1.1
Last 10 lines of the build log ( /home/user/.cabal/logs/array-0.5.1.1.log ):
Failed to install filepath-1.4.1.2
Last 10 lines of the build log ( /home/user/.cabal/logs/filepath-1.4.1.2.log ):
Failed to install ghc-boot-th-8.0.2
Last 10 lines of the build log ( /home/user/.cabal/logs/ghc-boot-th-8.0.2.log ):
Failed to install old-locale-1.0.0.7
Last 10 lines of the build log ( /home/user/.cabal/logs/old-locale-1.0.0.7.log ):
Failed to install transformers-0.5.4.0
Last 10 lines of the build log ( /home/user/.cabal/logs/transformers-0.5.4.0.log ):
cabal: Error: some packages failed to install:
Cabal-1.24.2.0 depends on filepath-1.4.1.2 which failed to install.
HTTP-4000.3.7 depends on transformers-0.5.4.0 which failed to install.
array-0.5.1.1 failed during the configure step. The exception was:
user error (The package 'array' requires Cabal library version -any && >=1.10
but no suitable version is installed.)
async-2.1.1.1 depends on array-0.5.1.1 which failed to install.
base16-bytestring-0.1.1.6 depends on array-0.5.1.1 which failed to install.
base64-bytestring-1.0.0.1 depends on array-0.5.1.1 which failed to install.
binary-0.8.5.1 depends on array-0.5.1.1 which failed to install.
bytestring-0.10.8.1 depends on array-0.5.1.1 which failed to install.
cabal-install-1.24.0.2 depends on transformers-0.5.4.0 which failed to
install.
containers-0.5.10.2 depends on array-0.5.1.1 which failed to install.
cryptohash-sha256-0.11.100.1 depends on array-0.5.1.1 which failed to install.
deepseq-1.4.2.0 depends on array-0.5.1.1 which failed to install.
directory-1.3.1.1 depends on filepath-1.4.1.2 which failed to install.
ed25519-0.0.5.0 depends on array-0.5.1.1 which failed to install.
filepath-1.4.1.2 failed during the configure step. The exception was:
user error (The package 'filepath' requires Cabal library version -any &&
>=1.18 but no suitable version is installed.)
ghc-boot-th-8.0.2 failed during the configure step. The exception was:
user error (The package 'ghc-boot-th' requires Cabal library version -any &&
>=1.10 but no suitable version is installed.)
hackage-security-0.5.2.2 depends on transformers-0.5.4.0 which failed to
install.
hashable-1.2.6.0 depends on array-0.5.1.1 which failed to install.
mtl-2.2.1 depends on transformers-0.5.4.0 which failed to install.
network-2.6.3.2 depends on array-0.5.1.1 which failed to install.
network-uri-2.6.1.0 depends on transformers-0.5.4.0 which failed to install.
old-locale-1.0.0.7 failed during the configure step. The exception was:
user error (The package 'old-locale' requires Cabal library version -any &&
>=1.10 but no suitable version is installed.)
parsec-3.1.11 depends on transformers-0.5.4.0 which failed to install.
pretty-1.1.3.5 depends on array-0.5.1.1 which failed to install.
process-1.4.3.0 depends on filepath-1.4.1.2 which failed to install.
random-1.1 depends on array-0.5.1.1 which failed to install.
stm-2.4.4.1 depends on array-0.5.1.1 which failed to install.
tar-0.5.0.3 depends on filepath-1.4.1.2 which failed to install.
template-haskell-2.11.1.0 depends on ghc-boot-th-8.0.2 which failed to
install.
text-1.2.2.2 depends on array-0.5.1.1 which failed to install.
time-1.7.0.1 depends on array-0.5.1.1 which failed to install.
transformers-0.5.4.0 failed during the configure step. The exception was:
user error (The package 'transformers' requires Cabal library version -any &&
>=1.6 but no suitable version is installed.)
unix-2.7.2.1 depends on array-0.5.1.1 which failed to install.
zlib-0.6.1.2 depends on array-0.5.1.1 which failed to install.
koalaman commented 7 years ago

I downloaded a Fedora 24 iso and gave it a try. I couldn't figure it out either, but @smidm posted a good tip to https://github.com/lierdakil/pandoc-crossref/issues/112 :

dnf install haskell-platform 

Apparently installing cabal itself is not enough.

I could then successfully do:

cabal update
cabal install cabal-install
cd shellcheck && ~/.cabal/bin/cabal install --force-reinstall
smidm commented 7 years ago

btw this should be already fixed in f25 and newer (https://bugzilla.redhat.com/show_bug.cgi?id=1445210)