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 ignores the executable bit on ghc and then fails #2538

Closed
johntyree opened this issue Aug 29, 2016 · 3 comments
Closed

Stack ignores the executable bit on ghc and then fails #2538

johntyree opened this issue Aug 29, 2016 · 3 comments

Comments

@johntyree
Copy link

General summary/comments (optional)

If there's a ghc in your path somewhere that does not have executable permission, stack will fail with /whatever/path/ghc: streamingProcess: runInteractiveProcess: exec: permission denied (Permission denied)

Steps to reproduce

  1. Create a file named ghc at the front of your $PATH.
  2. Run command that uses ghc, e.g. stack build.

Expected

I expect stack to ignore the ghc that is not executable, the way shells do.

Actual

Stack tries to invoke the unexecutable ghc and dies.

If you suspect that a stack command misbehaved, please include the output of that command in --verbose mode.

$ stack build --verbose
Version 1.1.2 x86_64 hpack-0.14.1
2016-08-28 21:18:31.583445: [debug] Checking for project config at: /home/john/projects/brainfuck/haskell/stack.yaml @(stack-1.1.2-K10UHJ5rbiiHm4AmYlkZE:Stack.Config src/Stack/Config.hs:811:9)
2016-08-28 21:18:31.583930: [debug] Loading project config file stack.yaml @(stack-1.1.2-K10UHJ5rbiiHm4AmYlkZE:Stack.Config src/Stack/Config.hs:829:13)
2016-08-28 21:18:31.586870: [debug] Checking whether stack was built with libgmp4 @(stack-1.1.2-K10UHJ5rbiiHm4AmYlkZE:Stack.Config src/Stack/Config.hs:326:5)
2016-08-28 21:18:31.587077: [debug] Run process: ldd /usr/bin/stack @(stack-1.1.2-K10UHJ5rbiiHm4AmYlkZE:System.Process.Read src/System/Process/Read.hs:283:3)
2016-08-28 21:18:31.598180: [debug] Stack was not built with libgmp4 @(stack-1.1.2-K10UHJ5rbiiHm4AmYlkZE:Stack.Config src/Stack/Config.hs:330:14)
2016-08-28 21:18:31.598422: [debug] Trying to decode /home/john/.stack/build-plan-cache/x86_64-linux/lts-6.13.cache @(stack-1.1.2-K10UHJ5rbiiHm4AmYlkZE:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-08-28 21:18:31.627936: [debug] Success decoding /home/john/.stack/build-plan-cache/x86_64-linux/lts-6.13.cache @(stack-1.1.2-K10UHJ5rbiiHm4AmYlkZE:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13)
2016-08-28 21:18:31.628848: [debug] Getting system compiler version @(stack-1.1.2-K10UHJ5rbiiHm4AmYlkZE:Stack.Setup src/Stack/Setup.hs:341:17)
2016-08-28 21:18:31.629055: [debug] Run process: ghc --info @(stack-1.1.2-K10UHJ5rbiiHm4AmYlkZE:System.Process.Read src/System/Process/Read.hs:283:3)
/home/john/projects/scripts/ghc: streamingProcess: runInteractiveProcess: exec: permission denied (Permission denied)

Stack version

$ stack --version
Version 1.1.2 x86_64 hpack-0.14.1

Method of installation

  • An unofficial package repository (arch linux official packages)
@johntyree
Copy link
Author

johntyree commented Aug 29, 2016

It looks like it should be doing this correctly already...

existsExec <- if exists then liftM D.executable $ D.getPermissions fp else return False

... but apparently it isn't.

@Blaisorblade
Copy link
Collaborator

@johntyree That's from master but you're testing 1.1.2—blame leads to 633ac50 and to #2489; the fix should be in 1.2.0.
I hope closing as duplicate is OK—please reopen if this happens on branch master or rc/v1.2.0.

@johntyree
Copy link
Author

Good call. LGTM

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

2 participants