corsis / clock

High-resolution clock functions: monotonic, realtime, cputime.
Other
58 stars 25 forks source link

Cannot install on Linux Mint: "posix_spawnp: permission denied" #83

Open alexeymuranov opened 1 year ago

alexeymuranov commented 1 year ago

I installed Stack on Linux Mint with

$ sudo apt install haskell-stack

Then I tried installing some package and got ExitFailure 1 caused by clock dependency. I tried to install just clock and got:

clock> hsc2hs: .stack-work/dist/x86_64-linux-tinfo6/Cabal-3.6.3.0/build/System/Clock_hsc_make: createProcess: posix_spawnp: permission denied (Permission denied)

Full output:

$ stack install clock
Writing implicit global project config file to: /home/alexey/.stack/global-project/stack.yaml
Note: You can change the snapshot via the resolver field there.
Using latest snapshot resolver: lts-20.5
Stack has not been tested with GHC versions above 8.10, and using 9.2.5, this may fail
Preparing to install GHC (tinfo6) to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-tinfo6-9.2.5.                                      
Unpacking GHC into /home/alexey/.stack/programs/x86_64-linux/ghc-tinfo6-9.2.5.te                                                                                Installed GHC.     
Stack has not been tested with Cabal versions above 3.2, but version 3.6.3.0 was found, this may fail
[1 of 2] Compiling Main             ( /home/alexey/.stack/setup-exe-src/setup-mPHDZzAJ.hs, /home/alexey/.stack/setup-exe-src/setup-mPHDZzAJ.o )
[2 of 2] Compiling StackSetupShim   ( /home/alexey/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /home/alexey/.stack/setup-exe-src/setup-shim-mPHDZzAJ.o )
Linking /home/alexey/.stack/setup-exe-cache/x86_64-linux-tinfo6/tmp-Cabal-simple_mPHDZzAJ_3.6.3.0_ghc-9.2.5 ...
clock> configure
clock> Configuring clock-0.8.3...
clock> build
clock> Preprocessing library for clock-0.8.3..
clock> hsc2hs: .stack-work/dist/x86_64-linux-tinfo6/Cabal-3.6.3.0/build/System/Clock_hsc_make: createProcess: posix_spawnp: permission denied (Permission denied)

--  While building package clock-0.8.3 using:
      /home/alexey/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_3.6.3.0_ghc-9.2.5 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.6.3.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

I also tried GHCup with the same result.

CetinSert commented 1 year ago

I have feeling this might be a wider problem and not just affecting clock. I will search the internet and add what I find here.

geekosaur commented 1 year ago

FWIW we just ran into this helping someone in #haskell, and the cause was /tmp was mounted noexec so hsc2hs couldn't run its self-generated script to use gcc to dump definitions of structs. hsc2hs obeys $TMPDIR so that can be used as a workaround.