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 exec pacman fails #1728

Closed
ndmitchell opened this issue Feb 2, 2016 · 10 comments
Closed

stack exec pacman fails #1728

ndmitchell opened this issue Feb 2, 2016 · 10 comments

Comments

@ndmitchell
Copy link
Contributor

C:\Neil\hlint>stack exec pacman
Executable named pacman not found on path: ["C:\\Neil\\hlint\\.stack-work\\install\\7ca85f7b\\bin","C:\\Users\\ndmit_000\\AppData\\Roaming\\stack\\snapshots\\7a8350a1\\bin","C:\\ProgramData\\Oracle\\Java\\javapath","C:\\Python27\\","C:\\Python27\\Scripts","C:\\WINDOWS\\system32","C:\\WINDOWS","C:\\WINDOWS\\System32\\Wbem","C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\","C:\\Program Files (x86)\\Git\\cmd","C:\\Program Files (x86)\\GNU\\GnuPG\\pub","C:\\Program Files\\SlikSvn\\bin","C:\\Program Files (x86)\\CMake\\bin","C:\\Program Files (x86)\\QuickTime\\QTSystem\\","C:\\Leksah\\bin\\","C:\\Users\\ndmit_000\\.dnx\\bin","C:\\Program Files\\Microsoft DNX\\Dnvm\\","C:\\Program Files (x86)\\Windows Kits\\8.1\\Windows Performance Toolkit\\","C:\\Program Files (x86)\\MiKTeX 2.9\\miktex\\bin\\","C:\\Program Files\\nodejs\\","C:\\ghc\\minghc-7.10.2-i386\\switch","C:\\ghc\\minghc-7.10.2-i386\\git-2.4.0.1\\cmd","C:\\ghc\\minghc-7.10.2-i386\\git-2.4.0.1\\usr\\bin","C:\\ghc\\minghc-7.10.2-i386\\ghc-7.10.2\\mingw\\bin","C:\\ghc\\minghc-7.10.2-i386\\ghc-7.10.2\\bin","C:\\ghc\\minghc-7.10.2-i386\\bin","C:\\Users\\ndmit_000\\AppData\\Roaming\\cabal\\bin","C:\\Program Files (x86)\\MinGHC-7.10.1\\switch","C:\\Users\\ndmit_000\\Desktop\\Radio","C:\\Program Files (x86)\\MinGHC-7.6.3\\switch","C:\\bin","C:\\Program Files (x86)\\MinGHC-7.8.3\\switch","C:\\Program Files (x86)\\MinGHC-7.8.3\\msys-1.0.1\\bin","C:\\Program Files (x86)\\MinGHC-7.8.3\\ghc-7.8.3\\mingw\\bin","C:\\Program Files (x86)\\MinGHC-7.8.3\\ghc-7.8.3\\bin","C:\\Program Files (x86)\\MinGHC-7.8.3\\bin","C:\\Users\\ndmit_000\\AppData\\Local\\atom\\bin","C:\\Program Files (x86)\\NSIS","C:\\Program Files (x86)\\Java\\jdk1.8.0_45\\bin","C:\\Users\\ndmit_000\\AppData\\Roaming\\local\\bin","C:\\Users\\ndmit_000\\AppData\\Roaming\\npm"]

Where should I be expecting pacman to live? I can't find it under C:\Users\ndmit_000\AppData\Roaming\stack, which is where I expected it? This is using stack HEAD.

@ndmitchell
Copy link
Contributor Author

For info, I do have C:\Users\ndmit_000\AppData\Local\Programs\stack\i386-windows\msys2-20150512\usr\bin\pacman.exe, but seems Stack doesn't put it on my path. I think stack has some "default context" stuff, e.g. which ghc/bitness is selected by default?

I think this might have all started going wrong when I ran:

stack setup --compiler ghcjs-0.1.0.20150924_ghc-7.10.2

@ndmitchell
Copy link
Contributor Author

For info, stack setup for ghcjs failed because it couldn't find cmp.exe on the PATH, which is located next to pacman.

@mgsloan
Copy link
Contributor

mgsloan commented Feb 3, 2016

Is it when compiling ghcjs or when booting it?

If when compiling it, then yes, that'd make sense, because msys gets installed after the compiler, and isn't available when building ghcjs.

Otherwise, though, the logic for msys is identical to when it is used with ghc.

@ndmitchell
Copy link
Contributor Author

It fails to find cmp when compiling. Note that msys is already installed, and even a normal stack exec has "lost" if from the path, without going anywhere near ghcjs. So it seems my failed attempt to install ghcjs has broken stack.

@mgsloan
Copy link
Contributor

mgsloan commented Feb 4, 2016

Ok, yeah, sounds like the fix is simple - install msys before installing the compiler - and have it on the path during that process. Hopefully this won't affect the success of normal ghc setup.

@mgsloan
Copy link
Contributor

mgsloan commented Feb 5, 2016

Oh wait, looking at this issue more carefully, obviously you aren't using ghcjs with hlint. A botched ghcjs setup really shouldn't affect anything. Weird!

@byorgey
Copy link

byorgey commented Mar 10, 2016

My student ran into this same issue. @mgsloan suggested doing stack setup --no-system-ghc, which actually forced it to download GHC and a bunch of other stuff---previously it had been using a system GHC. We actually saw it downloading pacman as we watched the messages scroll by. But when it was done, stack exec pacman still gave the same error.

What finally fixed it was uninstalling the system GHC and deleting everything we could find that looked like either a cache used by stack or something GHC-related (e.g. .stack-work, the global stack directory, several directories that had minghc in their name), then rerunning stack setup --no-system-ghc (just for good measure, though the --no-system-ghc was probably unnecessary at this point). It went through all the same work of downloading GHC and a bunch of other stuff that we had seen it do before, but when it was done, this time stack exec pacman worked!

@mgsloan
Copy link
Contributor

mgsloan commented Mar 11, 2016

@byorgey The issue with your first stack exec pacman was likely that you didn't pass --no-system-ghc to it. So, it was still using the system GHC. Deleting the system GHC resolved this.

That isn't your fault, I think it is a funky default that the system ghc is preferred even if you've done stack setup --no-system-ghc. I've opened an issue to fix this: #1901

You can also put system-ghc: false in your stack.yaml or config.yaml

@byorgey
Copy link

byorgey commented Mar 11, 2016

I thought we also tried stack exec --no-system-ghc -- pacman, but I can't be sure, and there's no way to test it now!

@mgsloan
Copy link
Contributor

mgsloan commented Mar 18, 2017

Closing this as an old support issue.

@mgsloan mgsloan closed this as completed Mar 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants