That is, to say the least, unexpected. If it can't install the version I'm asking for, I'd hope for a warning.
I conjecture this might relate on Cabal not tracking versions of installed executables, unless they come with a library. intero comes with no library, while pandoc does.
I don't think that changes the expected behavior, just the hardness of the fix.
$ stack install intero-0.1.15
Run from outside a project, using implicit global project config
Using resolver: lts-6.6 from implicit global project's config file: /Users/pgiarrusso/.stack/global/stack.yaml
Copying from /Users/pgiarrusso/.stack/global/.stack-work/install/x86_64-osx/lts-6.6/7.10.3/bin/intero to /Users/pgiarrusso/.local/bin/intero
Copied executables to /Users/pgiarrusso/.local/bin:
- intero
$ intero --version
0.1.16
$ which intero
/Users/pgiarrusso/.local/bin/intero
When v0.1.15 is already installed and you're installing v0.1.16 it seems to work:
~ $ intero --version
0.1.15
~ $ stack install intero-0.1.16
~ $ intero --version
0.1.16
~ $ stack --version
Version 1.1.3, Git revision 93c5ffecec8b5a249dc2afc5c78c241d646ea75b (dirty) (3763 commits) x86_64 hpack-0.14.0
What's your stack --version?
$ stack --version
Version 1.1.2 x86_64 hpack-0.14.0
Yes, I remember upgrading intero like that... could it be that downgrading fails? Also see below for intero-related stuff in my ~/.stack — both are listed in installed-packages, but the binary in my global project (/Users/pgiarrusso/.stack/global/.stack-work/install/x86_64-osx/lts-6.6/7.10.3/bin/intero) reports being 0.1.16.
Separately: I just learned you want to remove /Users/pgiarrusso/.local/bin/intero, building it is fine but installing it isn't: https://github.com/commercialhaskell/intero/issues/161#issuecomment-232651750
$ find ~/.stack/ -name 'intero*'
/Users/pgiarrusso/.stack/global/.stack-work/install/x86_64-osx/lts-6.6/7.10.3/bin/intero
/Users/pgiarrusso/.stack/global/.stack-work/install/x86_64-osx/lts-6.6/7.10.3/doc/intero-0.1.15
/Users/pgiarrusso/.stack/global/.stack-work/install/x86_64-osx/lts-6.6/7.10.3/doc/intero-0.1.16
/Users/pgiarrusso/.stack/global/.stack-work/install/x86_64-osx/lts-6.6/7.10.3/flag-cache/intero-0.1.15
/Users/pgiarrusso/.stack/global/.stack-work/install/x86_64-osx/lts-6.6/7.10.3/flag-cache/intero-0.1.16
/Users/pgiarrusso/.stack/global/.stack-work/install/x86_64-osx/lts-6.6/7.10.3/installed-packages/intero-0.1.15
/Users/pgiarrusso/.stack/global/.stack-work/install/x86_64-osx/lts-6.6/7.10.3/installed-packages/intero-0.1.16
/Users/pgiarrusso/.stack/global/.stack-work/install/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/intero-0.1.15
/Users/pgiarrusso/.stack/global/.stack-work/install/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/intero-0.1.15/elisp/intero.el
/Users/pgiarrusso/.stack/global/.stack-work/install/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/intero-0.1.16
/Users/pgiarrusso/.stack/global/.stack-work/install/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/intero-0.1.16/elisp/intero.el
/Users/pgiarrusso/.stack/global/.stack-work/logs/intero-0.1.15.log
/Users/pgiarrusso/.stack/global/.stack-work/logs/intero-0.1.16.log
/Users/pgiarrusso/.stack/indices/Hackage/packages/intero
/Users/pgiarrusso/.stack/indices/Hackage/packages/intero/0.1.13/intero-0.1.13.tar.gz
/Users/pgiarrusso/.stack/indices/Hackage/packages/intero/0.1.15/intero-0.1.15.tar.gz
/Users/pgiarrusso/.stack/indices/Hackage/packages/intero/0.1.16/intero-0.1.16.tar.gz
/Users/pgiarrusso/.stack/precompiled/x86_64-osx/ghc-8.0.1/1.24.0.0/intero-0.1.16
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.0.0/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.0/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.1/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.10/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.11/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.12/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.13/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.14/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.15/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.16/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.2/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.3/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.5/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.6/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.7/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.8/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/lts-6.6/7.10.3/share/x86_64-osx-ghc-7.10.3/hoogle-4.2.43/databases/downloads/cabal/intero/0.1.9/intero.cabal
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/nightly-2016-07-07/8.0.1/bin/intero
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/nightly-2016-07-07/8.0.1/doc/intero-0.1.16
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/nightly-2016-07-07/8.0.1/installed-packages/intero-0.1.16
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/nightly-2016-07-07/8.0.1/share/x86_64-osx-ghc-8.0.1/intero-0.1.16
/Users/pgiarrusso/.stack/snapshots/x86_64-osx/nightly-2016-07-07/8.0.1/share/x86_64-osx-ghc-8.0.1/intero-0.1.16/elisp/intero.el
The problem only seems to arise with packages that are _not_ contained in the current resolver.
For example, the resolver in my global project is nightly-2016-06-21 which contains hlint-1.9.35.
If I stack install hlint and then stack install hlint-1.9.34, v1.9.34 is correctly installed.
I cannot reproduce the issue on lts-6.0 (stack's stack.yaml resolver):
mgsloan@computer:~/fpco/stack$ stack install intero-0.1.16
intero-0.1.16: download
intero-0.1.16: configure
intero-0.1.16: build
intero --version
stack install intero-0.1.15intero-0.1.16: copy/register
Copying from /home/mgsloan/fpco/stack/.stack-work/install/x86_64-linux/lts-6.0/7.10.3/bin/intero to /home/mgsloan/.local/bin/intero
Copied executables to /home/mgsloan/.local/bin:
- intero
mgsloan@computer:~/fpco/stack$ intero --version
0.1.16
mgsloan@computer:~/fpco/stack$ stack install intero-0.1.15
intero-0.1.15: download
intero-0.1.15: configure
intero-0.1.15: build
intero-0.1.15: copy/register
Copying from /home/mgsloan/fpco/stack/.stack-work/install/x86_64-linux/lts-6.0/7.10.3/bin/intero to /home/mgsloan/.local/bin/intero
Copied executables to /home/mgsloan/.local/bin:
- intero
/fpco/stack$ intero --version
0.1.15
Ahh, yes, using stack install --resolver lts-6.6 intero-0.1.15 does reproduce it for me now. I needed to first install intero-0.1.15, then intero-0.1.16, then back to intero-0.1.15. This suggests that the issue has to do with the case where it thinks it has no work to do
mgsloan@computer:~/fpco/stack$ stack install intero-0.1.15 --resolver lts-6.6
Copying from /home/mgsloan/fpco/stack/.stack-work/install/x86_64-linux/lts-6.6/7.10.3/bin/intero to /home/mgsloan/.local/bin/intero
Copied executables to /home/mgsloan/.local/bin:
- intero
Fixed! That wasn't actually all that tricky. The issue was that when intero-0.16 gets installed, we don't remove the record that intero-0.15 is installed.