cabal icon indicating copy to clipboard operation
cabal copied to clipboard

Encountered possible bug during building rpki-prover

Open dan010 opened this issue 1 year ago • 14 comments

Encountered the error below while building rpki-prover

basement > hsc2hs-ghc-9.6.5: .stack-work/dist/x86_64-linux-tinfo6/ghc-9.6.5/build/Basement/Terminal/Size_hsc_make: createProcess: posix_spawnp: permission denied (Permission denied) clock > configure

dan010 avatar Jun 04 '24 01:06 dan010

Hello. Please provide a sequence of terminal commands that you perform to hit the issue. Including how you get rpki-prover. Judging by the error message, you're using stack. What makes you think that it's a cabal issue? Stack's bug tracker is located here: https://github.com/commercialhaskell/stack/issues

ulysses4ever avatar Jun 04 '24 01:06 ulysses4ever

Ok. Sorry. You can now close this ticket. I will open a ticket on stack.

dan010 avatar Jun 04 '24 01:06 dan010

TBH from looking at that error I'd be tempted to say hsc2hs is missing from build-tool-depends?

geekosaur avatar Jun 04 '24 01:06 geekosaur

TBH from looking at that error I'd be tempted to say hsc2hs is missing from build-tool-depends?

Sorry but how can I check this if missing?

dan010 avatar Jun 04 '24 02:06 dan010

It would be in the cabal file (probably rpki-prover.cabal). I found the package on GitHub but it apparently only has a package-template.yaml and it doesn't appear to include a build-tool-depends.

I'm looking at the message again and it's actually Permission denied and coming from hsc2hs, so it's finding that. You don't happen to have .stack-work symlinked onto a noexec filesystem (/tmp is usually noexec, for example), do you?

geekosaur avatar Jun 04 '24 02:06 geekosaur

It would be in the cabal file (probably rpki-prover.cabal). I found the package on GitHub but it apparently only has a package-template.yaml and it doesn't appear to include a build-tool-depends.

I'm looking at the message again and it's actually Permission denied. You don't happen to have .stack-work symlinked onto a noexec filesystem (/tmp is usually noexec, for example), do you?

How can I check if .stack-work is symlinked onto a noexec filesystem? Sorry I am just new on linux

dan010 avatar Jun 04 '24 02:06 dan010

In that case it probably isn't, but you might make sure of it. On my system, for example,

hilfy Z$ df .stack-work/.
Filesystem      1K-blocks      Used  Available Use% Mounted on
/dev/nvme0n1p2 1921208544 208667404 1614875300  12% /
hilfy Z$ awk '$2 == "/" && $4 ~ "noexec" {print "yes"}' /proc/mounts
hilfy Z$ _

If it prints "yes" then .stack-work lives on a noexec filesystem.

In my case there's no point in doing the second part of the check, because / can't be mounted noexec (the system wouldn't be able to boot).

(If you're wondering, I use .stack-work/. to ensure that any symlinks are followed.)

geekosaur avatar Jun 04 '24 02:06 geekosaur

In that case it probably isn't, but you might make sure of it. On my system, for example,

hilfy Z$ df .stack-work/.
Filesystem      1K-blocks      Used  Available Use% Mounted on
/dev/nvme0n1p2 1921208544 208667404 1614875300  12% /
hilfy Z$ awk '$2 == "/" && $4 ~ "noexec" {print "yes"}' /proc/mounts
hilfy Z$ _

If it prints "yes" then .stack-work lives on a noexec filesystem.

In my case there's no point in doing the second part of the check, because / can't be mounted noexec (the system wouldn't be able to boot).

(If you're wondering, I use .stack-work/. to ensure that any symlinks are followed.)

This command output is df .stack-work/. is no such file or directory and on second command don't have an output

dan010 avatar Jun 04 '24 02:06 dan010

You'll have to figure out where the .stack-work directory is, then; the error message didn't say. I also forgot to mention that in the second command, you need to replace "/" with the path printed at the end of the first command, double-quoted. (I used "/" because the first command showed / as the mountpoint.)

geekosaur avatar Jun 04 '24 02:06 geekosaur

You'll have to figure out where the .stack-work directory is, then; the error message didn't say. I also forgot to mention that in the second command, you need to replace "/" with the path printed at the end of the first command, double-quoted. (I used "/" because the first command showed / as the mountpoint.)

I already found it but the second command return no output. Even though I replaced with the path printed at the first command

dan010 avatar Jun 04 '24 02:06 dan010

No output in that case is good; it means the filesystem isn't noexec, so that can't be the problem. But it also means I don't know what could be going on. The next place to look is probably with stack, because .stack-work is created and managed by it; Cabal has no knowledge or control over it.

geekosaur avatar Jun 04 '24 03:06 geekosaur

No output in that case is good; it means the filesystem isn't noexec, so that can't be the problem. But it also means I don't know what could be going on. The next place to look is probably with stack, because .stack-work is created and managed by it; Cabal has no knowledge or control over it.

Ok Thank you. I already created a ticket on cabal but still no reply.

dan010 avatar Jun 04 '24 03:06 dan010

It's past midnight in Europe and approaching midnight in the eastern U.S., so not many people are likely to be around unless there are stack devs in the western U.S. Give them a few hours. (I'm usually the only cabal dev around at this time of day/night.)

geekosaur avatar Jun 04 '24 03:06 geekosaur

It's past midnight in Europe and approaching midnight in the eastern U.S., so not many people are likely to be around unless there are stack devs in the western U.S. Give them a few hours. (I'm usually the only cabal dev around at this time of day/night.)

Ok Thank you. I really appreciate your help.

dan010 avatar Jun 04 '24 05:06 dan010